PageSourceSearch

https://inscricao.mackenzie.br/1874.51029d9537ce0e14.js

js mackenzie.br collected 2026-10-01 09:06:51 UTC 289,439 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkprocesso_seletivo=self.webpackChunkprocesso_seletivo||[]).push([[1874],{13512:(nt,B,n)=>{n.d(B,{_:()=>_});var f=n(96850),M=n(70434),a=n(54438),e=n(1097);let _=(()=>{class t{constructor(j){this.confirmService=j,this.interceptValue=!0}getMatTabGroup(j){this.tabs=j,this.tabs._handleClick=this.interceptTabChange.bind(this)}interceptTabChange(j,I,F){if(!this.status())return this.interceptValue&&f.T8.prototype._handleClick.apply(this.tabs,[j,I,F]);this.confirmService.openConfirm("Sair da p\xe1gina ?","As altera\xe7\xf5es feitas n\xe3o ser\xe3o salvas.","Sair","Cancelar",!0).afterClosed().subscribe(T=>T&&f.T8.prototype._handleClick.apply(this.tabs,[j,I,F]))}setInterceptTabChange(j){this.interceptValue=j}status(){return this.modified=!(typeof(0,M.IG)([this.valueOne],[typeof this.valueTwo>"u"?this.valueOne:this.valueTwo])>"u")}static{this.\u0275fac=function(I){return new(I||t)(a.KVO(e.G))}}static{this.\u0275prov=a.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})()},2337:(nt,B,n)=>{n.d(B,{a:()=>j});var f=n(45312),M=n(6688),a=n(36671);class e extends a.F{}class _{fromJson(F){const T=new e;return typeof F.success<"u"?(T.success=F.success,T.data=this.toJson(F.data),T):this.toJson(F)}toJson(F){return"object"==typeof F?{id:F.id,name:F.name,token:F.token,secret_key:F.secret_key,edited_by:F.edited_by,active:F.active,type:F.type,portal_id:F.portal_id,main_setting_id:F.main_setting_id,updated_at:F.updated_at,being_used:F.being_used}:F}}var t=n(54438),m=n(21626);let j=(()=>{class I extends M.Q{constructor(T){super(T,`${f.c.API}`,"captcha",new _)}static{this.\u0275fac=function(E){return new(E||I)(t.KVO(m.Qq))}}static{this.\u0275prov=t.jDH({token:I,factory:I.\u0275fac,providedIn:"root"})}}return I})()},54003:(nt,B,n)=>{n.d(B,{q:()=>j});var f=n(45312),M=n(6688),a=n(36671);class e extends a.F{}class _{fromJson(F){const T=new e;return typeof F.success<"u"?(T.success=F.success,T.data=this.toJson(F.data),T):this.toJson(F)}toJson(F){return"object"==typeof F?{consentCheckboxOptions:F.consentCheckboxOptions,consentCheckboxOptionsData:F.consentCheckboxOptionsData,signatures:F.signatures,legalBases:F.legalBases}:F}}var t=n(54438),m=n(21626);let j=(()=>{class I extends M.Q{constructor(T){super(T,`${f.c.API}`,"component/lgpd/consent-checkbox-options",new _)}static{this.\u0275fac=function(E){return new(E||I)(t.KVO(m.Qq))}}static{this.\u0275prov=t.jDH({token:I,factory:I.\u0275fac,providedIn:"root"})}}return I})()},5759:(nt,B,n)=>{n.d(B,{_:()=>t});var f=n(34632),M=n(45312),a=n(6688),e=n(54438),_=n(21626);let t=(()=>{class m extends a.Q{constructor(I){super(I,`${M.c.API}`,"upload/file-types",new f.c)}static{this.\u0275fac=function(F){return new(F||m)(e.KVO(_.Qq))}}static{this.\u0275prov=e.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},27620:(nt,B,n)=>{n.d(B,{X:()=>t});var f=n(34632),M=n(45312),a=n(6688),e=n(54438),_=n(21626);let t=(()=>{class m extends a.Q{constructor(I){super(I,`${M.c.API}`,"upload/size-types",new f.c)}static{this.\u0275fac=function(F){return new(F||m)(e.KVO(_.Qq))}}static{this.\u0275prov=e.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},34632:(nt,B,n)=>{n.d(B,{c:()=>a});var f=n(36671);class M extends f.F{}class a{fromJson(_){const t=new M;return typeof _.success<"u"?(t.success=_.success,t.data=this.toJson(_.data),t):this.toJson(_)}toJson(_){return"object"==typeof _?{id:_.name,name:_.name,abbreviation:_.abbreviation}:_}}},99781:(nt,B,n)=>{n.d(B,{Z:()=>j});var f=n(6688),M=n(36671);class a extends M.F{}class e{fromJson(F){const T=new a;return typeof F.success<"u"?(T.success=F.success,T.data=this.toJson(F.data),T):this.toJson(F)}toJson(F){return"object"==typeof F?{id:F.id,field_id:F.id,field_settings_id:F.field_settings_id,key:F.key,step_id:F.step_id,label:F.label,description:F.description,form_build:F.form_build,totvs_table:F.totvs_table,totvs_field:F.totvs_field,rubeus_table:F.rubeus_table,rubeus_field:F.rubeus_field,ps_table:F.ps_table,field_type_id:F.field_type_id,multivalued:F.multivalued,action_logic_id:F.action_logic_id,condition_logic_id:F.condition_logic_id,data_type:F.data_type,data_value:F.data_value,defined_source:F.defined_source,relation_id:F.relation_id,field_relation:F.field_relation,logic_enabled:F.logic_enabled,logics:F.logics,main_setting_id:F.main_setting_id,predefined_options:F.predefined_options,predefined_source_options:F.predefined_source_options,read_only:F.read_only,auto_save:F.auto_save,external_source:F.external_source,predefined_external_source:F.predefined_external_source,manual_options:F.manual_options}:F}}var _=n(45312),t=n(54438),m=n(21626);let j=(()=>{class I extends f.Q{constructor(T){super(T,`${_.c.API}`,"settings/field",new e)}static{this.\u0275fac=function(E){return new(E||I)(t.KVO(m.Qq))}}static{this.\u0275prov=t.jDH({token:I,factory:I.\u0275fac,providedIn:"root"})}}return I})()},6568:(nt,B,n)=>{n.d(B,{m:()=>t});var f=n(6688),M=n(94219),a=n(45312),e=n(54438),_=n(21626);let t=(()=>{class m extends f.Q{constructor(I){super(I,`${a.c.API}`,"settings/totvs-query-cache",new M.U)}static{this.\u0275fac=function(F){return new(F||m)(e.KVO(_.Qq))}}static{this.\u0275prov=e.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},79047:(nt,B,n)=>{n.d(B,{T:()=>F});var f=n(84412),M=n(89308),a=n(52989),e=n(29674),_=n(51407),t=n(54438),m=n(37505),j=n(83225);const I=[];let F=(()=>{class T{constructor(P,J,k,Z,st,Q){this.loaderService=P,this.fieldStandardService=J,this.componentStandardService=k,this.visualIdentityService=Z,this.pagesService=st,this.notificationService=Q,this.buildTheData=new f.t(I),this.pageEditorData=this.buildTheData.asObservable(),this.checkLoad=!1}resolve(P,J){return this.loaderService.setChangesLoaderState(!0),this.pagesService.read(P.params.id).toPromise().then(k=>this.pagesData=k.data).then(k=>this.components=[]).then(()=>this.getVisualIdentity()).then(k=>this.visualIdentity=k.data).then(()=>this.getFields()).then(k=>this.fields=k).catch(k=>this.loaderService.setChangesLoaderState(!1,k.body,"","error",k.title,1e5)).then(k=>{if(k)return this.loaderService.setChangesLoaderState(!1),this.data={pageData:this.pagesData,standardFields:this.fields,componentStandard:this.components,visualIdentity:this.visualIdentity},this.setData(this.data),this.data})}setData(P){this.buildTheData.next(P)}getData(){let P;return this.pageEditorData.subscribe(J=>{P=J}),P}getFields(){return this.fieldStandardService.createArrayNoParam().toPromise()}getComponent(){return this.componentStandardService.createArrayNoParam().toPromise()}getVisualIdentity(){return this.visualIdentityService.readBasic().toPromise()}static{this.\u0275fac=function(J){return new(J||T)(t.KVO(m.Z),t.KVO(M.Z),t.KVO(a.U),t.KVO(e.M),t.KVO(_.W),t.KVO
1(j.J))}}static{this.\u0275prov=t.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()},6841:(nt,B,n)=>{n.d(B,{l:()=>F});var f=n(29674),M=n(3263),a=n(52989),e=n(89308),_=n(84412),t=n(54438),m=n(37505),j=n(83225);const I=[];let F=(()=>{class T{constructor(P,J,k,Z,st,Q){this.loaderService=P,this.fieldStandardService=J,this.componentStandardService=k,this.visualIdentityService=Z,this.notificationService=st,this.popUpService=Q,this.buildTheData=new _.t(I),this.popUpEditorData=this.buildTheData.asObservable(),this.checkLoad=!1}resolve(P,J){return this.loaderService.setChangesLoaderState(!0),this.popUpService.read(P.params.id).toPromise().then(k=>this.popUpData=k.data).then(()=>this.components=[]).then(()=>this.getVisualIdentity()).then(k=>this.visualIdentity=k.data).then(()=>this.getFields()).then(k=>this.fields=k).catch(k=>this.loaderService.setChangesLoaderState(!1,k.body,"","error",k.title,1e5)).then(k=>{if(k)return this.loaderService.setChangesLoaderState(!1),this.data={popUpData:this.popUpData,standardFields:this.fields,componentStandard:this.components,visualIdentity:this.visualIdentity},this.setData(this.data),this.data})}setData(P){this.buildTheData.next(P)}getData(){let P;return this.popUpEditorData.subscribe(J=>{P=J}),P}getFields(){return this.fieldStandardService.createArrayNoParam().toPromise()}getComponent(){return this.componentStandardService.createArrayNoParam().toPromise()}getVisualIdentity(){return this.visualIdentityService.readBasic().toPromise()}static{this.\u0275fac=function(J){return new(J||T)(t.KVO(m.Z),t.KVO(e.Z),t.KVO(a.U),t.KVO(f.M),t.KVO(j.J),t.KVO(M.y))}}static{this.\u0275prov=t.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()},81852:(nt,B,n)=>{n.d(B,{b:()=>_});var f=n(54438),M=n(96850),a=n(1097),e=n(13512);let _=(()=>{class t{constructor(j,I){this.confirmService=j,this.dataSourceStepFeedbackModel=I,this.interceptValue=!0,this.tabChange=new f.bkB}getMatTabGroup(j){this.tabs=j,this.tabs._handleClick=this.interceptTabChange.bind(this)}interceptTabChange(j,I,F){if(this.interceptValue)return this.interceptValue&&M.T8.prototype._handleClick.apply(this.tabs,[j,I,F]);this.confirmService.openConfirm("Sair da p\xe1gina ?","As altera\xe7\xf5es feitas n\xe3o ser\xe3o salvas.","Sair","Cancelar",!0).afterClosed().subscribe(T=>(T&&(this.dataSourceStepFeedbackModel.valueTwo=void 0,this.tabChange.emit(T)),this.interceptValue=T,T&&M.T8.prototype._handleClick.apply(this.tabs,[j,I,F])))}setInterceptTabChange(j){this.interceptValue=j}static{this.\u0275fac=function(I){return new(I||t)(f.KVO(a.G),f.KVO(e._))}}static{this.\u0275prov=f.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})()},58408:(nt,B,n)=>{n.d(B,{O:()=>tt});var f=n(81439),M=n(70434),a=n(54438),e=n(32575),_=n(34006),t=n(1097),m=n(60177),j=n(88834),I=n(96850),F=n(71997),T=n(52920),E=n(54117),P=n(89417),J=n(32102),k=n(82798),Z=n(86600),st=n(59042),Q=n(99213),et=n(14823),lt=n(85139);function ut(c,R){1&c&&(a.j41(0,"mat-error"),a.EFF(1," Campo obrigat\xf3rio "),a.k0s())}function U(c,R){1&c&&(a.j41(0,"mat-error"),a.EFF(1," Campo obrigat\xf3rio "),a.k0s())}let at=(()=>{class c{constructor(p){this.formBuilder=p,this.formulario=this.formBuilder.group({type:[{value:"cep",disabled:!0}],name:[null,P.k0.required],label:[null,P.k0.required],customClass:[null],field_id_to_save_cep:[null]})}ngOnInit(){this.formulario.patchValue({name:this.dataComponent.data.data.name,label:this.dataComponent.data.data.label,field_id_to_save_cep:this.dataComponent.data.data.field_id_to_save_cep,customClass:this.formBuild.customClass},{emitEvent:!1}),this.changedValues()}changedValues(){this.formulario.valueChanges.subscribe(p=>{this.dataComponent.data.data.name=p.name,this.dataComponent.data.data.label=p.label,this.dataComponent.data.data.field_id_to_save_cep=p.field_id_to_save_cep?.field_id||null,this.formBuild.name=p.name,this.formBuild.label=p.label,this.formBuild.customClass=p.customClass})}get f(){return this.formulario.controls}static{this.\u0275fac=function(V){return new(V||c)(a.rXU(P.ze))}}static{this.\u0275cmp=a.VBU({type:c,selectors:[["app-general-cep-config"]],inputs:{dataComponent:"dataComponent",formBuild:"formBuild"},decls:32,vars:7,consts:[[3,"formGroup"],["fxLayout","column","fxFlex","100"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row"],["fxFlex",""],["appearance","fill","fxFlex",""],["formControlName","type"],["value","cep"],["matInput","","formControlName","name","required",""],[4,"ngIf"],["matInput","","formControlName","label","required",""],["fxLayout","row","fxLayoutGap","20px"],[3,"systemFields","formulario","nameControl","label"],["fxFlex","","appearance","fill"],["matInput","","formControlName","customClass"],["matTooltip","Defina uma classe customizada para esse elemento","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon",2,"margin-left","10px"]],template:function(V,S){1&V&&(a.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),a.EFF(6,"Tipo de componente"),a.k0s(),a.j41(7,"mat-select",5)(8,"mat-option",6),a.EFF(9,"CEP com consulta na API"),a.k0s()()()(),a.j41(10,"div",3)(11,"mat-form-field",4)(12,"mat-label"),a.EFF(13,"Nome"),a.k0s(),a.nrm(14,"input",7),a.DNE(15,ut,2,0,"mat-error",8),a.k0s()(),a.j41(16,"div",3)(17,"mat-form-field",4)(18,"mat-label"),a.EFF(19,"R\xf3tulo"),a.k0s(),a.nrm(20,"input",9),a.DNE(21,U,2,0,"mat-error",8),a.k0s()()(),a.j41(22,"div",10)(23,"div",3),a.nrm(24,"app-autocomplete-system-fields",11),a.k0s(),a.j41(25,"div",3)(26,"mat-form-field",12)(27,"mat-label"),a.EFF(28,"Classe CSS"),a.k0s(),a.nrm(29,"input",13),a.k0s(),a.nrm(30,"mat-icon",14),a.k0s(),a.nrm(31,"div",3),a.k0s()()()),2&V&&(a.Y8G("formGroup",S.formulario),a.R7$(15),a.Y8G("ngIf",S.f.name.hasError("required")),a.R7$(6),a.Y8G("ngIf",S.f.label.hasError("required")),a.R7$(3),a.Y8G("systemFields",S.dataComponent.data.fields)("formulario",S.formulario)("nameControl","field_id_to_save_cep")("label","V\xedncular campo"))},dependencies:[m.bT,P.qT,P.me,P.BC,P.cb,P.YS,P.j4,P.JD,J.rl,J.nJ,J.TL,k.VO,Z.wT,st.fg,Q.An,et.oV,T.DJ,T.BO,T.UI,lt.M]})}}return c})();var dt=n(99172),ot=n(96354),rt=n(30450),ft=n(60850);function ct(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.f.address_id.setValue(null))}),a.j41(1,"mat-icon"),a.EFF(2,"close"),a.k0s()()}}function H(c,R){if(1&c&&(a.j41(0,"mat-option",27),a.EFF(1),a.k0s()),2&c){const p=R.$implicit;a.Y8G("value",p),a.R7$(),a.SpI(" ",p.label," ")}}function _t(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.f.district_id.setValue(null))}),a.j41(1,"mat-icon"),a.EFF(2,"close"),a.k0s()()}}function D(c,R){if(1&c&&(a.j41(0,"mat-option",27),a.EFF(1),a.k0s()),2&c){const p=R.$implicit;a.Y8G("value",p),a.R7$(),a.SpI(" ",p.label," ")}}function w(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.f.city_id.setValue(null))}),a.j41(1,"mat-icon"),a.EFF(2,"close"),a.k0s()()}}function z(c,R){if(1&c&&(a.j41(0,"mat-option",27),a.EFF(1),a.k0s()),2&c){const p=R.$implicit;a.Y8G("value",p),a.R7$(),a.SpI(" ",p.label," ")}}function it(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",26),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.f.state_id.setValue(null))}),a.j41(1,"mat-icon"),a.EFF(2,"close"),a.k0s()()}}function bt(c,R){if(1&c&&(a.j41(0,"mat-option",27),a.EFF(1),a.k0s()),2&c){const p=R.$implicit;a.Y8G("value",p),a.R7$(),a.SpI(" ",p.label," ")}}let Ft=(()=>{class c{constructor(p){this.formBuilder=p,this.fields=[],this.filteredOptions=[],this.formulario=this.formBuilder.group({id:[null],address_id:[null],enable_edit_address:[!1],district_id:[null],enable_edit_district:[!1],city_id:[null],enable_edit_city:[!1],state_id:[null],enable_edit_state:[!1]})}ngOnInit(){this.dataComponent&&(this.fields=this.dataComponent.data.data?.main_component?this.dataComponent.data.fields:(0,M.fq)(this.dataComponent.data.dataOfWhereTheComponentIs),this.setForm(),this.initAutoComplete(),this.changedValues())}initAutoComplete(){for(const p in this.f)p.includes("_id")&&this.filteredOptions.push(this.formulario.get(p).valueChanges.pipe((0,dt.Z)(""),(0,ot.T)(V=>V?this._filter(V):this.fields.slice())))}setForm(){const p=this.dataComponent.data.data.cep_fields;null!==p&&p&&this.formulario.patchValue({id:p.id,address_id:this.buildSelectedAutocompleteOption(p.address_id),enable_edit_address:this.switchIntToBoolean(p.enable_edit_address),district_id:this.buildSelectedAutocompleteOption(p.district_id),enable_edit_district:this.switchIntToBoolean(p.enable_edit_district),city_id:this.buildSelectedAutocompleteOption(p.city_id),enable_edit_city:this.switchIntToBoolean(p.enable_edit_city),state_id:this.buildSelectedAutocompleteOption(p.state_id),enable_edit_state:this.switchIntToBoolean(p.enable_edit_state)},{emitEvent:!1})}
1buildSelectedAutocompleteOption(p){if("object"!=typeof p){if(this.fields&&this.fields.length)for(const V of this.fields)if(V.field_id===p)return V;return null}return p}switchIntToBoolean(p){return 1===p}changedValues(){const p=null===this.dataComponent.data.data.cep_fields?{}:this.dataComponent.data.data.cep_fields;this.dataComponent.data.data.cep_fields=p,this.formulario.valueChanges.subscribe(V=>{p.id=V.id,p.address_id=(0,M.p1)(V.address_id)?V.address_id.field_id:null,p.enable_edit_address=V.enable_edit_address,p.district_id=(0,M.p1)(V.district_id)?V.district_id.field_id:null,p.enable_edit_district=V.enable_edit_district,p.city_id=(0,M.p1)(V.city_id)?V.city_id.field_id:null,p.enable_edit_city=V.enable_edit_city,p.state_id=(0,M.p1)(V.state_id)?V.state_id.field_id:null,p.enable_edit_state=V.enable_edit_state})}displayFn(p){return p?p.label:void 0}_filter(p){if("string"==typeof p){const V=p.toLowerCase();return this.fields.filter(S=>S.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").match(V)).sort((S,vt)=>S.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")<vt.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?-1:S.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")>vt.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?1:0)}return[]}get f(){return this.formulario.controls}static{this.\u0275fac=function(V){return new(V||c)(a.rXU(P.ze))}}static{this.\u0275cmp=a.VBU({type:c,selectors:[["app-fields-cep-config"]],inputs:{dataComponent:"dataComponent"},decls:77,vars:35,consts:[["auto","matAutocomplete"],["autoDistrict","matAutocomplete"],["autoCity","matAutocomplete"],["autoState","matAutocomplete"],[3,"formGroup"],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],[1,"ps-title-large"],["fxFlex",""],["fxLayout","row","fxLayoutAlign","start center",1,"ps-row-fields-cep-config"],["fxFlex","","fxFlex","30"],["fxFlex","",1,"ps-form-fields-cep-config-content"],["appearance","fill","fxFlex","",1,""],["type","text","matInput","","formControlName","address_id",3,"matAutocomplete"],["class","ps-fields-cep-config-btn-clean-value","mat-button","","matSuffix","","mat-icon-button","","aria-label","Limpar",3,"click",4,"ngIf"],[3,"displayWith"],[3,"value",4,"ngFor","ngForOf"],["formControlName","enable_edit_address","color","primary"],["appearance","fill","fxFlex","",1,"ps-form-fields-cep-config-content"],["type","text","matInput","","formControlName","district_id",3,"matAutocomplete"],["formControlName","enable_edit_district","color","primary"],["type","text","matInput","","formControlName","city_id",3,"matAutocomplete"],["formControlName","enable_edit_city","color","primary"],["type","text","matInput","","formControlName","state_id",3,"matAutocomplete"],["formControlName","enable_edit_state","color","primary"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Limpar",1,"ps-fields-cep-config-btn-clean-value",3,"click"],[3,"value"]],template:function(V,S){if(1&V&&(a.j41(0,"form",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"span",8),a.EFF(5,"Campo retornado pela API"),a.k0s()(),a.j41(6,"div",9)(7,"span",8),a.EFF(8,"Campo refer\xeancia"),a.k0s()(),a.j41(9,"div",9)(10,"span",8),a.EFF(11," Permitir edi\xe7\xe3o "),a.k0s()()()(),a.j41(12,"div",5)(13,"div",10)(14,"div",11)(15,"span"),a.EFF(16,"Endere\xe7o"),a.k0s()(),a.j41(17,"div",12)(18,"mat-form-field",13)(19,"mat-label"),a.EFF(20,"Selecione o campo"),a.k0s(),a.nrm(21,"input",14),a.DNE(22,ct,3,0,"button",15),a.j41(23,"mat-autocomplete",16,0),a.DNE(25,H,2,2,"mat-option",17),a.nI1(26,"async"),a.k0s()()(),a.j41(27,"div",9),a.nrm(28,"mat-slide-toggle",18),a.k0s()(),a.j41(29,"div",10)(30,"div",11)(31,"span"),a.EFF(32,"Bairro"),a.k0s()(),a.j41(33,"div",9)(34,"mat-form-field",19)(35,"mat-label"),a.EFF(36,"Selecione o campo"),a.k0s(),a.nrm(37,"input",20),a.DNE(38,_t,3,0,"button",15),a.j41(39,"mat-autocomplete",16,1),a.DNE(41,D,2,2,"mat-option",17),a.nI1(42,"async"),a.k0s()()(),a.j41(43,"div",9),a.nrm(44,"mat-slide-toggle",21),a.k0s()(),a.j41(45,"div",10)(46,"div",11)(47,"span"),a.EFF(48,"Cidade"),a.k0s()(),a.j41(49,"div",9)(50,"mat-form-field",19)(51,"mat-label"),a.EFF(52,"Selecione o campo"),a.k0s(),a.nrm(53,"input",22),a.DNE(54,w,3,0,"button",15),a.j41(55,"mat-autocomplete",16,2),a.DNE(57,z,2,2,"mat-option",17),a.nI1(58,"async"),a.k0s()()(),a.j41(59,"div",9),a.nrm(60,"mat-slide-toggle",23),a.k0s()(),a.j41(61,"div",10)(62,"div",11)(63,"span"),a.EFF(64,"Estado"),a.k0s()(),a.j41(65,"div",9)(66,"mat-form-field",19)(67,"mat-label"),a.EFF(68,"Selecione o campo"),a.k0s(),a.nrm(69,"input",24),a.DNE(70,it,3,0,"button",15),a.j41(71,"mat-autocomplete",16,3),a.DNE(73,bt,2,2,"mat-option",17),a.nI1(74,"async"),a.k0s()()(),a.j41(75,"div",9),a.nrm(76,"mat-slide-toggle",25),a.k0s()()()()),2&V){const vt=a.sdS(24),yt=a.sdS(40),Ot=a.sdS(56),It=a.sdS(72);a.Y8G("formGroup",S.formulario),a.R7$(10),a.xc7("margin-left",20,"px"),a.R7$(11),a.Y8G("matAutocomplete",vt),a.R7$(),a.Y8G("ngIf",S.f.address_id.value),a.R7$(),a.Y8G("displayWith",S.displayFn),a.R7$(2),a.Y8G("ngForOf",a.bMT(26,27,S.filteredOptions[0])),a.R7$(3),a.xc7("margin-left",20,"px"),a.R7$(9),a.Y8G("matAutocomplete",yt),a.R7$(),a.Y8G("ngIf",S.f.district_id.value),a.R7$(),a.Y8G("displayWith",S.displayFn),a.R7$(2),a.Y8G("ngForOf",a.bMT(42,29,S.filteredOptions[1])),a.R7$(3),a.xc7("margin-left",20,"px"),a.R7$(9),a.Y8G("matAutocomplete",Ot),a.R7$(),a.Y8G("ngIf",S.f.city_id.value),a.R7$(),a.Y8G("displayWith",S.displayFn),a.R7$(2),a.Y8G("ngForOf",a.bMT(58,31,S.filteredOptions[2])),a.R7$(3),a.xc7("margin-left",20,"px"),a.R7$(9),a.Y8G("matAutocomplete",It),a.R7$(),a.Y8G("ngIf",S.f.state_id.value),a.R7$(),a.Y8G("displayWith",S.displayFn),a.R7$(2),a.Y8G("ngForOf",a.bMT(74,33,S.filteredOptions[3])),a.R7$(3),a.xc7("margin-left",20,"px")}},dependencies:[m.Sq,m.bT,P.qT,P.me,P.BC,P.cb,P.j4,P.JD,j.$z,j.iY,J.rl,J.nJ,J.yw,Z.wT,st.fg,Q.An,rt.sG,ft.$3,ft.pN,T.DJ,T.sA,T.UI,m.Jj],styles:[".ps-title-large[_ng
1content-%COMP%]{color:#a2a2a2;font-weight:400}.ps-row-fields-cep-config[_ngcontent-%COMP%]{border-bottom:1px solid #D4D4D4}.ps-row-fields-cep-config[_ngcontent-%COMP%]:last-of-type{border-bottom:none}.ps-form-fields-cep-config-content[_ngcontent-%COMP%]{padding-top:2.04375em;padding-bottom:2.04375em}  .ps-fields-cep-config-btn-clean-value{width:1.6em!important;height:1.6em!important}  .ps-fields-cep-config-btn-clean-value mat-icon{height:.825em!important;line-height:.825!important;font-size:100%!important}"]})}}return c})();const $=()=>({value:1,name:"Mostrar este componente"}),mt=()=>({value:2,name:"Ocultar este componente"}),y=(c,R)=>[c,R],Y=c=>({data:c}),N=c=>[c],pt=c=>({components:c});function ht(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",16),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.saveCep())}),a.EFF(1," Salvar "),a.k0s()}if(2&c){const p=a.XpG();a.Y8G("disabled",!p.validateButton())}}function xt(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",17),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.clickSaveAsNewCustomComponent())}),a.EFF(1," Salvar como novo "),a.k0s()}if(2&c){const p=a.XpG();a.Y8G("disabled",!p.validateButton()||p.invalidLogic)}}function L(c,R){if(1&c){const p=a.RV6();a.j41(0,"button",16),a.bIt("click",function(){a.eBV(p);const S=a.XpG();return a.Njj(S.clickCustomComponent())}),a.EFF(1," Salvar "),a.k0s()}if(2&c){const p=a.XpG();a.Y8G("disabled",!p.validateButton()||p.invalidLogic)}}let tt=(()=>{class c{constructor(p,V,S,vt){this.dataComponent=p,this.dialogRef=V,this.systemComponentsService=S,this.serviceConfirm=vt,this.invalidLogic=!1,this.main_component=!1,this.main_component=this.dataComponent.data.data?.main_component||!1,this.dataComponent.data.data.save_as_new=!1}ngOnInit(){this.formBuild=JSON.parse(this.dataComponent.data.data.form_build),this.uploadDataUnchanged=JSON.parse(JSON.stringify(this.dataComponent.data.data))}logicChanged(p){this.verifyLogic(p),this.formBuild=p,this.dataComponent.data.data.logics=p.logics,this.dataComponent.data.data.action_logic_id=p.action_logic_id?p.action_logic_id:null,this.dataComponent.data.data.condition_logic_id=p.condition_logic_id?p.condition_logic_id:null,this.dataComponent.data.data.logic_enabled=p.logic_enabled}checkLogicRuleValue(p){return!(![3,4].includes(p.rule_logic_id)&&null==p.fixed_value&&!p.fixed_value)}verifyLogic(p){if(p.logic_enabled)if(p.condition_logic_id&&p.action_logic_id)if(p.logics.length>0){const V=p.logics.every(S=>S.field_compare_id&&S.rule_logic_id&&this.checkLogicRuleValue(S));this.invalidLogic=!V}else this.invalidLogic=!1;else this.invalidLogic=!0;else this.invalidLogic=!1}saveCep(){this.usingSaveOrCancelButtons=!0;const p=this.dataComponent.data.data.cep_fields;this.dataComponent.data.result=!0,this.dataComponent.data.data.form_build=JSON.stringify(this.formBuild),this.dataComponent.data.data.name=this.formBuild.name,this.dataComponent.data.data.label=this.formBuild.label,this.dataComponent.data.data.description=this.formBuild.description,null!==p&&((null===p.address_id||""===p.address_id)&&(p.enable_edit_address=!1),(null===p.city_id||""===p.city_id)&&(p.enable_edit_city=!1),(null===p.district_id||""===p.district_id)&&(p.enable_edit_district=!1),(null===p.state_id||""===p.state_id)&&(p.enable_edit_state=!1)),this.dialogRef.close(this.dataComponent.data.data)}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(p=>{p&&(this.dataComponent.data.data.action="add",this.dataComponent.data.data.save_as_new=!0,this.saveCustomComponent())})}clickCustomComponent(){this.dataComponent.data.data?.id?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(p=>{p&&this.saveCustomComponent()}):this.saveCustomComponent()}saveCustomComponent(){this.saveCep(),this.fillConditionalData(JSON.parse(this.dataComponent.data.data.form_build));const p={content:{...this.dataComponent.data.data}};delete p.content.keys,this.systemComponentsService.create(p).subscribe(V=>{V.success?(this.dataComponent.data.result=!0,this.dataComponent.data.data={...this.dataComponent.data.data,...V.data},this.dialogRef.close(this.dataComponent.data.data)):(this.dataComponent.data.result=!1,this.dialogRef.close())})}fillConditionalData(p){this.dataComponent.data.logic_enabled=p.logic_enabled,this.dataComponent.data.action_logic_id=p.action_logic_id,this.dataComponent.data.condition_logic_id=p.condition_logic_id,this.dataComponent.data.logics=p.logics}cancelCep(){this.usingSaveOrCancelButtons=!0,(0,M.Ns)(this.dataComponent.data.data,this.uploadDataUnchanged),this.dialogRef.close()}ngOnDestroy(){this.usingSaveOrCancelButtons||this.cancelCep()}validateButton(){return!(!this.formBuild.name||!this.formBuild.label)}static{this.\u0275fac=function(V){return new(V||c)(a.rXU(e.m),a.rXU(_.CP),a.rXU(f.x),a.rXU(t.G))}}static{this.\u0275cmp=a.VBU({type:c,selectors:[["app-dialog-cep-config"]],decls:19,vars:23,consts:[["mat-stretch-tabs","false",3,"animationDuration"],["label","Geral"],[1,"ps-dialog-cep-config-content",3,"dataComponent","formBuild"],["label","Campos"],[1,"ps-dialog-cep-config-content",3,"dataComponent"],["label","L\xf3gica"],["fxFlex","100",1,"ps-edit-form-logic-cep-config",3,"valueChanged","info","actionsButton","item","keys","currentForm"],[1,"ps-btn-rubeus-add-action-form-save-bar"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["class","ps-btn-rubeus-add-action-form-save-bar-btn","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["class","ps-btn-rubeus-add-action-form-save-bar-btn","mat-stroked-button","","color","primary",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"],["mat-stroked-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"]],template:function(V,S){1&V&&(a.j41(0,"mat-tab-group",0)(1,"mat-tab",1),a.nrm(2,"app-general-cep-config",2),a.k0s(),a.j41(3,"mat-tab",3),a.nrm(4,"app-fields-cep-config",4),a.k0s(),a.j41(5,"mat-tab",5)(6,"app-edit-form-logic",6),a.bIt("valueChanged",function(yt){return S.logicChanged(yt)}),a.k0s()()(),a.j41(7,"mat-dialog-actions",7)(8,"div",8)(9,"div",9),a.nrm(10,"mat-divider"),a.k0s()(),a.j41(11,"div",10)(12,"div",11)(13,"div",12)(14,"button",13),a.bIt("click",function(){return S.cancelCep()}
1),a.EFF(15," Cancelar "),a.k0s(),a.DNE(16,ht,2,1,"button",14)(17,xt,2,1,"button",15)(18,L,2,1,"button",14),a.k0s()()()()),2&V&&(a.Y8G("animationDuration","0ms"),a.R7$(2),a.Y8G("dataComponent",S.dataComponent)("formBuild",S.formBuild),a.R7$(2),a.Y8G("dataComponent",S.dataComponent),a.R7$(2),a.Y8G("info","Crie regras para mostrar ou ocultar o componente, dependendo dos valores de outros campos.")("actionsButton",a.l_i(14,y,a.lJ4(12,$),a.lJ4(13,mt)))("item",a.eq3(17,Y,S.dataComponent.data.data))("keys",S.dataComponent.data.data.keys)("currentForm",a.eq3(21,pt,a.eq3(19,N,S.formBuild))),a.R7$(10),a.Y8G("ngIf",!S.main_component),a.R7$(),a.Y8G("ngIf",S.main_component&&(null==S.dataComponent.data.data?null:S.dataComponent.data.data.id)),a.R7$(),a.Y8G("ngIf",S.main_component))},dependencies:[m.bT,j.$z,I.mq,I.T8,F.q,_.E7,T.DJ,T.sA,T.G2,T.UI,E.S,at,Ft],styles:[".ps-btn-rubeus-add-action-form-save-bar[_ngcontent-%COMP%]{height:57px;position:absolute;bottom:0;width:100%;padding:0;display:block;margin-bottom:0;z-index:1}.ps-btn-rubeus-add-action-form-save-bar-btn[_ngcontent-%COMP%]{margin-right:18px}  .ps-edit-form-logic-cep-config .ps_formBuilder_formContainer{padding:24px;width:auto!important}  .ps-edit-form-logic-cep-config .ps_formBuilder_formContainer_margin{margin:0!important}.ps-dialog-cep-config-content[_ngcontent-%COMP%]{display:block;padding:24px}"]})}}return c})()},1681:(nt,B,n)=>{n.d(B,{a:()=>ct});var f=n(54438),M=n(26924),a=n(89417),e=n(88834),_=n(86600),t=n(34006),m=n(32102),j=n(99213),I=n(59042),F=n(82798),T=n(30450),E=n(96850),P=n(14823),J=n(2337),k=n(4280),Z=n(1097),st=n(81439),Q=n(37505),et=n(43881),lt=n(52920),ut=n(71997),U=n(54117);function at(H,_t){if(1&H&&(f.j41(0,"mat-option",27),f.EFF(1),f.k0s()),2&H){const D=f.XpG().$implicit;
1f.Y8G("value",D.id),f.R7$(),f.SpI(" ",D.name," (DESATIVADA) ")}}function dt(H,_t){if(1&H&&(f.j41(0,"mat-option",27),f.EFF(1),f.k0s()),2&H){const D=f.XpG().$implicit;f.Y8G("value",D.id),f.R7$(),f.SpI(" ",D.name,"")}}function ot(H,_t){if(1&H&&f.DNE(0,at,2,2,"mat-option",27)(1,dt,2,2,"mat-option",27),2&H){const D=_t.$implicit,w=f.XpG();f.vxM(0,D.id!=(null==w.captchaForm?null:w.captchaForm.id)||null!=w.captchaForm&&w.captchaForm.active?-1:0),f.R7$(),f.vxM(1,D.active?1:-1)}}function rt(H,_t){if(1&H&&(f.j41(0,"div",15)(1,"div",10)(2,"div",20)(3,"div",28)(4,"p"),f.EFF(5," Defina a pontua\xe7\xe3o m\xednima "),f.k0s(),f.nrm(6,"mat-icon",29),f.k0s()()(),f.j41(7,"div",10)(8,"mat-slider",30),f.nrm(9,"input",31),f.k0s()()()),2&H){const D=f.XpG();f.R7$(8),f.Y8G("discrete",!0)("displayWith",D.formatScore)}}function ft(H,_t){if(1&H){const D=f.RV6();f.j41(0,"button",32),f.bIt("click",function(){f.eBV(D);const z=f.XpG();return f.Njj(z.clickSaveAsNewCustomComponent())}),f.EFF(1," Salvar como novo "),f.k0s()}}let ct=(()=>{class H{constructor(){this.captchas=[],this.keysCaptchaService=(0,f.WQX)(J.a),this.dataComponent=(0,f.WQX)(t.Vh),this.serviceConfirm=(0,f.WQX)(Z.G),this.systemComponentsService=(0,f.WQX)(st.x),this.dialogRef=(0,f.WQX)(t.CP),this.loaderService=(0,f.WQX)(Q.Z),this.captchaForm=null,this.validateType=D=>{if(!this.form)return null;const w=this.captchas.find(z=>z.id===this.form.value.captcha_id);return w&&"v3"===w.type&&null==D.value?{invalid:!0}:null}}ngOnInit(){this.component=this.dataComponent.data,this.dataComponent.data.main_component=!!this.dataComponent.data?.main_component&&this.dataComponent.data.main_component,this.captchas=this.dataComponent.captchas,this.configureFormBuild(),this.createForm(),this.setForm(),this.changesForm()}setForm(){this.dataComponent.data.captcha_id&&(this.captchaForm=this.captchas.find(w=>w.id==this.dataComponent?.data?.captcha_id)),this.form.patchValue(this.dataComponent.data?{id:this.dataComponent.data.id,name:this.dataComponent.data.name,customClass:this.formBuild.customClass,score:this.dataComponent.data.score,captcha_id:this.dataComponent.data.captcha_id,logic:{logic_enabled:this.dataComponent.data.logic_enabled,action_logic_id:this.dataComponent.data.action_logic_id,condition_logic_id:this.dataComponent.data.condition_logic_id,logics:this.dataComponent.data.logics}}:{score:.5},{emitEvent:!1})}configureFormBuild(){this.formBuild=JSON.parse(this.dataComponent.data.form_build),this.formBuild.conditionalData?.data&&this.formBuild.conditionalData.data.length>0&&(this.dataComponent.data.logics=this.formBuild.conditionalData.data)}formatScore(D){return D.toFixed(1)}createForm(){const D={components:[JSON.parse(this.dataComponent.data.form_build)]};this.fieldJson=D,this.form=new a.gE({id:new a.MJ(null),name:new a.MJ(null,a.k0.required),captcha_id:new a.MJ(null,a.k0.required),score:new a.MJ(null,this.validateType),customClass:new a.MJ(null),logic:new a.gE({logic_enabled:new a.MJ(null),action_logic_id:new a.MJ(null),condition_logic_id:new a.MJ(null),logics:new a.Yp([],this.validatorLogics)})})}validatorLogics(D){return D.value?D.value.every(it=>it.field_compare_id&&it.rule_logic_id&&function w(it){return!(![3,4].includes(it.rule_logic_id)&&null==it.fixed_value&&!it.fixed_value)}(it))?null:{logicInvalid:!0}:null}cancelFieldEdit(){this.dialogRef.close()}changesForm(){this.form.valueChanges.subscribe({next:D=>{D.captcha_id&&(this.validateIfAreV3(D.captcha_id),this.keyV3&&!D.score&&this.form.get("score")?.setValue(.5,{emitEvent:!1})),this.setValues(D)}})}validateIfAreV3(D){this.keyV3=!!this.captchas.find(w=>w.id==D&&"v3"==w.type)}setValues(D){this.dataComponent.data.captcha_id=D.captcha_id,this.dataComponent.data.name=D.name,this.dataComponent.data.score=D.score,this.formBuild.customClass=D.customClass,this.updateLogic(D),this.dataComponent.data.form_build=JSON.stringify(this.formBuild)}updateLogic(D){this.dataComponent.data.logic_enabled=D.logic.logic_enabled,this.dataComponent.data.action_logic_id=D.logic.action_logic_id,this.dataComponent.data.condition_logic_id=D.logic.condition_logic_id,this.dataComponent.data.logics=D.logic.logics,this.setFormBuildLogic(D)}setFormBuildLogic(D){this.formBuild.conditionalData={enable:D.logic.logic_enabled,action:D.logic.action_logic_id,condition:D.logic.condition_logic_id,data:D.logic.logics},this.formBuild.logics=D.logic.logics}save(){this.dataComponent.data.main_component?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(D=>{D&&(this.dataComponent.data.save_as_new=!1,this.saveCustomComponent())}):this.saveCustomComponent()}saveCustomComponent(){this.keyV3||(this.dataComponent.data.score=null),this.systemComponentsService.create({content:this.dataComponent.data}).subscribe({next:w=>{w.success?(this.dataComponent.data.result=!0,this.captchaConfigs(),this.dialogRef.close(this.dataComponent.data)):(this.dataComponent.data.result=!1,this.loaderService.setChangesLoaderState(!1,`Error ao ${"edit"===this.dataComponent.data.action?"editar":"salvar"} o componente!`,"ok","error"),this.dialogRef.close())},error:()=>{this.loaderService.setChangesLoaderState(!1,`Error ao ${"edit"===this.dataComponent.data.action?"editar":"salvar"} o componente!`,"ok","error"),this.dialogRef.close()}})}captchaConfigs(){this.captchas.forEach(D=>{D.id==this.dataComponent.data.captcha_id&&(this.dataComponent.data.token=D.token,this.dataComponent.data.captcha_type=D.type)})}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(D=>{D&&(this.component.save_as_new=!0,this.saveCustomComponent())})}logicChanged(D){this.fieldJson.components[0]=D,this.form.get("logic").get("logic_enabled").setValue(D.logic_enabled),this.form.get("logic").get("action_logic_id").setValue(D.action_logic_id),this.form.get("logic").get("condition_logic_id").setValue(D.condition_logic_id);const w=this.form.get("logic").get("logics");w.clear(),Array.isArray(D.logics)&&D.logics.forEach(z=>{w.push(new a.gE({id:new a.MJ(z.id),field_compare_id:new a.MJ(z.field_compare_id),rule_logic_id:new a.MJ(z.rule_logic_id),fixed_value:new a.MJ(z.fixed_value)}))})}static{this.\u0275fac=function(w){return new(w||H)}}static{this.\u0275cmp=f.VBU({type:H,selectors:[["app-dialog-config-custom-recaptcha"]],standalone:!0,features:[f.aNF],decls:50,vars:9,consts:[[3,"formGroup"],["mat-stretch-tabs","false",3,"animationDuration"],["label","Geral"],["fxLayout","row","fxLayoutGap","20px",1,"ps-tab-general-custom-recaptcha"],["appearance","fill","required",""],["value","button","required","","disabled",""],["value","button"],["matInput","","formControlName","name"],["label","B\xe1sico"],["fxLayout","column","fxLayoutGap","16px",1,"ps-tab-basic-custom-recaptcha"],["fxFlex","100"],["appearance","fill","fxFlex","50"],["matInput","","formControlName","customClass"],["fxLayout","column","fxFlex","100"],["formControlName","captcha_id"],["fxLayout","column"],["label","L\xf3gica"],["fxLayout","row wrap",1,"ps-dialog-config-form-logics-container"],[3,"valueChanged","item","keys","fxFlex","currentForm"],[1,"ps-form-save-bar",2,"height","51px"],["fxLayout","row"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center",1,"ps-form-save-bar",2,"height","100%"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["mat-stroked-button","","color","primary"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["fxFlex","50","fxLayout","row","fxLayoutGap","10px","fxLayoutAlign","start center"],["matTooltip","Para definir a pontua\xe7\xe3o m\xednima do reCAPTCHA v3, \xe9 importante equilibrar a seguran\xe7a do seu site e a experi\xeancia do usu\xe1rio. O reCAPTCHA v3 atribui uma pontua\xe7\xe3o entre 0.0 e 1.0 para cada intera\xe7\xe3o, onde valores pr\xf3ximos de 1.0 indicam comportamento humano e valores pr\xf3ximos de 0.0 sugerem atividade de bots. O Google recomenda iniciar com um limite padr\xe3o de 0.5.  \n                      ","matTooltipPosition","above","svgIcon","help",2,"width","20px","cursor","pointer"],["color","#009688","min","0.0","max","1.0","step","0.1","fxFlex","50",1,"ps-crud-filter-mat-slider",3,"discrete","displayWith"],["matSliderThumb","","formControlName","score"],["mat-stroked-button","","color","primary",3,"click"]],template:function(w,z){1&w&&(f.j41(0,"form",0)(1,"mat-tab-group",1)(2,"mat-tab",2)(3,"div",3)(4,"div")(5,"mat-form-field",4)(6,"mat-label"),f.EFF(7,"Tipo de componente"),f.k0s(),f.j41(8,"mat-select",5)(9,"mat-option",6),f.EFF(10,"reCAPTCHA"),f.k0s()()()(),f.j41(11,"div")(12,"mat-form-field",4)(13,"mat-label"),f.EFF(14,"R\xf3tulo"),f.k0s(),f.nrm(15,"input",7),f.k0s()()()(),f.j41(16,"mat-tab",8)(17,"div",9)(18,"div",10)(19,"mat-form-field",11)(20,"mat-label"),f.EFF(21,"Classe CSS"),f.k0s(),f.nrm(22,"input",12),f.k0s()(),f.j41(23,"div",13)(24,"div")(25,"p"),f.EFF(26,"Selecione o reCAPTCHA"),f.k0s()(),f.j41(27,"div",10)(28,"mat-form-field",11)(29,"mat-label"),f.EFF(30,"reCAPTCHA"),f.k0s(),f.j41(31,"mat-select",14),f.Z7z(32,ot,2,2,null,null,f.fX1),f.k0s()()(),f.DNE(34,rt,10,2,"div",15),f.k0s()()(),f.j41(35,"mat-tab",16)(36,"div",17)(37,"app-edit-form-logic",18),f.bIt("valueChanged",function(bt){return z.logicChanged(bt)}),f.k0s()()()(),f.j41(38,"mat-dialog-actions",19)(39,"div",20)(40,"div",10),f.nrm(41,"mat-divider"),f.k0s()(),f.j41(42,"div",21)(43,"div",22)(44,"div",23)(45,"button",24),f.bIt("click",function(){return z.cancelFieldEdit()}),f.EFF(46," Cancelar "),f.k0s(),f.DNE(47,ft,2,0,"button",25),f.j41(48,"button",26),f.bIt("click",function(){return z.save()}),f.EFF(49," Salvar "),f.k0s()()()()()()),2&w&&(f.Y8G("formGroup",z.form),f.R7$(),f.Y8G("animationDuration","0ms"),f.R7$(31),f.Dyx(z.captchas),f.R7$(2),f.vxM(34,z.keyV3?34:-1),f.R7$(3),f.Y8G("item",z.dataComponent)("keys",z.dataComponent.data.keys)("fxFlex",100)("currentForm",z.fieldJson),f.R7$(10),f.vxM(47,z.component.main_component&&z.component.id&&!z.dataComponent.removedSavedIsNew?47:-1),f.R7$(),f.Y8G("disabled",!z.form.valid))},dependencies:[m.RG,m.rl,m.nJ,I.fS,I.fg,_.Sy,_.wT,a.YN,a.qT,a.me,a.BC,a.cb,e.Hl,e.$z,T.mV,E.RI,E.mq,E.T8,F.Ve,F.VO,j.m_,j.An,M.YF,lt.DJ,lt.BO,lt.sA,lt.G2,lt.UI,P.uc,P.oV,et.Ez,et.IV,et.OU,k.G,a.j4,a.JD,ut.q,t.E7,U.S],styles:[".ps-data-source-settings-container[_ngcontent-%COMP%]{display:flex;padding:20px}.toggle[_ngcontent-%COMP%]{display:flex;padding:18px}.ps-tab-general-custom-recaptcha[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;padding:30px;
1gap:20px}.ps-tab-basic-custom-recaptcha[_ngcontent-%COMP%]{padding:30px;gap:20px}.ps-form-save-bar-buttons[_ngcontent-%COMP%]{margin:0 20px}.ps-slider-info-score[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.ps-tooltip-content[_ngcontent-%COMP%]{width:15px;vertical-align:middle;box-shadow:none}.mat-icon[_ngcontent-%COMP%]{font-size:16px;vertical-align:middle}.mat-tooltip[_ngcontent-%COMP%]{box-shadow:none;text-align:center}.ps-dialog-config-form-logics-container[_ngcontent-%COMP%]{min-height:300px;padding:15px 24px 0;display:flex!important}.ps-form-save-bar[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;left:0;min-height:unset;width:100%;padding:0;margin:0}  .ps-crud-filter-mat-slider{width:100%!important}"]})}}return H})()},30703:(nt,B,n)=>{n.d(B,{a:()=>Ta});var f=n(32575),M=n(453),a=n(89274),e=n(70434),_=n(89417),t=n(54438),m=n(60177),j=n(88834),I=n(71997),F=n(34006),T=n(5951),E=n(52920);function P(i,h){if(1&i&&(t.j41(0,"mat-radio-button",16),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.id),t.R7$(),t.SpI(" ",o.title," ")}}let J=(()=>{class i{constructor(o,s){this.formBuilder=o,this.dateComponent=s,this.dialogOptions=[{id:"1",title:"Atualizar as configura\xe7\xf5es em todos os locais em que o campo \xe9 utilizado"},{id:"0",title:"Atualizar apenas na configura\xe7\xe3o geral"}]}ngOnInit(){this.formulario=this.formBuilder.group({edit_type:[null,_.k0.required]})}get f(){return this.formulario.controls}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze),t.rXU(f.m))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-dialog-confirm-change-field"]],decls:28,vars:5,consts:[[3,"formGroup"],["fxLayout","row"],["fxFlex","","fxLayoutAlign","center center"],[1,"ps-title-large","ps-confirm-change-settings-title"],["fxLayout","row",1,"ps-confirm-change-settings-desc-content"],[1,"ps-description-14"],["fxLayout","row",1,"ps-confirm-change-settings-opts-content"],["fxFlex",""],["fxLayout","column","color","primary","formControlName","edit_type"],[3,"value",4,"ngFor","ngForOf"],[1,"ps-dialog-container-actions"],["fxFlex","100"],["fxLayout","row","fxFill","",2,"margin-top","2px"],["fxFlex","","fxLayoutAlign","end center",1,"ps-dialog-content-actions"],["mat-stroked-button","",3,"mat-dialog-close"],["mat-raised-button","","color","primary",3,"click","disabled","mat-dialog-close"],[3,"value"]],template:function(s,d){1&s&&(t.j41(0,"form",0)(1,"div")(2,"div",1)(3,"div",2)(4,"h3",3),t.EFF(5,"Voc\xea est\xe1 alterando um campo do sistema"),t.k0s()()(),t.j41(6,"div",4)(7,"div",2)(8,"p",5),t.EFF(9," Essa altera\xe7\xe3o pode atualizar o campo em todos os locais de uso."),t.nrm(10,"br"),t.EFF(11," Importante: mudan\xe7as em op\xe7\xf5es pr\xe9-definidas ser\xe3o aplicadas globalmente, independentemente da escolha."),t.nrm(12,"br"),t.EFF(13," Como deseja prosseguir? "),t.k0s()()(),t.j41(14,"div",6)(15,"div",7)(16,"mat-radio-group",8),t.DNE(17,P,2,2,"mat-radio-button",9),t.k0s()()(),t.j41(18,"mat-dialog-actions",10)(19,"div",1)(20,"div",11),t.nrm(21,"mat-divider"),t.k0s()(),t.j41(22,"div",12)(23,"div",13)(24,"a",14),t.EFF(25,"Cancelar"),t.k0s(),t.j41(26,"button",15),t.bIt("click",function(){return d.dateComponent.data.edit_type=d.f.edit_type.value}),t.EFF(27," Salvar "),t.k0s()()()()()()),2&s&&(t.Y8G("formGroup",d.formulario),t.R7$(17),t.Y8G("ngForOf",d.dialogOptions),t.R7$(7),t.Y8G("mat-dialog-close",!1),t.R7$(2),t.Y8G("disabled",!d.formulario.valid)("mat-dialog-close",!0))},dependencies:[m.Sq,_.qT,_.BC,_.cb,_.j4,_.JD,j.It,j.$z,I.q,F.tx,F.E7,T.VT,T._g,E.DJ,E.sA,E.G2,E.UI],styles:[".mdc-label{white-space:pre-line!important;padding-bottom:8px;padding-top:8px;align-items:end!important}.confirm-action-message[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-family:Poppins;font-style:normal;font-weight:500;font-size:16px;line-height:24px;text-align:center}.confirm-action-message[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-family:Roboto;font-style:italic;font-weight:400;font-size:14px;line-height:18px;text-align:center;letter-spacing:.025em;margin-left:20%;margin-right:20%}.ps-confirm-change-settings-title[_ngcontent-%COMP%]{margin-top:2em}.ps-confirm-change-settings-desc-content[_ngcontent-%COMP%]{padding:0 40px;text-align:center}.ps-confirm-change-settings-opts-content[_ngcontent-%COMP%]{padding:24px}.ps-dialog-content-actions[_ngcontent-%COMP%]{padding:10px 20px}.ps-dialog-content-actions[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:first-child{margin-right:21px}.ps-divider-margin[_ngcontent-%COMP%]{margin-bottom:0!important}.ps-dialog-container-actions[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;left:0;min-height:unset;width:100%;padding:0;margin:0;background:#fff}  .mat-mdc-dialog-container{position:relative;padding:0;width:100%;height:auto;overflow:hidden}  .mat-mdc-dialog-content{margin:0;padding:0;max-height:100%}"]})}}return i})();var k=n(82201),Z=n(37505),st=n(584),Q=n(96850),et=n(16038);let lt=(()=>{class i{constructor(){setTimeout(()=>{this.matTabGroup._tabHeader.updatePagination()})}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275dir=t.FsC({type:i,selectors:[["","UpdatePaginationMatTab",""]],inputs:{matTabGroup:[t.Mj6.None,"UpdatePaginationMatTab","matTabGroup"]}})}}return i})();var ut=n(83225),U=n(32102),at=n(82798),dt=n(86600),ot=n(59042),rt=n(99213),ft=n(14823),ct=n(30450);function H(i,h){if(1&i&&(t.j41(0,"mat-label"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.label)}}function _t(i,h){if(1&i&&(t.j41(0,"mat-hint"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.hint)}}function D(i,h){if(1&i&&(t.j41(0,"mat-hint",10),t.EFF(1),t.k0s()),2&i){t.XpG();const o=t.sdS(4),s=t.XpG();t.R7$(),t.Lme("",o.value.length,"/",s.field.size,"")}}function w(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function z(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",5)(1,"mat-form-field",6),t.DNE(2,H,2,1,"mat-label",4),t.j41(3,"input",7,0),t.bIt("input",function(){t.eBV(o);const d=t.XpG();return t.Njj(d.onInputChange())}),t.k0s(),t.DNE(5,_t,2,1,"mat-hint",4)(6,D,2,2,"mat-hint",8),t.k0s(),t.DNE(7,w,1,1,"mat-icon",9),t.k0s()}if(2&i){const o=t.XpG();t.R7$(2),t.Y8G("ngIf",o.field.label),t.R7$(),t.Y8G("formControl",o.form)("placeholder",o.field.placeholder)("maxlength",o.field.size),t.R7$(2),t.Y8G("ngIf",o.field.hint),t.R7$(),t.Y8G("ngIf",o.field.size),t.R7$(),t.Y8G("ngIf",o.field.tooltip)}}function it(i,h){if(1&i&&(t.j41(0,"mat-label"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.label)}}function bt(i,h){if(1&i&&(t.j41(0,"mat-hint"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.hint)}}function Ft(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function $(i,h){if(1&i&&(t.j41(0,"div",5)(1,"mat-form-field",6),t.DNE(2,it,2,1,"mat-label",4),t.nrm(3,"input",12),t.DNE(4,bt,2,1,"mat-hint",4),t.k0s(),t.DNE(5,Ft,1,1,"mat-icon",9),t.k0s()),2&i){const o=t.XpG();t.R7$(2),t.Y8G("ngIf",o.field.label),t.R7$(),t.Y8G("formControl",o.form)("placeholder",o.field.placeholder),t.R7$(),t.Y8G("ngIf",o.field.hint),t.R7$(),t.Y8G("ngIf",o.field.tooltip)}}function mt(i,h){if(1&i&&(t.j41(0,"mat-label"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.label)}}function y(i,h){if(1&i&&(t.j41(0,"mat-hint"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.hint)}}function Y(i,h){if(1&i&&(t.j41(0,"mat-hint",10),t.EFF(1),t.k0s()),2&i){t.XpG();const o=t.sdS(4),s=t.XpG();t.R7$(),t.Lme("",o.value.length,"/",s.field.size,"")}}function N(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function pt(i,h){if(1&i&&(t.j41(0,"div",5)(1,"mat-form-field",6),t.DNE(2,mt,2,1,"mat-label",4),t.nrm(3,"textarea",13,0),t.DNE(5,y,2,1,"mat-hint",4)(6,Y,2,2,"mat-hint",8),t.k0s(),t.DNE(7,N,1,1,"mat-icon",9),t.k0s()),2&i){const o=t.XpG();t.R7$(2),t.Y8G("ngIf",o.field.label),t.R7$(),t.Y8G("formControl",o.form)("placeholder",o.field.placeholder),t.R7$(2),t.Y8G("ngIf",o.field.hint),t.R7$(),t.Y8G("ngIf",o.field.size),t.R7$(),t.Y8G("ngIf",o.field.tooltip)}}function ht(i,h){if(1&i&&(t.j41(0,"mat-label"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.label)}}function xt(i,h){if(1&i&&(t.j41(0,"mat-option",16),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.value),t.R7$(),t.SpI(" ",o.name," ")}}function L(i,h){if(1&i&&(t.j41(0,"mat-hint"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.JRh(o.field.hint)}}function tt(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function c(i,h){if(1&i&&(t.j41(0,"div",5)(1,"mat-form-field",6),t.DNE(2,ht,2,1,"mat-label",4),t.j41(3,"mat-select",14),t.DNE(4,xt,2,2,"mat-option",15),t.k0s(),t.DNE(5,L,2,1,"mat-hint",4),t.k0s(),t.DNE(6,tt,1,1,"mat-icon",9),t.k0s()),2&i){const o=t.XpG();t.R7$(2),t.Y8G("ngIf",o.field.label),t.R7$(),t.Y8G("formControl",o.form)("placeholder",o.field.placeholder),t.R7$(),t.Y8G("ngForOf",o.field.options),t.R7$(),t.Y8G("ngIf",o.field.hint),t.R7$(),t.Y8G("ngIf",o.field.tooltip)}}function R(i,h){if(1&i&&(t.j41(0,"mat-slide-toggle",20),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("formControl",o.form)("color","primary"),t.R7$(),t.SpI(" ",o.field.label," ")}}function p(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function V(i,h){1&i&&(t.j41(0,"mat-icon",21),t.EFF(1,"visibility_off "),t.k0s())}function S(i,h){if(1&i&&(t.j41(0,"div",17),t.DNE(1,R,2,3,"mat-slide-toggle",18)(2,p,1,1,"mat-icon",9)(3,V,2,0,"mat-icon",19),t.k0s()),2&i){const o=t.XpG();t.R7$(),t.Y8G("ngIf","toogle"==o.field.type),t.R7$(),t.Y8G("ngIf",o.field.tooltip),t.R7$(),t.Y8G("ngIf","hidde"===o.field.key&&o.form.value)}}function vt(i,h){if(1&i&&(t.j41(0,"label",25),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.SpI("",o.field.label," ")}}function yt(i,h){if(1&i&&t.nrm(0,"mat-icon",11),2&i){const o=t.XpG(2);t.Y8G("matTooltip",o.field.tooltip)}}function Ot(i,h){if(1&i&&(t.j41(0,"mat-radio-button",26),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.value),t.R7$(),t.SpI(" ",o.name," ")}}function It(i,h){if(1&i&&(t.j41(0,"div"),t.DNE(1,vt,2,1,"label",22)(2,yt,1,1,"mat-icon",9),t.j41(3,"mat-radio-group",23),t.DNE(4,Ot,2,2,"mat-radio-button",24),t.k0s()()),2&i){const o=t.XpG();t.R7$(),t.Y8G("ngIf",o.field.label),t.R7$(),t.Y8G("ngIf",o.field.tooltip),t.R7$(),t.Y8G("formControl",o.form),t.R7$(),t.Y8G("ngForOf",o.field.options)}}let jt=(()=>{class i{constructor(o,s){this.serviceNotification=o,this.loaderService=s,this.valueChanged=new t.bkB}ngOnInit(){this.defineFieldOptions(this.formBuildInfo)}defineFieldOptions(o){this.field=o,this.form=new _.hs("",null!==o.validate?this.getValidators(o.validate):null),this.form.setValue(o.keyGroup?this.currentForm.components[0][o.keyGroup][o.key]:this.currentForm.components[0][o.key]??this.formBuildInfo.value),this.onChanges()}onChanges(){this.form.valueChanges.subscribe(o=>{this.valueChanged.emit({key:this.field.key,value:this.form.value,keyGroup:null!==this.field.keyGroup&&this.field.keyGroup})})}getValidators(o){const s=[];for(const d in o)if(o.hasOwnProperty(d)){const v=o[d];switch(d){case"required":v&&s.push(_.k0.required);break;case"maxLength":s.push(_.k0.maxLength(v));break;case"minLength":s.push(_.k0.minLength(v));break;case"max":s.push(_.k0.max(v));break;case"min":s.push(_.k0.min(v));break;case"pattern":s.push(_.k0.pattern(v));break;case"email":s.push(_.k0.email)}}return s}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(ut.J),t.rXU(Z.Z))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-field"]],inputs:{formBuildInfo:"formBuildInfo",currentForm:"currentForm"},outputs:{valueChanged:"valueChanged"},decls:7,vars:6,consts:[["inputField",""],["fxLayoutAlign","center center",1,"ps_formBuilder_formContainer"],["fxLayout","row",4,"ngIf"],["style","display: flex;",4,"ngIf"],[4,"ngIf"],["fxLayout","row"],["appearance","fill",2,"width","100%"],["matInput","",3,"input","formControl","placeholder","maxlength"],["align","end",4,"ngIf"],["class","ps_formBuilder_tooltipIcon","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",3,"matTooltip",4,"ngIf"],["align","end"],["matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon",3,"matTooltip"],["matInput","","type","number",3,"formControl","placeholder"],["matInput","",3,"formControl","placeholder"],[3,"formControl","placeholder"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"display","flex"],[3,"formControl","color",4,"ngIf"],["matTooltip","Este campo ficar\xe1 oculto","matTooltipPosition","after","matTooltipClass","ps-tooltip-content","class","ps-option-badge-icon",4,"ngIf"],[3,"formControl","color"],["matTooltip","Este campo ficar\xe1 oculto","matTooltipPosition","after","matTooltipClass","ps-tooltip-content",1,"ps-option-badge-icon"],["id","label",4,"ngIf"],["aria-labelledby","label",1,"ps_formBuilder_radioGroup",3,"formControl"],["class","ps_formBuilder_radioButton",3,"value",4,"ngFor","ngForOf"],["id","label"],[1,"ps_formBuilder_radioButton",3,"value"]],template:function(s,d){1&s&&(t.j41(0,"div",1),t.DNE(1,z,8,7,"div",2)(2,$,6,5,"div",2)(3,pt,8,6,"div",2)(4,c,7,6,"div",2)(5,S,4,3,"div",3)(6,It,5,4,"div",4),t.k0s()),2&s&&(t.R7$(),t.Y8G("ngIf","textfield"==d.field.type),t.R7$(),t.Y8G("ngIf","number"==d.field.type),t.R7$(),t.Y8G("ngIf","textarea"==d.field.type),t.R7$(),t.Y8G("ngIf","select"==d.field.type),t.R7$(),t.Y8G("ngIf","toogle"==d.field.type),t.R7$(),t.Y8G("ngIf","radio"==d.field.type))},dependencies:[m.Sq,m.bT,_.me,_.Q0,_.BC,_.tU,_.l_,U.rl,U.nJ,U.MV,at.VO,dt.wT,ot.fg,rt.An,ft.oV,ct.sG,T.VT,T._g,E.DJ,E.sA],styles:[".ps_formBuilder_formContainer[_ngcontent-%COMP%]{display:flex;width:100%;margin:10px auto}.ps_formBuilder_formContainer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]:first-of-type{width:90%}.ps_formBuilder_formContainer[_ngcontent-%COMP%]   .ps_formBuilder_tooltipIcon[_ngcontent-%COMP%]{margin-left:5px}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]   .ps_formBuilder_radioButton[_ngcontent-%COMP%]{margin:5px}.ps-option-badge-icon[_ngcontent-%COMP%]{padding:5px;border-radius:24px;background:gray;font-size:14px;margin-left:15px;height:14px;color:#fff;width:14px}
1.ps-form-content-editor[_ngcontent-%COMP%]{width:100%}.size_counter[_ngcontent-%COMP%]{color:#909090}"]})}}return i})();var Rt=n(54117),Lt=n(85767),Gt=n(79047),Bt=n(61391),At=n(89859),Dt=n(93337),St=n(60033),Mt=n(69697),Pt=n(58717),Nt=n(93181),b=n(32037),A=n(99172),l=n(96354),C=n(60850);const O=i=>({"ps-display-toggle-param":i});function K(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function Vt(i,h){if(1&i&&(t.j41(0,"mat-form-field",12)(1,"mat-label"),t.EFF(2,"Nome campo"),t.k0s(),t.nrm(3,"input",19,1),t.DNE(5,K,2,0,"mat-error",15),t.k0s()),2&i){const o=t.XpG(2).$implicit,s=t.XpG();t.R7$(3),t.Y8G("disableControl",1!==o.get("fixed_param").value)("errorStateMatcher",s.matcher),t.R7$(2),t.Y8G("ngIf",o.get("name").hasError("required"))}}function $t(i,h){if(1&i&&(t.j41(0,"mat-option",14),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.name?o.name:o),t.R7$(),t.SpI(" ",o.name?o.name:o," ")}}function Kt(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function Ht(i,h){if(1&i&&(t.j41(0,"mat-form-field",12)(1,"mat-label"),t.EFF(2,"Nome campo"),t.k0s(),t.j41(3,"mat-select",20),t.DNE(4,$t,2,2,"mat-option",21),t.k0s(),t.DNE(5,Kt,2,0,"mat-error",15),t.k0s()),2&i){const o=t.XpG(2).$implicit,s=t.XpG();t.R7$(3),t.Y8G("errorStateMatcher",s.matcher),t.R7$(),t.Y8G("ngForOf",s.nameFields),t.R7$(),t.Y8G("ngIf",o.get("name").hasError("required"))}}function Zt(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function Yt(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function Qt(i,h){if(1&i&&(t.j41(0,"mat-form-field",12)(1,"mat-label"),t.EFF(2,"Valor fixo"),t.k0s(),t.nrm(3,"input",22,1),t.DNE(5,Yt,2,0,"mat-error",15),t.k0s()),2&i){const o=t.XpG(2).$implicit,s=t.XpG();t.R7$(3),t.Y8G("errorStateMatcher",s.matcher),t.R7$(2),t.Y8G("ngIf",o.get("fixed_value").hasError("valueFixedValue"))}}function qt(i,h){if(1&i&&(t.j41(0,"mat-option",26),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("matTooltip",o.label)("matTooltipShowDelay",200)("value",o),t.R7$(),t.SpI(" ",o.label," ")}}function te(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function ee(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Selecione o campo "),t.k0s())}function ae(i,h){if(1&i&&(t.j41(0,"mat-form-field",12)(1,"mat-label"),t.EFF(2,"Campo sistema"),t.k0s(),t.nrm(3,"input",23),t.j41(4,"mat-autocomplete",24,2),t.DNE(6,qt,2,4,"mat-option",25),t.nI1(7,"async"),t.k0s(),t.DNE(8,te,2,0,"mat-error",15)(9,ee,2,0,"mat-error",15),t.k0s()),2&i){const o=t.sdS(5),s=t.XpG(2),d=s.$implicit,v=s.index,W=t.XpG();t.R7$(3),t.Y8G("errorStateMatcher",W.matcher)("matAutocomplete",o),t.R7$(),t.Y8G("displayWith",W.displayFn),t.R7$(2),t.Y8G("ngForOf",t.bMT(7,6,W.filteredOptions[v])),t.R7$(2),t.Y8G("ngIf",d.get("field_id").hasError("valueFieldId")),t.R7$(),t.Y8G("ngIf",d.get("field_id").hasError("match")&&!d.get("field_id").hasError("valueFieldId"))}}function oe(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",10),t.DNE(1,Vt,6,3,"mat-form-field",11)(2,Ht,6,3,"mat-form-field",11),t.j41(3,"mat-form-field",12)(4,"mat-label"),t.EFF(5,"Tipo do campo"),t.k0s(),t.j41(6,"mat-select",13),t.bIt("selectionChange",function(){t.eBV(o);const d=t.XpG(2);return t.Njj(d.changeParameterTypeId())}),t.j41(7,"mat-option",14),t.EFF(8,"Campo sistema"),t.k0s(),t.j41(9,"mat-option",14),t.EFF(10,"Valor fixo"),t.k0s()(),t.DNE(11,Zt,2,0,"mat-error",15),t.k0s(),t.DNE(12,Qt,6,2,"mat-form-field",11)(13,ae,10,8,"mat-form-field",11),t.j41(14,"div",16)(15,"a",17),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.removeItem(d))}),t.j41(16,"mat-icon"),t.EFF(17,"delete"),t.k0s()(),t.j41(18,"a",18),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.addItem([],d))}),t.j41(19,"mat-icon"),t.EFF(20,"add"),t.k0s()()()()}if(2&i){const o=t.XpG(),s=o.$implicit,d=o.index,v=t.XpG();t.Y8G("formGroupName",d),t.R7$(),t.Y8G("ngIf",0===v.nameFields.length),t.R7$(),t.Y8G("ngIf",v.nameFields.length>0),t.R7$(4),t.Y8G("errorStateMatcher",v.matcher),t.R7$(),t.Y8G("value",1),t.R7$(2),t.Y8G("value",2),t.R7$(2),t.Y8G("ngIf",s.get("parameter_type_id").hasError("required")),t.R7$(),t.Y8G("ngIf",2==s.get("parameter_type_id").value),t.R7$(),t.Y8G("ngIf",1==s.get("parameter_type_id").value),t.R7$(2),t.Y8G("disabled",1===s.get("fixed_param").value||v.disabled()||s.get("name").disabled&&s.get("parameter_type_id").disabled||s.get("field_id").disabled||s.get("fixed_value").disabled),t.R7$(3),t.Y8G("disabled",s.get("name").disabled&&s.get("parameter_type_id").disabled||s.get("field_id").disabled||s.get("fixed_value").disabled)}}function ie(i,h){if(1&i&&(t.j41(0,"div",8),t.DNE(1,oe,21,11,"div",9),t.k0s()),2&i){const o=t.XpG();t.R7$(),t.Y8G("ngIf",o.f.active_paramn.value)}}class Ut{static valueSelected(h){return o=>{const s=o.value?.label,d=h.filter(v=>v.label===s);if(o.parent)return o.value?d.length>0?null:{match:!0}:null}}}class ne{isErrorState(h,o){return!!(h&&h.invalid&&(h.dirty||o&&o.submitted))}}let se=(()=>{class i{constructor(o,s,d){this.formBuilder=o,this.addsPareamentsService=s,this.changeDetectorRef=d,this.systemFields=new Array,this.nameFields=new Array,this.toggle=!1,this.fieldsKey=[],this.matcher=new ne,this.filteredOptions=[]}ngOnInit(){this.toggle&&0===this.f.parameters.value.length&&this.addItem()}createItem(){return this.formBuilder.group({id:"",fixed_param:"",name:[{value:"",disabled:!(this.nameFields.length>0)},[_.k0.required]],parameter_type_id:[null,_.k0.required],field_id:["",[b.a.valueFieldId(),Ut.valueSelected(this.systemFields)]],fixed_value:["",b.a.valueFixedValue()]})}
1changeParameterTypeId(){this.parameters.controls.forEach(o=>{const s=o;s.controls.fixed_value.updateValueAndValidity(),s.controls.field_id.updateValueAndValidity()})}ngOnChanges(o){o.nameFields&&!o.nameFields.firstChange?(typeof this.addsPareamentsService.arrayTwo.parameters>"u"||0===this.addsPareamentsService.arrayTwo.parameters.length)&&this.removeItem(0):typeof this.addsPareamentsService.arrayTwo.parameters<"u"&&this.addItem(this.addsPareamentsService.arrayTwo.parameters)}addItem(o=[],s=null){if(this.parameters=this.formulario.get("parameters"),0===o.length)null!=s?(this.parameters.insert(s+1,this.createItem()),this.manageNameControl(s)):(this.parameters.push(this.createItem()),this.manageNameControl(this.parameters.length-1));else for(const d in o)if(o.hasOwnProperty(d)){const v=o[d];this.parameters.push(this.formBuilder.group({id:v.id,fixed_param:v.fixed_param,name:[{value:v.name,disabled:!(this.nameFields.length>0)},_.k0.required],parameter_type_id:[v.parameter_type_id,_.k0.required],field_id:[this.buildSelectedAutocompleteOption(v.field_id,this.systemFields),[Ut.valueSelected(this.systemFields),b.a.valueFieldId()]],fixed_value:[v.fixed_value,b.a.valueFixedValue()]})),this.manageNameControl(this.parameters.length-1)}this.changeDetectorRef.detectChanges()}manageNameControl(o){if(o===this.parameters.length-1)this.filteredOptions[o]=this.parameters.at(o).get("field_id").valueChanges.pipe((0,A.Z)(""),(0,l.T)(s=>s?(0,e.ji)({value:s,systemFields:this.systemFields}):this.systemFields.slice()));else{const s=[...this.filteredOptions],d=[Object.assign(s[o]),this.parameters.at(o+1).get("field_id").valueChanges.pipe((0,A.Z)(""),(0,l.T)(v=>v?(0,e.ji)({value:v,systemFields:this.systemFields}):this.systemFields.slice()))];s.splice(o,1,...d),this.filteredOptions=s}}buildSelectedAutocompleteOption(o,s){if("object"!=typeof o){if(s&&s.length)for(const d of s)if(d.field_id===o)return d;return null}return o}removeItem(o){const s=this.formulario.get("parameters");1===s.length&&this.formulario.patchValue({active_paramn:!1}),s.removeAt(o)}changeToggle(o){if(o.checked){if(typeof this.parameters<"u"){const s=this.formulario.get("parameters");typeof s.controls<"u"&&s.controls.map(d=>{for(const v in d.controls)if(d.controls.hasOwnProperty(v)){const W=d.controls[v];W.clearValidators(),W.updateValueAndValidity()}})}}else this.setValidatorsParameters(),0===this.p.value.length&&this.addItem()}disabled(){return!!this.toggle&&(1===this.f.parameters.value.length||void 0)}setValidatorsParameters(){const o=this.formulario.get("parameters");typeof o<"u"&&o.controls.map(s=>{for(const d in s.controls)if(s.controls.hasOwnProperty(d)){const v=s.controls[d];"name"===d&&v.setValidators(_.k0.required),"parameter_type_id"===d&&v.setValidators(_.k0.required),"fixed_value"===d&&v.setValidators(b.a.valueFixedValue()),"field_id"===d&&v.setValidators([b.a.valueFieldId(),Ut.valueSelected(this.systemFields)]),v.markAsUntouched()}})}displayFn(o){return o?o.label:void 0}ngOnDestroy(){this.addsPareamentsService.setValuesParametersTwo(void 0)}get p(){return this.formulario.get("parameters")}get f(){return this.formulario.controls}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze),t.rXU(St.g),t.rXU(t.gRc))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-adds-pareaments-secondary"]],inputs:{systemFields:"systemFields",formulario:"formulario",parameters:"parameters",nameFields:"nameFields",toggle:"toggle"},features:[t.OA$],decls:7,vars:8,consts:[["matSlideToggle","matSlideToggle"],["input",""],["auto","matAutocomplete"],[3,"formGroup"],["fxLayout","row",1,"ps-adds-pareaments-toggle-content",3,"ngClass"],["fxFlex",""],["color","primary","formControlName","active_paramn",3,"toggleChange"],["class","ps-adds-pareaments-input-content","formArrayName","parameters",4,"ngFor","ngForOf"],["formArrayName","parameters",1,"ps-adds-pareaments-input-content"],["class","ps-row","fxLayout","row","fxLayoutGap","20px",3,"formGroupName",4,"ngIf"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row",3,"formGroupName"],["appearance","fill","fxFlex","20",4,"ngIf"],["appearance","fill","fxFlex","20"],["formControlName","parameter_type_id",3,"selectionChange","errorStateMatcher"],[3,"value"],[4,"ngIf"],["fxLayoutGap","15px","fxFlex","","fxLayoutAlign","start center",1,"ps-adds-pareaments-btn-content"],["color","primary","mat-stroked-button","",1,"ps-adds-pareaments-del",3,"click","disabled"],["color","primary","mat-stroked-button","",1,"ps-adds-pareaments-add",3,"click","disabled"],["matInput","","formControlName","name",3,"disableControl","errorStateMatcher"],["formControlName","name",3,"errorStateMatcher"],[3,"value",4,"ngFor","ngForOf"],["matInput","","formControlName","fixed_value",3,"errorStateMatcher"],["type","text","matInput","","formControlName","field_id",3,"errorStateMatcher","matAutocomplete"],["autoActiveFirstOption","true",3,"displayWith"],["matTooltipPosition","below","matTooltipClass","ps-tooltip-content",3,"matTooltip","matTooltipShowDelay","value",4,"ngFor","ngForOf"],["matTooltipPosition","below","matTooltipClass","ps-tooltip-content",3,"matTooltip","matTooltipShowDelay","value"]],template:function(s,d){if(1&s){const v=t.RV6();t.j41(0,"form",3)(1,"div",4)(2,"div",5)(3,"mat-slide-toggle",6,0),t.bIt("toggleChange",function(){t.eBV(v);const q=t.sdS(4);return t.Njj(d.changeToggle(q))}),t.EFF(5),t.k0s()()(),t.DNE(6,ie,2,1,"div",7),t.k0s()}2&s&&(t.Y8G("formGroup",d.formulario),t.R7$(),t.xc7("display","none"),t.Y8G("ngClass",t.eq3(6,O,d.toggle)),t.R7$(4),t.SpI(" ",0===d.nameFields.length?"Enviar par\xe2metros":"Enviar contexto"," "),t.R7$(),t.Y8G("ngForOf",d.p.controls))},dependencies:[m.YU,m.Sq,m.bT,_.qT,_.me,_.BC,_.cb,_.j4,_.JD,_.$R,_.v8,j.It,U.rl,U.nJ,U.TL,at.VO,dt.wT,ot.fg,rt.An,ft.oV,ct.sG,C.$3,C.pN,E.DJ,E.BO,
1E.sA,E.UI,et.PW,Pt.j,m.Jj],styles:[".ps-adds-pareaments-toggle-content[_ngcontent-%COMP%]{padding:24px}.ps-adds-pareaments-input-content[_ngcontent-%COMP%]{padding:5px 24px}.ps-adds-pareaments-del[_ngcontent-%COMP%]{padding:0 4px;line-height:34px;min-width:34px}.ps-adds-pareaments-del[_ngcontent-%COMP%]     mat-icon{height:17px;width:17px;font-size:17px}.ps-adds-pareaments-add[_ngcontent-%COMP%]{padding:0 4px;line-height:34px;min-width:34px}.ps-adds-pareaments-add[_ngcontent-%COMP%]     mat-icon{height:20px;width:20px;font-size:20px}.ps-adds-pareaments-btn-content[_ngcontent-%COMP%]{height:60px}.ps-display-toggle-param[_ngcontent-%COMP%]{display:none!important}"]})}}return i})();const Xt=()=>({enabled:!1}),Jt=()=>({vertical:"hidden"}),Wt=(i,h)=>({selectionHighlight:!1,minimap:i,scrollbar:h,readOnly:!0,scrollPredominantAxis:!1,scrollBeyondLastLine:!1,scrollBeyondLastColumn:0});function re(i,h){if(1&i&&t.nrm(0,"input",29),2&i){const o=t.XpG(2);t.Y8G("disableControl",o.f.data_type.value)}}function le(i,h){if(1&i&&(t.j41(0,"mat-option",32),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.value),t.R7$(),t.SpI(" ",o.label," ")}}function de(i,h){if(1&i&&(t.j41(0,"mat-select",30),t.DNE(1,le,2,2,"mat-option",31),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("disableControl",o.f.data_type.value),t.R7$(),t.Y8G("ngForOf",o.currentForm.values)}}function me(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function pe(i,h){if(1&i&&(t.j41(0,"mat-error"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.SpI(" O par\xe2metro ",o.f.data_value.value," n\xe3o pode ser utilizado ")}}function ce(i,h){if(1&i&&(t.j41(0,"div",3)(1,"div",4)(2,"mat-form-field",26)(3,"mat-label"),t.EFF(4),t.k0s(),t.DNE(5,re,1,1,"input",27)(6,de,2,2,"ng-template",null,0,t.C5r)(8,me,2,0,"mat-error",28)(9,pe,2,1,"mat-error",28),t.k0s()()()),2&i){const o=t.sdS(7),s=t.XpG();t.R7$(4),t.JRh("1"===s.f.data_type.value?"Valor padr\xe3o":"Nome do par\xe2metro"),t.R7$(),t.Y8G("ngIf","1"!==s.f.data_type.value||void 0===s.currentForm.predefinedOption||!1===s.currentForm.predefinedOption)("ngIfElse",o),t.R7$(3),t.Y8G("ngIf",s.f.data_value.hasError("required")),t.R7$(),t.Y8G("ngIf",s.f.data_value.hasError("reserved"))}}function ue(i,h){if(1&i&&(t.j41(0,"mat-option",32),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.id),t.R7$(),t.SpI(" ",o.title," ")}}function fe(i,h){if(1&i&&(t.j41(0,"div",33)(1,"div",34)(2,"div",18)(3,"mat-form-field",35)(4,"mat-label"),t.EFF(5,"Tipo de envio"),t.k0s(),t.j41(6,"mat-select",36),t.DNE(7,ue,2,2,"mat-option",31),t.k0s()()(),t.j41(8,"div",37)(9,"mat-form-field",35)(10,"mat-label"),t.EFF(11,"Link"),t.k0s(),t.nrm(12,"input",38),t.k0s()()(),t.j41(13,"div",39)(14,"div",4)(15,"mat-slide-toggle",40),t.EFF(16," Salvar valor automaticamente "),t.k0s()()(),t.j41(17,"div",16),t.nrm(18,"app-adds-pareaments",41),t.k0s(),t.j41(19,"div",16)(20,"span",42),t.EFF(21,"Retorno esperado"),t.k0s()(),t.j41(22,"div",16),t.nrm(23,"td-code-editor",43),t.k0s()()),2&i){const o=t.XpG();t.R7$(7),t.Y8G("ngForOf",o.httpMethods),t.R7$(11),t.Y8G("toggle",!1)("systemFields",o.systemFields)("parameters",o.parameters)("formulario",o.f.external_source),t.R7$(4),t.xc7("margin-bottom",40,"px"),t.R7$(),t.xc7("height",57,"px"),t.Y8G("editorOptions",t.l_i(13,Wt,t.lJ4(11,Xt),t.lJ4(12,Jt)))("value",o.value)}}function u(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",4)(1,"p",19),t.EFF(2,"Defina a fonte"),t.k0s(),t.j41(3,"mat-radio-group",44),t.bIt("change",function(d){t.eBV(o);const v=t.XpG();return t.Njj(v.changeDefinedSource(d))}),t.j41(4,"mat-radio-button",45),t.EFF(5," TOTVS "),t.k0s(),t.j41(6,"mat-radio-button",45),t.EFF(7," Fonte externa "),t.k0s(),t.j41(8,"mat-radio-button",45),t.EFF(9," Manual "),t.k0s()()()}2&i&&(t.R7$(4),t.Y8G("value",1),t.R7$(2),t.Y8G("value",2),t.R7$(2),t.Y8G("value",3))}function G(i,h){if(1&i&&(t.j41(0,"mat-option",32),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o.id),t.R7$(),t.SpI(" ",o.title," ")}}function r(i,h){if(1&i&&(t.j41(0,"div",46)(1,"div",47)(2,"div",18)(3,"mat-form-field",35)(4,"mat-label"),t.EFF(5,"Tipo de envio"),t.k0s(),t.j41(6,"mat-select",36),t.DNE(7,G,2,2,"mat-option",31),t.k0s()()(),t.j41(8,"div",37)(9,"mat-form-field",35)(10,"mat-label"),t.EFF(11,"Link"),t.k0s(),t.nrm(12,"input",38),t.k0s()()(),t.j41(13,"div",16),t.nrm(14,"app-adds-pareaments-secondary",41),t.k0s(),t.j41(15,"div",16)(16,"span",42),t.EFF(17,"Retorno esperado"),t.k0s()(),t.j41(18,"div",16),t.nrm(19,"td-code-editor",43),t.k0s()()),2&i){const o=t.XpG();t.R7$(7),t.Y8G("ngForOf",o.httpMethods),t.R7$(7),t.Y8G("toggle",!1)("systemFields",o.systemFields)("parameters",o.parametersTwo)("formulario",o.f.predefined_external_source),t.R7$(4),t.xc7("margin-bottom",40,"px"),t.R7$(),t.xc7("height",228,"px"),t.Y8G("editorOptions",t.l_i(13,Wt,t.lJ4(11,Xt),t.lJ4(12,Jt)))("value",o.valueTwo)}}function x(i,h){if(1&i){const o=t.RV6();t.j41(0,"a",58),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG(2);return t.Njj(v.addManualOption([],d))}),t.j41(1,"mat-icon"),t.EFF(2,"add"),t.k0s()()}}function g(i,h){if(1&i){const o=t.RV6();t.j41(0,"a",59),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG(2);return t.Njj(v.removeManualOption(d))}),t.j41(1,"mat-icon"),t.EFF(2,"delete"),t.k0s()()}}function X(i,h){if(1&i&&(t.j41(0,"div",50)(1,"div",51)(2,"div",52)(3,"mat-form-field",35)(4,"mat-label"),t.EFF(5,"Valor"),t.k0s(),t.nrm(6,"input",53),t.k0s()(),t.j41(7,"div",52)(8,"mat-form-field",35)(9,"mat-label"),t.EFF(10,"Texto"),t.k0s(),t.nrm(11,"input",54),t.k0s()(),t.j41(12,"div",55),t.DNE(13,x,3,0,"a",56)(14,g,3,0,"a",57),t.k0s()()()),2&i){const o=h.index,s=t.XpG(2);t.R7$(),t.Y8G("formGroupName",o),t.R7$(12),t.Y8G("ngIf",!s.editorMode),t.R7$(),t.Y8G("ngIf",s.manualValues.length>1&&!s.editorMode)}}function gt(i,h){if(1&i&&(t.j41(0,"div",48),t.DNE(1,X,15,3,"div",49),t.k0s()),2&i){const o=t.XpG();t.R7$(),t.Y8G("ngForOf",o.manualValues)}}let Et=(()=>{class i{constructor(o,s,d,v,W,q,Ct,kt){this.formBuilder=o,this.addsPareamentsService=s,this.selectiveEditorService=d,this.pagesEditorService=v,this.httpMethodsService=W,this.loaderService=q,this.dialogComponent=Ct,this.formConfigDataSave=kt,this.valueChanged=new t.bkB,this.manualValues=[],this.httpMethods=new Array,this.systemFields=new Array,this.currentCheckedValue=null,this.value='{\n  "value": 1\n}',this.valueTwo='{\n    "options": [\n      {\n        "display": "Titulo",\n        "value": 1\n      },\n      {\n        "display": "Titulo 2",\n        "value": 2\n      }\n    ]\n  }',this.formulario=this.formBuilder.group({data_type:[null],data_value:[{value:null,disabled:!0},[_.k0.required,this.checkReservedParameters]],predefined_source_options:[!1],defined_source:[null],read_only:[!1]})}ngOnInit(){this.getHttpMethods(),this.setExternalSource(),this.setPredefinedExternalSource(),this.dialogComponent.data.standardFields?this.systemFields=JSON.parse(JSON.stringify(this.dialogComponent.data.standardFields)):this.dialogComponent.data.fields&&(this.systemFields=JSON.parse(JSON.stringify(this.dialogComponent.data.fields)));const o=At.Q.switchValueSlideToggleView(["predefined_source_options","auto_save","read_only"],{data_type:`${this.dateField.data_type}`,data_value:this.dateField.data_value,auto_save:this.dateField.auto_save,predefined_source_options:this.dateField.predefined_source_options,defined_source:this.dateField.defined_source,read_only:this.dateField.read_only});if(this.changeValueDateField(),this.dateField.manual_options&&this.dateField.manual_options.length){const s=this.dateField.manual_options;this.formulario.addControl("manual_options",this.createManualSource()),this.addManualOption(s)}this.editorMode&&(this.formulario.controls.predefined_source_options.disable(),this.formulario.controls.defined_source.disable(),this.dateField.manual_options&&this.dateField.manual_options.length&&this.formulario.controls.manual_options.disable()),this.formulario.patchValue(o),this.formulario.get("predefined_source_options").valueChanges.subscribe(s=>{if(this.formulario.get("manual_options")){for(let d=this.manualValues.length;d>=0;d--)this.removeManualOption(d);this.formulario.get("manual_options").reset(),s&&0===this.manualValues.length&&3==this.dateField.defined_source&&this.addManualOption()}this.formulario.get("predefined_external_source")&&(this.formulario.get("predefined_external_source").reset(),s?this.formulario.get("predefined_external_source").enable():this.formulario.get("predefined_external_source").disable())})}checkReservedParameters(o){const v=o.parent.controls.data_type.value;return["idPs"].includes(o.value)&&2==v?{reserved:!0}:null}changeDataType(o){"3"===o.value&&this.formulario.addControl("external_source",this.createExternalSource(0))}changeDefinedSource(o){if(2===o.value?this.formulario.addControl("predefined_external_source",this.createExternalSource(1)):this.formulario.get("predefined_external_source")&&this.formulario.get("predefined_external_source").reset(),3===o.value)this.formulario.get("manual_options")?(this.formulario.get("manual_options").enable(),0===this.manualValues.length&&this.addManualOption()):(this.formulario.addControl("manual_options",this.createManualSource()),0===this.manualValues.length&&this.addManualOption(),this.editorMode&&this.formulario.get("manual_options").disable());else if(this.formulario.get("manual_options")){for(let s=this.manualValues.length;s>=0;s--)this.removeManualOption(s);this.formulario.get("manual_options").reset(),this.formulario.get("manual_options").disable()}}removeManualOption(o){this.formArray.removeAt(o),this.manualValues.splice(o,1)}addManualOption(o=[],s=null){if(null!=s){const d=[...this.manualValues],v=[Object.assign(d[s]),{value:"",display:""}];d.splice(s,1,...v),this.formArray.insert(s+1,this.formBuilder.group({value:["",_.k0.required],display:[""]})),this.manualValues=[...d]}else 0===o.length?(this.formArray.push(this.formBuilder.group({value:["",_.k0.required],display:[""]})),this.manualValues.push({value:"",display:""})):o.map(d=>{this.formArray.push(this.formBuilder.group({value:[d.value,_.k0.required],display:[d.display]})),this.manualValues.push({value:d.value,display:d.display})})}get formArray(){return this.formulario.get("manual_options")}changeValueDateField(){this.formulario.valueChanges.subscribe(o=>{this.dateField.data_type=this.setDataType(o.data_type),this.dateField.data_value=this.setDataValue(o.data_value),this.dateField.defined_source=o.defined_source,this.dateField.predefined_source_options=this.switchValueSlideToggleAPI(o.predefined_source_options),this.dateField.read_only=this.switchValueSlideToggleAPI(o.read_only),this.dateField.external_source=o.external_source??null,this.editorMode||(this.dateField.predefined_external_source=o.predefined_external_source??null,o.predefined_external_source&&!o.predefined_external_source.active_paramn&&(this.dateField.predefined_external_source.parameters=[])),this.dateField.auto_save=!!o.external_source&&o.external_source.auto_save,o.manual_options&&(this.dateField.manual_options=this.getValidOptions(o.manual_options)),o.external_source&&!o.external_source.active_paramn&&(this.dateField.external_source.parameters=[]),setTimeout(()=>{this.checkFormValidity(o)},0)})}checkFormValidity(o){this.formConfigDataSave.setStatusData("VALID"),this.checkDefaultValueFormValidity(o),this.checkPredefinedOptionsFormValidity(o)}checkDefaultValueFormValidity(o){3==o.data_type?this.isDefaultValueExter
1nalSourceFormValid()&&this.formConfigDataSave.setStatusData("INVALID"):(""===o.data_value&&this.formConfigDataSave.setStatusData("INVALID"),2==o.data_type&&this.isParameterValueFormValid()&&this.formConfigDataSave.setStatusData("INVALID"))}isDefaultValueExternalSourceFormValid(){const o=this.formulario.get("external_source");return o?.enabled&&!o.valid}isParameterValueFormValid(){const o=this.formulario.get("data_value");return o?.enabled&&!o.valid}checkPredefinedOptionsFormValidity(o){o.predefined_source_options&&(2==o.defined_source?this.isPredefinedOptionsExternalSourceFormValid()&&this.formConfigDataSave.setStatusData("INVALID"):3==o.defined_source&&this.isPredefinedOptionsManualSourceFormValid()&&this.formConfigDataSave.setStatusData("INVALID"))}isPredefinedOptionsExternalSourceFormValid(){const o=this.formulario.get("predefined_external_source");return o?.enabled&&!o.valid}isPredefinedOptionsManualSourceFormValid(){const o=this.formulario.get("manual_options");return o?.enabled&&!o.valid}getValidOptions(o){return o?o.filter(d=>{if(""!==d.value&&""!==d.display)return d}):[]}switchValueSlideToggleAPI(o){return o?o?1:void 0:0}setDataValue(o){return typeof o>"u"?null:o}setDataType(o){return"null"===o||typeof o>"u"?null:o}setExternalSource(){this.dateField.external_source?(this.dateField.external_source.active_paramn=this.dateField.external_source.parameters.length>0,this.formulario.addControl("external_source",this.formBuilder.group({id:this.dateField.external_source.id,field_id:this.dateField.external_source.field_id,http_methods_type_id:this.dateField.external_source.http_methods_type_id,is_predefined_option:0,link:this.dateField.external_source.link,auto_save:this.dateField.auto_save,parameters:this.formBuilder.array([],Dt.W.slideToggle()),active_paramn:[this.dateField.external_source.parameters.length>0]})),this.dateField.external_source.parameters.length>0&&this.addsPareamentsService.setValuesParameters(this.dateField.external_source.parameters)):3==this.dateField.data_type&&(this.formulario.addControl("external_source",this.createExternalSource(0)),this.dateField.auto_save&&this.formulario.patchValue({external_source:{auto_save:!0}}))}setPredefinedExternalSource(){if(this.dateField.predefined_external_source&&null!==this.dateField.predefined_external_source){if(this.dateField.predefined_external_source.active_paramn=this.dateField.predefined_external_source.parameters.length>0,this.formulario.addControl("predefined_external_source",this.formBuilder.group({id:this.dateField.predefined_external_source.id,field_id:this.dateField.predefined_external_source.field_id,http_methods_type_id:this.dateField.predefined_external_source.http_methods_type_id,is_predefined_option:1,link:this.dateField.predefined_external_source.link,auto_save:this.dateField.auto_save,parameters:this.formBuilder.array([],Dt.W.slideToggle()),active_paramn:[this.dateField.predefined_external_source.parameters.length>0]})),this.dateField.predefined_external_source.parameters.length>0&&this.addsPareamentsService.setValuesParametersTwo(this.dateField.predefined_external_source.parameters),this.editorMode){this.formulario.controls.predefined_external_source.disable();const o=this.formulario.controls.predefined_external_source;setTimeout(()=>{o.controls.parameters.controls.forEach(s=>{s.disable()})},500)}}else this.formulario.addControl("predefined_external_source",this.createExternalSource(1))}createManualSource(){return this.formBuilder.array([])}createExternalSource(o){return this.formBuilder.group({id:[null],field_id:this.dateField.field_id,http_methods_type_id:[null],auto_save:[null],is_predefined_option:[o],link:[null],parameters:this.formBuilder.array([],Dt.W.slideToggle()),active_paramn:[!1]})}getHttpMethods(){this.httpMethodsService.listAll().subscribe(o=>{this.httpMethods=o},o=>{this.loaderService.setChangesLoaderState(!1,o.body,"","error",o.title,1e5)})}ngOnDestroy(){this.formulario.controls.predefined_source_options.enable(),this.formulario.controls.defined_source.enable()}get f(){return this.formulario.controls}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze),t.rXU(St.g),t.rXU(Bt.b),t.rXU(Gt.T),t.rXU(Lt.I),t.rXU(Z.Z),t.rXU(f.m),t.rXU(st.C))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-data"]],inputs:{currentForm:"currentForm",dateField:"dateField",editorMode:"editorMode"},outputs:{valueChanged:"valueChanged"},decls:43,vars:10,consts:[["elseBlock",""],[3,"formGroup"],[1,"ps-form-data-field-container"],["fxLayout","row",1,"ps-row"],["fxFlex",""],[1,"ps-description-14"],["fxFlex","","fxLayoutGap","20px"],["formControlName","data_type","fxLayoutGap","20px",3,"change"],["value","1","color","primary",1,"ps-form-data-radio-button"],["matTooltip","Marcando essa op\xe7\xe3o, insira vari\xe1veis no campo abaixo para defini-las como seu valor padr\xe3o.","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help"],["value","2","color","primary",1,"ps-form-data-radio-button"],["matTooltip","Marcando essa op\xe7\xe3o, insira vari\xe1veis no campo abaixo, para que sejam enviadas pelos\n              par\xe2metros da URL da p\xe1gina onde o campo se localiza.","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help"],["value","3","color","primary",1,"ps-form-data-radio-button"],["mat-stroked-button","",3,"click"],["class","ps-row","fxLayout","row",4,"ngIf"],["formGroupName","external_source","class","ps-row","fxLayout","column",4,"ngIf"],["fxLayout","row"],["fxLayout","column",1,"ps-form-data-field-two-container"],["fxFlex","30"],[1,"ps-label-slide-toggle"],["color","primary","formControlName","predefined_source_options"],["fxFlex","",4,"ngIf"],["formGroupName","predefined_external_source","class","ps-row","fxLayout","column",4,"ngIf"],["fxLayout","column",4,"ngIf"],["fxLayout","row",1,"ps-form-data-field-three-container"],["color","primary","formControlName","read_only"],["appearance","fill","fxFlex","50"],["matInput","","required","","formControlName","data_value",3,"disableControl",4,"ngIf","ngIfElse"],[4,"ngIf"],["matInput","","required","","formControlName","data_value",3,"disableControl"],["formControlName","data_value","required","",3,"disableControl"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formGroupName","external_source","fxLayout","column",1,"ps-row"],["fxLayout","row","fxLayoutGap","20px"],["appearance","fill","fxFlex",""],["formControlName","http_methods_type_id","required",""],["fxFlex","50"],["matInput","","formControlName","link","required",""],["fxLayout","row",2,"margin","15px 0"],["color","primary","formControlName","auto_save"],["fxFlex","",1,"ps-edit-form-parameters-custom",3,"toggle","systemFields","parameters","formulario"],[1,"ps-expected-return"],["theme","vs-dark","language","javascript","fxFlex","60",1,"monaco-editor-custom",3,"editorOptions","value"],["formControlName","defined_source","fxLayoutGap","25px",3,"change"],["color","primary",3,"value"],["formGroupName","predefined_external_source","fxLayout","column",1,"ps-row"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row"],["fxLayout","column"],["formArrayName","manual_options",4,"ngFor","ngForOf"],["formArrayName","manual_options"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row",3,"formGroupName"],["fxFlex","25"],["matInput","","formControlName","value","required",""],["matInput","","formControlName","display","required",""],["fxLayoutGap","15px","fxFlex","10","fxLayoutAlign","start center",1,"ps-adds-pareaments-btn-content"],["class","ps-adds-pareaments-add","color","primary","mat-stroked-button","",3,"click",4,"ngIf"],["class","ps-adds-pareaments-del","color","primary","mat-stroked-button","",3,"click",4,"ngIf"],["color","primary","mat-stroked-button","",1,"ps-adds-pareaments-add",3,"click"],["color","primary","mat-stroked-button","",1,"ps-adds-pareaments-del",3,"click"]],template:function(s,d){1&s&&(t.j41(0,"form",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"p",5),t.EFF(5," Defina abaixo as configura\xe7\xf5es dos dados do campo. "),t.k0s()()(),t.j41(6,"div",3)(7,"div",6)(8,"mat-radio-group",7),t.bIt("change",function(W){return d.changeDataType(W)}),t.j41(9,"mat-radio-button",8),t.EFF(10," Valor padr\xe3o simples "),t.nrm(11,"mat-icon",9),t.k0s(),t.j41(12,"mat-radio-button",10),t.EFF(13," Valor padr\xe3o din\xe2mico "),t.nrm(14,"mat-icon",11),t.k0s(),t.j41(15,"mat-radio-button",12),t.EFF(16," Fonte externa "),t.k0s()(),t.j41(17,"a",13),t.bIt("click",function(){return d.f.data_type.reset(null),d.f.data_value.reset(null)}),t.EFF(18,"Limpar"),t.k0s()()(),t.DNE(19,ce,10,5,"div",14)(20,fe,24,16,"div",15),t.k0s(),t.j41(21,"div",16)(22,"div",4),t.nrm(23,"mat-divider"),t.k0s()(),t.j41(24,"div",17)(25,"div",16)(26,"div",18)(27,"p",19),t.EFF(28,"Op\xe7\xf5es predefinidas"),t.k0s(),t.j41(29,"mat-slide-toggle",20),t.EFF(30),t.k0s()(),t.DNE(31,u,10,3,"div",21),t.k0s(),t.DNE(32,r,20,16,"div",22)(33,gt,2,1,"div",23),t.k0s(),t.j41(34,"div",16)(35,"div",4),t.nrm(36,"mat-divider"),t.k0s()(),t.j41(37,"div",24)(38,"div",4)(39,"p",19),t.EFF(40,"Somente leitura"),t.k0s(),t.j41(41,"mat-slide-toggle",25),t.EFF(42),t.k0s()()()()),2&s&&(t.Y8G("formGroup",d.formulario),t.R7$(19),t.Y8G("ngIf","3"!==d.f.data_type.value),t.R7$(),t.Y8G("ngIf","3"===d.f.data_type.value),t.R7$(5),t.xc7("margin-bottom",2===d.f.defined_source.value||3===d.f.defined_source.value&&d.f.predefined_source_options.value?35:0,"px"),t.R7$(5),t.SpI(" ",d.f.predefined_source_options.value?"Ativado":"Desativado"," "),t.R7$(),t.Y8G("ngIf",d.f.predefined_source_options.value),t.R7$(),t.Y8G("ngIf",2===d.f.defined_source.value&&d.f.predefined_source_options.value),t.R7$(),t.Y8G("ngIf",3===d.f.defined_source.value&&d.f.predefined_source_options.value),t.R7$(9),t.SpI(" ",d.f.read_only.value?"Ativado":"Desativado"," "))},dependencies:[m.Sq,m.bT,_.qT,_.me,_.BC,_.cb,_.YS,_.j4,_.JD,_.$R,_.v8,j.It,U.rl,U.nJ,U.TL,at.VO,dt.wT,ot.fg,I.q,rt.An,ft.oV,ct.sG,T.VT,T._g,E.DJ,E.BO,
1E.sA,E.UI,Mt.A,Pt.j,Nt.go,se],styles:[".ps_formBuilder_formContainer[_ngcontent-%COMP%]{display:flex;width:95%;margin:10px}.ps_formBuilder_formContainer[_ngcontent-%COMP%]   .ps_formBuilder_tooltipIcon[_ngcontent-%COMP%]{margin-left:5px}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]{flex-direction:column;margin:15px 0}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]   .ps_formBuilder_radioButton[_ngcontent-%COMP%]{margin:5px}.ps-adds-pareaments-del[_ngcontent-%COMP%]{padding:0 4px;line-height:34px;min-width:34px}.ps-adds-pareaments-del[_ngcontent-%COMP%]     mat-icon{height:17px;width:17px;font-size:17px}.ps-adds-pareaments-add[_ngcontent-%COMP%]{padding:0 4px;line-height:34px;min-width:34px}.ps-adds-pareaments-add[_ngcontent-%COMP%]     mat-icon{height:20px;width:20px;font-size:20px}.ps_manual_options_container[_ngcontent-%COMP%]{margin-top:10px}.ps_formBuilder_text[_ngcontent-%COMP%]{font-family:Poppins;font-style:normal;font-weight:500;font-size:12px;line-height:24px;color:#0009}.ps_formBuilder_noVariables[_ngcontent-%COMP%]{font-size:14px;padding:5px;letter-spacing:.025em;line-height:129.2%;background:#ffb946;opacity:.3;border-radius:9px}.ps_formBuilder_fieldsContainer[_ngcontent-%COMP%]{padding:15px 0 0 15px;margin:10px 0;position:relative;min-height:80px}.ps_formBuilder_fieldsContainer[_ngcontent-%COMP%]   .ps_formBuilder_deleteButton[_ngcontent-%COMP%]{position:absolute;top:0;right:0;outline:none}.ps_formBuilder_fieldsContainer[_ngcontent-%COMP%]   .ps_formBuilder_deleteButton[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_code[_ngcontent-%COMP%]{background:#263238;border-radius:10px}.ps_formBuilder_code[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{color:#fff}.ps_formBuilder_addFieldButton[_ngcontent-%COMP%]{margin-bottom:15px;margin-left:10px;border:1px solid rgba(0,0,0,.12)}.ps_formBuilder_addVarContainer[_ngcontent-%COMP%]   .ps_formBuilder_addVar[_ngcontent-%COMP%]{margin-left:10px;margin-bottom:20px}.ps_formBuilder_addVarContainer[_ngcontent-%COMP%]   .ps_formBuilder_addVar[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{display:flex}.ps_formBuilder_addVarContainer[_ngcontent-%COMP%]   .ps_formBuilder_addVar[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:26px}.ps-form-data-field-container[_ngcontent-%COMP%]{padding:15px 24px 0}.ps-form-data-field-two-container[_ngcontent-%COMP%]{padding:12px 24px 27px}.ps-form-data-field-three-container[_ngcontent-%COMP%]{padding:13px 24px 0}.ps-form-data-radio-button[_ngcontent-%COMP%]     .mdc-label{display:inline-flex;justify-content:center;align-items:center}.ps-form-data-radio-button[_ngcontent-%COMP%]     .mdc-label mat-icon{margin-left:10px;height:20px;width:20px}  .monaco-editor-custom .monaco-editor{padding-top:20px;padding-bottom:20px;border-radius:4px}.ps-expected-return[_ngcontent-%COMP%]{font-size:14px;color:#0009;margin-bottom:10px}  .ps-edit-form-parameters-custom .ps-adds-pareaments-input-content{padding:0!important}  .ps-edit-form-parameters-custom .ps-adds-pareaments-toggle-content{padding:0!important;margin-bottom:22px!important}"]})}}return i})();var _e=n(59115);const he=i=>({buttonDisabled:i}),ve=()=>({enabled:!1}),Ce=i=>({minimap:i,autoIndent:"full"});function be(i,h){if(1&i){const o=t.RV6();t.j41(0,"button",16),t.bIt("click",function(){const d=t.eBV(o).$implicit,v=t.XpG();return t.Njj(v.addValidator(d))}),t.EFF(1),t.k0s()}if(2&i){const o=h.$implicit;t.R7$(),t.SpI(" ",o.name," ")}}function Fe(i,h){1&i&&(t.j41(0,"p",17),t.EFF(1,' Ainda n\xe3o h\xe1 validadores, clique em "Adicionar validador" para adicionar um. '),t.k0s())}function xe(i,h){if(1&i&&(t.j41(0,"span",35),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2).$implicit;t.R7$(),t.JRh(o.name)}}function ye(i,h){1&i&&(t.j41(0,"mat-form-field",36),t.nrm(1,"input",37),t.k0s())}function Ee(i,h){1&i&&(t.j41(0,"span"),t.nrm(1,"mat-icon",38),t.k0s())}function Te(i,h){1&i&&(t.j41(0,"mat-form-field",39),t.nrm(1,"input",40),t.k0s())}function Oe(i,h){if(1&i&&(t.j41(0,"mat-slide-toggle",41),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2).index,s=t.XpG();t.Y8G("color","primary"),t.R7$(),t.SpI(" ",1==s.getForm(o).controls.value.value?"Ativado":"Desativado"," ")}}function Ie(i,h){1&i&&(t.j41(0,"div",5)(1,"mat-form-field",36)(2,"mat-label"),t.EFF(3,"Mensagem personalizada"),t.k0s(),t.nrm(4,"input",42),t.k0s()())}function De(i,h){if(1&i&&(t.j41(0,"div",43)(1,"span",4),t.EFF(2,"Inverter "),t.nrm(3,"mat-icon",44),t.k0s(),t.j41(4,"mat-slide-toggle",45),t.EFF(5),t.k0s()()),2&i){const o=t.XpG(2).index,s=t.XpG();t.R7$(4),t.Y8G("color","primary"),t.R7$(),t.SpI(" ",1==s.getForm(o).controls.reverse.value?"Ativado":"Desativado"," ")}}function ke(i,h){1&i&&(t.j41(0,"div",46)(1,"span",4),t.EFF(2," As seguintes vari\xe1veis est\xe3o dispon\xedveis no script "),t.k0s(),t.j41(3,"table",47)(4,"tbody")(5,"tr")(6,"th"),t.EFF(7,"input"),t.k0s(),t.j41(8,"td"),t.EFF(9,"O valor inserido no campo"),t.k0s()(),t.j41(10,"tr")(11,"th"),t.EFF(12,"component"),t.k0s(),t.j41(13,"td"),t.EFF(14,"O objeto JSON do componente"),t.k0s()(),t.j41(15,"tr")(16,"th"),t.EFF(17,"value"),t.k0s(),t.j41(18,"td"),t.EFF(19,"O valor atual do componente."),t.k0s()(),t.j41(20,"tr")(21,"th"),t.EFF(22,"moment"),t.k0s(),t.j41(23,"td"),t.EFF(24,"A biblioteca moment.js para manipula\xe7\xe3o de datas."),t.k0s()()()(),t.nrm(25,"td-code-editor",48),t.j41(26,"span",49),t.EFF(27," Insira o c\xf3digo personalizado "),t.k0s(),t.j41(28,"span",49),t.EFF(29," Voc\xea deve retornar a mensagem de erro se a valida\xe7\xe3o falhar "),t.k0s(),t.j41(30,"span",50),t.EFF(31," Exemplo: "),t.k0s(),t.j41(32,"span",49),t.EFF(33,' if(input === "Jonatas") {'),t.nrm(34,"br"),t.EFF(35,' \xa0\xa0\xa0\xa0\xa0return "O campo nome n\xe3o pode ser Jonatas"'),t.nrm(36,"br"),t.EFF(37," } "),t.k0s()()),2&i&&(t.R7$(25),t.Y8G("editorOptions",t.eq3(3,Ce,t.lJ4(2,ve)))("language","javascript"))}function Re(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",21),t.DNE(1,xe,2,1,"span",22),t.j41(2,"div",23),t.DNE(3,ye,2,0,"mat-form-field",24)(4,Ee,2,0,"span",25),t.k0s(),t.j41(5,"div",5),t.DNE(6,Te,2,0,"mat-form-field",26),t.k0s(),t.j41(7,"div",27),t.DNE(8,Oe,2,2,"mat-slide-toggle",28),t.k0s(),t.DNE(9,Ie,5,0,"div",29)(10,De,6,2,"div",30)(11,ke,38,5,"div",31),t.j41(12,"button",32),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.removeRule(d))}),t.j41(13,"mat-icon"),t.EFF(14,"delete"),t.k0s()(),t.j41(15,"button",33),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.stopEditing(d))}),t.j41(16,"mat-icon",34),t.EFF(17,"expand_less"),t.k0s()()()}if(2&i){const o=t.XpG(),s=o.$implicit,d=o.index,v=t.XpG();t.Y8G("formGroupName",d),t.R7$(),t.Y8G("ngIf",s.editing),t.R7$(2),t.Y8G("ngIf","string"===s.type),t.R7$(),t.Y8G("ngIf","pattern"===s.key),t.R7$(2),t.Y8G("ngIf","number"===s.type),t.R7$(2),t.Y8G("ngIf","boolean"===s.type),t.R7$(),t.Y8G("ngIf","code"!==s.type),t.R7$(),t.Y8G("ngIf","pattern"===s.key),t.R7$(),t.Y8G("ngIf","code"===s.type),t.R7$(),t.Y8G("disabled",!v.activeValidators.value||!s.editable),t.R7$(3),t.Y8G("disabled",!v.activeValidators.value),t.R7$(),t.Y8G("ngClass",t.eq3(12,he,!v.activeValidators.value))}}function Ge(i,h){if(1&i&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&i){const o=t.XpG(2).$implicit;t.R7$(),t.JRh(o.name)}}function Se(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",51),t.DNE(1,Ge,2,1,"span",25),t.j41(2,"button",52),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.removeRule(d))}),t.j41(3,"mat-icon"),t.EFF(4,"delete"),t.k0s()(),t.j41(5,"button",53),t.bIt("click",function(){t.eBV(o);const d=t.XpG().index,v=t.XpG();return t.Njj(v.editRule(d))}),t.j41(6,"mat-icon"),t.EFF(7,"settings"),t.k0s()()()}if(2&i){const o=t.XpG().$implicit,s=t.XpG();t.R7$(),t.Y8G("ngIf",!o.editing),t.R7$(),t.Y8G("disabled",!s.activeValidators.value||!o.editable),t.R7$(3),t.Y8G("disabled",!s.activeValidators.value)}}function Me(i,h){if(1&i&&(t.j41(0,"div",18),t.DNE(1,Re,18,14,"div",19)(2,Se,8,3,"div",20),t.k0s()),2&i){const o=h.$implicit;t.R7$(),t.Y8G("ngIf",o.editing),t.R7$(),t.Y8G("ngIf",!o.editing)}}function Pe(i,h){if(1&i&&(t.j41(0,"button",54)(1,"div",55)(2,"mat-icon"),t.EFF(3,"add"),t.k0s(),t.j41(4,"span"),t.EFF(5,"Validador"),t.k0s()()()),2&i){t.XpG();const o=t.sdS(1);t.Y8G("matMenuTriggerFor",o)}}let Ve=(()=>{class i{constructor(o){this.formBuilder=o,this.configChanged=new t.bkB,this.ValidatorList=[],this.savedValidatorsList=[],this.valList=[{name:"Obrigat\xf3rio",key:"required",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0},{name:"M\xe1ximo de caracteres",key:"maxLength",type:"number",editing:!0,value:1,customMessage:"",editable:!0},{name:"M\xednimo de caracteres",key:"minLength",type:"number",editing:!0,value:1,customMessage:"",editable:!0},{name:"M\xe1ximo de palavras",key:"maxWords",type:"number",editing:!0,value:1,customMessage:"",editable:!0},{name:"M\xednimo de palavras",key:"minWords",type:"number",editing:!0,value:1,customMessage:"",editable:!0}
1,{name:"Express\xe3o regular",key:"pattern",type:"string",editing:!0,value:"",customMessage:"",reverse:!1,editable:!0},{name:"Valida\xe7\xe3o de CPF",key:"cpf",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0},{name:"Valida\xe7\xe3o personalizada",key:"custom",type:"code",editing:!0,value:"",customMessage:"",editable:!0}],this.validators=this.formBuilder.group({formArray:this.formBuilder.array([])})}get formArray(){return this.validators.get("formArray")}getForm(o){return this.formArray.controls[o]}ngOnInit(){this.currentForm.validatorData&&this.executeChanges({activeValidators:this.currentForm.validatorData.enable,message:this.currentForm.validatorData.message,validators:this.currentForm.validatorData.data}),this.handleType(),this.currentForm.validatorData?(this.message=new _.hs(this.currentForm.validatorData.message),this.activeValidators=new _.hs(this.currentForm.validatorData.enable)):(this.message=new _.hs(""),this.activeValidators=new _.hs(!1)),this.activeValidators.value?this.message.enable({emitEvent:!1}):this.message.disable({emitEvent:!1}),this.onchanges(),this.currentForm.validatorData&&this.currentForm.validatorData.data&&this.currentForm.validatorData.data.length>0&&(this.savedValidatorsList=this.currentForm.validatorData.data,this.currentForm.validatorData.data.forEach(o=>{this.addValidator(o)}))}handleType(){const o=this.currentForm.type;"number"===o&&(this.valList=this.valList.filter(s=>"custom"===s.key),this.valList.splice(0,0,{name:"Obrigat\xf3rio",key:"requiredNumber",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0}),this.valList.splice(1,0,{name:"M\xe1ximo",key:"max",type:"number",editing:!0,value:1,customMessage:"",editable:!0}),this.valList.splice(1,0,{name:"M\xednimo",key:"min",type:"number",editing:!0,value:1,customMessage:"",editable:!0})),"selectboxes"===o&&(this.valList=this.valList.filter(s=>"custom"===s.key),this.valList.splice(0,0,{name:"Obrigat\xf3rio",key:"requiredCheck",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0}))}onchanges(){this.activeValidators.valueChanges.subscribe(o=>{o?(this.message.enable({emitEvent:!1}),this.validators.controls.formArray.enable()):(this.message.disable({emitEvent:!1}),this.validators.controls.formArray.disable(),this.stopEditingAll()),this.executeChanges()}),this.message.valueChanges.subscribe(o=>{this.executeChanges()})}addValidator(o){"required"===o.key||"requiredNumber"===o.key||"requiredCheck"===o.key?this.formArray.insert(0,this.createRuleFormGroup(o)):this.formArray.push(this.createRuleFormGroup(o));const s={key:o.key,value:o.value,type:o.type,name:o.name,editing:o.editing,customMessage:o.customMessage,editable:o.editable,reverse:o.reverse};"required"===o.key||"requiredNumber"===o.key||"requiredCheck"===o.key?(this.valList.splice(0,1),this.ValidatorList.splice(0,0,s),this.onValidatorChanges(this.getForm(this.formArray.length-1))):(this.ValidatorList.push(s),this.onValidatorChanges(this.getForm(this.formArray.length-1))),this.savedValidatorsList=this.ValidatorList,this.executeChanges()}editRule(o){this.ValidatorList[o].editing=!0}saveRule(o){this.ValidatorList[o].value=this.getForm(o).get("value").value,this.ValidatorList[o].customMessage=""!==this.getForm(o).get("message").value.trim()&&this.getForm(o).get("message").value,null!==this.getForm(o).get("reverse").value&&(this.ValidatorList[o].reverse=this.getForm(o).get("reverse").value),this.savedValidatorsList=this.ValidatorList,this.executeChanges(),this.activeValidators.enable({emitEvent:!1})}stopEditing(o){this.ValidatorList[o].editing=!1}stopEditingAll(){this.ValidatorList=this.savedValidatorsList,this.ValidatorList.forEach(o=>{o.editing=!1}),this.savedValidatorsList=this.ValidatorList}removeRule(o){"required"===this.ValidatorList[o].key&&this.valList.splice(0,0,{name:"Obrigat\xf3rio",key:"required",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0}),"requiredNumber"===this.ValidatorList[o].key&&this.valList.splice(0,0,{name:"Obrigat\xf3rio",key:"requiredNumber",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0}),"requiredCheck"===this.ValidatorList[o].key&&this.valList.splice(0,0,{name:"Obrigat\xf3rio",key:"requiredCheck",type:"boolean",editing:!0,value:!0,customMessage:"",editable:!0}),this.ValidatorList.splice(o,1),this.formArray.removeAt(o),this.savedValidatorsList=this.ValidatorList,this.executeChanges()}createRuleFormGroup(o){return this.formBuilder.group({key:[],value:[o.value,_.k0.required],message:[o.customMessage?o.customMessage:""],reverse:[o.reverse]})}onValidatorChanges(o){const s=o.controls.value,d=o.controls.message,v=o.controls.reverse;v.valueChanges.subscribe(W=>{this.formArray.controls.filter((q,Ct)=>{q===v.parent&&(this.index=Ct,this.saveRule(Ct))})}),d.valueChanges.subscribe(W=>{this.formArray.controls.filter((q,Ct)=>{q===d.parent&&(this.index=Ct,this.saveRule(Ct))})}),s.valueChanges.subscribe(W=>{this.formArray.controls.filter((q,Ct)=>{q===s.parent&&(this.index=Ct,this.saveRule(Ct))})})}emitChanges(){this.configChanged.emit(this.currentForm)}executeChanges(o){let s;s=o||{activeValidators:this.activeValidators.value,message:this.message.value,validators:this.savedValidatorsList},this.setValidationsData(s),this.emitChanges()}setValidationsData(o){this.currentForm.validatorData=o.validators.length>0?{enable:o.activeValidators,message:o.message,data:o.validators}:{enable:o.activeValidators,message:o.message,data:[]}}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-advanced"]],inputs:{currentForm:"currentForm"},outputs:{configChanged:"configChanged"},decls:23,vars:9,consts:[["appMenu","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],[1,"ps_formBuilder_formContainer"],["fxLayout","row wrap"],["fxFlex","100",1,"ps_formBuilder_text",2,"margin-top","5px"],["fxFlex","100"],["fxFlex","100",3,"color","formControl"],["fxFlex","100","fxLayoutAlign","start center",2,"margin-top","15px"],["fxFlex","75","appearance","fill"],["matInput","","placeholder","",3,"formControl"],["class","ps_formBuilder_noValidators",4,"ngIf"],["fxLayout","row wrap","fxFlex","100"],["fxLayout","row wrap","fxFlex","100",3,"formGroup"],["formArrayName","formArray","fxFlex","100","fxLayout","row wrap","fxLayoutAlign","start",4,"ngFor","ngForOf"],["fxFlex","100",1,"ps_formBuilder_addVal"],["mat-stroked-button","","color","primary",3,"matMenuTriggerFor",4,"ngIf"],["mat-menu-item","",3,"click"],[1,"ps_formBuilder_noValidators"],["formArrayName","formArray","fxFlex","100","fxLayout","row wrap","fxLayoutAlign","start"],["fxLayout","row wrap","class","ps_formBuilder_validatorContainer mat-elevation-z1",3,"formGroupName",4,"ngIf"],["class","ps_formBuilder_validatorContainerClosed mat-elevation-z1",4,"ngIf"],["fxLayout","row wrap",1,"ps_formBuilder_validatorContainer","mat-elevation-z1",3,"formGroupName"],["fxFlex","100","class","ps_formBuilder_validatorTitle",4,"ngIf"],["fxFlex","100",2,"margin-top","0.5rem"],["appearance","fill","fxFlex","90",4,"ngIf"],[4,"ngIf"],["appearance","fill","fxFlex","40",4,"ngIf"],["fxFlex","100",2,"margin","10px 0"],["fxFlex","100","formControlName","value",3,"color",4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","fxLayout","row wrap","style","margin-bottom: 10px",4,"ngIf"],["fxFlex","100","fxLayout","row wrap",4,"ngIf"],["mat-icon-button","",2,"margin-right","10px",3,"click","disabled"],["mat-icon-button","",3,"click","disabled"],[3,"ngClass"],["fxFlex","100",1,"ps_formBuilder_validatorTitle"],["appearance","fill","fxFlex","90"],["matInput","","formControlName","value","placeholder","Insira um valor","formControlName","value"],["matTooltip",'A express\xe3o regular dever\xe1 come\xe7ar e terminar com "/". Exemplo: /[a-z0-9]/',"matTooltipPosition","after","matTooltipClass","ps-tooltip-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon"],["appearance","fill","fxFlex","40"],["matInput","","type","number","min","1","formControlName","value","placeholder","Insira um valor","formControlName","value"],["fxFlex","100","formControlName","value",3,"color"],["matInput","","formControlName","message"],["fxFlex","100","fxLayout","row wrap",2,"margin-bottom","10px"],["matTooltip","Inverte a aplica\xe7\xe3o da express\xe3o regular procurando n\xe3o conter o padr\xe3o estabelecido por ela","matTooltipPosition","after","matTooltipClass","ps-tooltip-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon"],["fxFlex","100","formControlName","reverse",3,"color"],["fxFlex","100","fxLayout","row wrap"],[1,"ps_formBuilder_table","table-bordered","table-condensed","table-striped"],["fxFlex","97","formControlName","value","theme","vs-dark","flex","",1,"ps_formBuilder_editor",2,"height","300px",3,"disabled","editorOptions","language"],["fxFlex","97",1,"ps_formBuilder_text",2,"margin-top","5px"],["fxFlex","97",1,"ps_formBuilder_validatorTitle",2,"margin-top","5px"],[1,"ps_formBuilder_validatorContainerClosed","mat-elevation-z1"],["mat-icon-button","","aria-label","Remover",2,"margin-right","10px",3,"click","disabled"],["mat-icon-button","","aria-label","Editar",3,"click","disabled"],["mat-stroked-button","","color","primary",3,"matMenuTriggerFor"],["fxLayout","row","fxLayoutAlign","justify-between center","fxLayoutGap","10px"]],template:function(s,d){1&s&&(t.j41(0,"mat-menu",null,0),t.DNE(2,be,2,1,"button",1),t.k0s(),t.j41(3,"div",2)(4,"div",3)(5,"span",4),t.EFF(6,"Validador"),t.k0s(),t.j41(7,"div",5)(8,"mat-slide-toggle",6),t.EFF(9),t.k0s()(),t.j41(10,"span",4),t.EFF(11," Valida
1dores verificam se os dados inseridos pelo usu\xe1rio s\xe3o v\xe1lidos."),t.k0s(),t.j41(12,"div",7)(13,"mat-form-field",8)(14,"mat-label"),t.EFF(15,"Mensagem de campo inv\xe1lido"),t.k0s(),t.nrm(16,"input",9),t.k0s()(),t.DNE(17,Fe,2,0,"p",10),t.j41(18,"div",11)(19,"div",12),t.DNE(20,Me,3,2,"div",13),t.k0s(),t.j41(21,"div",14),t.DNE(22,Pe,6,1,"button",15),t.k0s()()()()),2&s&&(t.R7$(2),t.Y8G("ngForOf",d.valList),t.R7$(6),t.Y8G("color","primary")("formControl",d.activeValidators),t.R7$(),t.SpI(" ",1==d.activeValidators.value?"Ativado":"Desativado"," "),t.R7$(7),t.Y8G("formControl",d.message),t.R7$(),t.Y8G("ngIf",0===d.ValidatorList.length&&d.activeValidators.value),t.R7$(2),t.Y8G("formGroup",d.validators),t.R7$(),t.Y8G("ngForOf",d.ValidatorList),t.R7$(2),t.Y8G("ngIf",d.activeValidators.value))},dependencies:[m.YU,m.Sq,m.bT,_.me,_.Q0,_.BC,_.cb,_.VZ,_.l_,_.j4,_.JD,_.$R,_.v8,j.$z,j.iY,_e.kk,_e.fb,_e.Cp,U.rl,U.nJ,ot.fg,rt.An,ft.oV,ct.sG,E.DJ,E.BO,E.sA,E.UI,et.PW,Mt.A],styles:["[_nghost-%COMP%]{font-family:Roboto,Helvetica Neue,sans-serif}.ps_formBuilder_formContainer[_ngcontent-%COMP%]{display:flex;width:95%;margin:10px 15px}.ps_formBuilder_formContainer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]:first-of-type{width:100%}.ps_formBuilder_formContainer[_ngcontent-%COMP%]   .ps_formBuilder_tooltipIcon[_ngcontent-%COMP%]{height:17px;width:17px;margin-left:5px}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.ps_formBuilder_radioGroup[_ngcontent-%COMP%]   .ps_formBuilder_radioButton[_ngcontent-%COMP%]{margin:5px}.ps_formBuilder_noValidators[_ngcontent-%COMP%]{font-size:14px;padding:5px;letter-spacing:.025em;line-height:129.2%;background:#ffb94630;border-radius:9px}.ps_formBuilder_text[_ngcontent-%COMP%]{font-style:normal;font-size:14px;line-height:24px;color:#0009}.ps_formBuilder_noVariables[_ngcontent-%COMP%]{font-size:14px;padding:5px;letter-spacing:.025em;line-height:129.2%;background:#ffb946;opacity:.3;border-radius:9px}.ps_formBuilder_validatorContainer[_ngcontent-%COMP%]{padding:15px 0 0 15px;margin:10px 0;position:relative;min-height:80px}.ps_formBuilder_validatorContainer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{position:absolute;top:0;right:25px;outline:none}.ps_formBuilder_validatorContainer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_validatorContainer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:last-of-type{position:absolute;top:0;right:0;outline:none}.ps_formBuilder_validatorContainer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:last-of-type   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_validatorTitle[_ngcontent-%COMP%]{font-family:Roboto,Helvetica Neue,sans-serif;font-style:normal;font-weight:400;font-size:15px;line-height:154.2%;color:#4d4d4d}.ps_formBuilder_editor[_ngcontent-%COMP%]{max-width:97%;border:1px solid rgba(0,0,0,.6)}.ps_formBuilder_table[_ngcontent-%COMP%]{width:97%;font-size:14px}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]{padding:15px 0 0 15px;margin:10px 0;position:relative;height:50px}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:first-of-type{font-family:Roboto,Helvetica Neue,sans-serif;font-style:normal;font-weight:400;font-size:15px;line-height:154.2%;color:#4d4d4d}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{position:absolute;top:0;right:25px;outline:none}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:last-of-type{position:absolute;top:0;right:0;outline:none}.ps_formBuilder_validatorContainerClosed[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:last-of-type   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_buttonDisabled[_ngcontent-%COMP%]{filter:opacity(.3)}.ps_formBuilder_addVal[_ngcontent-%COMP%]{margin-bottom:20px}.ps_formBuilder_addVal[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{display:flex}.ps_formBuilder_addVal[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:26px}"]})}}return i})();var je=n(71387),Le=n(99781),Be=n(7673),ge=n(36471);const Ae=i=>({"ps-relation-hidden-chip":i});function Ne(i,h){if(1&i&&(t.j41(0,"mat-option",15),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o),t.R7$(),t.SpI(" ",o.label," ")}}function $e(i,h){1&i&&(t.j41(0,"mat-icon",21),t.EFF(1," cancel "),t.k0s())}function Ye(i,h){if(1&i){const o=t.RV6();t.j41(0,"mat-chip-option",19),t.bIt("removed",function(){const d=t.eBV(o).$implicit,v=t.XpG(2);return t.Njj(v.remove(d))}),t.EFF(1),t.DNE(2,$e,2,0,"mat-icon",20),t.k0s()}if(2&i){const o=h.$implicit,s=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Ae,o.field_id===s.dateField.field_id))("removable",s.removable),t.R7$(),t.SpI(" ",o.label," "),t.R7$(),t.Y8G("ngIf",s.removable)}}function Ue(i,h){if(1&i&&(t.j41(0,"div",16)(1,"div",4)(2,"span",17),t.EFF(3),t.k0s(),t.j41(4,"mat-chip-listbox"),t.DNE(5,Ye,3,6,"mat-chip-option",18),t.k0s()()()),2&i){const o=t.XpG();t.R7$(3),t.SpI("Campos vinculados ao campo ",o.dateField.label,""),t.R7$(2),t.Y8G("ngForOf",o.relatedFields)}}let we=(()=>{class i{constructor(o,s,d){this.systemFieldService=o,this.loaderService=s,this.formBuilder=d,this.availableFieldsForRelation=[],this.relatedFields=[],this.relatedFieldsBefore=[],this.selectedField=null,this.removable=!0}ngOnInit(){if(this.formulario=this.formBuilder.group({relation_field:null}),this.editorMode)this.removable=!1,this.dateFields=JSON.parse(JSON.stringify(this.dateFields)),this.relatedFields=this.dateField.field_relation??[];else{this.dateFields=JSON.parse(JSON.stringify(this.dateFields)),this.relatedFields=this.dateField.field_relation;const o=this.dateFields.fields.filter(s=>{if(1===s.predefined_source_options)return s});this.dateFields.fields=o,this.availableFieldsForRelation=(0,e.vR)(this.dateFields.fields,"field_id",this.dateField.field_id),this.availableFieldsForRelation=(0,e.HL)(this.availableFieldsForRelation,this.relatedFields,"field_id"),this.relatedFieldsBefore=JSON.parse(JSON.stringify(this.relatedFields))}this.fields=(0,Be.of)(this.availableFieldsForRelation),this.initAutoCompleteFields(),this.subscribeChanged()}displayFn(o){return o&&o.label?o.label:""}initAutoCompleteFields(){return this.fields=this.formulario.get("relation_field").valueChanges.pipe((0,A.Z)(""),(0,l.T)(o=>o?(0,e.ji)({value:o,systemFields:this.availableFieldsForRelation}):this.availableFieldsForRelation.slice())),!0}subscribeChanged(){this.formulario.get("relation_field").valueChanges.subscribe(o=>{this.selectedField=o})}relating(){null!==this.selectedField&&(this.setCurrentFieldIfNeeded(),typeof this.selectedField.wasRemoved>"u"?this.systemFieldService.read(this.selectedField.field_id).subscribe(o=>{o.success&&(o.data.field_relation.length>0?(this.setChange(o.data.field_relation),this.relatedFields=[...this.relatedFields,...o.data.field_relation],this.relatedFields=(0,e._V)(this.relatedFields,["field_id","label","relation_id","new"]),this.availableFieldsForRelation=(0,e.HL)(this.availableFieldsForRelation,this.relatedFields,"field_id"),delete this.dateField.relation_id):this.relatedFields.push(this.selectedField),this.dateField.field_relation=this.relatedFields,this.availableFieldsForRelation=(0,e.HL)(this.availableFieldsForRelation,this.relatedFields,"field_id"),this.selectedField=null)},o=>{this.loaderService.setChangesLoaderState(!1,o.body,"","error",o.title,1e5)}):(this.relatedFields.push(this.selectedField),this.dateField.field_relation=this.relatedFields,this.availableFieldsForRelation=(0,e.HL)(this.availableFieldsForRelation,this.relatedFields,"field_id"),this.selectedField=null))}remove(o){const s=this.relatedFields.indexOf(o);s>=0&&(this.relatedFields.slice(s),this.dateField.field_relation.splice(s,1),this.verification(this.relatedFields),o.field_id!==this.dateField.field_id&&(o.wasRemoved=1,this.availableFieldsForRelation.unshift(o)))}setChange(o){for(const s in o)o.hasOwnProperty(s)&&(o[s].new=1)}
1verification(o){if(typeof o.find(d=>1===d.new)>"u"&&this.relatedFieldsBefore.length>0){for(const d in o)for(const v in this.relatedFieldsBefore)o[d].field_id===this.relatedFieldsBefore[v].field_id&&(o[d]=this.relatedFieldsBefore[v]);this.dateField.relation_id=this.relatedFieldsBefore[0].relation_id,this.isOnlyFieldItself()}}isOnlyFieldItself(){1===this.relatedFields.length&&(this.relatedFields=[]),1===this.dateField.field_relation.length&&(this.dateField.field_relation=[])}setCurrentFieldIfNeeded(){if(typeof this.relatedFields.find(s=>s.field_id===this.dateField.field_id)>"u"&&this.relatedFieldsBefore.length>0)for(const s in this.relatedFieldsBefore)if(this.relatedFieldsBefore.hasOwnProperty(s)){const d=this.relatedFieldsBefore[s];d.field_id===this.dateField.field_id&&this.relatedFields.push(d)}}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(Le.Z),t.rXU(Z.Z),t.rXU(_.ze))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-relation"]],inputs:{dateFields:"dateFields",dateField:"dateField",editorMode:"editorMode"},decls:22,vars:8,consts:[["auto","matAutocomplete"],[1,"",3,"formGroup"],[1,"ps-form-relation-field-container"],["fxLayout","row",1,"ps-row"],["fxFlex",""],[1,"ps-description-14"],["fxLayout","row","fxLayoutGap","20px","fxLayoutAlign","start center",1,"ps-row"],["fxFlex","40"],["appearance","fill","fxFlex",""],["type","text","matInput","","formControlName","relation_field",3,"matAutocomplete"],["required","",3,"displayWith"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","",1,"ps-button-add-relation-content"],["mat-stroked-button","","color","primary",1,"ps-button-add-relation",3,"click","disabled"],["fxLayout","row",4,"ngIf"],[3,"value"],["fxLayout","row"],[1,"ps-label-chips-toggle"],[3,"ngClass","removable","removed",4,"ngFor","ngForOf"],[3,"removed","ngClass","removable"],["matChipRemove","",4,"ngIf"],["matChipRemove",""]],template:function(s,d){if(1&s){const v=t.RV6();t.j41(0,"form",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"p",5),t.EFF(5," Nesta tela ser\xe1 poss\xedvel criar uma rela\xe7\xe3o entre os campos do sistema. O valor preenchido em campos vinculados definem os valores exibidos nos mesmos. "),t.k0s()()(),t.j41(6,"div",6)(7,"div",7)(8,"mat-form-field",8)(9,"mat-label"),t.EFF(10,"Selecione um campo"),t.k0s(),t.nrm(11,"input",9),t.j41(12,"mat-autocomplete",10,0),t.DNE(14,Ne,2,2,"mat-option",11),t.nI1(15,"async"),t.k0s()()(),t.j41(16,"div",12)(17,"a",13),t.bIt("click",function(){return t.eBV(v),t.Njj(d.relating())}),t.j41(18,"mat-icon"),t.EFF(19,"add"),t.k0s(),t.EFF(20," Vincular "),t.k0s()()(),t.DNE(21,Ue,6,2,"div",14),t.k0s()()}if(2&s){const v=t.sdS(13);t.Y8G("formGroup",d.formulario),t.R7$(11),t.Y8G("matAutocomplete",v),t.R7$(),t.Y8G("displayWith",d.displayFn),t.R7$(2),t.Y8G("ngForOf",t.bMT(15,6,d.fields)),t.R7$(3),t.Y8G("disabled",d.editorMode),t.R7$(4),t.Y8G("ngIf",d.relatedFields.length>0)}},dependencies:[m.YU,m.Sq,m.bT,_.qT,_.me,_.BC,_.cb,_.j4,_.JD,j.It,U.rl,U.nJ,dt.wT,ot.fg,ge.uI,ge.gq,ge.Zv,rt.An,C.$3,C.pN,E.DJ,E.BO,E.sA,E.UI,et.PW,m.Jj],styles:[".ps-form-relation-field-container[_ngcontent-%COMP%]{padding:15px 24px 0}.ps-form-relation-field-two-container[_ngcontent-%COMP%]{padding:12px 24px 27px}.ps-form-relation-field-three-container[_ngcontent-%COMP%]{padding:13px 24px 0}.ps-label-chips-toggle[_ngcontent-%COMP%]{display:block;font-size:14px;color:#0009;margin-bottom:1em}  .ps-button-add-relation .mat-button-wrapper{display:flex;justify-content:center;align-items:center}  .ps-button-add-relation .mat-button-wrapper .mat-icon{line-height:16px;height:16px;width:16px;font-size:20px;margin-right:8px}.ps-button-add-relation-content[_ngcontent-%COMP%]{padding-bottom:1.34375em}.ps-relation-hidden-chip[_ngcontent-%COMP%]{display:none}"]})}}return i})();var wt=n(23886),Xe=n(34737);const zt=i=>({disabled:i}),Je=i=>({hideRubeusFields:i}),We=i=>({hideTotvsFields:i});function ze(i,h){if(1&i&&(t.j41(0,"mat-option",14),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o),t.R7$(),t.SpI(" ",o.name," ")}}function Ke(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function He(i,h){if(1&i&&(t.j41(0,"mat-option",14),t.EFF(1),t.k0s()),2&i){const o=h.$implicit;t.Y8G("value",o),t.R7$(),t.SpI(" ",o.name," ")}}function Ze(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function Qe(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function qe(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," Campo obrigat\xf3rio "),t.k0s())}function ta(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," O n\xfamero m\xe1ximo de caracteres \xe9 30 "),t.k0s())}function ea(i,h){1&i&&(t.j41(0,"mat-error"),t.EFF(1," N\xe3o pode haver ponto "),t.k0s())}class aa{isErrorState(h,o){return!!(h&&h.invalid&&(h.dirty||h.touched||o&&o.submitted))}}let oa=(()=>{class i{constructor(o,s,d){this.formBuilder=o,this.crudModel=s,this.loaderService=d,this.indentityChange=new t.bkB,this.indentityFormValid=new t.bkB,this.fieldRulesChange=new t.bkB,this.fieldRulesChangeOnCreate=new t.bkB,this.dialogConfirm={titleDialogConfirm:null,subTitleDialogConfirm:null,disableCloseDialogConfirm:null},this.selectedFieldTypeIndex=null,this.selectTabelaTotvs=!0,this.selectColunaTotvs=!0,this.selectTabelaRubeus=!0,this.selectColunaRubeus=!0,this.hideTotvsFields=!0,this.hideRubeusFields=!0,this.fieldTypes=[{name:"Campo de texto",value:"textfield",id:9},{name:"\xc1rea de texto",value:"textarea",id:9},{name:"E-mail",value:"email",id:3},{name:"N\xfamero",value:"number",id:5},{name:"Select",value:"select",id:11},{name:"Senha",value:"password",id:6},{name:"Data",value:"datetime",id:2},{name:"Caixa de sele\xe7\xe3o",value:"checkbox",id:1},{name:"Bot\xe3o de op\xe7\xe3o",value:"radio",id:7}],this.disabledInput=!1,this.matcher=new aa}ngOnInit(){this.editorMode?this.formEdit(this.fieldSettings):(this.crmFields.forEach(o=>{this.fieldSettings&&o.attr===this.fieldSettings.rubeus_field&&(this.selectedCrmField=o)}),!0===this.creatingField?this.formAdd():this.formUpdate(this.fieldSettings),this.formChanges(),this.filterColumnRubeus())}get f(){return this.formulario.controls}onSubmit(){"add"===this.dataComponent.data.action&&this.formulario.valid?this.customFieldsCreate():"update"===this.dataComponent.data.action&&this.formulario.valid&&this.customFieldsUpdate()}formAdd(){this.indentityFormValid.emit(!1),this.formulario=this.formBuilder.group({integracaoTotvs:[!1],integracaoRubeus:[!1],tabelaTotvs:[null],colunaTotvs:[null],nomeAlternativoTotvs:[null],tabelaRubeus:[null],colunaRubeus:[null],ps_table:[!1],fieldType:[null,[_.k0.required]],multivalue:[!1,[_.k0.required]]}),this.f.tabelaRubeus.valueChanges.subscribe(o=>{this.filterColumnRubeus()})}formUpdate(o){this.formulario=this.formBuilder.group({integracaoTotvs:[null],integracaoRubeus:[null],tabelaTotvs:[o.totvs_table],colunaTotvs:[o.totvs_field],nomeAlternativoTotvs:[o.totvs_alternative_name],tabelaRubeus:[null],colunaRubeus:[this.selectedCrmField],ps_table:[{value:null,disabled:!0}],fieldType:[null,[_.k0.required]],multivalue:[null,[_.k0.required]]}),this.setFieldTypeRules(this.selectedCrmField),0===o.ps_table?this.f.ps_table.setValue(!1):1===o.ps_table&&this.f.ps_table.setValue(!0),0===o.rubeus_table?this.f.tabelaRubeus.setValue(!1):1===o.rubeus_table&&this.f.tabelaRubeus.setValue(!0),this.f.multivalue.setValue(0!==o.multivalued),null!==this.f.tabelaRubeus.value&&(this.f.integracaoRubeus.setValue(!0),this.setValidationInRubeusIntegration(!0),this.hideRubeusFields=!1),null!==this.f.tabelaTotvs.value&&(this.f.integracaoTotvs.setValue(!0),this.setValidationTOTVSIntegration(!0),this.hideTotvsFields=!1),this.currentForm&&this.currentForm.components[0]?(this.fieldTypes.forEac
1h((s,d)=>{s.value===this.currentForm.components[0].type&&(this.selectedFieldTypeIndex=d)}),this.f.fieldType.setValue(this.fieldTypes[this.selectedFieldTypeIndex])):this.f.fieldType.setValue(this.fieldTypes[0]),this.f.tabelaRubeus.valueChanges.subscribe(s=>{this.filterColumnRubeus()})}formEdit(o){this.formulario=this.formBuilder.group({integracaoTotvs:[{value:null,disabled:!0}],integracaoRubeus:[{value:null,disabled:!0}],tabelaTotvs:[{value:o.totvs_table,disabled:!0}],colunaTotvs:[{value:o.totvs_field,disabled:!0}],nomeAlternativoTotvs:[{value:o.totvs_alternative_name,disabled:!0}],tabelaRubeus:[{value:null,disabled:!0}],colunaRubeus:[{value:{name:o.rubeus_field},disabled:!0}],ps_table:[{value:null,disabled:!0}],fieldType:[{value:null,disabled:!0},[_.k0.required]],multivalue:[{value:null,disabled:!0},[_.k0.required]]}),0===o.rubeus_table?this.f.tabelaRubeus.setValue(!1):1===o.rubeus_table&&this.f.tabelaRubeus.setValue(!0),0===o.ps_table?this.f.ps_table.setValue(!1):1===o.ps_table&&this.f.ps_table.setValue(!0),this.f.multivalue.setValue(0!==o.multivalued),this.currentForm&&this.currentForm.components[0]?(this.fieldTypes.forEach((s,d)=>{s.value===this.currentForm.components[0].type&&(this.selectedFieldTypeIndex=d)}),this.f.fieldType.setValue(this.fieldTypes[this.selectedFieldTypeIndex])):this.f.fieldType.setValue(this.fieldTypes[0]),null!==this.f.tabelaRubeus.value&&(this.f.integracaoRubeus.setValue(!0),this.hideRubeusFields=!1),null!==this.f.tabelaTotvs.value&&(this.f.integracaoTotvs.setValue(!0),this.hideTotvsFields=!1)}setValidationTOTVSIntegration(o=!1){o?(this.formulario.controls.tabelaTotvs.setValidators(_.k0.required),this.formulario.controls.colunaTotvs.setValidators(_.k0.required),this.formulario.controls.nomeAlternativoTotvs.setValidators([_.k0.maxLength(30),s=>s.value&&s.value.includes(".")?{invalidCharacter:!0}:null]),this.formulario.controls.tabelaTotvs.setValue(this.f.tabelaTotvs.value),this.formulario.controls.colunaTotvs.setValue(this.f.colunaTotvs.value),this.formulario.controls.nomeAlternativoTotvs.setValue(this.f.nomeAlternativoTotvs.value),this.hideTotvsFields=!1,this.formulario.controls.tabelaTotvs.updateValueAndValidity(),this.formulario.controls.colunaTotvs.updateValueAndValidity(),this.formulario.controls.nomeAlternativoTotvs.updateValueAndValidity()):this.formulario.controls.integracaoTotvs.valueChanges.subscribe(s=>{!0===s?(this.formulario.controls.tabelaTotvs.setValidators(_.k0.required),this.formulario.controls.colunaTotvs.setValidators(_.k0.required),this.formulario.controls.nomeAlternativoTotvs.setValidators([_.k0.maxLength(30),d=>d.value&&d.value.includes(".")?{invalidCharacter:!0}:null]),this.formulario.controls.tabelaTotvs.setValue(null),this.formulario.controls.colunaTotvs.setValue(null),this.formulario.controls.nomeAlternativoTotvs.setValue(null),this.hideTotvsFields=!1,this.formulario.controls.tabelaTotvs.updateValueAndValidity(),this.formulario.controls.colunaTotvs.updateValueAndValidity(),this.formulario.controls.nomeAlternativoTotvs.updateValueAndValidity()):(this.formulario.controls.tabelaTotvs.setValidators(null),this.formulario.controls.colunaTotvs.setValidators(null),this.formulario.controls.nomeAlternativoTotvs.setValidators(null),this.formulario.controls.tabelaTotvs.setValue(null),this.formulario.controls.colunaTotvs.setValue(null),this.formulario.controls.nomeAlternativoTotvs.setValue(null),this.hideTotvsFields=!0,this.formulario.controls.tabelaTotvs.updateValueAndValidity(),this.formulario.controls.colunaTotvs.updateValueAndValidity(),this.formulario.controls.nomeAlternativoTotvs.updateValueAndValidity())})}setValidationInRubeusIntegration(o=!1){o?(this.formulario.controls.tabelaRubeus.setValidators(_.k0.required),this.formulario.controls.colunaRubeus.setValidators(_.k0.required),this.formulario.controls.tabelaRubeus.setValue(this.f.tabelaRubeus.value),this.hideRubeusFields=!1,this.formulario.controls.colunaRubeus.updateValueAndValidity(),this.formulario.controls.tabelaRubeus.updateValueAndValidity()):this.formulario.controls.integracaoRubeus.valueChanges.subscribe(s=>{!0===s?(this.formulario.controls.tabelaRubeus.setValidators(_.k0.required),this.formulario.controls.colunaRubeus.setValidators(_.k0.required),this.formulario.controls.tabelaRubeus.setValue(!1),this.hideRubeusFields=!1,this.formulario.controls.colunaRubeus.updateV
1alueAndValidity(),this.formulario.controls.tabelaRubeus.updateValueAndValidity()):(this.formulario.controls.tabelaRubeus.setValidators(null),this.formulario.controls.colunaRubeus.setValidators(null),this.formulario.controls.tabelaRubeus.setValue(null),this.formulario.controls.colunaRubeus.setValue(null),this.hideRubeusFields=!0,this.formulario.controls.colunaRubeus.updateValueAndValidity(),this.formulario.controls.tabelaRubeus.updateValueAndValidity())})}changesOnMultivalue(o){7==o?.id&&this.formulario.get("multivalue").value?this.formulario.get("multivalue").patchValue(!1):this.formulario.get("multivalue").enable()}formChanges(){this.setValidationInRubeusIntegration(),this.setValidationTOTVSIntegration(),this.formulario.controls.colunaRubeus.valueChanges.subscribe(o=>{this.setFieldTypeRules(o)}),this.formulario.controls.fieldType.valueChanges.subscribe(o=>{this.changesOnMultivalue(o)}),this.formulario.valueChanges.subscribe(o=>{if(this.formulario.valid&&(0,wt.isObject)(o.fieldType)?this.indentityFormValid.emit(!0):this.indentityFormValid.emit(!1),this.creatingField){if(this.formulario.valid)if(this.formulario.controls.integracaoRubeus.value){if((0,wt.isObject)(o.colunaRubeus)){const s={settings:{totvs_table:o.tabelaTotvs,totvs_field:o.colunaTotvs,totvs_alternative_name:o.nomeAlternativoTotvs,rubeus_table:Number(o.tabelaRubeus),rubeus_field:o.colunaRubeus.attr,ps_table:o.ps_table,field_type_id:o.fieldType.id,type:o.fieldType.value,multivalued:Number(o.multivalue),label:o.fieldType.name}};this.indentityChange.emit(s)}}else{const s={settings:{totvs_table:o.tabelaTotvs,totvs_field:o.colunaTotvs,totvs_alternative_name:o.nomeAlternativoTotvs,rubeus_table:null,rubeus_field:null,ps_table:o.ps_table,field_type_id:o.fieldType.id,type:o.fieldType.value,multivalued:Number(o.multivalue),label:o.fieldType.name}};this.indentityChange.emit(s)}}else if(this.formulario.controls.integracaoRubeus.value){if((0,wt.isObject)(o.colunaRubeus)){const s={settings:{totvs_table:o.tabelaTotvs,totvs_field:o.colunaTotvs,totvs_alternative_name:o.nomeAlternativoTotvs,rubeus_table:Number(o.tabelaRubeus),rubeus_field:o.colunaRubeus.attr,ps_table:o.ps_table,field_type_id:o.fieldType.id,type:o.fieldType.value,multivalued:Number(o.multivalue),label:o.fieldType.name}};this.indentityChange.emit(s)}}else{const s={settings:{totvs_table:o.tabelaTotvs,totvs_field:o.colunaTotvs,totvs_alternative_name:o.nomeAlternativoTotvs,rubeus_table:null,rubeus_field:null,ps_table:o.ps_table,field_type_id:o.fieldType.id,type:o.fieldType.value,multivalued:Number(o.multivalue),label:o.fieldType.name}};this.indentityChange.emit(s)}})}customFieldsCreate(){this.loaderService.setChangesLoaderState(!0),this.formulario.patchValue({})}customFieldsUpdate(){this.loaderService.setChangesLoaderState(!0)}setFieldTypeRules(o){if((0,wt.isObject)(o)){const s=o.type,d=o.rule.split(",");let v=0,W="none",q=!1,Ct=!1,kt=!1;d.forEach(Tt=>{Tt.startsWith("max:")&&(v=Number(Tt.split(":")[1])),"email"===Tt&&(W="email"),"cpf"===Tt&&(W="cpf"),"cep"===Tt&&(W="cep")}),o.tipoSexo&&(Ct=!0),"date"===s&&(W="date"),"datetime"===s&&(W="datetime"),o.tipoLogico&&(kt=!0),1==o.temOpcoesPredefinidas&&(q=!0),this.currentForm&&this.currentForm.components[0]&&(this.fieldTypes.forEach((Tt,Oa)=>{Tt.value===this.currentForm.components[0].type&&(this.selectedFieldTypeIndex=Oa)}),null!==this.selectedFieldTypeIndex&&this.f.fieldType.setValue(this.fieldTypes[this.selectedFieldTypeIndex])),this.currentForm.components[0].key?this.fieldRulesChange.emit({max:v,pattern:W,predefined:q,typeLogical:kt,typeSex:Ct,fieldType:o.attr}):this.fieldRulesChangeOnCreate.emit({max:v,pattern:W,predefined:q,typeLogical:kt,typeSex:Ct,fieldType:o.attr})}}onColumnRubeusChanged(o){this.f.colunaRubeus.setValue(""),this.filterColumnRubeus()}filterColumnRubeus(){this.fieldRubeus=this.crmFields;let o=[];o=this.fieldRubeus.filter(this.f.tabelaRubeus.value?s=>"pessoa"!==s.attr.split(["."])[0]&&"contato"!==s.attr.split(["."])[0]:s=>"pessoa"===s.attr.split(["."])[0]||"contato"===s.attr.split(["."])[0]),this.filteredColumnRubeus=this.formulario.controls.colunaRubeus.valueChanges.pipe((0,A.Z)(""),(0,l.T)(s=>this._filter(s,o)))}getOptionText(o){if(o&&o.name)return o.name}_filter(o,s){let d="";return(0,wt.isObject)(o)||null!==o&&(d=o.toLowerCase()),s.filter(v=>v.name.toLowerCase().includes(d))}checkStatus(o,s){this.f.tabelaRubeus.value===s&&(this.f.tabelaRubeus.setValue(null),o.preventDefault())}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze),t.rXU(Xe.S),t.rXU(Z.Z))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-identity"]],inputs:{fieldSettings:"fieldSettings",crmFields:"crmFields",currentForm:"currentForm",creatingField:"creatingField",editorMode:"editorMode"},outputs:{indentityChange:"indentityChange",indentityFormValid:"indentityFormValid",fieldRulesChange:"fieldRulesChange",fieldRulesChangeOnCreate:"fieldRulesChangeOnCreate"},decls:92,vars:40,consts:[["auto4","matAutocomplete"],["fxLayout","column","fxFill","",3,"ngSubmit","formGroup"],[1,"ps-identity-container"],["fxLayout","row"],[1,"ps-title-large","ps-title-margin"],["fxLayout","row","fxLayoutGap","23px","fxLayout.sm","column","fxLayout.xs","column",1,"ps-row"],["fxLayout","column","fxFlex",""],["appearance","fill","fxFlex",""],["formControlName","fieldType"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"ngClass"],["fxFlex","","formControlName","ps_table","color","primary","fxLayoutAlign","start center"],[2,"margin-right","20px",3,"value"],[3,"value"],["fxLayout","column","fxFlex","",3,"ngClass"],["fxFlex","","formControlName","multivalue","color","primary","fxLayoutAlign","start center"],[3,"value","disabled"],["fxFlex",""],[1,"ps-identity-container",2,"padding-top","13px"],["fxLayout","column",2,"padding-bottom","15px"],[2,"color","#808080","padding-bottom","10px"],["color","primary","formControlName","integracaoRubeus",2,"width","135px"],["fxFlex","","formControlName","tabelaRubeus","color","primary","fxLayoutAlign","start center",3,"change"],["type","text","placeholder","Escolha uma coluna","aria-label","Texto","matInput","","formControlName","colunaRubeus",3,"matAutocomplete"],["autoActiveFirstOption","",3,"displayWith"],["color","primary","formControlName","integracaoTotvs",2,"width","135px"],["appearance","fill","fxFlex","","fxFlex.gt-sm","100"],["type","text","placeholder","Escolha uma tabela","aria-label","Texto","matInput","","formControlName","tabelaTotvs"],["type","text","placeholder","Escolha uma coluna","aria-label","Texto","matInput","","id","colunaTotvs","formControlName","colunaTotvs"],["type","text","placeholder","Nome do campo","aria-label","Texto","matInput","","id","nomeAlternativoTotvs","formControlName","nomeAlternativoTotvs"]],template:function(s,d){if(1&s){const v=t.RV6();t.j41(0,"form",1),t.bIt("ngSubmit",function(){return t.eBV(v),t.Njj(d.onSubmit())}),t.j41(1,"div",2)(2,"div",3)(3,"h2",4),t.EFF(4,"Configure os campos de integra\xe7\xe3o"),t.k0s()(),t.j41(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),t.EFF(9,"Tipo do campo"),t.k0s(),t.j41(10,"mat-select",8),t.DNE(11,ze,2,2,"mat-option",9),t.k0s(),t.DNE(12,Ke,2,0,"mat-error",10),t.k0s()(),t.j41(13,"div",6)(14,"mat-label",11),t.EFF(15,"Tabela do processo seletivo"),t.k0s(),t.j41(16,"mat-radio-group",12)(17,"mat-radio-button",13),t.EFF(18,"Pessoa"),t.k0s(),t.j41(19,"mat-radio-button",14),t.EFF(20,"Inscri\xe7\xe3o"),t.k0s()()(),t.j41(21,"div",15)(22,"mat-label",11),t.EFF(23,"Multivalorado"),t.k0s(),t.j41(24,"mat-radio-group",16)(25,"mat-radio-button",13),t.EFF(26,"N\xe3o"),t.k0s(),t.j41(27,"mat-radio-button",17),t.EFF(28,"Sim"),t.k0s()()()()(),t.j41(29,"div",3)(30,"div",18),t.nrm(31,"mat-divider"),t.k0s()(),t.j41(32,"div",19)(33,"div",20)(34,"span",21),t.EFF(35,"Integra\xe7\xe3o Rubeus"),t.k0s(),t.j41(36,"mat-slide-toggle",22),t.EFF(37),t.k0s()(),t.j41(38,"div",11)(39,"div",5)(40,"div",6)(41,"mat-label",11),t.EFF(42,"Tabela Rubeus"),t.k0s(),t.j41(43,"mat-radio-group",23),t.bIt("change",function(q){return t.eBV(v),t.Njj(d.onColumnRubeusChanged(q))}),t.j41(44,"mat-radio-button",13),t.EFF(45,"Contato"),t.k0s(),t.j41(46,"mat-radio-button",14),t.EFF(47,"Registro"),t.k0s()()(),t.j41(48,"mat-form-field",7)(49,"mat-label"),t.EFF(50,"Coluna Rubeus"),t.k0s(),t.nrm(51,"input",24),t.j41(52,"mat-autocomplete",25,0),t.DNE(54,He,2,2,"mat-option",9),t.nI1(55,"async"),t.k0s(),t.j41(56,"mat-hint"),t.EFF(57,"Escolha uma coluna j\xe1 existente referente \xe0 tabela selecionada"),t.k0s(),t.DNE(58,Ze,2,0,"mat-error",10),t.k0s()()()(),t.j41(59,"div",3)(60,"div",18),t.nrm(61,"mat-divider"),t.k0s()(),t.j41(62,"div",19)(63,"div",20)(64,"span",21),t.EFF(65,"Integra\xe7\xe3o TOTVS"),t.k0s(),t.j41(66,"mat-slide-toggle",26),t.EFF(67),t.k0s()(),t.j41(68,"div",11)(69,"div",5)(70,"mat-form-field",27)(71,"mat-label"),t.EFF(72,"Tabela do TOTVS"),t.k0s(),t.nrm(73,"input",28),t.j41(74,"mat-hint"),t.EFF(75,"Escolha uma tabela j\xe1 existente no TOTVS"),t.k0s(),t.DNE(76,Qe,2,0,"mat-error",10),t.k0s(),t.j41(77,"mat-form-field",27)(78,"mat-label"),t.EFF(79,"Campo TOTVS"),t.k0s(),t.nrm(80,"input",29),t.j41(81,"mat-hint"),t.EFF(82,"Escolha uma coluna j\xe1 existente referente \xe0 tabela selecionada"),t.k0s(),t.DNE(83,qe,2,0,"mat-error",10),t.k0s(),t.j41(84,"mat-form-field",27)(85,"mat-label"),t.EFF(86,"Nome alternativo"),t.k0s(),t.nrm(87,"input",30),t.j41(88,"mat-hint"),t.EFF(89,"Seguindo padr\xe3o Oracle"),t.k0s(),t.DNE(90,ta,2,0,"mat-error",10)(91,ea,2,0,"mat-error",10),t.k0s()()()()()}if(2&s){let v,W;const q=t.sdS(53);t.Y8G("formGroup",d.formulario),t.R7$(11),t.Y8G("ngForOf",d.fieldTypes),t.R7$(),t.Y8G("ngIf",d.f.tabelaTotvs.hasError("required")),t.R7$(2),t.Y8G("ngClass",t.eq3(28,zt,d.f.ps_table.disabled)),t.R7$(3),t.Y8G("value",!1),t.R7$(2),t.Y8G("value",!0),t.R7$(2),t.Y8G("ngClass",t.eq3(30,zt,7==(null==(v=d.formulario.get("fieldType").value)?null:v.id))),t.R7$(),t.Y8G("ngClass",t.eq3(32,zt,d.f.multivalue.disabled)),t.R7$(3),t.Y8G("value",!1),t.R7$(2),t.Y8G("value",!0)("disabled",7==(null==(W=d.formulario.get("fieldType").value)?null:W.id)),t.R7$(10),t.SpI(" ",!0===d.formulario.controls.integracaoRubeus.value?"Ativada":"Desativada"," "),t.R7$(),t.Y8G("ngClass",t.eq3(34,Je,d.hideRubeusFields)),t.R7$(3),t.Y8G("ngClass",t.eq3(36,zt,d.f.tabelaRubeus.disabled)),t.R7$(3),t.Y8G("value",!1),t.R7$(2),t.Y8G("value",!0),t.R7$(5),t.Y8G("matAutocomplete",q),t.R7$(),t.Y8G("displayWith",d.getOptionText),t.R7$(2),t.Y8G("ngForOf",t.bMT(55,26,d.filteredColumnRubeus)),t.R7$(4),t.Y8G("ngIf",d.f.colunaRubeus.hasError("required")),t.R7$(9),t.SpI(" ",!0===d.formulario.controls.integracaoTotvs.value?"Ativada":"Desativada"," "),t.R7$(),t.Y8G("ngClass",t.eq3(38,We,d.hideTotvsFields)),t.R7$(8),t.Y8G("ngIf",d.f.tabelaTotvs.hasError("required")),t.R7$(7),t.Y8G("ngIf",d.f.colunaTotvs.hasError("required")),t.R7$(7),t.Y8G("ngIf",d.f.nomeAlternativoTotvs.hasError("maxlength")),t.R7$(),t.Y8G("ngIf",d.f.nomeAlternativoTotvs.hasError("invalidCharacter"))}},dependencies:[m.YU,m.Sq,m.bT,_.qT,_.me,_.BC,_.cb,_.j4,_.JD,U.rl,U.nJ,U.MV,U.TL,at.VO,dt.wT,ot.fg,I.q,ct.sG,C.$3,C.pN,T.VT,T._g,E.DJ,E.BO,
1E.sA,E.G2,E.UI,et.PW,m.Jj],styles:[".ps-title-margin[_ngcontent-%COMP%]{color:gray;margin:25px 0}.ps-identity-container[_ngcontent-%COMP%]{padding:0 24px}@media (min-width: 960px){.ps-slide-toggle-cf[_ngcontent-%COMP%]{margin-top:0}}.disabled[_ngcontent-%COMP%]{color:#cbcbcb}.hideTotvsFields[_ngcontent-%COMP%], .hideRubeusFields[_ngcontent-%COMP%]{display:none}.mat-icon[_ngcontent-%COMP%]{height:34px;width:20px}.mat-icon[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{fill:#23bf6a}"]})}}return i})();function ia(i,h){if(1&i&&(t.j41(0,"div")(1,"p",4),t.EFF(2," Nenhuma configura\xe7\xe3o dispon\xedvel, o campo "),t.j41(3,"b"),t.EFF(4),t.k0s(),t.EFF(5," n\xe3o \xe9 multivalorado "),t.k0s()()),2&i){const o=t.XpG();t.R7$(4),t.JRh(o.dateField.label)}}function na(i,h){1&i&&(t.j41(0,"div")(1,"p",5),t.EFF(2," Nesta tela \xe9 poss\xedvel configurar a quantidade m\xednima e m\xe1xima de op\xe7\xf5es que o campo multivalorado pode receber. "),t.k0s()())}function sa(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",6)(1,"div",7)(2,"div",8)(3,"mat-form-field",9)(4,"mat-label"),t.EFF(5,"M\xednimo de op\xe7\xf5es"),t.k0s(),t.nrm(6,"input",10),t.k0s()(),t.j41(7,"div",8)(8,"mat-form-field",9)(9,"mat-label"),t.EFF(10,"M\xe1ximo de op\xe7\xf5es"),t.k0s(),t.nrm(11,"input",11),t.k0s()(),t.j41(12,"a",12),t.bIt("click",function(){t.eBV(o);const d=t.XpG();return d.f.min_multivalued_options.reset(null),t.Njj(d.f.max_multivalued_options.reset(null))}),t.EFF(13,"Limpar"),t.k0s()()()}}let ra=(()=>{class i{constructor(o){this.formBuilder=o}get f(){return this.formulario.controls}initFormulario(){this.formulario=this.formBuilder.group({min_multivalued_options:[this.dateField.min_multivalued_options??null],max_multivalued_options:[this.dateField.max_multivalued_options??null]}),this.formulario.valueChanges.subscribe(o=>{o.min_multivalued_options>o.max_multivalued_options?(this.formulario.patchValue({max_multivalued_options:o.min_multivalued_options},{emitEvent:!1}),this.dateField.min_multivalued_options=o.min_multivalued_options,this.dateField.max_multivalued_options=o.min_multivalued_options):(this.dateField.min_multivalued_options=o.min_multivalued_options,this.dateField.max_multivalued_options=o.max_multivalued_options)})}ngOnInit(){this.initFormulario()}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(_.ze))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-edit-form-multivalue"]],inputs:{dateFields:"dateFields",dateField:"dateField",editorMode:"editorMode"},decls:5,vars:4,consts:[[1,"",3,"formGroup"],[1,"ps-form-relation-field-container"],[4,"ngIf"],["class","ps-row","fxLayout","row",4,"ngIf"],[1,"ps_formBuilder_noValidators"],[1,"ps_multivalue_title"],["fxLayout","row",1,"ps-row"],["fxLayout","row","fxFlex","100","fxLayoutGap","30px"],["fxFlex","30"],["appearance","fill",2,"width","100%"],["min","0","matInput","","type","number","formControlName","min_multivalued_options"],["min","0","matInput","","type","number","formControlName","max_multivalued_options"],["mat-stroked-button","",1,"ps-clear-button",3,"click"]],template:function(s,d){1&s&&(t.j41(0,"form",0)(1,"div",1),t.DNE(2,ia,6,1,"div",2)(3,na,3,0,"div",2)(4,sa,14,0,"div",3),t.k0s()()),2&s&&(t.Y8G("formGroup",d.formulario),t.R7$(2),t.Y8G("ngIf",!d.dateField.multivalued),t.R7$(),t.Y8G("ngIf",d.dateField.multivalued),t.R7$(),t.Y8G("ngIf",d.dateField.multivalued))},dependencies:[m.bT,_.qT,_.me,_.Q0,_.BC,_.cb,_.VZ,_.j4,_.JD,j.It,U.rl,U.nJ,ot.fg,E.DJ,E.BO,E.UI],styles:[".ps-form-relation-field-container[_ngcontent-%COMP%]{padding:15px 24px 0}.ps_formBuilder_noValidators[_ngcontent-%COMP%]{font-size:14px;padding:5px;letter-spacing:.025em;line-height:129.2%;background:#ffb94630;border-radius:9px;text-align:center}.ps_multivalue_title[_ngcontent-%COMP%]{color:#00000080}.ps-clear-button[_ngcontent-%COMP%]{height:50%}"]})}}return i})();var la=n(90373);const da=["formViewer"];function ma(i,h){1&i&&t.nrm(0,"mat-tab",15),2&i&&t.Y8G("label",h.$implicit.name)}function pa(i,h){if(1&i){const o=t.RV6();t.j41(0,"app-edit-form-field",22),t.bIt("valueChanged",function(d){t.eBV(o);const v=t.XpG(3);return t.Njj(v.configChanged(d))}),t.k0s()}if(2&i){const o=h.$implicit,s=t.XpG(3);
1t.Y8G("formBuildInfo",o)("currentForm",s.fieldJson)}}function ca(i,h){if(1&i&&(t.j41(0,"div",20),t.DNE(1,pa,1,2,"app-edit-form-field",21),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("basic")),t.R7$(),t.Y8G("ngForOf",o.formEdit)}}function ua(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",19)(1,"app-edit-form-logic",23),t.bIt("valueChanged",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.logicChanged(d))}),t.k0s()()}if(2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("logic")),t.R7$(),t.Y8G("item",o.dataComponent)("keys",o.dataComponent.data.keys)("currentForm",o.fieldJson)}}function fa(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",19)(1,"app-edit-form-advanced",24),t.bIt("configChanged",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.validatorsConfigChanged(d))}),t.k0s()()}if(2&i){const o=t.XpG(2),s=t.sdS(3);t.Y8G("ngClass",o.isTabSelected("adv")),t.R7$(),t.Y8G("UpdatePaginationMatTab",s)("currentForm",o.currentForm)}}function _a(i,h){if(1&i&&(t.j41(0,"div",19),t.nrm(1,"app-edit-form-data",25),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("data")),t.R7$(),t.Y8G("dateField",o.fieldSettings)("currentForm",o.currentForm)("editorMode",o.editorMode)}}function ga(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",19)(1,"app-edit-form-identity",26),t.bIt("indentityFormValid",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.checkIndentyValid(d))})("indentityChange",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.identityChange(d))})("fieldRulesChange",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.fieldRulesChange(d))})("fieldRulesChangeOnCreate",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.fieldRulesChangeOnCreate(d))}),t.k0s()()}if(2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("identity")),t.R7$(),t.Y8G("crmFields",o.dataComponent.crmFields)("currentForm",o.fieldJson)("fieldSettings",o.fieldSettings)("creatingField",o.creatingField)("editorMode",o.editorMode)}}function ha(i,h){if(1&i&&(t.j41(0,"div",19),t.nrm(1,"app-edit-form-relation",27),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("relation")),t.R7$(),t.Y8G("dateFields",o.dataComponent)("dateField",o.fieldSettings)("editorMode",o.editorMode)}}function va(i,h){if(1&i&&(t.j41(0,"div",19),t.nrm(1,"app-edit-form-multivalue",27),t.k0s()),2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("multivalue")),t.R7$(),t.Y8G("dateFields",o.dataComponent)("dateField",o.fieldSettings)("editorMode",o.editorMode)}}function Ca(i,h){if(1&i){const o=t.RV6();t.j41(0,"div",19)(1,"app-edit-form-properties",28),t.bIt("valueChanged",function(d){t.eBV(o);const v=t.XpG(2);return t.Njj(v.propertiesConfigChanged(d))}),t.k0s()()}if(2&i){const o=t.XpG(2);t.Y8G("ngClass",o.isTabSelected("properties")),t.R7$(),t.Y8G("currentForm",o.fieldJson)}}function ba(i,h){if(1&i&&(t.j41(0,"div",16),t.DNE(1,ca,2,2,"div",17)(2,ua,2,4,"div",18)(3,fa,2,3,"div",18)(4,_a,2,4,"div",18)(5,ga,2,6,"div",18)(6,ha,2,4,"div",18)(7,va,2,4,"div",18)(8,Ca,2,2,"div",19),t.k0s()),2&i){const o=t.XpG();t.R7$(),t.Y8G("ngIf",o.haveTab("basic")),t.R7$(),t.Y8G("ngIf",o.haveTab("logic")),t.R7$(),t.Y8G("ngIf",o.haveTab("adv")),t.R7$(),t.Y8G("ngIf",o.haveTab("data")),t.R7$(),t.Y8G("ngIf",o.haveTab("identity")),t.R7$(),t.Y8G("ngIf",o.haveTab("relation")),t.R7$(),t.Y8G("ngIf",o.haveTab("multivalue")),t.R7$(),t.vxM(8,o.haveTab("properties")?8:-1)}}function Fa(i,h){if(1&i&&(t.j41(0,"div",32),t.nrm(1,"app-edit-form-viewer",33,1),t.k0s()),2&i){const o=t.XpG(2);t.R7$(),t.Y8G("fieldJson",o.fieldJson)}}function xa(i,h){if(1&i&&(t.j41(0,"div",29)(1,"div",30)(2,"div",3)(3,"span"),t.EFF(4,"Pr\xe9-visualiza\xe7\xe3o"),t.k0s()(),t.DNE(5,Fa,3,1,"div",31),t.k0s()()),2&i){const o=t.XpG();t.R7$(5),t.Y8G("ngForOf",o.reset)}}function ya(i,h){if(1&i){const o=t.RV6();t.j41(0,"button",34),t.bIt("click",function(){t.eBV(o);const d=t.XpG();return t.Njj(d.saveFieldEdit())}),t.EFF(1," Salvar "),t.k0s()}if(2&i){const o=t.XpG();t.Y8G("disabled",o.checkFieldValidity())}}function Ea(i,h){if(1&i){const o=t.RV6();t.j41(0,"button",34),t.bIt("click",function(){t.eBV(o);const d=t.XpG();return t.Njj(d.createField())}),t.EFF(1," Criar "),t.k0s()}if(2&i){const o=t.XpG();t.Y8G("disabled",null===o.fieldSettings||!1===o.indentityValid)}}let Ta=(()=>{class i{constructor(o,s,d,v,W,q,Ct,kt){this.dialogRef=o,this.dialogConfirmationService=s,this.dateComponent=d,this.systemFieldService=v,this.cdref=W,this.loaderService=q,this.formConfigDataSave=Ct,this.dialog=kt,this.currentFieldType="",this.indentityValid=!0,this.creatingField=!1,this.displayViewer=!1,this.fieldConfigValid=!0,this.fieldSettings={},this.reset=[{}],this.resetPopUp=[{}],this.editorMode=!1,this.saved=!1,this.invalidPropertiesByType={checkbox:["inputMask","case","format","copy","prefix","suffix","placeholder","decimalLimit","requireDecimal","optionsLabelPosition","inline"],datetime:["inputMask","copy","case","decimalLimit","requireDecimal","optionsLabelPosition","inline"],email:["format","decimalLimit","requireDecimal","optionsLabelPosition","inline"],number:["inputMask","copy","case","optionsLabelPosition","inline"],password:["decimalLimit","requireDecimal","optionsLabelPosition","inline"],radio:["inputMask","case","format","copy","prefix","suffix","placeholder","decimalLimit","requireDecimal"],textfield:["decimalLimit","requireDecimal","optionsLabelPosition","inline"],textarea:["decimalLimit","requireDecimal","optionsLabelPosition","inline"],select:["inputMask","case","format","copy","prefix","suffix","decimalLimit","requireDecimal","optionsLabelPosition","inline"]},this.formEdit=[],this.dataComponent=d.data}ngOnInit(){if("add"===this.dataComponent.data.action&&(this.creatingField=!0,this.definitions=[{id:"identity",name:"Identidade"}],this.selectedTab=0,this.fieldJson={components:[{}]}),"update"===this.dataComponent.data.action){this.fieldSettings=this.dataComponent.data,this.currentFieldType=this.fieldSettings.rubeus_field,this.creatingField=!1,this.definitions=[{id:"identity",name:"Identidade"},{id:"basic",name:"B\xe1sico"},{id:"multivalue",name:"Multivalorado"},{id:"adv",name:"Valida\xe7\xe3o"},{id:"data",name:"Dados"},{id:"properties",name:"Propriedades"},{id:"relation",name:"V\xednculos"}],this.selectedTab=1;const o={components:[JSON.parse(this.dataComponent.data.form_build)]};this.fieldJson=o,this.currentForm=this.fieldJson.components[0],this.currentForm.validate={},this.fieldType=this.currentForm.type,this.handleFieldType(this.fieldType)}if("edit"===this.dataComponent.data.action){this.fieldSettings=this.dataComponent.data,this.currentFieldType=this.fieldSettings.rubeus_field,this.creatingField=!1,this.editorMode=!0,this.definitions=[{id:"identity",name:"Identidade"},{id:"basic",name:"B\xe1sico"},{id:"multivalue",name:"Multivalorado"},{id:"adv",name:"Valida\xe7\xe3o"},{id:"logic",name:"L\xf3gica"},{id:"data",name:"Dados"},{id:"properties",name:"Propriedades"},{id:"relation",name:"V\xednculos"}],this.selectedTab=0;const o={components:[JSON.parse(this.dataComponent.data.form_build)]};this.fieldJson=o,this.currentForm=this.fieldJson.components[0],this.currentForm.validate={},this.fieldType=this.currentForm.type,this.selectedTab=1,this.handleTabs(this.fieldType),this.handleFieldType(this.fieldType)}}ngAfterContentChecked(){this.cdref.detectChanges()}fieldRulesChangeOnCreate(o){this.fieldRulesData=o}fieldRulesChange(o){this.currentFieldType!==o.fieldType&&(this.currentForm.format="",this.currentForm.inputMask="",this.currentForm.data={},this.currentForm.values=[],this.currentForm.predefinedOption=!1,this.fieldSettings.predefined_options=0,o.predefined&&(this.fieldSettings.predefined_options=1),"cpf"===o.pattern&&(this.currentForm.inputMask="999.999.999-99"),"cep"===o.pattern&&(this.currentForm.inputMask="99999-999"),"date"===o.pattern&&(this.currentForm.format="dd/MM/yyyy"),"datetime"===o.pattern&&(this.currentForm.format="dd/MM/yyyy hh:mm"),this.currentFieldType=this.fieldSettings.rubeus_field)}saveFieldEdit(){"add"===this.dataComponent.data.action?(this.saveDataInElement(),this.saveField(),this.dialogRef.close(this.dataComponent.data)):"update"===this.dataComponent.data.action?this.openConfimationUpdateData():"edit"===this.dataComponent.data.action&&(this.saveDataInElement(),this.dataComponent.result=!0,this.dialogRef.close(this.dataComponent.data))}openConfimationUpdateData(){const o=this.dialog.open(f.m,{width:"800px",height:"380px",data:{titleDialog:"Aten\xe7\xe3o",titleButton:"Salvar",component:J,edit_type:null,headerRed:!0},autoFocus:!1,disableClose:!0});o.beforeClosed().subscribe(s=>{"boolean"==typeof s&&s&&o.afterClosed().subscribe(d=>{this.dataComponent.data.update_all_fieldsettings=d.data.edit_type,this.saveDataInElement(),this.updateField(),this.dataComponent.result=!0,this.dialogRef.close(this.dataComponent.data)})})}saveField(){this.loaderService.setChangesLoaderState(!0),this.systemFieldService.create(this.dataComponent.data).subscribe(o=>{o.success?this.loaderService.setChangesLoaderState(!1,"Campo salvo com sucesso","ok","success"):this.loaderService.setChangesLoaderState(!1,"N\xe3o foi poss\xedvel salvar o campo, tente novamente mais tarde !","ok","alert")},o=>{this.loaderService.setChangesLoaderState(!1,o.body,"","error",o.title,1e5)})}updateField(){this.loaderService.setChangesLoaderState(!0),this.systemFieldService.create(this.dataComponent.data).subscribe(o=>{o.success?this.loaderService.setChangesLoaderState(!1,"Campo salvo com sucesso","ok","success"):this.loaderService.setChangesLoaderState(!1,"N\xe3o foi poss\xedvel salvar o campo, tente novamente mais tarde !","ok","alert")},o=>{this.loaderService.setChangesLoaderState(!1,o.body,"","error",o.title,1e5)})}saveDataInElement(){const o=this.cleanInvalidProperties(this.fieldJson.components[0]);if(this.dataComponent.data=Object.assign(this.dataComponent.data,this.fieldSettings),this.dataComponent.data.form_build=JSON.stringify(o),this.dataComponent.data.label=o.label,this.dataComponent.data.description=o.description,void 0===this.dataComponent.data.label&&(this.dataComponent.data.label=""),void 0===this.dataComponent.data.description&&(this.dataComponent.data.description=""),this.dataComponent.data.external_source){const s=this.dataComponent.data.external_source;null===s.http_methods_type_id&&null===s.link&&(this.dataComponent.data.external_source=null)}if(this.dataComponent.data.predefined_external_source){const s=this.dataComponent.data.predefined_external_source;null===s.http_methods_type_id&&null===s.link&&(this.dataComponent.data.predefined_external_source=null)}this.formatExternalSourceParametersFieldId(),this.saved=!0}
1cancelFieldEdit(){this.dialogRef.close()}cleanInvalidProperties(o){const s=o.type;if(!s||!this.invalidPropertiesByType[s])return o;const d=this.invalidPropertiesByType[s],v={...o};return d.forEach(W=>{v.hasOwnProperty(W)&&delete v[W]}),v}handleFieldType(o){this.formEdit=M.Rz,"radio"===o&&(this.formEdit=M.Wd),"checkbox"===o&&(this.formEdit=M.q9),"number"===o&&(this.formEdit=M.e7),"select"===o?(this.formEdit=M.R1,this.currentForm.customOptions=M.do):this.currentForm.customOptions&&(this.currentForm.customOptions={}),"content"===o&&(this.formEdit=M.yW),"container"===o&&(this.formEdit=M.s6),"datetime"===o?(this.formEdit=M.mh,this.currentForm.widget=M.me,(""===this.currentForm.format||null===this.currentForm.format||typeof this.currentForm.format>"u")&&(this.currentForm.format=M.me.format)):this.currentForm.widget&&"calendar"===this.currentForm.widget.type&&(this.currentForm.widget={})}handleTabs(o){"content"===o&&(this.definitions=this.definitions.filter(s=>"basic"===s.id||"logic"===s.id),this.selectedTab=0),"container"===o&&(this.definitions=this.definitions.filter(s=>"basic"===s.id||"logic"===s.id),this.selectedTab=0)}configChanged(o){this.currentForm=this.fieldJson.components[0],o.keyGroup?this.currentForm[o.keyGroup][o.key]=o.value:this.currentForm[o.key]=o.value,this.fieldJson.components[0]=this.currentForm,this.redraw()}validatorsConfigChanged(o){this.currentForm=this.fieldJson[0],this.currentForm=o,this.fieldJson[0]=this.currentForm,this.redraw()}logicChanged(o){this.currentForm=this.fieldJson[0],this.currentForm=o,this.fieldJson[0]=this.currentForm,this.redraw()}identityChange(o){this.creatingField?this.fieldSettings=Object.assign(this.fieldSettings,o.settings):(this.fieldSettings=Object.assign(this.fieldSettings,o.settings),this.fieldJson.components[0].type=this.fieldSettings.type,this.redraw(),this.handleFieldType(this.fieldSettings.type))}propertiesConfigChanged(o){this.currentForm.properties=o,this.fieldJson[0]=this.currentForm}createField(){this.fieldJson={components:[{label:this.fieldSettings.label,type:this.fieldSettings.type,validate:{}}]},this.currentForm=this.fieldJson.components[0],this.fieldType=this.currentForm.type,typeof this.fieldRulesData<"u"&&this.fieldRulesChange(this.fieldRulesData),this.saveDataInElement(),this.loaderService.setChangesLoaderState(!0),this.systemFieldService.create(this.dataComponent.data).subscribe(s=>{s.success?(this.fieldSettings=Object.assign(this.fieldSettings,s.data),this.fieldSettings=Object.assign(this.fieldSettings,{data_type:null,data_value:null,read_only:0,field_relation:[],relation_id:null,field_id:this.fieldSettings.id,external_source:null,predefined_external_source:null}),this.definitions=[{id:"identity",name:"Identidade"},{id:"basic",name:"B\xe1sico"},{id:"multivalue",name:"Multivalorado"},{id:"adv",name:"Valida\xe7\xe3o"},{id:"data",name:"Dados"},{id:"properties",name:"Propriedades"},{id:"relation",name:"V\xednculos"}],this.handleFieldType(this.fieldType),this.creatingField=!1,this.redraw(),this.resetPopup(),this.selectedTab=1,this.loaderService.setChangesLoaderState(!1)):this.loaderService.setChangesLoaderState(!1,"N\xe3o foi poss\xedvel salvar o campo, tente novamente mais tarde !","ok","alert")},s=>{this.loaderService.setChangesLoaderState(!1,s.body,"","error",s.title,1e5)})}checkIndentyValid(o){this.indentityValid=o}checkFieldValidity(){return!1===this.indentityValid||""===this.fieldJson.components[0].label.trim()||"INVALID"===this.formConfigDataSave.statusData||"INVALID"===this.formConfigDataSave.statusProperties}redraw(){this.reset[0]={}}resetPopup(){this.resetPopUp[0]={}}haveTab(o){let s=!1;return this.definitions.forEach(d=>{d.id===o&&(s=!0)}),s}isTabSelected(o){return this.definitions[this.selectedTab]&&this.definitions[this.selectedTab].id===o?"ps-dialog-config-form-field-container":"ps-dialog-config-form-field-container-hidden"}displayFormViewer(o){if(typeof o<"u")return"basic"===o.id||"adv"===o.id?(this.displayViewer=!0,!0):(this.displayViewer=!1,!1)}updatePaginationMatTab(o){o._tabHeader.updatePagination()}ngOnDestroy(){this.saved||this.formatExternalSourceParametersFieldId()}formatExternalSourceParametersFieldId(){this.dataComponent.data.external_source&&(this.dataComponent.data.external_source.active_paramn?this.dataComponent.data.external_source.parameters.filter(o=>{(0,e.Im)(o.field_id)&&(0,e.Im)(o.fixed_param)&&(0,e.Im)(o.fixed_value)&&(0,e.Im)(o.id)&&(0,e.Im)(o.name)&&null===o.parameter_type_id&&(this.dataComponent.data.external_source.parameters=[]),o.field_id&&(o.field_id=o.field_id.field_id)}):this.dataComponent.data.external_source.parameters=[]),this.dataComponent.data.predefined_external_source&&(this.dataComponent.data.predefined_external_source.active_paramn?this.dataComponent.data.predefined_external_source.parameters.filter(o=>{(0,e.Im)(o.field_id)&&(0,e.Im)(o.fixed_param)&&(0,e.Im)(o.fixed_value)&&(0,e.Im)(o.id)&&(0,e.Im)(o.name)&&null===o.parameter_type_id&&(this.dataComponent.data.predefined_external_source.parameters=[]),o.field_id&&(o.field_id=o.field_id.field_id)}):this.dataComponent.data.predefined_external_source.parameters=[])}static{this.\u0275fac=function(s){return new(s||i)(t.rXU(F.CP),t.rXU(k.L),t.rXU(f.m),t.rXU(a.a),t.rXU(t.gRc),t.rXU(Z.Z),t.rXU(st.C),t.rXU(F.bZ))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-dialog-form-config"]],viewQuery:function(s,d){if(1&s&&t.GBs(da,5),2&s){let v;t.mGM(v=t.lsd())&&(d.formViewer=v.first)}},decls:18,vars:7,consts:[["matTabGroup",""],["formViewer",""],["fxLayout","row wrap"],["fxFlex","100"],["mat-stretch-tabs","false",1,"ps-dialog-config-form-field-matgroup",3,"selectedTabChange","selectedIndexChange","animationDuration","selectedIndex"],[3,"label",4,"ngFor","ngForOf"],["class","ps_formBuilder_definitions","fxLayout","column","fxFlex","",4,"ngFor","ngForOf"],["class","ps_formBuilder_formCanvas","fxFlex","1 1 35","fxLayoutAlign","center start",4,"ngIf"],[1,"ps-form-save-bar",2,"height","56px"],["fxLayout","row"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center",1,"ps-form-save-bar",2,"height","100%"],[1,"ps-form-save-bar-buttons"],["mat-button","",2,"margin-right","15px",3,"click"],["mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],[3,"label"],["fxLayout","column","fxFlex","",1,"ps_formBuilder_definitions"],["fxLayout","row wrap","fxLayoutAlign","center center",3,"ngClass",4,"ngIf"],["fxLayout","row wrap",3,"ngClass",4,"ngIf"],["fxLayout","row wrap",3,"ngClass"],["fxLayout","row wrap","fxLayoutAlign","center center",3,"ngClass"],["fxFlex","100",3,"formBuildInfo","currentForm","valueChanged",4,"ngFor","ngForOf"],["fxFlex","100",3,"valueChanged","formBuildInfo","currentForm"],["fxFlex","100",3,"valueChanged","item","keys","currentForm"],["fxFlex","100",3,"configChanged","UpdatePaginationMatTab","currentForm"],["fxFlex","100",3,"dateField","currentForm","editorMode"],[2,"width","100%",3,"indentityFormValid","indentityChange","fieldRulesChange","fieldRulesChangeOnCreate","crmFields","currentForm","fieldSettings","creatingField","editorMode"],["fxFlex","100",3,"dateFields","dateField","editorMode"],["fxFlex","100",3,"valueChanged","currentForm"],["fxFlex","1 1 35","fxLayoutAlign","center start",1,"ps_formBuilder_formCanvas"],["fxLayout","column","fxFlex","100"],["class","ps_formBuilder_formViewer","fxFlex","100","fxLayoutAlign","center center",4,"ngFor","ngForOf"],["fxFlex","100","fxLayoutAlign","center center",1,"ps_formBuilder_formViewer"],[3,"fieldJson"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(s,d){if(1&s){const v=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"mat-tab-group",4,0),t.bIt("selectedTabChange",function(){t.eBV(v);const q=t.sdS(3);return t.Njj(d.updatePaginationMatTab(q))}),t.mxI("selectedIndexChange",function(q){return t.eBV(v),t.DH7(d.selectedTab,q)||(d.selectedTab=q),t.Njj(q)}),t.DNE(4,ma,1,1,"mat-tab",5),t.k0s()(),t.DNE(5,ba,9,8,"div",6)(6,xa,6,1,"div",7),t.k0s(),t.j41(7,"div",8)(8,"div",9)(9,"div",3),t.nrm(10,"mat-divider"),t.k0s()(),t.j41(11,"div",10)(12,"div",11)(13,"div",12)(14,"button",13),t.bIt("click",function(){return t.eBV(v),t.Njj(d.cancelFieldEdit())}),t.EFF(15," Cancelar "),t.k0s(),t.DNE(16,ya,2,1,"button",14)(17,Ea,2,1,"button",14),t.k0s()()()()}if(2&s){const v=t.sdS(3);t.R7$(2),t.Y8G("animationDuration","0"),t.R50("selectedIndex",d.selectedTab),t.R7$(2),t.Y8G("ngForOf",d.definitions),t.R7$(),t.Y8G("ngForOf",d.resetPopUp),t.R7$(),t.Y8G("ngIf",!d.creatingField&&"content"!==d.fieldType&&d.displayFormViewer(d.definitions[v.selectedIndex])),t.R7$(10),t.Y8G("ngIf",!d.creatingField),t.R7$(),t.Y8G("ngIf",d.creatingField)}},dependencies:[m.YU,m.Sq,m.bT,j.$z,Q.mq,Q.T8,I.q,E.DJ,E.sA,E.G2,E.UI,et.PW,lt,jt,Rt.S,Et,Ve,je.y,we,oa,ra,la.r],styles:[".ps_formBuilder_formCanvas[_ngcontent-%COMP%]{max-width:35%;min-height:400px;display:flex;height:100%;margin:25px}.ps_formBuilder_fields[_ngcontent-%COMP%]{overflow:hidden;min-height:450px}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]{height:100%}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]     mat-mdc-tab-body .mat-mdc-tab-body-content{overflow:unset!important}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]     .mat-mdc-tab-header .mat-mdc-tab{padding:0 12px;min-width:135px}.ps-form-edit-dialog-footer[_ngcontent-%COMP%]{height:50px}.ps_formBuilder_definitions[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.12);overflow:auto;height:477px}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-track{box-shadow:inset 0 0 6px #00000057;border-radius:0;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:0;box-shadow:inset 0 0 6px #0000;background-color:#a9a9a96e}.ps_formBuilder_formViewer[_ngcontent-%COMP%]{margin-top:20px;max-height:460px}.ps_formBuilder_formViewer[_ngcontent-%COMP%]   app-edit-form-viewer[_ngcontent-%COMP%]{overflow-wrap:break-word;min-height:360px;width:70%}span[_ngcontent-%COMP%]{font-family:Roboto,Helvetica Neue,sans-serif;font-style:normal;font-weight:500;font-size:16px;line-height:24px;color:#4d4d4d}.ps-form-save-bar-buttons[_ngcontent-%COMP%]{margin:0 20px}.ps-form-save-bar[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;left:0;min-height:unset;width:100%;padding:0;margin:0}.slide-in-right[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slide-in-right .5s cubic-bezier(.25,.46,.45,.94) both;display:block}@keyframes _ngcontent-%COMP%_slide-in-right{0%{transform:translate(1000px);opacity:0}
1to{transform:translate(0);opacity:1}}.slide-out-right[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slide-out-right .5s cubic-bezier(.55,.085,.68,.53) both;display:none!important}@keyframes _ngcontent-%COMP%_slide-out-right{0%{transform:translate(0);opacity:1}to{transform:translate(1000px);opacity:0}}  .ps-dialog-config-form-field-content-overflow-hidden{height:calc(100% - 39px)!important;margin-bottom:0!important}  .ps-dialog-config-form-field-content-overflow-hidden mat-dialog-content{overflow:hidden!important;height:100%}  .ps-dialog-config-form-field-content-overflow-hidden .mat-mdc-dialog-content{overflow:hidden!important;height:100%}  .ps-dialog-config-form-field-content{height:calc(100% - 39px)!important;margin-bottom:0!important}  .ps-dialog-config-form-field-content .mat-mdc-dialog-content{height:100%}.ps-dialog-config-form-field-container[_ngcontent-%COMP%]{display:flex!important;padding-bottom:20px}.ps-dialog-config-form-field-container-hidden[_ngcontent-%COMP%]{display:none!important}.ps-dialog-config-form-field-nopadding-container[_ngcontent-%COMP%]{padding:0!important;height:100%}.ps-dialog-config-form-field-matgroup[_ngcontent-%COMP%]{height:100%}.ps-dialog-config-form-field-matgroup[_ngcontent-%COMP%]     .mat-mdc-tab-body-wrapper{height:100%}.ps-dialog-config-form-field-matgroup[_ngcontent-%COMP%]     .mat-mdc-tab-body-wrapper .mat-mdc-tab-body-content{height:100%;overflow-x:hidden;overflow-y:auto}"]})}}return i})()},82325:(nt,B,n)=>{n.d(B,{h:()=>xt});var f=n(89417),M=n(81439),a=n(93337),e=n(54438),_=n(34006),t=n(82201),m=n(32575),j=n(1097),I=n(60033),F=n(60177),T=n(88834),E=n(32102),P=n(82798),J=n(86600),k=n(96850),Z=n(59042),st=n(71997),Q=n(99213),et=n(14823),lt=n(30450),ut=n(5951),U=n(52920),at=n(16038),dt=n(54117),ot=n(71387),rt=n(69697),ft=n(93181);const ct=()=>({enabled:!1}),H=L=>({minimap:L,autoIndent:"full"});function _t(L,tt){1&L&&e.nrm(0,"mat-tab",17),2&L&&e.Y8G("label",tt.$implicit.name)}function D(L,tt){1&L&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio. "),e.k0s())}function w(L,tt){if(1&L&&(e.j41(0,"div",18)(1,"div",19)(2,"div",20)(3,"mat-form-field",21)(4,"mat-label"),e.EFF(5,"Tipo de componente"),e.k0s(),e.j41(6,"mat-select",22)(7,"mat-option",23),e.EFF(8,"HTML"),e.k0s()()()(),e.j41(9,"div",20)(10,"mat-form-field",21)(11,"mat-label"),e.EFF(12,"Nome"),e.k0s(),e.nrm(13,"input",24),e.DNE(14,D,2,0,"mat-error",25),e.k0s()()()()),2&L){const c=e.XpG();e.Y8G("ngClass",c.isTabSelected("general")),e.R7$(14),e.Y8G("ngIf",c.f.name.hasError("required"))}}function z(L,tt){1&L&&(e.j41(0,"div",41)(1,"div",2)(2,"mat-form-field",32)(3,"mat-label"),e.EFF(4,"Classe CSS"),e.k0s(),e.nrm(5,"input",42),e.k0s()()())}function it(L,tt){1&L&&(e.j41(0,"mat-icon",46),e.EFF(1,"visibility_off"),e.k0s())}function bt(L,tt){if(1&L&&(e.j41(0,"div",43)(1,"mat-slide-toggle",44),e.EFF(2," Esconder "),e.k0s(),e.DNE(3,it,2,0,"mat-icon",45),e.k0s()),2&L){const c=e.XpG(2);e.R7$(),e.Y8G("color","primary"),e.R7$(2),e.Y8G("ngIf",c.fieldJson.components[0].hidden&&c.f.hidden.value)}}function Ft(L,tt){if(1&L&&(e.j41(0,"div",18)(1,"div",26)(2,"div",27)(3,"span",28),e.EFF(4,"Escolha o tipo de c\xf3digo"),e.k0s(),e.j41(5,"mat-radio-group",29)(6,"mat-radio-button",30),e.EFF(7,"HTML"),e.k0s(),e.j41(8,"mat-radio-button",31),e.EFF(9,"Script"),e.k0s()()()(),e.j41(10,"div",26)(11,"div",2)(12,"mat-form-field",32)(13,"mat-label"),e.EFF(14,"Tag HTML"),e.k0s(),e.nrm(15,"input",33),e.k0s()()(),e.DNE(16,z,6,0,"div",34),e.j41(17,"div",35)(18,"div",36),e.nrm(19,"app-adds-pareaments",37),e.k0s()(),e.j41(20,"div",35)(21,"span",38),e.EFF(22,"Conte\xfado"),e.k0s(),e.nrm(23,"td-code-editor",39),e.k0s(),e.DNE(24,bt,4,2,"div",40),e.k0s()),2&L){const c=e.XpG();e.Y8G("ngClass",c.isTabSelected("basic")),e.R7$(15),e.Y8G("readonly","script"===c.f.code.value),e.R7$(),e.Y8G("ngIf","script"!==c.f.code.value),e.R7$(3),e.Y8G("systemFields",c.standardFields)("fxFlex","auto")("parameters",c.parameters)("formulario",c.formulario),e.R7$(4),e.Y8G("editorOptions",e.eq3(11,H,e.lJ4(10,ct)))("language",c.language),e.R7$(),e.Y8G("ngIf","script"!==c.f.code.value)}}function $(L,tt){if(1&L){const c=e.RV6();e.j41(0,"div",18)(1,"app-edit-form-logic",47),e.bIt("valueChanged",function(p){e.eBV(c);const V=e.XpG();return e.Njj(V.logicChanged(p))}),e.k0s()()}if(2&L){const c=e.XpG();e.Y8G("ngClass",c.isTabSelected("logic")),e.R7$(),e.Y8G("item",c.dataComponent)("keys",c.dataComponent.data.keys)("currentForm",c.fieldJ
1son)}}function mt(L,tt){if(1&L&&(e.j41(0,"div",51),e.nrm(1,"app-edit-form-viewer",52,0),e.k0s()),2&L){const c=e.XpG(2);e.R7$(),e.Y8G("fieldJson",c.fieldJson)}}function y(L,tt){if(1&L){const c=e.RV6();e.j41(0,"div",48)(1,"div",2)(2,"span"),e.EFF(3,"Pr\xe9-visualiza\xe7\xe3o"),e.k0s()(),e.DNE(4,mt,3,1,"div",49),e.j41(5,"button",50),e.bIt("click",function(){e.eBV(c);const p=e.XpG();return e.Njj(p.openCanvas())}),e.j41(6,"mat-icon"),e.EFF(7,"arrow_forward"),e.k0s()()()}if(2&L){const c=e.XpG();e.R7$(4),e.Y8G("ngForOf",c.reset)}}function Y(L,tt){if(1&L){const c=e.RV6();e.j41(0,"button",53),e.bIt("click",function(){e.eBV(c);const p=e.XpG();return e.Njj(p.openCanvas())}),e.j41(1,"mat-icon"),e.EFF(2,"arrow_back"),e.k0s()()}}function N(L,tt){if(1&L){const c=e.RV6();e.j41(0,"button",54),e.bIt("click",function(){e.eBV(c);const p=e.XpG();return e.Njj(p.clickSaveAsNewCustomComponent())}),e.EFF(1," Salvar como novo "),e.k0s()}if(2&L){const c=e.XpG();e.Y8G("disabled",c.validHTML(c.f.content.value)||c.f.name.hasError("required")||c.invalidLogic)}}function pt(L,tt){if(1&L){const c=e.RV6();e.j41(0,"button",55),e.bIt("click",function(){e.eBV(c);const p=e.XpG();return e.Njj(p.clickCustomComponent())}),e.EFF(1," Salvar "),e.k0s()}if(2&L){const c=e.XpG();e.Y8G("disabled",c.validHTML(c.f.content.value)||c.f.name.hasError("required")||c.invalidLogic)}}function ht(L,tt){if(1&L){const c=e.RV6();e.j41(0,"button",55),e.bIt("click",function(){e.eBV(c);const p=e.XpG();return e.Njj(p.saveFieldEdit())}),e.EFF(1," Salvar "),e.k0s()}if(2&L){const c=e.XpG();e.Y8G("disabled",c.validHTML(c.f.content.value)||c.f.name.hasError("required")||c.invalidLogic)}}let xt=(()=>{class L{constructor(c,R,p,V,S,vt,yt,Ot){this.formBuilder=c,this.dialog=R,this.dialogRef=p,this.dialogConfirmationService=V,this.dateComponent=S,this.systemComponentsService=vt,this.serviceConfirm=yt,this.addsPareamentsService=Ot,this.reset=[{}],this.resetPopUp=[{}],this.language="html",this.canvas=!1,this.usedButtons=!1,this.invalidLogic=!1,this.definitions=[],this.main_component=!1,this.dataComponent=S.data,this.dataComponent.data.save_as_new=!1}ngOnInit(){this.oldParameters=this.dataComponent.data.parameters,this.definitions=[{id:"general",name:"Geral"},{id:"basic",name:"B\xe1sico"},{id:"logic",name:"L\xf3gica"}],this.selectedTab=0;const c={components:[JSON.parse(this.dataComponent.data.form_build)]};this.standardFields=this.dataComponent.standardFields,this.fieldJson=c,this.main_component=this.dataComponent.data?.main_component||!1,this.initForm(this.fieldJson.components[0])}initForm(c){this.formulario=this.formBuilder.group({name:[c.name,[f.k0.required]],tag:[c.tag],class:[c.className],content:[c.content],parameters:this.formBuilder.array([],a.W.slideToggle()),hidden:[c.hidden],code:[c.psCodeType],active_paramn:[!1]}),"script"===this.f.code.value?(this.language="javascript",this.setDisplayLogicTab(!1),this.definitions.splice(2,1)):"html"===this.f.code.value&&(this.language="html"),this.dataComponent.data.parameters?.length>0&&(this.formulario.patchValue({active_paramn:!0}),this.addsPareamentsService.setValuesParameters(this.dataComponent.data.parameters)),this.formulario.valueChanges.subscribe(R=>{this.fieldJson.components[0].psCodeType!=R.code&&("script"===R.code?(c.conditionalData&&c.conditionalData.enable&&(c.conditionalData.enable=!1),R.tag="script",this.f.tag.setValue("script",{emitEvent:!1}),this.language="javascript",this.setDisplayLogicTab(!1)):"html"===R.code&&(R.tag="p",this.f.tag.setValue("p",{emitEvent:!1}),this.language="html",this.setDisplayLogicTab(!0))),this.fieldJson.components[0].name=R.name,R.tag&&""===R.tag.trim()&&(R.tag="div",this.f.tag.setValue(R.tag,{emitEvent:!1})),this.fieldJson.components[0].tag=R.tag,this.fieldJson.components[0].className=R.class,this.fieldJson.components[0].content=R.content,this.fieldJson.components[0].hidden=R.hidden,this.fieldJson.components[0].psCodeType=R.code,this.fieldJson.components[0].attrs=this.formatAttributes(R.parameters,R.active_paramn),this.dataComponent.data.use_parameters=R.active_paramn?1:0,this.dataComponent.data.parameters=R.parameters,this.redraw()})}formatAttributes(c,R){const p=[];return R&&Array.isArray(c)&&c.length>
10&&c.forEach(V=>{2==V.parameter_type_id&&p.push({attr:V.name,value:V.fixed_value})}),p}setDisplayLogicTab(c){c?this.definitions.splice(2,0,{id:"logic",name:"L\xf3gica"}):this.definitions.splice(2,1)}saveFieldEdit(){this.usedButtons=!0,"edit"===this.dataComponent.data.action&&(this.saveDataInElement(),this.dataComponent.result=!0,this.dialogRef.close(this.dataComponent.data))}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(c=>{c&&(this.dataComponent.data.action="add",this.dataComponent.data.save_as_new=!0,this.saveCustomComponent())})}clickCustomComponent(){this.dataComponent.data?.id?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(c=>{c&&this.saveCustomComponent()}):this.saveCustomComponent()}saveCustomComponent(){this.usedButtons=!0,this.saveDataInElement(),this.fillConditionalData(JSON.parse(this.dataComponent.data.form_build));const c={content:{...this.dataComponent.data}};delete c.content.keys,this.systemComponentsService.create(c).subscribe(R=>{R.success?(this.dataComponent.result=!0,this.dataComponent.data={...this.dataComponent.data,...R.data},this.dialogRef.close(this.dataComponent.data)):(this.dataComponent.result=!1,this.dialogRef.close())})}fillConditionalData(c){this.dataComponent.data.logic_enabled=c.logic_enabled,this.dataComponent.data.action_logic_id=c.action_logic_id,this.dataComponent.data.condition_logic_id=c.condition_logic_id,this.dataComponent.data.logics=c.logics}ngOnDestroy(){this.usedButtons||this.cancelFieldEdit()}cancelFieldEdit(){this.dataComponent.result=!1,this.dataComponent.data.parameters=this.oldParameters,this.dialogRef.close()}saveDataInElement(){const c=this.fieldJson.components[0];this.dataComponent.data.form_build=JSON.stringify(c),this.dataComponent.data.name=c.name,this.dataComponent.data.description=c.description,this.dataComponent.data.use_parameters?this.dataComponent.data.parameters.filter(R=>{R.field_id&&(R.field_id=R.field_id.field_id)}):this.dataComponent.data.parameters=[]}openCanvas(){this.canvas=!this.canvas}validHTML(c){if("html"===this.language){let R,p;return R=(c=(c=c.replace(/<[^>]*\/\s?>/g,"")).replace(/<(br|hr|img).*?>/g,"")).match(/<[^\/].*?>/g)||[],p=c.match(/<\/.+?>/g)||[],R.length!==p.length}return!1}logicChanged(c){this.verifyLogic(c),this.fieldJson.components[0]=c,this.redraw()}checkLogicRuleValue(c){return!(![3,4].includes(c.rule_logic_id)&&null==c.fixed_value&&!c.fixed_value)}verifyLogic(c){if(c.logic_enabled)if(c.condition_logic_id&&c.action_logic_id)if(c.logics.length>0){const R=c.logics.every(p=>p.field_compare_id&&p.rule_logic_id&&this.checkLogicRuleValue(p));this.invalidLogic=!R}else this.invalidLogic=!1;else this.invalidLogic=!0;else this.invalidLogic=!1}redraw(){this.reset[0]={}}resetPopup(){this.resetPopUp[0]={}}haveTab(c){let R=!1;return this.definitions.forEach(p=>{p.id===c&&(R=!0)}),R}isTabSelected(c){return this.definitions[this.selectedTab]&&this.definitions[this.selectedTab].id===c?"ps-dialog-config-form-field-container":"ps-dialog-config-form-field-container-hidden"}get f(){return this.formulario.controls}static{this.\u0275fac=function(R){return new(R||L)(e.rXU(f.ze),e.rXU(_.bZ),e.rXU(_.CP),e.rXU(t.L),e.rXU(m.m),e.rXU(M.x),e.rXU(j.G),e.rXU(I.g))}}static{this.\u0275cmp=e.VBU({type:L,selectors:[["app-dialog-html-component-config"]],decls:23,vars:11,consts:[["formViewer",""],["fxLayout","row wrap",1,"ps_html_container"],["fxFlex","100"],["mat-stretch-tabs","false",1,"ps_formBuilder_tabGroup",3,"selectedIndexChange","selectedIndex"],[3,"label",4,"ngFor","ngForOf"],["fxFlex","",1,"ps_formBuilder_definitions",3,"formGroup"],["fxLayout","row wrap",3,"ngClass",4,"ngIf"],["class","ps_formBuilder_formCanvas","fxLayout","row wrap","fxFlex","1 1 35","fxLayoutAlign","center center",4,"ngIf"],["title","Pr\xe9-visualiza\xe7\xe3o","mat-mini-fab","","color","primary","class","ps_open_canvas_button",3,"click",4,"ngIf"],[1,"ps-form-save-bar",2,"height","51px"],["fxLayout","row"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center",1,"ps-form-save-bar",2,"height","100%"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["mat-stroked-button","","color","primary",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],[3,"label"],["fxLayout","row wrap",3,"ngClass"],["fxLayout","row","fxFlex","100","fxLayoutGap","20px",1,"ps-row"],["fxFlex","30"],["appearance","fill","required",""],["value","html","required","","disabled",""],["value","html"],["matInput","","formControlName","name"],[4,"ngIf"],["fxLayout","row","fxFlex","98",1,"ps-row"],["fxLayout","row wrap","fxFlex","100"],["fxFlex","100",2,"margin-bottom","20px"],["formControlName","code"],["color","primary","value","html",2,"margin-right","20px"],["color","primary","value","script"],["fxFlex","","appearance","fill"],["matInput","","formControlName","tag",3,"readonly"],["fxFlex","98","fxLayout","row","class","ps-row",4,"ngIf"],["fxLayout","row wrap","fxFlex","98",1,"ps-row"],["fxFlex","","fxLayout","row wrap",1,"ps_formBuilder_rules"],["nameToggle","Usar atributos",3,"systemFields","fxFlex","parameters","formulario"],["fxFlex","100",2,"color","#837e7e"],["fxFlex","100","formControlName","content","theme","vs-dark","flex","",1,"ps_formBuilder_editor",2,"height","300px",3,"disabled","editorOptions","language"],["fxFlex","100","fxLayout","row","class","ps-row",4,"ngIf"],["fxFlex","98","fxLayout","row",1,"ps-row"],["matInput","","formControlName","class"],["fxFlex","100","fxLayout","row",1,"ps-row"],["formControlName","hidden",3,"color"],["matTooltip","Este campo ficar\xe1 inicialmente oculto","matTooltipPosition","after","matTooltipClass","ps-tooltip-content","class","ps-option-badge-icon",4,"ngIf"],["matTooltip","Este campo ficar\xe1 inicialmente oculto","matTooltipPosition","after","matTooltipClass","ps-tooltip-content",1,"ps-option-badge-icon"],["fxFlex","100",3,"valueChanged","item","keys","currentForm"],["fxLayout","row wrap","fxFlex","1 1 35","fxLayoutAlign","center center",1,"ps_formBuilder_formCanvas"],["class","ps_formBuilder_formViewer","fxFlex","100","fxLayoutAlign","center center",4,"ngFor","ngForOf"],["t
1itle","Pr\xe9-visualiza\xe7\xe3o","mat-mini-fab","","color","primary",1,"ps_close_canvas_button",3,"click"],["fxFlex","100","fxLayoutAlign","center center",1,"ps_formBuilder_formViewer"],[3,"fieldJson"],["title","Pr\xe9-visualiza\xe7\xe3o","mat-mini-fab","","color","primary",1,"ps_open_canvas_button",3,"click"],["mat-stroked-button","","color","primary",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(R,p){1&R&&(e.j41(0,"div",1)(1,"div",2)(2,"mat-tab-group",3),e.mxI("selectedIndexChange",function(S){return e.DH7(p.selectedTab,S)||(p.selectedTab=S),S}),e.DNE(3,_t,1,1,"mat-tab",4),e.k0s()(),e.j41(4,"form",5)(5,"div",2),e.DNE(6,w,15,2,"div",6)(7,Ft,25,13,"div",6)(8,$,2,4,"div",6),e.k0s()(),e.DNE(9,y,8,1,"div",7)(10,Y,3,0,"button",8),e.k0s(),e.j41(11,"mat-dialog-actions",9)(12,"div",10)(13,"div",2),e.nrm(14,"mat-divider"),e.k0s()(),e.j41(15,"div",11)(16,"div",12)(17,"div",13)(18,"button",14),e.bIt("click",function(){return p.cancelFieldEdit()}),e.EFF(19," Cancelar "),e.k0s(),e.DNE(20,N,2,1,"button",15)(21,pt,2,1,"button",16)(22,ht,2,1,"button",16),e.k0s()()()()),2&R&&(e.R7$(2),e.R50("selectedIndex",p.selectedTab),e.R7$(),e.Y8G("ngForOf",p.definitions),e.R7$(),e.Y8G("formGroup",p.formulario),e.R7$(2),e.Y8G("ngIf",p.haveTab("general")),e.R7$(),e.Y8G("ngIf",p.haveTab("basic")),e.R7$(),e.Y8G("ngIf",p.haveTab("logic")),e.R7$(),e.Y8G("ngIf","basic"===p.definitions[p.selectedTab].id&&"script"!==p.f.code.value&&p.canvas),e.R7$(),e.Y8G("ngIf","basic"===p.definitions[p.selectedTab].id&&"script"!==p.f.code.value&&!p.canvas),e.R7$(10),e.Y8G("ngIf",p.main_component&&(null==p.dataComponent.data?null:p.dataComponent.data.id)),e.R7$(),e.Y8G("ngIf",p.main_component),e.R7$(),e.Y8G("ngIf",!p.main_component))},dependencies:[F.YU,F.Sq,F.bT,f.qT,f.me,f.BC,f.cb,f.j4,f.JD,T.$z,T.$0,E.rl,E.nJ,E.TL,P.VO,J.wT,k.mq,k.T8,Z.fg,st.q,Q.An,et.oV,lt.sG,_.E7,ut.VT,ut._g,U.DJ,U.BO,U.sA,U.G2,U.UI,at.PW,dt.S,ot.y,rt.A,ft.go],styles:[".ps_formBuilder_formCanvas[_ngcontent-%COMP%]{display:flex;height:100%;margin:25px;max-width:35%;position:relative}.ps_close_canvas_button[_ngcontent-%COMP%]{position:absolute;top:-25px;left:-48px}.ps_open_canvas_button[_ngcontent-%COMP%]{position:absolute;top:49px;right:0}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]{height:100%}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]     mat-mdc-tab-body .mat-mdc-tab-body-content{overflow:unset!important}.ps-dialog-config-form-field-container[_ngcontent-%COMP%]{min-height:450px;padding:15px 24px 0;display:flex!important}.ps-dialog-config-form-field-container-hidden[_ngcontent-%COMP%]{display:none!important}.ps-option-badge-icon[_ngcontent-%COMP%]{padding:5px;border-radius:24px;background:gray;font-size:14px;margin-left:15px;height:14px;color:#fff;width:14px}.ps-form-edit-dialog-footer[_ngcontent-%COMP%]{height:50px}.ps_formBuilder_editor[_ngcontent-%COMP%]{max-width:97%;border:1px solid rgba(0,0,0,.6)}.ps_formBuilder_definitions[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.12);overflow:auto;width:100%;height:482px}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-track{box-shadow:inset 0 0 6px #00000057;border-radius:0;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:0;box-shadow:inset 0 0 6px #0000;background-color:#a9a9a96e}.ps_formBuilder_formViewer[_ngcontent-%COMP%]{margin-top:50px;max-height:550px}.ps_formBuilder_formViewer[_ngcontent-%COMP%]   app-edit-form-viewer[_ngcontent-%COMP%]{overflow-wrap:break-word;min-height:200px;max-height:350px;width:70%}span[_ngcontent-%COMP%]{font-family:Poppins;font-style:normal;font-weight:500;font-size:16px;line-height:24px;color:#4d4d4d}.ps_formBuilder_rule[_ngcontent-%COMP%]{padding:15px 0 0 15px;margin:10px 0;position:relative}.ps_formBuilder_rule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{position:absolute;top:0;right:0;outline:none}.ps_formBuilder_rule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_addRule[_ngcontent-%COMP%]{margin-bottom:20px}.ps_formBuilder_addRule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{display:flex}.ps_formBuilder_addRule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:26px}.ps_html_container[_ngcontent-%COMP%]{position:relative}.ps-form-save-bar-buttons[_ngcontent-%COMP%]{margin:0 20px}.ps-form-save-bar[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;left:0;min-height:unset;width:100%;padding:0;margin:0}.ps-theme-button-content[_ngcontent-%COMP%]   .mat-mdc-radio-button[_ngcontent-%COMP%]{margin-right:20px}.ps-theme-button-content[_ngcontent-%COMP%]   .mat-mdc-radio-button[_ngcontent-%COMP%]:last-of-type{margin-right:0}  .ps-dialog-config-button-picked-color .rbPalleteColorActions{padding:0;margin-bottom:20px}  .ps-dialog-config-button-picked-color .rbPalleteColorActions .rb-title-palette{margin-top:0;margin-bottom:20px}  .ps-dialog-config-button-content{height:calc(100% - 90px)!important;margin-bottom:50px!important}  .rbPalleteColorActions{position:relative}  .rbPalleteColorActions .color-picker{position:absolute!important;top:95px!important;left:6px!important;margin-bottom:10px}.attr-tip[_ngcontent-%COMP%]{color:#ffb946;font-size:12px;margin:10px 0;font-weight:500}mat-form-field[_ngcontent-%COMP%]{width:100%}"]})}}return L})()},71929:(nt,B,n)=>{n.d(B,{Z:()=>Nt});var f=n(81439),M=n(70434),a=n(54438),e=n(32575),_=n(34006),t=n(1097),m=n(60177),j=n(88834),I=n(96850),F=n(71997),T=n(52920),E=n(89417),P=n(32102),J=n(82798),k=n(86600),Z=n(
159042);function st(b,A){1&b&&(a.j41(0,"mat-error"),a.EFF(1," Campo obrigat\xf3rio "),a.k0s())}let Q=(()=>{class b{constructor(l){this.formBuilder=l}ngOnInit(){this.formulario=this.formBuilder.group({type:[{value:"lgpd",disabled:!0}],name:[this.dataComponent.data.data.name,E.k0.required]}),this.changedValues()}changedValues(){this.formulario.valueChanges.subscribe(l=>{this.dataComponent.data.data.name=l.name})}static{this.\u0275fac=function(C){return new(C||b)(a.rXU(E.ze))}}static{this.\u0275cmp=a.VBU({type:b,selectors:[["app-general-lgpd-config"]],inputs:{dataComponent:"dataComponent"},decls:15,vars:2,consts:[[3,"formGroup"],["fxLayout","row","fxLayoutGap","20px","fxFlex","80",1,"ps-row"],["fxFlex",""],["appearance","fill","fxFlex",""],["formControlName","type"],["value","lgpd"],["matInput","","formControlName","name","required",""],[4,"ngIf"]],template:function(C,O){1&C&&(a.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),a.EFF(5,"Tipo de componente"),a.k0s(),a.j41(6,"mat-select",4)(7,"mat-option",5),a.EFF(8,"Aceite de termos LGPD"),a.k0s()()()(),a.j41(9,"div",2)(10,"mat-form-field",3)(11,"mat-label"),a.EFF(12,"Nome"),a.k0s(),a.nrm(13,"input",6),a.DNE(14,st,2,0,"mat-error",7),a.k0s()()()()),2&C&&(a.Y8G("formGroup",O.formulario),a.R7$(14),a.Y8G("ngIf",O.formulario.controls.name.hasError("required")))},dependencies:[m.bT,E.qT,E.me,E.BC,E.cb,E.YS,E.j4,E.JD,P.rl,P.nJ,P.TL,J.VO,k.wT,Z.fg,T.DJ,T.BO,T.UI]})}}return b})();var et=n(99213),lt=n(71387),ut=n(85139),U=n(2969),at=n(1875),dt=n(99172),ot=n(96354),rt=n(36471),ft=n(82765),ct=n(60850),H=n(9454),_t=n(16038);const D=["signatureInput"],w=["autocompleteSignatures"],z=b=>({signatureInvalid:b});function it(b,A){if(1&b&&(a.j41(0,"mat-option",25),a.EFF(1),a.k0s()),2&b){const l=A.$implicit,C=a.XpG(3);a.Y8G("value",l)("disabled",C.disablesAlreadySelectedSignatures(l)),a.R7$(),a.SpI(" ",l.assinatura," ")}}function bt(b,A){if(1&b&&a.nrm(0,"app-textarea-with-editor",26),2&b){const l=a.XpG().$implicit;a.Y8G("height",200)("label","R\xf3tulo da caixa de sele\xe7\xe3o")("form",l.value)("controlName","label")}}function Ft(b,A){if(1&b){const l=a.RV6();a.j41(0,"div",10)(1,"mat-expansion-panel",11)(2,"mat-expansion-panel-header",12)(3,"mat-panel-title",13),a.EFF(4),a.k0s()(),a.j41(5,"div",14)(6,"mat-form-field",15)(7,"mat-label"),a.EFF(8,"Tipo de assinatura *"),a.k0s(),a.j41(9,"mat-select",16),a.DNE(10,it,2,3,"mat-option",17),a.k0s()()(),a.j41(11,"div",14)(12,"div",18),a.DNE(13,bt,1,4,"app-textarea-with-editor",19),a.k0s()(),a.j41(14,"div",14)(15,"div",18),a.nrm(16,"app-autocomplete-system-fields",20),a.k0s()(),a.j41(17,"div",14)(18,"div",21)(19,"mat-checkbox",22),a.EFF(20,"Tornar este campo obrigat\xf3rio"),a.k0s()(),a.j41(21,"div",23)(22,"button",24),a.bIt("click",function(){const O=a.eBV(l).$implicit,K=a.XpG(2);return a.Njj(K.deleteSignature(O.key))}),a.j41(23,"mat-icon"),a.EFF(24,"delete"),a.k0s(),a.EFF(25," Excluir "),a.k0s()()()()()}if(2&b){const l=A.$implicit,C=a.XpG(2);a.Y8G("formGroupName",l.key),a.R7$(),a.Y8G("ngClass",a.eq3(11,z,"INVALID"===l.value.status)),a.R7$(3),a.SpI(" ",C.formControlSignatures.value[l.key].signature_id?C.formControlSignatures.value[l.key].signature_id.assinatura:"Selecione o tipo de assinatura"," "),a.R7$(6),a.Y8G("ngForOf",C.availableSignatures),a.R7$(3),a.Y8G("ngForOf",C.reset),a.R7$(3),a.Y8G("systemFields",C.nonMultivalueFields)("formulario",l.value)("nameControl","field_id_to_save_signature")("matTooltipText","O campo vinculado n\xe3o dever\xe1 ser um campo multivalorado")("label","Vincular campo"),a.R7$(6),a.Y8G("disabled",C.disableDeleteButton(C.formControlSignatures.value[l.key].signature_id))}}function $(b,A){if(1&b){const l=a.RV6();a.j41(0,"mat-accordion")(1,"div",8),a.bIt("cdkDropListDropped",function(O){a.eBV(l);const K=a.XpG();return a.Njj(K.changesPositionOfTheSignatures(O))}),a.DNE(2,Ft,26,13,"div",9),a.nI1(3,"keyvalue"),a.k0s()()}if(2&b){const l=a.XpG();a.R7$(2),a.Y8G("ngForOf",a.i5U(3,1,l.formControlSignatures.controls,l.asIs))}}function mt(b,A){if(1&b){const l=a.RV6();a.j41(0,"div",14)(1,"div",18)(2,"button",27),a.bIt("click",function(){a.eBV(l);const O=a.XpG();return a.Njj(O.addSignature({obrigatorio:"0"}))}),a.j41(3,"mat-icon"),a.EFF(4,"add"),a.k0s(),a.EFF(5," Adicione outra caixa de sele\xe7\xe3o "),a.k0s()()()}2&b&&a.xc7("margin-top",20,"px")}function y(b,A){1&b&&(a.j41(0,"mat-icon",37),a.EFF(1,"cancel"),a.k0s())}function Y(b,A){if(1&b){const l=a.RV6();a.j41(0,"mat-chip-row",35),a.bIt("removed",function(){const O=a.eBV(l).index,K=a.XpG(2);return a.Njj(K.removeChipSignature(O))}),a.EFF(1),a.DNE(2,y,2,0,"mat-icon",36),a.k0s()}if(2&b){const l=A.$implicit,C=a.XpG(2);a.Y8G("selectable",C.selectable)("removable",C.removable),a.R7$(),a.SpI(" ",l.label," "),a.R7$(),a.Y8G("ngIf",C.removable)}}function N(b,A){if(1&b&&(a.j41(0,"mat-option",38),a.EFF(1),a.k0s()),2&b){const l=A.$implicit,C=a.XpG(2);a.Y8G("disabled",C.disablesAlreadySelectedSignatures(l))("value",l),a.R7$(),a.SpI(" ",l.assinatura," ")}}function pt(b,A){if(1&b){const l=a.RV6();a.j41(0,"div",28)(1,"div",18)(2,"mat-form-field",29)(3,"mat-label"),a.EFF(4,"Tipo de assinatura"),a.k0s(),a.j41(5,"mat-chip-grid",30,0),a.DNE(7,Y,3,4,"mat-chip-row",31),a.nrm(8,"input",32,1),a.k0s(),a.j41(10,"mat-autocomplete",33,2),a.bIt("optionSelected",function(O){a.eBV(l);const K=a.XpG();return a.Njj(K.selectedChipSignature(O))}),a.DNE(12,N,2,3,"mat-option",34),a.nI1(13,"async"),a.k0s()()()()}if(2&b){const l=a.sdS(6),C=a.sdS(11),O=a.XpG();a.R7$(7),a.Y8G("ngForOf",O.formControlSignatures.value),a.R7$(),a.Y8G("formControl",O.autoCompleteSignatureCtrl)("matAutocomplete",C)("matChipInputFor",l),a.R7$(4),a.Y8G("ngForOf",a.bMT(13,5,O.filteredSignatures))}}function ht(b,A){if(1&b&&(a.j41(0,"div",14)(1,"div",18),a.nrm(2,"app-autocomplete-system-fields",20),a.k0s()()),2&b){const l=a.XpG();a.R7$(2),a.Y8G("systemFields",l.nonMultivalueFields)("formulario",l.form)("nameControl","field_id_to_save_legitimate_interests")("matTooltipText","O campo vinculado n\xe3o dever\xe1 ser um campo multivalorado")("label","Vincular campo")}}let xt=(()=>
1{class b{get signatureForm(){return this.form}constructor(l){this.formBuilder=l,this.editorInFocus=!1,this.reset=[[]],this.selectable=!0,this.removable=!0,this.autoCompleteSignatureCtrl=new E.hs}ngOnChanges(l){l.consentId.firstChange||this.formControlSignatures.clear(),this.buildSignature(l.selectedConsentSignatures.currentValue.signatures),this.initAutoCompleteSignature()}addSignature(l){this.formControlSignatures=this.form.get("signatures"),this.formControlSignatures.push(this.formBuilderSignature(l)),this.saveFieldByLegitimateInterests(),this.updatePositionsOfTheSignaturesOnTheForm()}buildSignature(l){l.map(C=>this.addSignature(C))}findSignatureByTypeId(l){return"object"==typeof l?l:this.availableSignatures.filter(C=>C.id===String(l))[0]}updatePositionsOfTheSignaturesOnTheForm(){this.formControlSignatures.controls.map((l,C)=>{l.patchValue({position:C+1},{emitEvent:!0})})}disablesAlreadySelectedSignatures(l){return this.formControlSignatures.value.filter(O=>{if(O.signature_id)return O.signature_id.id===l.id}).length>0}deleteSignature(l){this.formControlSignatures.removeAt(l),this.updatePositionsOfTheSignaturesOnTheForm()}changesPositionOfTheSignatures(l){this.reset[0]=[],l.previousIndex!==l.currentIndex&&((0,at.HD)(this.formControlSignatures.controls,l.previousIndex,l.currentIndex),this.updatePositionsOfTheSignaturesOnTheForm())}saveFieldByLegitimateInterests(){this.form.valueChanges.subscribe(l=>{l.field_id_to_save_legitimate_interests&&"3"===l.consent_id&&this.setFieldIdToSaveSignature(l.field_id_to_save_legitimate_interests.field_id)})}setFieldIdToSaveSignature(l){let C=!1;this.formControlSignatures.controls.map(O=>{(0,M.p1)(l)&&O.get("field_id_to_save_signature").value!==l&&(O.patchValue({field_id_to_save_signature:l},{emitEvent:!1}),C=!0)}),C&&this.formControlSignatures.updateValueAndValidity()}formBuilderSignature(l){const C=this.convertSignatureDataToEnglish(l),O=this.formBuilder.group({id:C.id??null,field_id_to_save_signature:[C.field_id_to_save_signature??null,E.k0.required],signature_id:[this.findSignatureByTypeId(C.signature_id)??null,E.k0.required],label:[C.label??null,E.k0.required],required:C.required??!1,position:C.position??null});return this.setSignatureIDValueChanges(O),O}setSignatureIDValueChanges(l){l.get("signature_id").valueChanges.subscribe(C=>{const O=this.findSignatureByTypeId(C),K=this.getNameLabel(O);l.get("label").setValue(K,{emitEvent:!1})})}convertSignatureDataToEnglish(l){return l.id||l.signature_id?l:{id:null,field_id_to_save_signature:l.field_id_to_save_signature??null,signature_id:l.idTipo??l.signature_id,label:this.getNameLabel(l),required:l.obrigatorio,position:l.ordem}}getNameLabel(l){return l.rotulo?l.rotulo:l.assinaturaMontada?l.assinaturaMontada:null}initAutoCompleteSignature(){this.filteredSignatures=this.autoCompleteSignatureCtrl.valueChanges.pipe((0,dt.Z)(""),(0,ot.T)(l=>l?this._filter(l):this.availableSignatures.slice()))}disableDeleteButton(l){let C=!1;return l&&this.consentCheckboxOptionsData.map(O=>{const K=O.assinaturas.find(Vt=>Vt.idTipo===l.id);K&&"1"===K.obrigatorio&&(C=!0)}),C}removeChipSignature(l){this.formControlSignatures.removeAt(l)}selectedChipSignature(l){this.formControlSignatures.push(this.formBuilderSignature({idTipo:l.option.value.id,rotulo:l.option.value.assinatura,field_id_to_save_signature:this.getValueFieldIdToSaveLegitimateInterests()})),this.signatureInput.nativeElement.value="",this.autoCompleteSignatureCtrl.setValue(null),this.updatePositionsOfTheSignaturesOnTheForm()}getValueFieldIdToSaveLegitimateInterests(){const l=this.form.get("field_id_to_save_legitimate_interests").value;return l&&l.field_id}_filter(l){if("string"==typeof l){const C=l.toLowerCase();return this.availableSignatures.filter(O=>O.assinatura.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").match(C)).sort((O,K)=>O.assinatura.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")<K.assinatura.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?-1:O.assinatura.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")>K.assinatura.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?1:0)}return[]}asIs(){return 0}static{this.\u0275fac=function(C){return new(C||b)(a.rXU(E.ze))}}static{this.\u0275cmp=a.VBU({type:b,selectors:[["app-lgpd-signatures"]],viewQuery:function(C,O){if(1&C&&(a.GBs(D,5),a.GBs(w,5)),2&C){let K;a.mGM(K=a.lsd())&&(O.signatureInput=K.first),a.mGM(K=a.lsd())&&(O.matAutocomplete=K.first)}},inputs:{selectedConsentSignatures:"selectedConsentSignatures",consentCheckboxOptionsData:"consentCheckboxOptionsData",availableSignatures:"availableSignatures",nonMultivalueFields:"nonMultivalueFields",controlName:"controlName",form:"form",consentId:"consentId"},features:[a.OA$],decls:5,vars:5,consts:[["chipList",""],["signatureInput",""],["autocompleteSignatures","matAutocomplete"],[3,"formGroup"],[4,"ngIf"],["fxLayout","row",3,"margin-top",4,"ngIf"],["fxLayout","row","class","ps-row",4,"ngIf"],["fxLayout","row",4,"ngIf"],["formArrayName","signatures","cdkDropList","",1,"ps-lgpd-signature-list",3,"cdkDropListDropped"],["cdkDragLockAxis","y","cdkDrag","",3,"formGroupName",4,"ngFor","ngForAsync","ngForOf"],["cdkDragLockAxis","y","cdkDrag","",3,"formGroupName"],[3,"ngClass"],["cdkDragHandle",""],[1,"ps-lgpd-signature-title"],["fxLayout","row"],["appearance","fill","fxFill",""],["formControlName","signature_id"],[3,"value","disabled",4,"ngFor","ngForOf"],["fxFlex",""],[3,"height","label","form","controlName",4,"ngFor","ngForOf"],[3,"systemFields","formulario","nameControl","matTooltipText","label"],["fxFlex","65","fxLayoutAlign","start center"],["color","primary","formControlName","required"],["fxFlex","","fxLayoutAlign","end center"],["mat-button","","color","warn",1,"ps-lgpd-signature-btn-delete",3,"click","disabled"],[3,"value","disabled"],[3,"height","label","form","controlName"],["disableRipple","true","mat-button","","color","primary",1,"ps-lgpd-signature-btn-add",3,"click"],["fxLayout","row",1,"ps-row"],["appearance","fill","fxFlex",""],["aria-label","Sele\xe7\xe3o de assinatura"],[3,"selectable","removable","removed",4,"ngFor","ngForOf"],["matInput","",3,"formControl","matAutocomplete","matChipInputFor"],[3,"optionSelected"],[3,"disabled","value",4,"ngFor","ngForOf"],[3,"removed","selectable","removable"],["matChipRemove","",4,"ngIf"],["matChipRemove",""],[3,"disabled","value"]],template:function(C,O){1&C&&(a.j41(0,"form",3),a.DNE(1,$,4,4,"mat-accordion",4)(2,mt,6,2,"div",5)(3,pt,14,7,"div",6)(4,ht,3,5,"div",7),a.k0s()),2&C&&(a.Y8G("formGroup",O.form),a.R7$(),a.Y8G("ngIf","3"!==O.consentId),a.R7$(),a.Y8G("ngIf","3"!==O.consentId),a.R7$(),a.Y8G("ngIf","3"===O.consentId),a.R7$(),a.Y8G("ngIf","3"===O.consentId))},dependencies:[m.YU,m.Sq,m.bT,E.qT,E.me,E.BC,E.cb,E.l_,E.j4,E.JD,E.$R,E.v8,j.$z,P.rl,P.nJ,J.VO,k.wT,Z.fg,rt.HW,rt.D7,rt.Zv,rt.jH,ft.So,et.An,ct.$3,ct.pN,H.BS,H.GK,H.Z2,H.WN,T.DJ,T.sA,T.G2,T.UI,_t.PW,at.O7,at.T1,at.Fb,ut.M,U.d,m.Jj,m.lG],styles:[".ps-lgpd-signature-list[_ngcontent-%COMP%]{max-width:100%;min-height:50px;display:block;background:#fff;border-radius:4px}.ps-lgpd-signature-list[_ngcontent-%COMP%]     mat-expansion-panel{margin-bottom:10px!important;transition:filter .3s ease}.ps-lgpd-signature-list[_ngcontent-%COMP%]     mat-expansion-panel:hover{filter:drop-shadow(0px 2px 1px rgba(0,0,0,.2)) drop-shadow(0px 1px 1px rgba(0,0,0,.14)) drop-shadow(0px 1px 3px rgba(0,0,0,.12))}.ps-lgpd-signature-list[_ngcontent-%COMP%]     mat-expansion-panel mat-expansion-panel-header{padding-left:10px;border-bottom:1px solid #D5D5D5;border-bottom-left-radius:0;border-bottom-right-radius:0;cursor:pointer}.ps-lgpd-signature-list[_ngcontent-%COMP%]     mat-expansion-panel mat-expansion-panel-header:hover{background:transparent!important}.ps-lgpd-signature-list[_ngcontent-%COMP%]     mat-expansion-panel .mat-expansion-panel-body{padding-top:16px}  .cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}  .cdk-drag-preview mat-icon{margin-left:10px}  .cdk-drag-preview mat-expansion-panel-header{padding-left:0!important}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}
1.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .15s cubic-bezier(0,0,.2,1)}  .ps-lgpd-signature-list.cdk-drop-list-dragging mat-expansion-panel:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.ps-lgpd-signature-title[_ngcontent-%COMP%]{align-items:center;font-family:poppins;font-style:normal;font-size:13px;line-height:19px;color:gray}.ps-lgpd-signature-title[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{margin-right:10px}.ps-lgpd-signature-title[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]:hover{cursor:move}ps-lgpd-signature-btn-delete[_ngcontent-%COMP%]{padding:0;font-size:small!important}ps-lgpd-signature-btn-delete[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{height:18px!important;width:18px!important;font-size:15px!important;line-height:15px!important;margin-right:5px!important}  .ps-lgpd-signature-btn-add{padding:0}  .ps-lgpd-signature-btn-add mat-icon{height:25px;font-size:22px}  .ps-lgpd-signature-btn-add.mat-mdc-button:hover .mat-mdc-focus-indicator,   .ps-lgpd-signature-btn-add .mat-mdc-outlined-button:hover .mat-mdc-focus-indicator{background-color:transparent!important}.ps-textarea-editor-container[_ngcontent-%COMP%]{margin-bottom:15px}.ps-textarea-editor-container[_ngcontent-%COMP%]   iframe[_ngcontent-%COMP%]{outline:none;background:#f5f5f5;border-radius:4px 4px 0 0;font-family:Roboto;font-style:normal;font-weight:400;font-size:16px;line-height:24px!important;color:#000000de;border-bottom:1px solid #e0e0e0}.signatureInvalid[_ngcontent-%COMP%]{border:1px solid rgba(229,16,16,.6235294118)}  .ps-textarea-editor-container .tox .tox-toolbar__primary{background:transparent!important}  .ps-textarea-editor-container .tox .tox-toolbar-overlord{background-color:transparent!important}  .ps-textarea-editor-container .tox.tox-tinymce.tox-tinymce--toolbar-bottom{border:0px solid transparent!important}  .ps-textarea-editor-container .tox{transition:all .2s ease}  .ps-textarea-editor-container iframe.tox-edit-area__iframe{border:1px solid #f5f5f5;outline:none;border-radius:4px 4px 0 0;font-family:Roboto;font-style:normal;font-weight:400;font-size:16px;line-height:24px!important;color:#000000de;border-bottom:1px solid #e0e0e0;background-color:#f5f5f5}  .ps-textarea-editor-container.rbEditorIsFocused iframe.tox-edit-area__iframe{border-bottom:2px solid #0da6a6}.ps-textarea-editor-label[_ngcontent-%COMP%]{color:#4d4d4d}"]}
1)}}return b})();function L(b,A){if(1&b&&(a.j41(0,"p",22),a.EFF(1),a.k0s()),2&b){const l=a.XpG().$implicit;a.R7$(),a.JRh(l.descricao)}}function tt(b,A){if(1&b&&(a.j41(0,"mat-option",20),a.EFF(1),a.DNE(2,L,2,1,"p",21),a.k0s()),2&b){const l=A.$implicit;a.XpG();const C=a.sdS(16);a.Y8G("value",l.id),a.R7$(),a.SpI(" ",l.opcao," "),a.R7$(),a.Y8G("ngIf",C.panelOpen)}}function c(b,A){1&b&&(a.j41(0,"div",10)(1,"div",23)(2,"p",24),a.nrm(3,"mat-icon",25),a.EFF(4," Escolha uma base legal de processamento de dados para prosseguir "),a.k0s()()())}function R(b,A){1&b&&(a.j41(0,"div",10)(1,"div",7),a.nrm(2,"mat-divider"),a.k0s()())}function p(b,A){if(1&b&&(a.j41(0,"div",5)(1,"div",10)(2,"div",7)(3,"p",18),a.EFF(4,"Notifica\xe7\xe3o e consentimento / Interesse leg\xedtimo (LGPD)"),a.k0s()()(),a.j41(5,"div",10)(6,"div",7),a.nrm(7,"app-textarea-with-editor",31),a.k0s()()()),2&b){const l=a.XpG(2);a.R7$(7),a.Y8G("label","Texto de consentimento de comunica\xe7\xe3o")("form",l.formulario)("controlName","text_consent_communication")}}function V(b,A){1&b&&(a.j41(0,"div",10)(1,"div",7),a.nrm(2,"mat-divider"),a.k0s()())}function S(b,A){1&b&&(a.j41(0,"div",10)(1,"div",7),a.nrm(2,"mat-divider"),a.k0s()())}function vt(b,A){if(1&b&&(a.j41(0,"div",32)(1,"div",7),a.nrm(2,"app-textarea-with-editor",31),a.k0s()()),2&b){const l=a.XpG(2);a.Y8G("fxFlexOrder","2"===l.selectedConsentData.consent_id?5:1),a.R7$(2),a.Y8G("label","Texto de privacidade")("form",l.formulario)("controlName","text_privacy")}}function yt(b,A){if(1&b&&(a.qex(0),a.j41(1,"div",33)(2,"div",7),a.nrm(3,"app-textarea-with-editor",34),a.k0s()(),a.j41(4,"div",35)(5,"div",7),a.nrm(6,"app-autocomplete-system-fields",36),a.k0s()(),a.j41(7,"div",37)(8,"div",7),a.nrm(9,"app-textarea-with-editor",34),a.k0s()(),a.bVm()),2&b){const l=a.XpG(2);a.R7$(3),a.Y8G("height",200)("label","R\xf3tulo de caixa de sele\xe7\xe3o do consentimento com o processo")("form",l.formulario)("controlName","label_consent_process"),a.R7$(3),a.Y8G("systemFields",l.dataComponent.data.nonMultivalueFields)("formulario",l.formulario)("nameControl","field_id_to_save_consent_process")("matTooltipText","O campo vinculado n\xe3o dever\xe1 ser um campo multivalorado")("label","Vincular campo"),a.R7$(3),a.Y8G("height",200)("label","Rodap\xe9 do consentimento com o processo")("form",l.formulario)("controlName","footer_consent_process")}}function Ot(b,A){if(1&b&&(a.j41(0,"div",32)(1,"div",7),a.nrm(2,"app-textarea-with-editor",31),a.k0s()()),2&b){const l=a.XpG(2);a.Y8G("fxFlexOrder","2"===l.selectedConsentData.consent_id?1:2),a.R7$(2),a.Y8G("label","Texto de consentimento para processar")("form",l.formulario)("controlName","text_consent_process")}}function It(b,A){if(1&b&&(a.qex(0),a.DNE(1,p,8,3,"div",26)(2,V,3,0,"div",14),a.j41(3,"div",5)(4,"div",10)(5,"div",7)(6,"p",18),a.EFF(7,"Assinaturas"),a.k0s()()(),a.j41(8,"div",27)(9,"div",7),a.nrm(10,"app-lgpd-signatures",28),a.k0s()()(),a.DNE(11,S,3,0,"div",14),a.j41(12,"div",29),a.DNE(13,vt,3,4,"div",30)(14,yt,10,13,"ng-container",15)(15,Ot,3,4,"div",30),a.k0s(),a.bVm()),2&b){const l=a.XpG();a.R7$(),a.Y8G("ngIf",null!==l.selectedConsentData.text_consent_communication),a.R7$(),a.Y8G("ngIf",null!==l.selectedConsentData.text_consent_communication),a.R7$(),a.xc7("padding-bottom","3"!==l.formControls.consent_id.value?20:0,"px"),a.R7$(7),a.Y8G("form",l.formulario)("consentId",l.formControls.consent_id.value)("nonMultivalueFields",l.dataComponent.data.nonMultivalueFields)("availableSignatures",l.lgpdConsentCheckboxOptions.signatures)("consentCheckboxOptionsData",l.lgpdConsentCheckboxOptions.consentCheckboxOptionsData)("selectedConsentSignatures",l.selectedConsentData)("controlName","signatures"),a.R7$(),a.Y8G("ngIf",null!==l.selectedConsentData.text_privacy||null!==l.selectedConsentData.text_consent_process),a.R7$(2),a.Y8G("ngIf",null!==l.selectedConsentData.text_privacy),a.R7$(),a.Y8G("ngIf","2"===l.selectedConsentData.consent_id),a.R7$(),a.Y8G("ngIf",null!==l.selectedConsentData.text_consent_process)}}function jt(b,A){1&b&&(a.j41(0,"div",10)(1,"div",7)(2,"p",38),a.EFF(3,"Nenhuma op\xe7\xe3o selecionada."),a.k0s()()())}function Rt(b,A){if(1&b&&(a.j41(0,"div",41),a.nrm(1,"app-edit-form-viewer",42,1),a.k0s()),2&b){const l=a.XpG(2);a.R7$(),a.Y8G("fieldJson",l.fieldJson)}}function Lt(b,A){if(1&b&&(a.j41(0,"div",39),a.DNE(1,Rt,3,1,"div",40),a.k0s()),2&b){const l=a.XpG();a.R7$(),a.Y8G("ngForOf",l.reset)}}let Gt=(()=>{class b{constructor(l){this.formBuilder=l,this.statusFormChanged=new a.bkB,this.selectedConsentData=null,this.lgpdDataUnchanged=null,this.reset=[{}],this.formulario=this.formBuilder.group({consent_id:[null,E.k0.required],text_consent_communication:null,signatures:this.formBuilder.array([]),text_consent_process:null,text_privacy:[null,E.k0.required],footer_consent_process:null,label_consent_process:null,field_id_to_save_legitimate_interests:[null],field_id_to_save_consent_process:[null]}),this.formControlSignatures=this.formulario.get("signatures")}ngOnInit(){this.lgpdConsentCheckboxOptions=this.dataComponent.data.lgpdConsentCheckboxOptions,this.lgpdDataUnchanged=JSON.parse(JSON.stringify(this.dataComponent.data.data)),this.refreshPreview(),this.setComponentValues(this.dataComponent.data.data),this.updateComponentValues(),this.get
1StatusForm()}getConsentCheckboxOptionData(l){const O=this.lgpdConsentCheckboxOptions.consentCheckboxOptionsData.find(K=>K.idCaixaVerificacao===l.value);this.clearSignaturesByLegitimateInterests(l.value),this.setComponentValues(O)}convertConsentDataToEnglish(l){return{consent_id:l.idCaixaVerificacao,text_consent_communication:l.consentimentoComunicacao,signatures:l.assinaturas,text_consent_process:l.consentimentoProcessar,text_privacy:l.privacidade,footer_consent_process:l.rodapeConsentimentoProcesso,label_consent_process:l.rotuloConsentimentoProcesso}}setComponentValues(l){this.lgpdDataUnchanged.consent_id=String(this.lgpdDataUnchanged.consent_id),l.consent_id&&(l.consent_id=String(l.consent_id),this.saveFieldByLegitimateInterests(l),this.selectedConsentData=l),l.idCaixaVerificacao&&this.lgpdDataUnchanged.consent_id!==l.idCaixaVerificacao&&(this.selectedConsentData=this.convertConsentDataToEnglish(l)),this.lgpdDataUnchanged.consent_id&&this.lgpdDataUnchanged.consent_id===l.idCaixaVerificacao&&(this.selectedConsentData=this.lgpdDataUnchanged),this.formulario.patchValue(this.selectedConsentData??{}),this.setValidatorsByConsentId()}saveFieldByLegitimateInterests(l){"3"===l.consent_id&&l.signatures.map(C=>{!this.formulario.get("field_id_to_save_legitimate_interests").value&&C.field_id_to_save_signature&&this.formulario.patchValue({field_id_to_save_legitimate_interests:C.field_id_to_save_signature},{emitEvent:!1})})}updateComponentValues(){this.formulario.valueChanges.subscribe(l=>{this.dataComponent.data.data.consent_id=l.consent_id,this.dataComponent.data.data.text_consent_communication=l.text_consent_communication,this.dataComponent.data.data.signatures=l.signatures,this.dataComponent.data.data.text_consent_process=l.text_consent_process,this.dataComponent.data.data.text_privacy=l.text_privacy,this.dataComponent.data.data.footer_consent_process=l.footer_consent_process,this.dataComponent.data.data.label_consent_process=l.label_consent_process,this.dataComponent.data.data.field_id_to_save_consent_process=l.field_id_to_save_consent_process})}clearSignaturesByLegitimateInterests(l){"3"===l&&this.formControlSignatures.clear()}refreshPreview(){this.formulario.valueChanges.subscribe(l=>{const C=JSON.parse(this.dataComponent.data.data.form_build);C.lgpd_content=l,this.fieldJson={components:[C]},this.reset[0]={}})}setValidatorsByConsentId(){this.selectedConsentData&&"1"===this.selectedConsentData.consent_id&&this.addValidatorsOnFormByControlsNames(["text_consent_communication","text_privacy","text_consent_process"]),this.selectedConsentData&&"2"===this.selectedConsentData.consent_id&&this.addValidatorsOnFormByControlsNames(["text_consent_communication","text_consent_process","label_consent_process","field_id_to_save_consent_process","text_privacy"]),this.selectedConsentData&&"3"===this.selectedConsentData.consent_id&&this.addValidatorsOnFormByControlsNames(["field_id_to_save_legitimate_interests","text_privacy"])}addValidatorsOnFormByControlsNames(l){for(const C of Object.keys(this.formulario.controls)){const O=l.some(K=>C.includes(K));O&&(this.formulario.controls[C].setValidators(E.k0.required),this.formulario.controls[C].updateValueAndValidity({emitEvent:!1})),!O&&"consent_id"!==C&&"signatures"!==C&&(this.formulario.controls[C].clearValidators(),this.formulario.controls[C].updateValueAndValidity({emitEvent:!1}))}}getStatusForm(){this.formulario.statusChanges.subscribe(l=>this.statusFormChanged.emit(l))}get formControls(){return this.formulario.controls}static{this.\u0275fac=function(C){return new(C||b)(a.rXU(E.ze))}}static{this.\u0275cmp=a.VBU({type:b,selectors:[["app-lgpd-config"]],inputs:{dataComponent:"dataComponent"},outputs:{statusFormChanged:"statusFormChanged"},decls:29,vars:7,consts:[["matSelect","matSelect"],["formViewer",""],["fxFlexFill","",3,"formGroup"],["fxLayout","row","fxFlexFill",""],["fxFlex","55",1,"ps-lgpd-settings-container"],["fxLayout","column",1,"ps-lgdp-config-content"],["fxLayout","row",1,"ps-row"],["fxFlex",""],[1,"ps-lgpd-config-info"],["href","https://rubeus.me/CqR9x8T","target","_blank"],["fxLayout","row"],["appearance","fill","fxFlex",""],["formControlName","consent_id",3,"selectionChange"],["class","ps-lgpd-select-custom",3,"value",4,"ngFor","ngForOf"],["fxLayout","row",4,"ngIf"],[4,"ngIf"],["fxFlex","",1,"ps-lgpd-preview-container"],["fxLayout","column"],[1,"ps-title-large"],["fxLayout","row","class","preview-wrap",4,"ngIf"],[1,"ps-lgpd-select-custom",3,"value"],["class","description",4,"ngIf"],[1,"description"],["fxFlex","",1,"ps-lgpd-config-info-base-legal"],["fxLayoutAlign","start center"],["svgIcon","alert"],["fxLayout","column","class","ps-lgdp-config-content",4,"ngIf"],["fxLayout","row",1,"dragBoundarie"],[3,"form","consentId","nonMultivalueFields","availableSignatures","consentCheckboxOptionsData","
1selectedConsentSignatures","controlName"],["fxLayout","column",1,"ps-lgdp-config-last-row-content"],["fxLayout","row",3,"fxFlexOrder",4,"ngIf"],[3,"label","form","controlName"],["fxLayout","row",3,"fxFlexOrder"],["fxLayout","row","fxFlexOrder","2"],[3,"height","label","form","controlName"],["fxLayout","row","fxFlexOrder","3"],[3,"systemFields","formulario","nameControl","matTooltipText","label"],["fxLayout","row","fxFlexOrder","4"],[1,"ps-description-14"],["fxLayout","row",1,"preview-wrap"],["class","card","fxFlex","100","fxLayoutAlign","start center",4,"ngFor","ngForOf"],["fxFlex","100","fxLayoutAlign","start center",1,"card"],[1,"form-viewer",3,"fieldJson"]],template:function(C,O){if(1&C){const K=a.RV6();a.j41(0,"form",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7)(6,"p",8),a.EFF(7," Adicione caixas de verifica\xe7\xe3o de consentimento e texto ao seu formul\xe1rio para seguir as leis e regulamento de privacidade. "),a.j41(8,"a",9),a.EFF(9,"Saiba mais"),a.k0s()()()(),a.j41(10,"div",10)(11,"div",7)(12,"mat-form-field",11)(13,"mat-label"),a.EFF(14,"Selecione uma op\xe7\xe3o"),a.k0s(),a.j41(15,"mat-select",12,0),a.bIt("selectionChange",function($t){return a.eBV(K),a.Njj(O.getConsentCheckboxOptionData($t))}),a.DNE(17,tt,3,3,"mat-option",13),a.k0s()()()(),a.DNE(18,c,5,0,"div",14),a.k0s(),a.DNE(19,R,3,0,"div",14)(20,It,16,15,"ng-container",15),a.k0s(),a.j41(21,"div",16)(22,"div",17)(23,"div",10)(24,"div",7)(25,"h3",18),a.EFF(26,"Pr\xe9-visualiza\xe7\xe3o"),a.k0s()()(),a.DNE(27,jt,4,0,"div",14)(28,Lt,2,1,"div",19),a.k0s()()()()}2&C&&(a.Y8G("formGroup",O.formulario),a.R7$(17),a.Y8G("ngForOf",O.lgpdConsentCheckboxOptions.consentCheckboxOptions),a.R7$(),a.Y8G("ngIf",null===O.formControls.consent_id.value),a.R7$(),a.Y8G("ngIf",null!==O.formControls.consent_id.value),a.R7$(),a.Y8G("ngIf",null!==O.selectedConsentData),a.R7$(7),a.Y8G("ngIf",null===O.formControls.consent_id.value),a.R7$(),a.Y8G("ngIf",null!==O.formControls.consent_id.value))},dependencies:[m.Sq,m.bT,E.qT,E.BC,E.cb,E.j4,E.JD,P.rl,P.nJ,J.VO,k.wT,F.q,et.An,T.DJ,T.sA,T.i4,T.G2,T.UI,lt.y,ut.M,U.d,xt],styles:[".ps-lgpd-config-info[_ngcontent-%COMP%]{font-style:italic;font-weight:400;font-size:14px;line-height:129.2%;letter-spacing:.025em;color:#a2a2a2;margin-top:0}.ps-lgpd-config-info[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#0da6a6;text-decoration:none}.ps-lgpd-settings-container[_ngcontent-%COMP%]{border-right:1px solid #D5D5D5;max-height:476px;overflow-y:auto}.preview-wrap[_ngcontent-%COMP%]{word-break:break-word}.ps-lgpd-preview-container[_ngcontent-%COMP%]{max-width:50%;padding:24px}.ps-lgpd-preview-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{background:#fff;border-radius:4px;filter:drop-shadow(0px 3px 3px rgba(0,0,0,.2)) drop-shadow(0px 3px 4px rgba(0,0,0,.14)) drop-shadow(0px 1px 8px rgba(0,0,0,.12));padding:20px;max-height:385px;overflow-y:auto}.ps-lgpd-preview-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .form-viewer[_ngcontent-%COMP%]{display:block;height:100%}.ps-lgpd-preview-container[_ngcontent-%COMP%]   .ps-title-large[_ngcontent-%COMP%], .ps-lgpd-preview-container[_ngcontent-%COMP%]   .ps-description-14[_ngcontent-%COMP%]{margin-top:0}  .ps-lgpd-config-info-base-legal{background:#ffb946;border-radius:4px;padding:16px}  .ps-lgpd-config-info-base-legal p{font-style:normal;font-weight:500;font-size:13px;line-height:16px;color:#fff;margin:0}  .ps-lgpd-config-info-base-legal p mat-icon{margin-right:10px}
1  .ps-lgpd-config-info-base-legal p mat-icon svg path{fill:#fff}  .ps-lgpd-select-custom{font-size:14px!important;line-height:24px!important;height:auto!important;white-space:unset!important}  .ps-lgpd-select-custom .mat-option-text{font-weight:400;line-height:20px;margin-top:20px}  .ps-lgpd-select-custom .description{font-weight:300;margin-top:5px;font-size:13px;color:#808080f2;font-style:italic;line-height:19px}.ps-lgdp-config-content[_ngcontent-%COMP%]{padding:20px}.ps-lgdp-config-content[_ngcontent-%COMP%]   .ps-title-large[_ngcontent-%COMP%]{margin-top:0}.ps-lgdp-config-last-row-content[_ngcontent-%COMP%]{padding:8px 20px 0}.ps-lgdp-config-last-row-content[_ngcontent-%COMP%]   .ps-title-large[_ngcontent-%COMP%]{margin-top:0}"]})}}return b})();function Bt(b,A){1&b&&(a.j41(0,"div",16)(1,"div",17)(2,"p")(3,"b"),a.EFF(4,"Aten\xe7\xe3o!"),a.k0s(),a.EFF(5," O componente s\xf3 pode ser utilizado caso a LGPD esteja ativa na plataforma Rubeus. "),a.j41(6,"a",18),a.EFF(7,"Saiba mais"),a.k0s()()()())}function At(b,A){if(1&b&&a.nrm(0,"app-general-lgpd-config",19),2&b){const l=a.XpG();a.Y8G("dataComponent",l.dataComponent)}}function Dt(b,A){if(1&b){const l=a.RV6();a.j41(0,"app-lgpd-config",20),a.bIt("statusFormChanged",function(O){a.eBV(l);const K=a.XpG();return a.Njj(K.getStatusFormLgpdConfig(O))}),a.k0s()}if(2&b){const l=a.XpG();a.Y8G("dataComponent",l.dataComponent)}}function St(b,A){if(1&b){const l=a.RV6();a.j41(0,"button",21),a.bIt("click",function(){a.eBV(l);const O=a.XpG();return a.Njj(O.clickSaveAsNewCustomComponent())}),a.EFF(1," Salvar como novo "),a.k0s()}if(2&b){const l=a.XpG();a.Y8G("disabled","INVALID"===l.statusFormLgpdConfig)}}function Mt(b,A){if(1&b){const l=a.RV6();a.j41(0,"button",22),a.bIt("click",function(){a.eBV(l);const O=a.XpG();return a.Njj(O.clickCustomComponent())}),a.EFF(1," Salvar "),a.k0s()}if(2&b){const l=a.XpG();a.Y8G("disabled","INVALID"===l.statusFormLgpdConfig)}}function Pt(b,A){if(1&b){const l=a.RV6();a.j41(0,"button",22),a.bIt("click",function(){a.eBV(l);const O=a.XpG();return a.Njj(O.closeDialog())}),a.EFF(1," Salvar "),a.k0s()}if(2&b){const l=a.XpG();a.Y8G("disabled","INVALID"===l.statusFormLgpdConfig)}}let Nt=(()=>{class b{constructor(l,C,O,K){this.dataComponent=l,this.dialogRef=C,this.serviceConfirm=O,this.systemComponentsService=K,this.usingSaveOrCancelButtons=!1,this.main_component=!1}ngOnInit(){this.formBuild=JSON.parse(this.dataComponent.data.data.form_build),this.lgpdDataUnchanged=JSON.parse(JSON.stringify(this.dataComponent.data.data)),this.isLgpdActive=!!this.dataComponent.data.lgpdConsentCheckboxOptions,this.dataComponent.data.data.save_as_new=!1,this.main_component=this.dataComponent.data.data?.main_component||!1}closeDialog(){this.saveDataInElement(),this.dialogRef.close(this.dataComponent.data.data)}getStatusFormLgpdConfig(l){this.statusFormLgpdConfig=l}cancelLgpd(){this.usingSaveOrCancelButtons=!0,(0,M.Ns)(this.dataComponent.data.data,this.lgpdDataUnchanged),this.getFieldAndSignatureId(this.dataComponent.data.data),this.dialogRef.close()}ngOnDestroy(){this.usingSaveOrCancelButtons||this.cancelLgpd()}getFieldAndSignatureId(l){for(const C of Object.keys(l))C.includes("field_id_to_save_")&&null!==l[C]&&l[C]&&l[C].field_id&&(l[C]=l[C].field_id),C.includes("signature_id")&&null!==l[C]&&l[C]&&l[C].id&&(l[C]=l[C].id),C.includes("signatures")&&l[C].map(O=>this.getFieldAndSignatureId(O))}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(l=>{l&&(this.dataComponent.data.data.action="add",this.dataComponent.data.data.save_as_new=!0,this.saveCustomComponent())})}clickCustomComponent(){this.dataComponent.data.data?.id?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(l=>{l&&this.saveCustomComponent()}):this.saveCustomComponent()}saveCustomComponent(){this.saveDataInElement(),delete this.dataComponent.data.data.keys;const l={content:{...this.dataComponent.data.data}};this.systemComponentsService.create(l).subscribe(C=>{C.success?(this.dataComponent.data.result=!0,this.dataComponent.data.data={...this.dataComponent.data.data,...C.data},this.dialogRef.close(this.dataComponent.data.data)):(this.dataComponent.data.result=!1,this.dialogRef.close())})}saveDataInElement(){this.usingSaveOrCancelButtons=!0,this.dataComponent.data.result=!0,this.dataComponent.data.data.form_build=JSON.stringify(this.formBuild),this.getFieldAndSignatureId(this.dataComponent.data.data)}static{this.\u0275fac=function(C){return new(C||b)(a.rXU(e.m),a.rXU(_.CP),a.rXU(t.G),a.rXU(f.x))}}static{this.\u0275cmp=a.VBU({type:b,selectors:[["app-dialog-lgpd-config"]],decls:18,vars:7,consts:[["mat-stretch-tabs","false",1,"ps-mat-tab-group-lgpd-config",3,"animationDuration"],["label","Geral"],["fxLayout","row","class","ps-lgpd-deactivated-info-container",4,"ngIf"],["class","ps-dialog-general-config-content",3,"dataComponent",4,"ngIf"],["label","LGPD",3,"disabled"],["matTabContent",""],[1,"ps-btn-rubeus-add-action-form-save-bar"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["mat-stroked-button","","class","ps-btn-rubeus-add-action-form-save-bar-btn","color","primary",3,"disabled","click",4,"ngIf"],["mat-raised-button","","class","ps-btn-rubeus-add-action-form-save-bar-btn","color","primary",3,"disabled","click",4,"ngIf"],["class","ps-btn-rubeus-add-action-form-save-bar-btn","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["fxLayout","row",1,"ps-lgpd-deactivated-info-container"],["fxFlex","",1,"ps-lgpd-deactivated-info"],["href","https://crmrubeus.zendesk.com/hc/pt-br/articles/360061459291-Como-ativar-as-funcionalidades-da-LGPD-na-Plataforma-Rubeus- ","target","_blank"],[1,"ps-dialog-general-config-content",3,"dataComponent"],[1,"ps-dialog-lgpd-config-content",3,"statusFormChanged","dataComponent"],["mat-stroked-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"],["mat-raised-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"]],template:function(C,O){1&C&&(a.j41(0,"mat-tab-group",0)(1,"mat-tab",1),a.DNE(2,Bt,8,0,"div",2)(3,At,1,1,"app-general-lgpd-config",3),a.k0s(),a.j41(4,"mat-tab",4),a.DNE(5,Dt,1,1,"ng-template",5),a.k0s()(),a.j41(6,"mat-dialog-actions",6)(7,"div",7)(8,"div",8),a.nrm(9,"mat-divider"),a.k0s()(),a.j41(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),a.bIt("click",function(){return O.cancelLgpd()}),a.EFF(14," Cancelar "),a.k0s(),a.DNE(15,St,2,1,"button",13)(16,Mt,2,1,"button",14)(17,Pt,2,1,"button",15),a.k0s()()()()),2&C&&(a.Y8G("animationDuration","0ms"),a.R7$(2),a.Y8G("ngIf",!O.isLgpdActive),a.R7$(),a.Y8G("ngIf",O.isLgpdActive),a.R7$(),a.Y8G("disabled",!O.isLgpdActive),a.R7$(11),a.Y8G("ngIf",O.main_component&&(null==O.dataComponent.data.data?null:O.dataComponent.data.data.id)),a.R7$(),a.Y8G("ngIf",O.main_component),a.R7$(),a.Y8G("ngIf",!O.main_component))},dependencies:[m.bT,j.$z,I.$L,I.mq,I.T8,F.q,_.E7,T.DJ,T.sA,T.G2,T.UI,Q,Gt],styles:[".ps-btn-rubeus-add-action-form-save-bar[_ngcontent-%COMP%]{height:57px;position:absolute;bottom:0;width:100%;padding:0;display:block;margin-bottom:0;z-index:1}.ps-btn-rubeus-add-action-form-save-bar-btn[_ngcontent-%COMP%]{margin-right:18px}  .ps-mat-tab-group-lgpd-config .mat-mdc-tab-body-content{height:477px;overflow:auto}  .ps-edit-form-logic-lgpd-config .ps_formBuilder_formContainer{padding:24px;width:auto!important}  .ps-edit-form-logic-lgpd-config .ps_formBuilder_formContainer_margin{margin:0!important}.ps-dialog-general-config-content[_ngcontent-%COMP%]{display:block;padding:24px}.ps-dialog-lgpd-config-content[_ngcontent-%COMP%]{display:block;height:100%}.ps-lgpd-deactivated-info[_ngcontent-%COMP%]{background:#ffeac8;border-radius:9px;padding:9px}.ps-lgpd-deactivated-info[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-style:italic;font-size:14px;line-height:129.2%;color:#0009;margin:0}.ps-lgpd-deactivated-info[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#0da6a6;text-decoration:none}.ps-lgpd-deactivated-info-container[_ngcontent-%COMP%]{padding:24px}"]})}}return b})()},75409:(nt,B,n)=>{n.d(B,{p:()=>Ft});var f=n(10467),M=n(89417),a=n(81439),e=n(33461),t=n(89274),m=n(54438),j=n(34006),I=n(82201),F=n(32575),T=n(1097),E=n(83225),P=n(37505),J=n(60177),k=n(88834),Z=n(32102),st=n(82798),Q=n(86600),et=n(96850),lt=n(59042),ut=n(71997),U=n(30450),at=n(52920),dt=n(16038),ot=n(54117),rt=n(7550);function ft($,mt){1&$&&m.nrm(0,"mat-tab",14),2&$&&m.Y8G("label",mt.$implicit.name)}function ct($,mt){1&$&&(m.j41(0,"mat-error"),m.EFF(1," Campo obrigat\xf3rio. "),m.k0s())}function H($,mt){if(1&$&&(m.j41(0,"div",15)(1,"div",16)(2,"div",17)(3,"mat-form-field",18)(4,"mat-label"),m.EFF(5,"Tipo de componente"),m.k0s(),m.j41(6,"mat-select",19)(7,"mat-option",20),m.EFF(8,"Texto"),m.k0s()()()(),m.j41(9,"div",17)(10,"mat-form-field",18)(11,"mat-label"),m.EFF(12,"Nome "),m.k0s(),m.nrm(13,"input",21),m.DNE(14,ct,2,0,"mat-error",22),m.k0s()()()()),2&$){const y=m.XpG();m.Y8G("ngClass",y.isTabSelected("general")),m.R7$(13),m.Y8G("formControl",y.name),m.R7$(),m.Y8G("ngIf",y.name.hasError("required"))}}function _t($,mt){if(1&$&&(m.j41(0,"div",1),m.nrm(1,"ckeditor",28),m.k0s()),2&$){const y=m.XpG(2);m.R7$(),m.Y8G("formControl",y.html)("editor",y.editor)("config",y.config)}}function D($,mt){if(1&$&&(m.j41(0,"div",15)(1,"div",23)(2,"mat-form-field",24)(3,"mat-label"),m.EFF(4,"Classe CSS"),m.k0s(),m.nrm(5,"input",21),m.k0s(),m.j41(6,"div",25)(7,"mat-slide-toggle",26),m.EFF(8," Esconder "),m.k0s()()(),m.DNE(9,_t,2,3,"div",27),m.k0s()),2&$){const y=m.XpG();m.Y8G("ngClass",y.isTabSelected("basic")),m.R7$(5),m.Y8G("formControl",y.class),m.R7$(2),m.Y8G("formControl",y.hidden)("color","primary"),m.R7$(2),m.Y8G("ngIf",y.editor)}}function w($,mt){if(1&$){const y=m.RV6();m.j41(0,"div",15)(1,"app-edit-form-logic",29),m.bIt("valueChanged",function(N){m.eBV(y);const pt=m.XpG();return m.Njj(pt.logicChanged(N))}),m.k0s()()}if(2&$){const y=m.XpG();m.Y8G("ngClass",y.isTabSelected("logic")),m.R7$(),m.Y8G("item",y.dataComponent)("keys",y.dataComponent.data.keys)("currentForm",y.fieldJ
1son)}}function z($,mt){if(1&$){const y=m.RV6();m.j41(0,"button",30),m.bIt("click",function(){m.eBV(y);const N=m.XpG();return m.Njj(N.clickSaveAsNewCustomComponent())}),m.EFF(1," Salvar como novo "),m.k0s()}if(2&$){const y=m.XpG();m.Y8G("disabled",y.invalidLogic||y.name.hasError("required"))}}function it($,mt){if(1&$){const y=m.RV6();m.j41(0,"button",31),m.bIt("click",function(){m.eBV(y);const N=m.XpG();return m.Njj(N.clickCustomComponent())}),m.EFF(1," Salvar "),m.k0s()}if(2&$){const y=m.XpG();m.Y8G("disabled",y.invalidLogic||y.name.hasError("required"))}}function bt($,mt){if(1&$){const y=m.RV6();m.j41(0,"button",31),m.bIt("click",function(){m.eBV(y);const N=m.XpG();return m.Njj(N.saveFieldEdit())}),m.EFF(1," Salvar "),m.k0s()}if(2&$){const y=m.XpG();m.Y8G("disabled",y.invalidLogic||y.name.hasError("required"))}}let Ft=(()=>{class ${constructor(y,Y,N,pt,ht,xt,L,tt,c,R){this.formBuilder=y,this.dialog=Y,this.dialogRef=N,this.dialogConfirmationService=pt,this.dateComponent=ht,this.systemComponentsService=xt,this.systemFieldService=L,this.serviceConfirm=tt,this.serviceNotification=c,this.loaderService=R,this.config={variables:{items:[]}},this.main_component=!1,this.reset=[{}],this.invalidLogic=!1,this.definitions=[],this.dataComponent=ht.data,this.dataComponent.data.save_as_new=!1}ngOnInit(){this.definitions=[{id:"general",name:"Geral"},{id:"basic",name:"B\xe1sico"},{id:"logic",name:"L\xf3gica"}],this.selectedTab=0;const y={components:[JSON.parse(this.dataComponent.data.form_build)]};this.fieldJson=y,this.main_component=this.dataComponent.data?.main_component||!1,this.initForm(this.fieldJson.components[0]),this.mountEditor()}saveFieldEdit(){"edit"===this.dataComponent.data.action&&(this.saveDataInElement(),this.dataComponent.result=!0,this.dialogRef.close(this.dataComponent.data))}initForm(y){this.name=new M.hs("",[M.k0.required]),this.class=new M.hs,this.html=new M.hs,this.hidden=new M.hs,this.name.setValue(y.name??"Texto"),this.class.setValue(y.customClass),this.html.setValue(y.html),this.hidden.setValue(y.hidden),this.name.valueChanges.subscribe(Y=>{this.fieldJson.components[0].name=Y,this.redraw()}),this.class.valueChanges.subscribe(Y=>{this.fieldJson.components[0].customClass=Y,this.redraw()}),this.html.valueChanges.subscribe(Y=>{this.fieldJson.components[0].html=Y,this.redraw()}),this.hidden.valueChanges.subscribe(Y=>{this.fieldJson.components[0].hidden=Y,this.redraw()})}checkLogicRuleValue(y){return!(![3,4].includes(y.rule_logic_id)&&null==y.fixed_value&&!y.fixed_value)}verifyLogic(y){if(y.logic_enabled)if(y.condition_logic_id&&y.action_logic_id)if(y.logics.length>0){const Y=y.logics.every(N=>N.field_compare_id&&N.rule_logic_id&&this.checkLogicRuleValue(N));this.invalidLogic=!Y}else this.invalidLogic=!1;else this.invalidLogic=!0;else this.invalidLogic=!1}mountEditor(){var y=this;return(0,f.A)(function*(){y.loaderService.setChangesLoaderState(!0),y.config.variables.items=yield y.listFields(),y.config.toolbar=["variables"," |","heading","|","bold","italic","alignment","|","fontSize","fontFamily","fontColor","fontBackgroun
1dColor","|","link","insertTable","bulletedList","numberedList","|","undo","redo"],y.editor=e,y.loaderService.setChangesLoaderState(!1)})()}cancelFieldEdit(){this.dialogRef.close()}listFields(){return new Promise(y=>{this.systemFieldService.listAll().subscribe(Y=>{const N=Y.map(pt=>(pt.value=pt.key,pt));y(N)},Y=>{this.serviceNotification.notificationOpen("Erro ao listar vari\xe1veis.","","error",1e4,"Erro"),y([])})})}haveTab(y){let Y=!1;return this.definitions.forEach(N=>{N.id===y&&(Y=!0)}),Y}isTabSelected(y){return this.definitions[this.selectedTab]&&this.definitions[this.selectedTab].id===y?"ps-dialog-config-form-field-container":"ps-dialog-config-form-field-container-hidden"}redraw(){this.reset[0]={}}logicChanged(y){this.verifyLogic(y),this.fieldJson.components[0]=y,this.redraw()}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(y=>{y&&(this.dataComponent.data.action="add",this.dataComponent.data.save_as_new=!0,this.saveCustomComponent())})}clickCustomComponent(){this.dataComponent.data?.id?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(y=>{y&&this.saveCustomComponent()}):this.saveCustomComponent()}saveCustomComponent(){this.saveDataInElement(),this.fillConditionalData(JSON.parse(this.dataComponent.data.form_build)),delete this.dataComponent.data.keys;const y={content:{...this.dataComponent.data}};this.systemComponentsService.create(y).subscribe(Y=>{Y.success?(this.dataComponent.result=!0,this.dataComponent.data={...this.dataComponent.data,...Y.data},this.dialogRef.close(this.dataComponent.data)):(this.dataComponent.result=!1,this.dialogRef.close())})}fillConditionalData(y){this.dataComponent.data.logic_enabled=y.logic_enabled,this.dataComponent.data.action_logic_id=y.action_logic_id,this.dataComponent.data.condition_logic_id=y.condition_logic_id,this.dataComponent.data.logics=y.logics}saveDataInElement(){const y=this.fieldJson.components[0];this.dataComponent.data.form_build=JSON.stringify(y),this.dataComponent.data.label=y.label,this.dataComponent.data.name=y.name,this.dataComponent.data.description=y.description}static{this.\u0275fac=function(Y){return new(Y||$)(m.rXU(M.ze),m.rXU(j.bZ),m.rXU(j.CP),m.rXU(I.L),m.rXU(F.m),m.rXU(a.x),m.rXU(t.a),m.rXU(T.G),m.rXU(E.J),m.rXU(P.Z))}}static{this.\u0275cmp=m.VBU({type:$,selectors:[["app-dialog-text-component-config"]],decls:21,vars:8,consts:[["fxLayout","row wrap"],["fxFlex","100"],["mat-stretch-tabs","false",1,"ps_formBuilder_tabGroup",3,"selectedIndexChange","selectedIndex"],[3,"label",4,"ngFor","ngForOf"],["fxFlex","",1,"ps_formBuilder_definitions"],["fxLayout","row wrap",3,"ngClass",4,"ngIf"],[1,"ps-form-save-bar",2,"height","51px"],["fxLayout","row"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center",1,"ps-form-save-bar",2,"height","100%"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["mat-stroked-button","","color","primary",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],[3,"label"],["fxLayout","row wrap",3,"ngClass"],["fxLayout","row","fxFlex","100","fxLayoutGap","20px"],["fxFlex","30"],["appearance","fill","required","",2,"width","100%"],["value","text","required","","disabled",""],["value","text"],["matInput","",3,"formControl"],[4,"ngIf"],["fxFlex","100","fxLayoutGap","20px"],["fxFlex","50","fxFlex","","appearance","fill",2,"display","block"],["fxFlex","50"],[2,"display","block",3,"formControl","color"],["fxFlex","100",4,"ngIf"],[1,"ps-form-content-editor",3,"formControl","editor","config"],["fxFlex","100",3,"valueChanged","item","keys","currentForm"],["mat-stroked-button","","color","primary",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(Y,N){1&Y&&(m.j41(0,"div",0)(1,"div",1)(2,"mat-tab-group",2),m.mxI("selectedIndexChange",function(ht){return m.DH7(N.selectedTab,ht)||(N.selectedTab=ht),ht}),m.DNE(3,ft,1,1,"mat-tab",3),m.k0s()(),m.j41(4,"div",4)(5,"div",1),m.DNE(6,H,15,3,"div",5)(7,D,10,5,"div",5)(8,w,2,4,"div",5),m.k0s()()(),m.j41(9,"mat-dialog-actions",6)(10,"div",7)(11,"div",1),m.nrm(12,"mat-divider"),m.k0s()(),m.j41(13,"div",8)(14,"div",9)(15,"div",10)(16,"button",11),m.bIt("click",function(){return N.cancelFieldEdit()}),m.EFF(17," Cancelar "),m.k0s(),m.DNE(18,z,2,1,"button",12)(19,it,2,1,"button",13)(20,bt,2,1,"button",13),m.k0s()()()()),2&Y&&(m.R7$(2),m.R50("selectedIndex",N.selectedTab),m.R7$(),m.Y8G("ngForOf",N.definitions),m.R7$(3),m.Y8G("ngIf",N.haveTab("general")),m.R7$(),m.Y8G("ngIf",N.haveTab("basic")),m.R7$(),m.Y8G("ngIf",N.haveTab("logic")),m.R7$(10),m.Y8G("ngIf",N.main_component&&(null==N.dataComponent.data?null:N.dataComponent.data.id)),m.R7$(),m.Y8G("ngIf",N.main_component),m.R7$(),m.Y8G("ngIf",!N.main_component))},dependencies:[J.YU,J.Sq,J.bT,M.me,M.BC,M.l_,k.$z,Z.rl,Z.nJ,Z.TL,st.VO,Q.wT,et.mq,et.T8,lt.fg,ut.q,U.sG,j.E7,at.DJ,at.BO,at.sA,at.G2,at.UI,dt.PW,ot.S,rt.h],styles:[".ps_formBuilder_formCanvas[_ngcontent-%COMP%]{display:flex;height:100%;margin:25px;max-width:35%}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]{height:100%}.ps_formBuilder_tabGroup[_ngcontent-%COMP%]     mat-mdc-tab-body .mat-mdc-tab-body-content{overflow:unset!important}.ps-dialog-config-form-field-container[_ngcontent-%COMP%]{min-height:300px;padding:15px 24px 0;display:flex!important}.ps-dialog-config-form-field-container-hidden[_ngcontent-%COMP%]{display:none!important}.ps-option-badge-icon[_ngcontent-%COMP%]{padding:5px;border-radius:24px;background:gray;font-size:14px;margin-left:15px;height:14px;color:#fff;width:14px}.ps-form-edit-dialog-footer[_ngcontent-%COMP%]{height:50px}
1.ps_formBuilder_editor[_ngcontent-%COMP%]{max-width:97%;border:1px solid rgba(0,0,0,.6)}.ps_formBuilder_definitions[_ngcontent-%COMP%]{border-right:1px solid rgba(0,0,0,.12);overflow:auto;width:100%;height:482px}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-track{box-shadow:inset 0 0 6px #00000057;border-radius:0;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px;background-color:#f5f5f5}.ps_formBuilder_definitions[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:0;box-shadow:inset 0 0 6px #0000;background-color:#a9a9a96e}.ps_formBuilder_formViewer[_ngcontent-%COMP%]{margin-top:50px;max-height:550px}.ps_formBuilder_formViewer[_ngcontent-%COMP%]   app-edit-form-viewer[_ngcontent-%COMP%]{overflow-wrap:break-word;min-height:200px;max-height:350px;width:70%}span[_ngcontent-%COMP%]{font-family:Poppins;font-style:normal;font-weight:500;font-size:16px;line-height:24px;color:#4d4d4d}.ps_formBuilder_rule[_ngcontent-%COMP%]{padding:15px 0 0 15px;margin:10px 0;position:relative}.ps_formBuilder_rule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{position:absolute;top:0;right:0;outline:none}.ps_formBuilder_rule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:21px;width:17px;font-size:18px}.ps_formBuilder_addRule[_ngcontent-%COMP%]{margin-bottom:20px}.ps_formBuilder_addRule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{display:flex}.ps_formBuilder_addRule[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type   .mat-icon[_ngcontent-%COMP%]{height:26px}.ps-form-save-bar-buttons[_ngcontent-%COMP%]{margin:0 20px}.ps-form-save-bar[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;left:0;min-height:unset;width:100%;padding:0;margin:0}.ps-theme-button-content[_ngcontent-%COMP%]   .mat-mdc-radio-button[_ngcontent-%COMP%]{margin-right:20px}.ps-theme-button-content[_ngcontent-%COMP%]   .mat-mdc-radio-button[_ngcontent-%COMP%]:last-of-type{margin-right:0}  .ps-dialog-config-button-picked-color .rbPalleteColorActions{padding:0;margin-bottom:20px}  .ps-dialog-config-button-picked-color .rbPalleteColorActions .rb-title-palette{margin-top:0;margin-bottom:20px}  .ps-dialog-config-button-content{height:calc(100% - 90px)!important;margin-bottom:50px!important}.attr-tip[_ngcontent-%COMP%]{color:#ffb946;font-size:12px;margin:10px 0;font-weight:500}"]})}}return $})()},28268:(nt,B,n)=>{n.d(B,{H:()=>fe});var f=n(44089),M=n(70434),a=n(81439),e=n(54438),_=n(32575),t=n(34006),m=n(37505),j=n(1097),I=n(60177),F=n(88834),T=n(96850),E=n(71997),P=n(52920),J=n(54117),k=n(89417),Z=n(99172),st=n(96354),Q=n(32102),et=n(82798),lt=n(86600),ut=n(59042),U=n(99213),at=n(14823),dt=n(30450),ot=n(60850);function rt(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function ft(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function ct(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function H(u,G){1&u&&(e.j41(0,"div",28)(1,"div",14)(2,"span",34),e.EFF(3,"Preencha pelo menos um campo"),e.k0s()()())}function _t(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function D(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function w(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function z(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function it(u,G){if(1&u&&(e.j41(0,"div",35)(1,"div",14)(2,"mat-form-field",23)(3,"mat-label"),e.EFF(4,"Tipo do documento "),e.k0s(),e.nrm(5,"input",36),e.j41(6,"mat-autocomplete",25,1),e.DNE(8,_t,2,2,"mat-option",26),e.nI1(9,"async"),e.k0s(),e.DNE(10,D,2,0,"mat-error",19),e.k0s()(),e.j41(11,"div",14)(12,"mat-form-field",23)(13,"mat-label"),e.EFF(14,"Status"),e.k0s(),e.nrm(15,"input",37),e.j41(16,"mat-autocomplete",25,2),e.DNE(18,w,2,2,"mat-option",26),e.nI1(19,"async"),e.k0s(),e.DNE(20,z,2,0,"mat-error",19),e.k0s()()()),2&u){const r=e.sdS(7),x=e.sdS(17),g=e.XpG();e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",r),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(9,10,g.filteredFields[1])),e.R7$(2),e.Y8G("ngIf",g.formControls.type_file_field_id_to_save_upload.hasError("required")),e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",x),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(19,12,g.filteredFields[2])),e.R7$(2),e.Y8G("ngIf",g.formControls.status_field_id_to_save_upload.hasError("required"))}}function bt(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function Ft(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function $(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function mt(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function y(u,G){if(1&u&&(e.j41(0,"div",35)(1,"div",14)(2,"mat-form-field",23)(3,"mat-label"),e.EFF(4,"Base64"),e.k0s(),e.nrm(5,"input",38),e.j41(6,"mat-autocomplete",25,3),e.DNE(8,bt,2,2,"mat-option",26),e.nI1(9,"async"),e.k0s(),e.DNE(10,Ft,2,0,"mat-error",19),e.k0s()(),e.j41(11,"div",14)(12,"mat-form-field",23)(13,"mat-label"),e.EFF(14,"Nome do arquivo com extens\xe3o"),e.k0s(),e.nrm(15,"input",39),e.j41(16,"mat-autocomplete",25,4),e.DNE(18,$,2,2,"mat-option",26),e.nI1(19,"async"),e.k0s(),e.DNE(20,mt,2,0,"mat-error",19),e.k0s()()()),2&u){const r=e.sdS(7),x=e.sdS(17),g=e.XpG();e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",r),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(9,10,g.filteredFields[3])),e.R7$(2),e.Y8G("ngIf",g.formControls.base64_field_id_to_save_upload.hasError("required")),e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",x),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(19,12,g.filteredFields[4])),e.R7$(2),e.Y8G("ngIf",g.formControls.name_file_field_id_to_save_upload.hasError("required"))}}function Y(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function N(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function pt(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function ht(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function xt(u,G){if(1&u&&(e.j41(0,"div",35)(1,"div",14)(2,"mat-form-field",23)(3,"mat-label"),e.EFF(4,"Path"),e.k0s(),e.nrm(5,"input",40),e.j41(6,"mat-autocomplete",25,5),e.DNE(8,Y,2,2,"mat-option",26),e.nI1(9,"async"),e.k0s(),e.DNE(10,N,2,0,"mat-error",19),e.k0s()(),e.j41(11,"div",14)(12,"mat-form-field",23)(13,"mat-label"),e.EFF(14,"Chave RM"),e.k0s(),e.nrm(15,"input",41),e.j41(16,"mat-autocomplete",25,6),e.DNE(18,pt,2,2,"mat-option",26),e.nI1(19,"async"),e.k0s(),e.DNE(20,ht,2,0,"mat-error",19),e.k0s()()()),2&u){const r=e.sdS(7),x=e.sdS(17),g=e.XpG();e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",r),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(9,10,g.filteredFields[5])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_path_upload.hasError("required")),e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",x),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(19,12,g.filteredFields[6])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_chaverm_upload.hasError("required"))}}function L(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function tt(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function c(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function R(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function p(u,G){if(1&u&&(e.j41(0,"div",35)(1,"div",14)(2,"mat-form-field",23)(3,"mat-label"),e.EFF(4,"Nome do arquivo"),e.k0s(),e.nrm(5,"input",42),e.j41(6,"mat-autocomplete",25,7),e.DNE(8,L,2,2,"mat-option",26),e.nI1(9,"async"),e.k0s(),e.DNE(10,tt,2,0,"mat-error",19),e.k0s()(),e.j41(11,"div",14)(12,"mat-form-field",23)(13,"mat-label"),e.EFF(14,"Extens\xe3o do arquivo"),e.k0s(),e.nrm(15,"input",43),e.j41(16,"mat-autocomplete",25,8),e.DNE(18,c,2,2,"mat-option",26),e.nI1(19,"async"),e.k0s(),e.DNE(20,R,2,0,"mat-error",19),e.k0s()()()),2&u){const r=e.sdS(7),x=e.sdS(17),g=e.XpG();e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",r),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(9,10,g.filteredFields[7])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_filename_upload.hasError("required")),e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",x),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(19,12,g.filteredFields[8])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_file_extension_upload.hasError("required"))}}function V(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function S(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function vt(u,G){if(1&u&&(e.j41(0,"mat-option",33),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.label," ")}}function yt(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function Ot(u,G){if(1&u&&(e.j41(0,"div",35)(1,"div",14)(2,"mat-form-field",23)(3,"mat-label"),e.EFF(4,"Campo adicional 1"),e.k0s(),e.nrm(5,"input",44),e.j41(6,"mat-autocomplete",25,9),e.DNE(8,V,2,2,"mat-option",26),e.nI1(9,"async"),e.k0s(),e.DNE(10,S,2,0,"mat-error",19),e.k0s()(),e.j41(11,"div",14)(12,"mat-form-field",23)(13,"mat-label"),e.EFF(14,"Campo adicional 2"),e.k0s(),e.nrm(15,"input",45),e.j41(16,"mat-autocomplete",25,10),e.DNE(18,vt,2,2,"mat-option",26),e.nI1(19,"async"),e.k0s(),e.DNE(20,yt,2,0,"mat-error",19),e.k0s()()()),2&u){const r=e.sdS(7),x=e.sdS(17),g=e.XpG();e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",r),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(9,10,g.filteredFields[9])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_additional_upload.hasError("required")),e.R7$(5),e.Y8G("errorStateMatcher",g.matcher)("matAutocomplete",x),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(19,12,g.filteredFields[10])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_additional_2_upload.hasError("required"))}}class It{isErrorState(){return!1}}let jt=(()=>{class u{constructor(r){this.formBuilder=r,this.valueChanged=new e.bkB,this.fields=[],this.filteredFields=[],this.matcher=new It,this.formulario=this.formBuilder.group({type:[{value:"upload",disabled:!0}],name:[null,k.k0.required],field_id_to_save_upload:[null],customClass:[null],bind_more_than_one_field:[!1],type_file_field_id_to_save_upload:[null],status_field_id_to_save_upload:[null],base64_field_id_to_save_upload:[null],name_file_field_id_to_save_upload:[null],field_id_to_save_path_upload:[null],field_id_to_save_chaverm_upload:[null],field_id_to_save_filename_upload:[null],field_id_to_save_file_extension_upload:[null],field_id_to_save_additional_upload:[null],field_id_to_save_additional_2_upload:[null]})}ngOnInit(){this.fields=this.filterByMultivaluedFields(this.dataComponent.data.fields),this.buildAutoCompleteFields(this.fields),this.fillOutForm(),this.addValidatorsToFieldsSaveUpload(this.formulario.get("bind_more_than_one_field").value),this.setUpAutoCompleteFieldFilter(),this.changedValues(),this.bindMoreThanOneFieldValueChanges(),this.checkFormValidationStatus()}changedValues(){this.formulario.valueChanges.subscribe(r=>{this.dataComponent.data.data.name=r.name,this.dataComponent.data.data.field_id_to_save_upload=this.formulario.getRawValue().field_id_to_save_upload,this.dataComponent.data.data.bind_more_than_one_field=r.bind_more_than_one_field,this.dataComponent.data.data.base64_field_id_to_save_upload=r.base64_field_id_to_save_upload,this.dataComponent.data.data.status_field_id_to_save_upload=r.status_field_id_to_save_upload,this.dataComponent.data.data.type_file_field_id_to_save_upload=r.type_file_field_id_to_save_upload,this.dataComponent.data.data.name_file_field_id_to_save_upload=r.name_file_field_id_to_save_upload,this.dataComponent.data.data.field_id_to_save_path_upload=r.field_id_to_save_path_upload,this.dataComponent.data.data.field_id_to_save_chaverm_upload=r.field_id_to_save_chaverm_upload,this.dataComponent.data.data.field_id_to_save_filename_upload=r.field_id_to_save_filename_upload,this.dataComponent.data.data.field_id_to_save_file_extension_upload=r.field_id_to_save_file_extension_upload,this.dataComponent.data.data.field_id_to_save_additional_2_upload=r.field_id_to_save_additional_2_upload,this.dataComponent.data.data.field_id_to_save_additional_upload=r.field_id_to_save_additional_upload,this.formBuild.name=r.name,this.formBuild.customClass=r.customClass})}fillOutForm(){this.formulario.patchValue({name:this.dataComponent.data.data.name,field_id_to_save_upload:this.dataComponent.data.data.field_id_to_save_upload,bind_more_than_one_field:this.dataComponent.data.data.bind_more_than_one_field,base64_field_id_to_save_upload:this.dataComponent.data.data.base64_field_id_to_save_upload,status_field_id_to_save_upload:this.dataComponent.data.data.status_field_id_to_save_upload,type_file_field_id_to_save_upload:this.dataComponent.data.data.type_file_field_id_to_save_upload,name_file_field_id_to_save_upload:this.dataComponent.data.data.name_file_field_id_to_save_upload,field_id_to_save_path_upload:this.dataComponent.data.data.field_id_to_save_path_upload,field_id_to_save_chaverm_upload:this.dataComponent.data.data.field_id_to_save_chaverm_upload,field_id_to_save_filename_upload:this.dataComponent.data.data.field_id_to_save_filename_upload,field_id_to_save_file_extension_upload:this.dataComponent.data.data.field_id_to_save_file_extension_upload,field_id_to_save_additional_upload:this.dataComponent.data.data.field_id_to_save_additional_upload,field_id_to_save_additional_2_upload:this.dataComponent.data.data.field_id_to_save_additional_2_upload,customClass:this.formBuild.customClass})}checkFormValidationStatus(){this.valueChanged.emit(this.dataComponent.data.data.field_id_to_save_upload||this.dataComponent.data.data.type_file_field_id_to_save_upload?"VALID":"INVALID"),this.formulario.statusChanges.subscribe(r=>{this.valueChanged.emit(r)})}buildAutoCompleteFields(r){for(const x in this.formControls)if(x.includes("field_id")){const g=r.filter(X=>X.field_id===this.dataComponent.data.data[x])[0];this.dataComponent.data.data[x]&&g&&(this.dataComponent.data.data[x]=g)}}setUpAutoCompleteFieldFilter(){for(const r in this.formControls)r.includes("field_id")&&this.filteredFields.push(this.formulario.get(r).valueChanges.pipe((0,Z.Z)(""),
1(0,st.T)(x=>x?this._filter(x):this.fields.slice())))}bindMoreThanOneFieldValueChanges(){this.formulario.get("bind_more_than_one_field").valueChanges.subscribe(r=>this.addValidatorsToFieldsSaveUpload(r))}addValidatorsToFieldsSaveUpload(r){for(const x in this.formControls)x.includes("field_id")&&(r||1===r?this.addAndClearValidatorsIfBindMoreThanOneFielIsActive(x):this.addAndClearValidatorsIfBindMoreThanOneFielIsDeactivate(x))}addAndClearValidatorsIfBindMoreThanOneFielIsActive(r){"field_id_to_save_upload"!==r?(this.formulario.get(r).enable(),"type_file_field_id_to_save_upload"===r&&(this.formulario.get(r).setValidators(k.k0.required),this.formulario.get(r).updateValueAndValidity())):(this.formulario.get(r).setValue(""),this.formulario.get(r).disable(),this.formulario.get(r).clearValidators(),this.formulario.get(r).updateValueAndValidity())}addAndClearValidatorsIfBindMoreThanOneFielIsDeactivate(r){"field_id_to_save_upload"!==r?(this.formulario.get(r).setValue(""),this.formulario.get(r).clearValidators(),this.formulario.get(r).updateValueAndValidity()):(this.formulario.get(r).enable(),this.formulario.get(r).setValidators(k.k0.required),this.formulario.get(r).updateValueAndValidity())}filterByMultivaluedFields(r){return r.filter(x=>1===x.multivalued)}_filter(r){if("string"==typeof r){const x=r.toLowerCase();return this.fields.filter(g=>g.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").match(x)).sort((g,X)=>g.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")<X.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?-1:g.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")>X.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?1:0)}return[]}displayFn(r){return r?r.label:void 0}get formControls(){return this.formulario.controls}static{this.\u0275fac=function(x){return new(x||u)(e.rXU(k.ze))}}static{this.\u0275cmp=e.VBU({type:u,selectors:[["app-general-upload-config"]],inputs:{dataComponent:"dataComponent",formBuild:"formBuild"},outputs:{valueChanged:"valueChanged"},decls:45,vars:15,consts:[["fieldIdToSaveUpload","matAutocomplete"],["typeFileFieldIdToSaveUpload","matAutocomplete"],["statusFieldIdToSaveUpload","matAutocomplete"],["base64FieldIdToSaveUpload","matAutocomplete"],["nameFileFieldIdToSaveUpload","matAutocomplete"],["fieldIdToSavePath","matAutocomplete"],["fieldIdToSaveChavermUpload","matAutocomplete"],["fieldIdToSaveFilenameUpload","matAutocomplete"],["fieldIdToSaveFileExtensionUpload","matAutocomplete"],["fieldIdToSaveAdditional","matAutocomplete"],["fieldIdToSaveAdditional2","matAutocomplete"],[3,"formGroup"],["fxLayout","column","fxFlex","80"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row"],["fxFlex",""],["appearance","fill","fxFlex",""],["formControlName","type"],["value","upload"],["matInput","","formControlName","name","required",""],[4,"ngIf"],["fxFlex","","appearance","fill"],["matInput","","formControlName","customClass"],["matTooltip","Defina uma classe customizada para esse elemento","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon",2,"margin-left","10px"],["appearance","fill","fxFlex","100"],["type","text","matInput","","formControlName","field_id_to_save_upload",3,"matAutocomplete"],[3,"displayWith"],[3,"value",4,"ngFor","ngForOf"],["matTooltip","O campo vinculado dever\xe1 ser um campo multivalorado","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",1,"ps_formBuilder_tooltipIcon",2,"margin-left","10px"],["fxLayout","row",1,"ps-row"],["formControlName","bind_more_than_one_field","color","primary"],["matTooltip","Os\xa0campos a ser vinculados devem ser\xa0multivalorado","matTooltipPosition","after","matTooltipClass","ps-tooltip-preLined-content","svgIcon","help",1,"ps-general-upload-tooltip-toggle"],["fxLayout","row","class","ps-row",4,"ngIf"],["fxLayout","row","fxLayoutGap","20px",4,"ngIf"],[3,"value"],[1,"ps-general-upload-info"],["fxLayout","row","fxLayoutGap","20px"],["type","text","matInput","","formControlName","type_file_field_id_to_save_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","status_field_id_to_save_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","base64_field_id_to_save_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","name_file_field_id_to_save_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_path_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_chaverm_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_filename_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_file_extension_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_additional_upload",3,"errorStateMatcher","matAutocomplete"],["type","text","matInput","","formControlName","field_id_to_save_additional_2_upload",3,"errorStateMatcher","matAutocomplete"]],template:function(x,g){if(1&x&&(e.j41(0,"form",11)(1,"div",12)(2,"div",13)(3,"div",14)(4,"mat-form-field",15)(5,"mat-label"),e.EFF(6,"Tipo de componente"),e.k0s(),e.j41(7,"mat-select",16)(8,"mat-option",17),e.EFF(9,"Upload"),e.k0s()()()(),e.j41(10,"div",14)(11,"mat-form-field",15)(12,"mat-label"),e.EFF(13,"Nome"),e.k0s(),e.nrm(14,"input",18),e.DNE(15,rt,2,0,"mat-error",19),e.k0s()()(),e.j41(16,"div",13)(17,"div",14)(18,"mat-form-field",20)(19,"mat-label"),e.EFF(20,"Classe CSS"),e.k0s(),e.nrm(21,"input",21),e.k0s(),e.nrm(22,"mat-icon",22),e.k0s(),e.j41(23,"div",14)(24,"mat-form-field",23)(25,"mat-label"),e.EFF(26),e.k0s(),e.nrm(27,"input",24),e.j41(28,"mat-autocomplete",25,0),e.DNE(30,ft,2,2,"mat-option",26),e.nI1(31,"async"),e.k0s(),e.DNE(32,ct,2,0,"mat-error",19),e.k0s(),e.nrm(33,"mat-icon",27),e.k0s()(),e.j41(34,"div",28)(35,"div",14)(36,"mat-slide-toggle",29),e.EFF(37," Vincule mais de um campo "),e.nrm(38,"mat-icon",30),e.k0s()()(),e.DNE(39,H,4,0,"div",31)(40,it,21,14,"div",32)(41,y,21,14,"div",32)(42,xt,21,14,"div",32)(43,p,21,14,"div",32)(44,Ot,21,14,"div",32),e.k0s()()),2&x){const X=e.sdS(29);e.Y8G("formGroup",g.formulario),e.R7$(15),e.Y8G("ngIf",g.formControls.name.hasError("required")),e.R7$(11),e.SpI(" Vincular campo ",g.formControls.bind_more_than_one_field.value?"":"*"," "),e.R7$(),e.Y8G("matAutocomplete",X),e.R7$(),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(31,13,g.filteredFields[0])),e.R7$(2),e.Y8G("ngIf",g.formControls.field_id_to_save_upload.hasError("required")),e.R7$(7),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value),e.R7$(),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value),e.R7$(),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value),e.R7$(),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value),e.R7$(),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value),e.R7$(),e.Y8G("ngIf",g.formControls.bind_more_than_one_field.value)}},dependencies:[I.Sq,I.bT,k.qT,k.me,k.BC,k.cb,k.YS,k.j4,k.JD,Q.rl,Q.nJ,Q.TL,et.VO,lt.wT,ut.fg,U.An,at.oV,dt.sG,ot.$3,ot.pN,P.DJ,P.BO,P.UI,I.Jj],styles:[".ps-general-upload-tooltip-toggle[_ngcontent-%COMP%]{margin-left:10px;height:17px;width:17px}.ps-general-upload-info[_ngcontent-%COMP%]{font-size:14px;color:#0009}"]})}}return u})();var Rt=n(93337),Lt=n(60033),Gt=n(5951),Bt=n(69697),At=n(85249),Dt=n(93181);const St=()=>["title","description"],Mt=()=>({enabled:!1}),Pt=()=>({vertical:"hidden"}),Nt=(u,G)=>({selectionHighlight:!1,minimap:u,scrollbar:G,readOnly:!0,scrollPredominantAxis:!1,scrollBeyondLastLine:!1,scrollBeyondLastColumn:0});function b(u,G){1&u&&(e.j41(0,"div",1)(1,"div",10),e.nrm(2,"mat-divider"),e.k0s()())}function A(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function l(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function C(u,G){1&u&&(e.j41(0,"mat-error"),e.EFF(1," Campo obrigat\xf3rio "),e.k0s())}function O(u,G){if(1&u&&(e.j41(0,"mat-option",25),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r.value),e.R7$(),e.JRh(r.name)}}function K(u,G){if(1&u&&(e.j41(0,"mat-form-field",22)(1,"mat-label"),e.EFF(2,"Frequ\xeancia"),e.k0s(),e.j41(3,"mat-select",23),e.DNE(4,O,2,2,"mat-option",24),e.k0s()()),2&u){const r=e.XpG(2);e.R7$(4),e.Y8G("ngForOf",r.intervals)}}function Vt(u,G){if(1&u&&(e.j41(0,"div",11)(1,"div",12)(2,"div",13),e.nrm(3,"app-totvs-query-fields",14),e.k0s()(),e.j41(4,"div",15)(5,"mat-form-field",16)(6,"mat-label"),e.EFF(7,"Coligada"),e.k0s(),e.nrm(8,"input",17,0
1),e.DNE(10,A,2,0,"mat-error",9),e.k0s(),e.j41(11,"mat-form-field",16)(12,"mat-label"),e.EFF(13,"Cod Sistema"),e.k0s(),e.nrm(14,"input",18,0),e.DNE(16,l,2,0,"mat-error",9),e.k0s(),e.j41(17,"mat-form-field",16)(18,"mat-label"),e.EFF(19,"Cod Consulta"),e.k0s(),e.nrm(20,"input",19,0),e.DNE(22,C,2,0,"mat-error",9),e.k0s(),e.j41(23,"mat-slide-toggle",20),e.EFF(24," Utilizar cache "),e.k0s(),e.DNE(25,K,5,1,"mat-form-field",21),e.k0s()()),2&u){const r=e.XpG();e.R7$(3),e.Y8G("dataSource",r.dataSource)("displayedColumns",e.lJ4(6,St)),e.R7$(7),e.Y8G("ngIf",r.f.colligate.hasError("required")),e.R7$(6),e.Y8G("ngIf",r.f.system.hasError("required")),e.R7$(6),e.Y8G("ngIf",r.f.code.hasError("required")),e.R7$(3),e.Y8G("ngIf",r.formulario.controls.use_cache.value)}}function $t(u,G){if(1&u&&(e.j41(0,"mat-option",25),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r.id),e.R7$(),e.SpI(" ",r.title," ")}}function Kt(u,G){if(1&u&&(e.j41(0,"div",11)(1,"div",15)(2,"div",26)(3,"mat-form-field",27)(4,"mat-label"),e.EFF(5,"Tipo de envio "),e.k0s(),e.j41(6,"mat-select",28),e.DNE(7,$t,2,2,"mat-option",24),e.k0s()()(),e.j41(8,"div",29)(9,"mat-form-field",27)(10,"mat-label"),e.EFF(11,"Link *"),e.k0s(),e.nrm(12,"input",30),e.k0s()()(),e.j41(13,"div",1)(14,"div",13),e.nrm(15,"app-adds-pareaments",31),e.k0s()(),e.j41(16,"div",1)(17,"span",32),e.EFF(18,"Retorno esperado"),e.k0s()(),e.j41(19,"div",1),e.nrm(20,"td-code-editor",33),e.k0s()()),2&u){const r=e.XpG();e.R7$(7),e.Y8G("ngForOf",r.dataComponent.data.httpTypes),e.R7$(8),e.Y8G("disableOnDestroyFunctions",!0)("systemFields",r.systemFields)("parameters",r.parameters)("formulario",r.formulario),e.R7$(4),e.xc7("margin-bottom",40,"px"),e.R7$(),e.xc7("height",348,"px"),e.Y8G("editorOptions",e.l_i(13,Nt,e.lJ4(11,Mt),e.lJ4(12,Pt)))("value",r.expectedReturn)}}function Ht(u,G){if(1&u&&(e.j41(0,"div")(1,"div",1)(2,"div",10),e.nrm(3,"mat-divider"),e.k0s()(),e.nrm(4,"app-adds-pareaments",34),e.k0s()),2&u){const r=e.XpG();e.R7$(4),e.Y8G("disableOnDestroyFunctions",!0)("systemFields",r.systemFields)("parameters",r.parameters)("formulario",r.formulario)}}let Zt=(()=>{class u{constructor(r,x){this.formBuilder=r,this.addsPareamentsService=x,this.dataSource=[{title:"CODTIPODOCUMENTO",description:"C\xf3digo do tipo de documento"},{title:"DESCRICAODOCUMENTO",description:"Descri\xe7\xe3o do documento"},{title:"OBRIGATORIO",description:"Documento obrigat\xf3rio (1 = Sim, 0 = N\xe3o)"},{title:"STATUSENVIO",description:"Status do envio do documento (1 = Em an\xe1lise, 2 = Recusado, 3 = Aceito)"},{title:"MOTIVORECUSA",description:"Motivo da recusa"},{title:"PATHARQUIVO",description:"Caminho do arquivo no TOTVS"},{title:"CHAVERM",description:"Chave identificadora do arquivo no TOTVS"},{title:"ADICIONAL",description:"Campo adicional"},{title:"ADICIONAL2",description:"Campo adicional"}],this.intervals=[{value:1,name:"15 minutos"},{value:2,name:"30 minutos"},{value:3,name:"1 hora"},{value:4,name:"2 horas"},{value:5,name:"3 horas"},{value:6,name:"6 horas"},{value:7,name:"12 horas"},{value:8,name:"Di\xe1rio"},{value:9,name:"Semanal"}],this.formulario=this.formBuilder.group({}),this.systemFields=new Array,this.valueChanged=new e.bkB,this.expectedReturn='{\n  "documentos": [\n    {\n      "statusenvio": 2,\n      "motivorecusa": "Anexe o verso do Diploma.",\n      "obrigatorio": 1,\n      "descricaodocumento": "Diploma ou Declara\xe7\xe3o de Conclus\xe3o da Gradua\xe7\xe3o",\n      "codtipodocumento": "19"\n    },\n    {\n      "statusenvio": 3,\n      "motivorecusa": "",\n      "obrigatorio": 1,\n      "descricaodocumento": "Hist\xf3rico Escolar de Gradua\xe7\xe3o",\n      "codtipodocumento": "21"\n    }\n  ]\n}'}ngOnInit(){this.selectedDataSourceType(),this.systemFields=JSON.parse(JSON.stringify(this.dataComponent.data.fields))}changesConsultDataSourceType(r){1===r&&this.buildDataStructureTotvs(),2===r&&this.buildDataStructureExternalSource(),this.buildFormByDataSourceType(r),this.dataComponent.data.data.defined_source=r}buildDataStructureTotvs(){this.dataComponent.data.data.totvs_query||(this.dataComponent.data.data.totvs_query={component_id:this.dataComponent.data.data.id,title:"Consulta Personalizada",local_id:3,type_id:2,colligate:null,code:null,use_cache:null,cache_interval_type_id:null,
1system:null,parameters:[]}),this.consultData=this.dataComponent.data.data.totvs_query}buildDataStructureExternalSource(){0===this.dataComponent.data.data.external_source.length&&this.dataComponent.data.data.external_source.push({http_method_type_id:null,position:0,link:null,parameters:[],type_id:1}),this.consultData=this.dataComponent.data.data.external_source}buildFormByDataSourceType(r){1===r&&(this.formulario=this.formBuilder.group({id:[null],colligate:[null,k.k0.required],use_cache:[null],cache_interval_type_id:[null],system:[null,k.k0.required],code:[null,k.k0.required],active_paramn:[!1],parameters:this.formBuilder.array([],Rt.W.slideToggle())}),this.checkChangedValuesOnTheFormTotvs()),2===r&&(this.formulario=this.formBuilder.group({id:[null],type_id:[1],position:0,http_method_type_id:[null,k.k0.required],link:[null,k.k0.required],active_paramn:[!1],parameters:this.formBuilder.array([],Rt.W.slideToggle())}),this.checkChangedValuesOnTheFormExternalSource()),this.setFormulario(this.consultData),this.checkFormValidationStatus()}selectedDataSourceType(){1===this.dataComponent.data.data.defined_source&&(this.typeOfConsultCategorySelected=1,this.changesConsultDataSourceType(1)),2===this.dataComponent.data.data.defined_source&&(this.typeOfConsultCategorySelected=2,this.changesConsultDataSourceType(2))}checkFormValidationStatus(){this.valueChanged.emit(this.formulario.status),this.formulario.statusChanges.subscribe(r=>{this.valueChanged.emit(r)})}checkChangedValuesOnTheFormTotvs(){this.formulario.valueChanges.subscribe(r=>{this.consultData.id=r.id,this.consultData.colligate=r.colligate,this.consultData.code=r.code,this.consultData.system=r.system,this.consultData.use_cache=r.use_cache,this.consultData.cache_interval_type_id=r.cache_interval_type_id,this.consultData.parameters=r.parameters,this.consultData.active_paramn=r.active_paramn})}checkChangedValuesOnTheFormExternalSource(){this.formulario.valueChanges.subscribe(r=>{this.consultData[0].id=r.id,this.consultData[0].type_id=r.type_id,this.consultData[0].position=r.position,this.consultData[0].http_method_type_id=r.http_method_type_id,this.consultData[0].link=r.link,this.consultData[0].parameters=r.parameters,this.consultData[0].active_paramn=r.active_paramn})}setFormulario(r){Array.isArray(r)||(r=[r]),r.length>0&&r.filter(x=>{this.formulario.patchValue(x,{emitEvent:!1}),x.parameters.length>0&&(this.formulario.patchValue({active_paramn:!0},{emitEvent:!1}),this.addsPareamentsService.setValuesParameters(x.parameters)),0===x.parameters.length&&this.addsPareamentsService.setValuesParameters(void 0)})}get f(){return this.formulario.controls}static{this.\u0275fac=function(x){return new(x||u)(e.rXU(k.ze),e.rXU(Lt.g))}}static{this.\u0275cmp=e.VBU({type:u,selectors:[["app-consult-upload-config"]],inputs:{dataComponent:"dataComponent"},outputs:{valueChanged:"valueChanged"},decls:16,vars:8,consts:[["input",""],["fxLayout","row"],["fxFlex","",1,"ps-type-font-upload-content"],[1,"ps-unexpected-return"],["fxLayoutGap","20px",3,"change","ngModelChange","ngModel"],["color","primary",3,"value"],["fxLayout","row",4,"ngIf"],[3,"formGroup"],["class","ps-consult-upload-content",4,"ngIf"],[4,"ngIf"],["fxFlex","100"],[1,"ps-consult-upload-content"],["fxLayout","row",1,"ps-row-custom-two"],["fxFlex",""],[3,"dataSource","displayedColumns"],["fxLayout","row","fxLayoutGap","20px"],["appearance","fill","fxFlex","18"],["matInput","","formControlName","colligate","required",""],["matInput","","formControlName","system","required",""],["matInput","","formControlName","code","required",""],["color","primary","formControlName","use_cache"],["appearance","fill","fxFlex","20",4,"ngIf"],["appearance","fill","fxFlex","20"],["formControlName","cache_interval_type_id"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","30"],["appearance","fill","fxFlex",""],["formControlName","http_method_type_id"],["fxFlex","50"],["matInput","","type","text","formControlName","link"],[1,"ps-edit-form-parameters-custom-upload",3,"disableOnDestroyFunctions","systemFields","parameters","formulario"],[1,"ps-expected-return-upload"],["theme","vs-dark","language","javascript","fxFlex","60",1,"monaco-editor-custom-upload",3,"editorOptions","value"],[3,"disableOnDestroyFunctions","systemFields","parameters","formulario"]],template:function(x,g){1&x&&(e.j41(0,"div",1)(1,"div",2)(2,"p"),e.EFF(3," Fonte "),e.j41(4,"span",3),e.
1EFF(5,"Caso o retorno n\xe3o corresponda com o de exemplo, o componente de upload n\xe3o ser\xe1 exibido no formul\xe1rio."),e.k0s()(),e.j41(6,"mat-radio-group",4),e.bIt("change",function(gt){return g.changesConsultDataSourceType(gt.value)}),e.mxI("ngModelChange",function(gt){return e.DH7(g.typeOfConsultCategorySelected,gt)||(g.typeOfConsultCategorySelected=gt),gt}),e.j41(7,"mat-radio-button",5),e.EFF(8,"TOTVS"),e.k0s(),e.j41(9,"mat-radio-button",5),e.EFF(10,"Sistema externo"),e.k0s()()()(),e.DNE(11,b,3,0,"div",6),e.j41(12,"form",7),e.DNE(13,Vt,26,7,"div",8)(14,Kt,21,16,"div",8)(15,Ht,5,4,"div",9),e.k0s()),2&x&&(e.R7$(6),e.R50("ngModel",g.typeOfConsultCategorySelected),e.R7$(),e.Y8G("value",1),e.R7$(2),e.Y8G("value",2),e.R7$(2),e.Y8G("ngIf",g.typeOfConsultCategorySelected),e.R7$(),e.Y8G("formGroup",g.formulario),e.R7$(),e.Y8G("ngIf",1===g.typeOfConsultCategorySelected),e.R7$(),e.Y8G("ngIf",2===g.typeOfConsultCategorySelected),e.R7$(),e.Y8G("ngIf",1===g.typeOfConsultCategorySelected))},dependencies:[I.Sq,I.bT,k.qT,k.me,k.BC,k.cb,k.YS,k.vS,k.j4,k.JD,Q.rl,Q.nJ,Q.TL,et.VO,lt.wT,ut.fg,E.q,dt.sG,Gt.VT,Gt._g,P.DJ,P.BO,P.UI,Bt.A,At.J,Dt.go],styles:[".ps-row-custom-two[_ngcontent-%COMP%]{margin-bottom:31px}.ps-consult-upload-content[_ngcontent-%COMP%]{padding:24px 24px 20px}.ps-type-font-upload-content[_ngcontent-%COMP%]{padding:24px}.ps-type-font-upload-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;font-weight:500}.ps-type-font-upload-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-weight:400}  .ps-edit-form-parameters-custom-upload .ps-adds-pareaments-input-content{padding:0!important}  .ps-edit-form-parameters-custom-upload .ps-adds-pareaments-toggle-content{padding:0!important;margin-bottom:22px!important}  .monaco-editor-custom-upload{max-width:73%!important}  .monaco-editor-custom-upload .monaco-editor{padding-top:20px;padding-bottom:20px;border-radius:4px}.ps-expected-return-upload[_ngcontent-%COMP%]{font-size:14px;color:#0009;margin-bottom:10px}.ps-unexpected-return[_ngcontent-%COMP%]{display:block;font-family:Roboto,Helvetica Neue,sans-serif;font-style:normal;font-size:13px;line-height:24px;color:#0009;margin-top:2px;margin-bottom:10px}"]})}}return u})();var Yt=n(36471);const Qt=["trigger"],qt=(u,G)=>G.name;function te(u,G){if(1&u&&(e.j41(0,"mat-option",20),e.EFF(1),e.k0s()),2&u){const r=G.$implicit;e.Y8G("value",r.id),e.R7$(),e.SpI(" ",r.name," ")}}function ee(u,G){if(1&u){const r=e.RV6();e.j41(0,"mat-option",21),e.bIt("click",function(g){e.eBV(r);const X=e.XpG(),gt=e.sdS(27);return e.Njj(X.remainsOpenPanel(g,gt))}),e.EFF(1),e.k0s()}if(2&u){const r=G.$implicit;e.Y8G("value",r),e.R7$(),e.SpI(" ",r.name," ")}}function ae(u,G){if(1&u){const r=e.RV6();e.j41(0,"mat-chip",22),e.bIt("removed",function(){const g=e.eBV(r),X=g.$implicit,gt=g.$index,Et=e.XpG();return e.Njj(Et.removesSelectedFileTypes(X,gt))}),e.EFF(1),e.j41(2,"mat-icon",23),e.EFF(3,"cancel"),e.k0s()()}if(2&u){const r=G.$implicit;e.Y8G("removable",!0),e.R7$(),e.SpI(" ",r.name," ")}}let oe=(()=>{class u{constructor(r){this.formBuilder=r,this.valueChanged=new e.bkB,this.fileTypes=[],this.sizeTypes=[],this.selectedFileType=[],this.fileFormat=new k.hs,this.formulario=this.formBuilder.group({upload_max_size:[null],upload_size_type_id:[null],upload_multiple_files:[0],block_attaching_reject_files:[!1],component_upload_file_types:this.formBuilder.array([])})}ngOnInit(){this.fileTypes=this.dataComponent.data.fileTypes,this.sizeTypes=this.dataComponent.data.sizeTypes,this.setDataFromTheUploadComponentSettings(),this.initAutoComplete(),this.setValuesOnForm(),this.checkChangedValuesOnTheForm()}initAutoComplete(){this.fileTypes=this._filter(""),this.filteredOptions=this.fileFormat.valueChanges.pipe((0,Z.Z)(""),(0,st.T)(r=>r?this._filter(r):this.fileTypes.slice()))}selectedFileFormat(r){this.formulario.get("component_upload_file_types").push(this.formBuilder.group({upload_file_type_id:r.option.value.id,name:r.option.value.name})),this.removesFileTypes(r.option.value)}removesSelectedFileTypes(r,x){r.id=r.upload_file_type_id,this.formulario.get("component_upload_file_types").removeAt(x),this.addFileTypes(r)}removesFileTypes(r){const x=this.fileTypes.indexOf(this.fileTypes.find(g=>g.id===r.id));x>
1=0&&(this.fileTypes.splice(x,1),this.fileFormat.setValue(null),this.initAutoComplete())}remainsOpenPanel(r,x){r.stopPropagation(),x.openPanel()}addFileTypes(r){this.fileTypes.push(r),this.initAutoComplete()}_filter(r){if("string"==typeof r){const x=r.toLowerCase();return this.fileTypes.filter(g=>g.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").match(x)).sort((g,X)=>g.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")<X.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?-1:g.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")>X.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")?1:0)}return[]}checkChangedValuesOnTheForm(){this.formulario.valueChanges.subscribe(r=>{this.dataComponent.data.data.upload_max_size=r.upload_max_size,this.dataComponent.data.data.upload_size_type_id=r.upload_size_type_id,this.dataComponent.data.data.component_upload_file_types=r.component_upload_file_types,this.dataComponent.data.data.upload_multiple_files=r.upload_multiple_files,this.dataComponent.data.data.block_attaching_reject_files=r.block_attaching_reject_files})}setValuesOnForm(){if(this.formulario.patchValue(this.dataComponent.data.data),this.dataComponent.data.data.component_upload_file_types.length>0){const r=this.formulario.get("component_upload_file_types");this.dataComponent.data.data.component_upload_file_types.filter((x,g)=>{r.push(this.formBuilder.group({id:x.id,upload_file_type_id:x.upload_file_type_id,name:this.returnsTheFileTypeName(x.upload_file_type_id)})),this.removesFileTypes({id:x.upload_file_type_id,name:this.returnsTheFileTypeName(x.upload_file_type_id)})})}}returnsTheFileTypeName(r){return this.fileTypes.find(x=>x.id===r).name}displayFn(r){return r?r.name:""}setDataFromTheUploadComponentSettings(){this.dataComponent.data.data.component_upload_file_types||(this.dataComponent.data.data.upload_max_size=null,this.dataComponent.data.data.upload_size_type_id=null,this.dataComponent.data.data.upload_multiple_files=!1,this.dataComponent.data.data.block_attaching_reject_files=!1,this.dataComponent.data.data.component_upload_file_types=[])}get f(){return this.formulario.controls}static{this.\u0275fac=function(x){return new(x||u)(e.rXU(k.ze))}}static{this.\u0275cmp=e.VBU({type:u,selectors:[["app-settings-upload-config"]],viewQuery:function(x,g){if(1&x&&e.GBs(Qt,5,ot.pN),2&x){let X;e.mGM(X=e.lsd())&&(g.trigger=X.first)}},inputs:{dataComponent:"dataComponent",formBuild:"formBuild"},outputs:{valueChanged:"valueChanged"},decls:37,vars:12,consts:[["trigger","matAutocompleteTrigger"],["auto","matAutocomplete"],[3,"formGroup"],["fxLayout","column","fxFlex","70"],["fxLayout","column",1,"ps-row"],["fxFlex",""],["formControlName","upload_multiple_files","color","primary"],["formControlName","block_attaching_reject_files","color","primary"],["fxLayout","row","fxLayoutGap","20px",1,"ps-row"],["appearance","fill","fxFlex",""],["matInput","","formControlName","upload_max_size","type","number"],["formControlName","upload_size_type_id"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","row",1,"ps-row"],["appearance","fill","fxFlex","48.5"],["type","text","matInput","",3,"formControl","matAutocomplete"],[3,"optionSelected","displayWith"],[3,"value","click",4,"ngFor","ngForOf"],["fxLayout","row"],[3,"removable"],[3,"value"],[3,"click","value"],[3,"removed","removable"],["matChipRemove",""]],template:function(x,g){if(1&x){const X=e.RV6();e.j41(0,"form",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"mat-slide-toggle",6),e.EFF(5," Permitir mais de um arquivo do mesmo tipo "),e.k0s()(),e.j41(6,"div",5)(7,"mat-slide-toggle",7),e.EFF(8," N\xe3o permitir reenvio de documentos recusados "),e.k0s()()(),e.j41(9,"div",8)(10,"div",5)(11,"mat-form-field",9)(12,"mat-label"),e.EFF(13,"Tamanho m\xe1ximo"),e.k0s(),e.nrm(14,"input",10),e.k0s()(),e.j41(15,"div",5)(16,"mat-form-field",9)(17,"mat-label"),e.EFF(18,"Unidade"),e.k0s(),e.j41(19,"mat-select",11),e.DNE(20,te,2,2,"mat-option",12),e.k0s()()()(),e.j41(21,"div",13)(22,"div",5)(23,"mat-form-field",14)(24,"mat-label"),e.EFF(25,"Formato de arquivo"),e.k0s(),e.nrm(26,"input",15,0),e.j41(28,"mat-autocomplete",16,1),e.bIt("optionSelected",function(Et){return e.eBV(X),e.Njj(g.selectedFileFormat(Et))}),e.DNE(30,ee,2,2,"mat-option",17),e.nI1(31,"async"),e.k0s()()()(),e.j41(32,"div",18)(33,"div",5)(34,"mat-chip-set"),e.Z7z(35,ae,4,2,"mat-chip",19,qt),e.k0s()()()()()}if(2&x){const X=e.sdS(29);e.Y8G("formGroup",g.formulario),e.R7$(4),e.xc7("margin","15px 0px"),e.R7$(3),e.xc7("margin","15px 0px"),e.R7$(13),e.Y8G("ngForOf",g.sizeTypes),e.R7$(6),e.Y8G("formControl",g.f
1ileFormat)("matAutocomplete",X),e.R7$(2),e.Y8G("displayWith",g.displayFn),e.R7$(2),e.Y8G("ngForOf",e.bMT(31,10,g.filteredOptions)),e.R7$(5),e.Dyx(g.f.component_upload_file_types.value)}},dependencies:[I.Sq,k.qT,k.me,k.Q0,k.BC,k.cb,k.l_,k.j4,k.JD,Q.rl,Q.nJ,et.VO,lt.wT,ut.fg,Yt.Jl,Yt.Zv,Yt.Jo,U.An,dt.sG,ot.$3,ot.pN,P.DJ,P.BO,P.UI,I.Jj]})}}return u})();const ie=()=>({value:1,name:"Mostrar este componente"}),Ut=()=>({value:2,name:"Ocultar este componente"}),ne=(u,G)=>[u,G],se=u=>({data:u}),Xt=u=>[u],Jt=u=>({components:u});function Wt(u,G){1&u&&(e.j41(0,"div",20),e.EFF(1," O componente precisa ser salvo no formul\xe1rio antes de configurar uma consulta "),e.k0s())}function re(u,G){if(1&u){const r=e.RV6();e.j41(0,"app-consult-upload-config",22),e.bIt("valueChanged",function(g){e.eBV(r);const X=e.XpG(2);return e.Njj(X.changesConsultValidationStatus(g))}),e.k0s()}if(2&u){const r=e.XpG(2);e.Y8G("dataComponent",r.dataComponent)}}function le(u,G){if(1&u&&(e.j41(0,"div"),e.DNE(1,re,1,1,"app-consult-upload-config",21),e.k0s()),2&u){const r=e.XpG();e.R7$(),e.Y8G("ngIf",r.dataComponent.data.data.id)}}function de(u,G){if(1&u){const r=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){e.eBV(r);const g=e.XpG();return e.Njj(g.saveUpload())}),e.EFF(1," Salvar "),e.k0s()}if(2&u){const r=e.XpG();e.Y8G("disabled","INVALID"===r.generalFormValidationStatus)}}function me(u,G){if(1&u){const r=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){e.eBV(r);const g=e.XpG();return e.Njj(g.saveConsultByDefinedSourceType())}),e.EFF(1," Salvar "),e.k0s()}if(2&u){const r=e.XpG();e.Y8G("disabled","INVALID"===r.consultFormValidationStatus)}}function pe(u,G){if(1&u){const r=e.RV6();e.j41(0,"button",24),e.bIt("click",function(){e.eBV(r);const g=e.XpG();return e.Njj(g.clickSaveAsNewCustomComponent())}),e.EFF(1," Salvar como novo "),e.k0s()}if(2&u){const r=e.XpG();e.Y8G("disabled",r.invalidLogic||"INVALID"===r.generalFormValidationStatus)}}function ce(u,G){if(1&u){const r=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){e.eBV(r);const g=e.XpG();return e.Njj(g.saveCustomComponentConsultByDefinedSourceType())}),e.EFF(1," Salvar "),e.k0s()}if(2&u){const r=e.XpG();e.Y8G("disabled","INVALID"===r.consultFormValidationStatus)}}function ue(u,G){if(1&u){const r=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){e.eBV(r);const g=e.XpG();return e.Njj(g.clickCustomComponent())}),e.EFF(1," Salvar "),e.k0s()}if(2&u){const r=e.XpG();e.Y8G("disabled",r.invalidLogic||"INVALID"===r.generalFormValidationStatus)}}let fe=(()=>{class u{constructor(r,x,g,X,gt,Et){this.dataComponent=r,this.dialogRef=x,this.saveEditQueryDataService=g,this.loaderService=X,this.systemComponentsService=gt,this.serviceConfirm=Et,this.consultFormValidationStatus="INVALID",this.resetConsultComponent=[{}],this.usingSaveOrCancelButtons=!1,this.main_component=!1,this.invalidLogic=!1}ngOnInit(){this.main_component=this.dataComponent.data.data?.main_component||!1,this.dataComponent.data.data.save_as_new=!1,this.dataComponent.data.data?.external_source||(this.dataComponent.data.data.external_source=[]),this.formBuild=JSON.parse(this.dataComponent.data.data.form_build),this.uploadDataUnchanged=JSON.parse(JSON.stringify(this.dataComponent.data.data))}logicChanged(r){this.verifyLogic(r),this.formBuild=r,this.dataComponent.data.data.logics=r.logics,this.dataComponent.data.data.action_logic_id=r.action_logic_id?r.action_logic_id:null,this.dataComponent.data.data.condition_logic_id=r.condition_logic_id?r.condition_logic_id:null,this.dataComponent.data.data.logic_enabled=r.logic_enabled}checkLogicRuleValue(r){return!(![3,4].includes(r.rule_logic_id)&&null==r.fixed_value&&!r.fixed_value)}verifyLogic(r){if(r.logic_enabled)if(r.condition_logic_id&&r.action_logic_id)if(r.logics.length>0){const x=r.logics.every(g=>g.field_compare_id&&g.rule_logic_id&&this.checkLogicRuleValue(g));this.invalidLogic=!x}else this.invalidLogic=!1;else this.invalidLogic=!0;else this.invalidLogic=!1}saveUpload(){this.saveDataInElement(),this.dialogRef.close(this.dataComponent.data.data)}saveDataInElement(){this.usingSaveOrCancelButtons=!0,this.dataComponent.data.result=!0,this.dataComponent.data.data.form_build=JSON.stringify(this.formBuild),this.dataComponent.data.data.label=this.formBuild.label,this.dataComponent.data.data.name=this.formBuild.name,this.dataComponent.data.data.description=this.formBuild.description,this.formatsUploadBindFieldsId(this.dataComponent.data.data),this.saveConsultByDefinedSourceType()}clickSaveAsNewCustomComponent(){this.serviceConfirm.openConfirm("Deseja salvar como novo?","O atual componente n\xe3o ser\xe1 alterado.","Salvar","Cancelar").afterClosed().subscribe(r=>{r&&(this.dataComponent.data.data.action="add",this.dataComponent.data.data.save_as_new=!0,this.saveDataInElement(),this.saveCustomComponent())})}clickCustomComponent(r=!1){r?(this.saveDataInElement(),this.saveCustomComponent()):this.dataComponent.data.data?.id?this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(x=>{x&&(this.saveDataInElement(),this.saveCustomComponent())}):(this.saveDataInElement(),this.saveCustomComponent())}formatsUploadBindFieldsId(r){for(const x in r)x.includes("field_id_to_save_")&&null!==r[x]&&r[x]&&"object"==typeof r[x]&&(r[x]=r[x].field_id)}saveConsultByDefinedSourceType(){1===this.dataComponent.data.data.defined_source&&(this.dataComponent.data.data.external_source=null,!this.dataComponent.data.data?.save_as_new&&this.saveConsultByTotvs()),2===this.dataComponent.data.data.defined_source&&(this.dataComponent.data.data.totvs_query=null,this.saveConsultExternal())}saveCustomComponentConsultByDefinedSourceType(){this.serviceConfirm.openConfirm("Aten\xe7\xe3o","Ao salvar as altera\xe7\xf5es, todos os portais que utilizam esse componente ser\xe3o atualizados.","Salvar","Cancelar").afterClosed().subscribe(r=>{r&&(1===this.dataComponent.data.data.defined_source&&(this.dataComponent.data.data.external_source=null,this.saveConsultByTotvs()),2===this.dataComponent.data.data.defined_source&&(this.dataComponent.data.data.totvs_query=null,this.saveConsultExternal())),this.clickCustomComponent(!0)})}saveConsultByTotvs(){this.formatsConsultParametersForsendingTheServer(),this.loaderService.setChangesLoaderState(!0),this.saveEditQueryDataService.create(this.dataComponent.data.data.totvs_query).subscribe(r=>{r.success?(this.dataComponent.data.data.totvs_query=r.data,this.resetConsultComponent[0]={},this.saveConsultExternal(),this.loaderService.setChangesLoaderState(!1,"Consulta configurada com sucesso","ok","success")):this.loaderService.setChangesLoaderState(!1,"N\xe3o foi poss\xedvel configurar a consulta, tente novamente mais tarde !","ok","alert")}
1,r=>{this.loaderService.setChangesLoaderState(!1,r.body,"","error",r.title,1e5)})}saveConsultExternal(){this.usingSaveOrCancelButtons=!0,this.dataComponent.data.result=!0,this.dataComponent.data.data.form_build=JSON.stringify(this.formBuild),this.dataComponent.data.data.label=this.formBuild.label,this.dataComponent.data.data.name=this.formBuild.name,this.dataComponent.data.data.description=this.formBuild.description,this.formatsUploadBindFieldsId(this.dataComponent.data.data),this.formatsConsultParametersForsendingTheServer(),!this.main_component&&this.dialogRef.close(this.dataComponent.data.data)}saveCustomComponent(){const r={content:{...this.dataComponent.data.data}};delete r.content.keys,this.systemComponentsService.create(r).subscribe(x=>{x.success?(this.dataComponent.data.result=!0,this.dataComponent.data.data={...this.dataComponent.data.data,...x.data},this.dialogRef.close(this.dataComponent.data.data)):(this.dataComponent.data.result=!1,this.dialogRef.close())})}changesConsultValidationStatus(r){this.consultFormValidationStatus=r}changesGeneralValidationStatus(r){this.generalFormValidationStatus=r}formatsConsultParametersForsendingTheServer(){this.dataComponent.data.data.totvs_query&&this.dataComponent.data.data.totvs_query.parameters&&(!1===this.dataComponent.data.data.totvs_query.active_paramn&&(this.dataComponent.data.data.totvs_query.parameters=[]),this.dataComponent.data.data.totvs_query.parameters.filter(r=>{r.field_id&&r.field_id.field_id&&(r.field_id=r.field_id.field_id)})),this.dataComponent.data.data.external_source&&this.dataComponent.data.data.external_source.map(r=>{!1===r.active_paramn&&(r.parameters=[]),r.parameters.map(x=>{x.field_id&&x.field_id.field_id&&(x.field_id=x.field_id.field_id)})})}cancelUpload(){this.usingSaveOrCancelButtons=!0,(0,M.Ns)(this.dataComponent.data.data,this.uploadDataUnchanged),this.dialogRef.close()}ngOnDestroy(){this.usingSaveOrCancelButtons||this.cancelUpload()}static{this.\u0275fac=function(x){return new(x||u)(e.rXU(_.m),e.rXU(t.CP),e.rXU(f.j),e.rXU(m.Z),e.rXU(a.x),e.rXU(j.G))}}static{this.\u0275cmp=e.VBU({type:u,selectors:[["app-dialog-upload-config"]],decls:25,vars:27,consts:[["consult",""],["mat-stretch-tabs","false",1,"ps-mat-tab-group-upload-config",3,"animationDuration"],["label","Geral"],[1,"ps-dialog-upload-config-content",3,"valueChanged","dataComponent","formBuild"],["label","Configura\xe7\xf5es"],[1,"ps-dialog-upload-config-content",3,"dataComponent"],["label","Consulta"],["style","padding: 24px;",4,"ngIf"],[4,"ngFor","ngForOf"],["label","L\xf3gica"],["fxFlex","100",1,"ps-edit-form-logic-upload-config",3,"valueChanged","info","actionsButton","item","keys","currentForm"],[1,"ps-btn-rubeus-add-action-form-save-bar"],["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxFill",""],["fxFlex","","fxLayoutAlign","end center"],[1,"ps-form-save-bar-buttons"],["mat-button","",3,"click"],["class","ps-btn-rubeus-add-action-form-save-bar-btn","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["mat-stroked-button","","class","ps-btn-rubeus-add-action-form-save-bar-btn","color","primary",3,"disabled","click",4,"ngIf"],[2,"padding","24px"],[3,"dataComponent","valueChanged",4,"ngIf"],[3,"valueChanged","dataComponent"],["mat-raised-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"],["mat-stroked-button","","color","primary",1,"ps-btn-rubeus-add-action-form-save-bar-btn",3,"click","disabled"]],template:function(x,g){if(1&x){const X=e.RV6();e.j41(0,"mat-tab-group",1)(1,"mat-tab",2)(2,"app-general-upload-config",3),e.bIt("valueChanged",function(Et){return e.eBV(X),e.Njj(g.changesGeneralValidationStatus(Et))}),e.k0s()(),e.j41(3,"mat-tab",4),e.nrm(4,"app-settings-upload-config",5),e.k0s(),e.j41(5,"mat-tab",6,0),e.DNE(7,Wt,2,0,"div",7)(8,le,2,1,"div",8),e.k0s(),e.j41(9,"mat-tab",9)(10,"app-edit-form-logic",10),e.bIt("valueChanged",function(Et){return e.eBV(X),e.Njj(g.logicChanged(Et))}),e.k0s()()(),e.j41(11,"mat-dialog-actions",11)(12,"div",12)(13,"div",13),e.nrm(14,"mat-divider"),e.k0s()(),e.j41(15,"div",14)(16,"div",15)(17,"div",16)(18,"button",17),e.bIt("click",function(){return e.eBV(X),e.Njj(g.cancelUpload())}),e.EFF(19," Cancelar "),e.k0s(),e.DNE(20,de,2,1,"button",18)(21,me,2,1,"button",18)(22,pe,2,1,"button",19)(23,ce,2,1,"button",18)(24,ue,2,1,"button",18),e.k0s()()()()}if(2&x){const X=e.sdS(6);e.Y8G("animationDuration","0ms"),e.R7$(2),e.Y8G("dataComponent",g.dataComponent)("formBuild",g.formBuild),e.R7$(2),e.Y8G("dataComponent",g.dataComponent),e.R7$(3),e.Y8G("ngIf",!g.dataComponent.data.data.id),e.R7$(),e.Y8G("ngForOf",g.resetConsultComponent),e.R7$(2),e.Y8G("info","Crie regras para mostrar ou ocultar o componente, dependendo dos valores de outros campos.")("actionsButton",e.l_i(18,ne,e.lJ4(16,ie),e.lJ4(17,Ut)))("item",e.eq3(21,se,g.dataComponent.data.data))("keys",g.dataComponent.data.data.keys)("currentForm",e.eq3(25,Jt,e.eq3(23,Xt,g.formBuild))),e.R7$(10),e.Y8G("ngIf",!X.isActive&&!g.main_component),e.R7$(),e.Y8G("ngIf",X.isActive&&!g.main_component),e.R7$(),e.Y8G("ngIf",g.main_component&&(null==g.dataComponent.data.data?null:g.dataComponent.data.data.id)),e.R7$(),e.Y8G("ngIf",X.isActive&&g.main_component),e.R7$(),e.Y8G("ngIf",!X.isActive&&g.main_component)}},dependencies:[I.Sq,I.bT,F.$z,T.mq,T.T8,E.q,t.E7,P.DJ,P.sA,P.G2,P.UI,J.S,jt,Zt,oe],styles:[".ps-btn-rubeus-add-action-form-save-bar[_ngcontent-%COMP%]{height:57px;position:absolute;bottom:0;width:100%;padding:0;display:block;margin-bottom:0;z-index:1}.ps-btn-rubeus-add-action-form-save-bar-btn[_ngcontent-%COMP%]{margin-right:18px}  .ps-mat-tab-group-upload-config .mat-mdc-tab-body-content{height:477px;overflow:auto}  .ps-edit-form-logic-upload-config .ps_formBuilder_formContainer{padding:24px;width:auto!important}  .ps-edit-form-logic-upload-config .ps_formBuilder_formContainer_margin{margin:0!important}.ps-dialog-upload-config-content[_ngcontent-%COMP%]{display:block;padding:24px}"]})}}return u})()},56027:(nt,B,n)=>{n.d(B,{r:()=>a});var f=n(84412),M=n(54438);let a=(()=>{class e{constructor(){this.checksIfItWasChanged=new f.t({changed:!1}),this.hasBeenChanged=this.checksIfItWasChanged.asObservable()}setChanged(t){this.checksIfItWasChanged.next(t)}static{this.\u0275fac=function(m){return new(m||e)}}static{this.\u0275prov=M.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})()},9945:(nt,B,n)=>{n.d(B,{p:()=>a});var f=n(84412),M=n(54438);let a=(()=>{class e{constructor(){this.checksIfItWasChanged=new f.t({changed:!1}),this.hasBeenChanged=this.checksIfItWasChanged.asObservable()}setChanged(t){this.checksIfItWasChanged.next(t)}static{this.\u0275fac=function(m){return new(m||e)}}static{this.\u0275prov=M.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})()},65895:(nt,B,n)=>{n.d(B,{A:()=>a});var f=n(60177),M=n(54438);let a=(()=>{class e{constructor(t){this.keyValuePipe=new f.lG(t)}transform(t){return this.keyValuePipe.transform(t,e.compareNumericKeys.bind(this))}static compareNumericKeys(t,m){const j=parseInt(t.key,10),I=parseInt(m.key,10);return isNaN(j)||isNaN(I)?t.key.localeCompare(m.key):j-I}static{this.\u0275fac=function(m){return new(m||e)(M.rXU(M.MKu,16))}}static{this.\u0275pipe=M.EJ8({name:"keyvalueNumeric",type:e,pure:!0,standalone:!0})}}return e})()},49505:(nt,B,n)=>{n.d(B,{T:()=>M});var f=n(54438);let M=(()=>{class a{transform(_){return _?parseInt(_,10):0}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275pipe=f.EJ8({name:"toNumber",type:a,pure:!1})}}return a})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.