1import{a as J,b as $,c as Q}from"./chunk-ZIGGKU2T.js";import{Ba as mt,E as st,G as dt,T as ct,b as lt}from"./chunk-D2DXWN37.js";import{R as ot,s as nt,z as at}from"./chunk-ZTSILIWW.js";import{a as rt}from"./chunk-E4RNTLEE.js";import{b as re}from"./chunk-UTIROFZB.js";import{P as Ue,Q as Ge,V as it,b as Pe,g as Le,q as De,r as ke,w as Ve}from"./chunk-STQRMAKW.js";import{$ as we,Ba as Ae,D as ye,E as Se,Ha as Ie,Oa as Me,Wa as Ne,Ya as Be,Z as Ee,Za as Re,_ as Fe,_a as Oe,aa as Te,ab as qe,b as he,cb as $e,d as x,g as _e,h as ge,jb as je,kb as He,l as fe,m as ve,mb as We,nb as Je,ob as Qe,p as Ce,rb as Ye,s as xe,sb as Ze,tb as Ke,v as ze,vb as Xe,wb as et,xb as tt,z as be}from"./chunk-E6SPOSAE.js";import{$a as w,$b as W,Ab as o,Ba as N,Bb as g,Cb as y,Cc as ie,Db as te,Ga as ee,Hb as D,Hc as ne,Hf as se,Ib as k,J as M,Jb as V,Jf as de,Kf as ce,Ma as I,Mf as me,Pa as d,Pb as C,Q as K,Ra as H,Vb as m,Xb as h,Ya as F,Yb as q,_ as X,_a as L,ab as T,ag as pe,ba as z,bb as n,c as Z,ca as b,cb as i,cg as ue,db as _,hb as A,kb as S,ke as oe,mb as f,nd as ae,pb as j,xa as r,xf as le,zb as O}from"./chunk-CECBUGKR.js";import{a as R,b as G,h as Y}from"./chunk-O7S4L63H.js";var ht=()=>["condominio"],_t=()=>["unidade"],gt=()=>({standalone:!0}),ft=()=>({x:"100%"}),E=()=>({prefix:"R$ ",thousands:".",decimal:",",align:"right",allowNegative:!1}),vt=()=>[0,14],Ct=(s,c)=>c.titularCobrancaId,xt=(s,c)=>c.pessoaHasUnidadeId;function zt(s,c){if(s&1){let e=A();n(0,"button",11),S("click",function(){z(e);let a=f();return b(a.prevStep())}),o(1,"Anterior"),i()}if(s&2){let e=f();d("disabled",e.isSubmiting)}}function bt(s,c){if(s&1){let e=A();n(0,"button",11),S("click",function(){z(e);let a=f();return b(a.nextStep())}),o(1," Pr\xF3ximo "),i()}if(s&2){let e=f();d("disabled",e.isSubmiting)}}function yt(s,c){if(s&1&&_(0,"nz-step",8),s&2){let e=c.$implicit,t=c.$index,a=f();d("nzDisabled",a.currentStepIndex!=t&&!a.canProceed(t)||a.isSubmiting)("nzTitle",e.title)}}function St(s,c){if(s&1){let e=A();n(0,"nz-col",12)(1,"nz-alert",37),S("nzOnClose",function(){let a=z(e).$implicit,l=f(2);return b(l.closeErrorAlert(a))}),i()()}if(s&2){let e=c.$implicit;r(),j("nzMessage",e)}}function Et(s,c){if(s&1&&_(0,"nz-option",28),s&2){let e=c.$implicit;d("nzValue",e.titularCobrancaId)("nzLabel",e.label)}}function Ft(s,c){if(s&1&&_(0,"nz-option",28),s&2){let e=c.$implicit;d("nzValue",e.pessoaHasUnidadeId)("nzLabel",e.label)}}function wt(s,c){if(s&1&&(n(0,"nz-tag",49),o(1),i()),s&2){let e=c,t=f(4);d("nzColor",t.getChargeResponsavelTagColor(e)),r(),y(" ",t.getChargeResponsavelTipoLabel(e)," ")}}function Tt(s,c){if(s&1&&(n(0,"tr",38)(1,"td",46)(2,"div",47)(3,"span",48),o(4),i(),I(5,wt,2,2,"nz-tag",49),i()()()),s&2){let e,t=f().$implicit;r(4),g(t.pessoa),r(),F((e=t.tipo_pessoa)?5:-1,e)}}function Pt(s,c){s&1&&(n(0,"nz-tag",42),o(1,"Bloqueada"),i())}function Lt(s,c){s&1&&o(0," \u2014 ")}function At(s,c){s&1&&(n(0,"td",52)(1,"nz-tag",42),o(2,"Composi\xE7\xE3o cedida \u2014 cobran\xE7a pelo fundo"),i()())}function It(s,c){if(s&1&&(n(0,"td",40),o(1),m(2,"currency"),i(),n(3,"td",40),o(4),m(5,"currency"),i(),n(6,"td",40),o(7),m(8,"currency"),i(),n(9,"td",40),o(10),m(11,"currency"),i(),n(12,"td",40),o(13),m(14,"currency"),i(),n(15,"td",40),o(16),m(17,"currency"),i(),n(18,"td",40),o(19),m(20,"currency"),i()),s&2){let e=f().$implicit;r(),g(h(2,7,e.valor,"BRL")),r(3),g(h(5,10,e.multa,"BRL")),r(3),g(h(8,13,e.juros,"BRL")),r(3),g(h(11,16,e.correcao_monetaria,"BRL")),r(3),g(h(14,19,e.honorarios,"BRL")),r(3),g(h(17,22,e.encargo_administrativo,"BRL")),r(3),g(h(20,25,e.total,"BRL"))}}function Mt(s,c){if(s&1&&(n(0,"tr")(1,"td",51),o(2),i(),n(3,"td"),o(4),i(),I(5,At,3,0,"td",52)(6,It,21,28),i()),s&2){let e=c.$implicit,t=f(4);r(2),y(" ",t.transformDescription(e==null?null:e.parcela,e.total_parcelas,e.plano_de_contas==null?null:e.plano_de_contas.nome,e==null?null:e.descricao)," "),r(2),g(e.tipo_taxa),r(),F(e.cedida_divida?5:6)}}function Nt(s,c){if(s&1&&(n(0,"td")(1,"nz-table",50)(2,"thead")(3,"tr")(4,"th",51),o(5,"Plano de Contas"),i(),n(6,"th"),o(7,"Tipo"),i(),n(8,"th"),o(9,"Valor Principal"),i(),n(10,"th"),o(11,"Valor Multa"),i(),n(12,"th"),o(13,"Valor Juros"),i(),n(14,"th"),o(15,"Valor C Monet\xE1ria"),i(),n(16,"th"),o(17,"Valor Hon."),i(),n(18,"th"),o(19,"Valor Enc. Adm."),i(),n(20,"th"),o(21,"Total"),i()()(),n(22,"tbody"),w(23,Mt,7,3,"tr",null,L),i()()()),s&2){let e=f(3);r(),d("nzData",e.chargeCompositionList)("nzShowPagination",!1)("nzFrontPagination",!1)("nzScroll",C(4,ft)),r(22),T(e.chargeCompositionList)}}function Dt(s,c){if(s&1){let e=A();I(0,Tt,6,2,"tr",38),n(1,"tr")(2,"td",39),S("nzCheckedChange",function(a){let l=z(e).$implicit,p=f(2);return b(p.updateCheckedSet(l.cobranca_uuid,a))}),i(),n(3,"td"),o(4),m(5,"date"),i(),n(6,"td"),o(7),m(8,"date"),i(),n(9,"td",40),o(10),m(11,"currency"),i(),n(12,"td",40),o(13),m(14,"currency"),i(),n(15,"td",40),o(16),m(17,"currency"),i(),n(18,"td",40),o(19),m(20,"currency"),i(),n(21,"td",40),o(22),m(23,"currency"),i(),n(24,"td",40),o(25),m(26,"currency"),i(),n(27,"td",40),o(28),m(29,"currency"),i(),n(30,"td",41),I(31,Pt,2,0,"nz-tag",42)(32,Lt,1,0),i(),n(33,"td")(34,"button",43),S("click",function(){let a=z(e).$implicit,l=f(2);return b(l.toggleDetail(a.cobranca_uuid))}),_(35,"span",44),i()()(),n(36,"tr",45),I(37,Nt,25,5,"td"),i()}if(s&2){let e=c.$implicit,t=f(2);F(t.showChargeResponsavel?0:-1),r(),H("charge-row-blocked",e.cedida_divida),r(),d("nzChecked",t.setOfCheckedUuid.has(e.cobranca_uuid))("nzDisabled",!!e.checkboxDisabled&&!e.cedida_divida),r(2),g(q(5,19,e.competencia,"MM/yyyy","utc")),r(3),g(q(8,23,e.data_vencimento,"dd/MM/yyyy","utc")),r(3),g(h(11,27,e.valor,"BRL")),r(3),g(h(14,30,e.multa_calculada,"BRL")),r(3),g(h(17,33,e.juros_calculado,"BRL")),r(3),g(h(20,36,e.correcao_monetaria_calculada,"BRL")),r(3),g(h(23,39,e.honorarios_calculado,"BRL")),r(3),g(h(26,42,e.encargo_administrativo_calculado,"BRL")),r(3),g(h(29,45,e.total_calculado,"BRL")),r(3),F(e.cedida_divida?31:32),r(3),d("nzType","default"),r(),d("nzType",t.isDetailExpanded(e.cobranca_uuid)?"minus-circle":"plus-circle"),r(),d("nzExpand",t.isDetailExpanded(e.cobranca_uuid)),r(),F(t.chargeCompositionList?37:-1)}}function kt(s,c){if(s&1){let e=A();n(0,"nz-page-header",9)(1,"nz-page-header-content"),w(2,St,2,1,"nz-col",12,L),n(4,"form",13)(5,"div",14)(6,"nz-form-item",15),_(7,"nz-form-control",16),n(8,"nz-form-control"),_(9,"app-filtro-pessoas",17),i()()(),n(10,"div",14)(11,"nz-form-item",15),_(12,"nz-form-control",18),n(13,"nz-form-control"),_(14,"app-filtro-unidades",19),i()()(),n(15,"div",14)(16,"nz-form-item")(17,"nz-form-label",20),o(18,"Data refer\xEAncia"),i(),n(19,"nz-form-control"),_(20,"nz-date-picker",21),i()()(),n(21,"div",22)(22,"nz-form-item")(23,"button",23),S("click",function(){z(e);let a=f();return b(a.getCharges())}),_(24,"span",24),o(25," Buscar "),i()()(),n(26,"div",25)(27,"nz-form-item")(28,"nz-form-label",26),o(29,"Titular da cobran\xE7a"),i(),n(30,"nz-form-control")(31,"nz-select",27),w(32,Et,1,2,"nz-option",28,Ct),i()()()(),n(34,"div",25)(35,"nz-form-item")(36,"nz-form-label"),o(37,"Filtrar cobran\xE7as por respons\xE1vel"),i(),n(38,"nz-form-control")(39,"nz-select",29),w(40,Ft,1,2,"nz-option",28,xt),i()()()(),n(42,"div",30)(43,"nz-form-item")(44,"nz-form-label"),o(45,"\xA0"),i(),n(46,"nz-form-control")(47,"label",31),V("ngModelChange",function(a){z(e);let l=f();return k(l.showChargeResponsavel,a)||(l.showChargeResponsavel=a),b(a)}),n(48,"span",32),_(49,"span",33),o(50," Visualizar respons\xE1vel "),i()()()()(),n(51,"div",34)(52,"nz-table",35,2)(54,"thead")(55,"tr")(56,"th",36),S("nzCheckedChange",function(a){z(e);let l=f();return b(l.onAllChecked(a))}),i(),n(57,"th"),o(58,"Compet\xEAncia"),i(),n(59,"th"),o(60,"Vencimento"),i(),n(61,"th"),o(62,"Valor Principal"),i(),n(63,"th"),o(64,"Valor Multa"),i(),n(65,"th"),o(66,"Valor Juros"),i(),n(67,"th"),o(68,"Valor Corre\xE7\xE3o monet\xE1ria"),i(),n(69,"th"),o(70,"Valor Honor\xE1rios"),i(),n(71,"th"),o(72,"Valor Enc. Administrativo"),i(),n(73,"th"),o(74,"Valor total"),i(),n(75,"th"),o(76,"Situa\xE7\xE3o"),i(),n(77,"th"),o(78,"A\xE7\xF5es"),i()()(),n(79,"tbody"),w(80,Dt,38,48,null,null,L),i()()()()()()}if(s&2){let e,t=O(53),a=f(),l=O(17);d("nzGhost",!1),r(2),T(a.errorList),r(2),d("formGroup",a.searchChargesForm),r(5),d("required",!0)("selectMode","default")("tiposPessoas",C(24,ht))("disableComponent",a.disabledComponents()),r(5),d("required",!0)("condominium_uuid",(e=a.searchChargesForm.get("condominio"))==null?null:e.value)("tiposPessoas",C(25,_t))("allowClear",!0)("unit_uuid",a.nzData?a.nzData.unit_uuid:"")("disableComponent",a.disabledComponents()),r(6),d("nzDisabled",a.disabledComponents()),r(3),d("disabled",!a.searchChargesForm.valid||a.disabledComponents()),r(9),T(a.unitOwnerOptions),r(8),T(a.unitOwnerOptions),r(2),H("agreement-show-responsavel--active",a.showChargeResponsavel),r(5),D("ngModel",a.showChargeResponsavel),d("ngModelOptions",C(26,gt)),r(5),d("nzData",a.page[a.pageIndex])("nzLoading",a.isLoadingList)("nzFrontPagination",!1)("nzFooter",a.pageTotal?l:""),r(4),d("nzChecked",a.checked)("nzIndeterminate",a.indeterminate),r(24),T(t.data)}}function Vt(s,c){if(s&1){let e=A();n(0,"nz-col",12)(1,"nz-alert",37),S("nzOnClose",function(){let a=z(e).$implicit,l=f(2);return b(l.closeErrorAlert(a))}),i()()}if(s&2){let e=c.$implicit;r(),j("nzMessage",e)}}function Bt(s,c){s&1&&(n(0,"div",53)(1,"nz-form-item")(2,"nz-form-label",96),o(3,"Descri\xE7\xE3o outros"),i(),n(4,"nz-form-control"),_(5,"input",97),i()()()),s&2&&(r(2),d("nzRequired",!0))}function Rt(s,c){if(s&1&&_(0,"nz-option",28),s&2){let e=c.$implicit;d("nzValue",e.uuid)("nzLabel",e.nome)}}function Ot(s,c){if(s&1&&_(0,"nz-option",28),s&2){let e=c.$implicit;d("nzValue",e.uuid)("nzLabel",e.nome)}}function qt(s,c){if(s&1&&(n(0,"nz-page-header",9)(1,"nz-page-header-content"),w(2,Vt,2,1,"nz-col",12,L),n(4,"form",13)(5,"div",53)(6,"nz-form-item")(7,"nz-form-label",54),o(8,"Data acordo"),i(),n(9,"nz-form-control"),_(10,"nz-date-picker",55),i()()(),n(11,"div",53)(12,"nz-form-item")(13,"nz-form-label",56),o(14,"Tipo acordo"),i(),n(15,"nz-form-control")(16,"nz-select",57),_(17,"nz-option",58)(18,"nz-option",59),i()()()(),n(19,"div",53)(20,"nz-form-item")(21,"nz-form-label",60),o(22,"Total taxa"),i(),n(23,"nz-form-control"),_(24,"input",61),i()()(),n(25,"div",53)(26,"nz-form-item")(27,"nz-form-label",62),o(28,"Total multa"),i(),n(29,"nz-form-control"),_(30,"input",63),i()()(),n(31,"div",53)(32,"nz-form-item")(33,"nz-form-label",64),o(34,"Total juros"),i(),n(35,"nz-form-control"),_(36,"input",65),i()()(),n(37,"div",53)(38,"nz-form-item")(39,"nz-form-label",66),o(40,"Total corre\xE7\xE3o monet\xE1ria"),i(),n(41,"nz-form-control"),_(42,"input",67),i()()(),n(43,"div",53)(44,"nz-form-item")(45,"nz-form-label",68),o(46,"Total honor\xE1rios"),i(),n(47,"nz-form-control"),_(48,"input",69),i()()(),n(49,"div",53)(50,"nz-form-item")(51,"nz-form-label",70),o(52,"Total encargo administrativo"),i(),n(53,"nz-form-control"),_(54,"input",71),i()()(),n(55,"div",53)(56,"nz-form-item")(57,"nz-form-label",72),o(58,"Honor\xE1rios embutidos"),i(),n(59,"nz-form-control"),_(60,"input",73),i()()(),n(61,"div",53)(62,"
1nz-form-item")(63,"nz-form-label",74),o(64,"Qtde parcelas honor\xE1rios"),i(),n(65,"nz-form-control"),_(66,"nz-input-number",75),i()()(),n(67,"div",53)(68,"nz-form-item")(69,"nz-form-label",76),o(70,"Total outros"),i(),n(71,"nz-form-control"),_(72,"input",77),i()()(),I(73,Bt,6,1,"div",53),n(74,"div",53)(75,"nz-form-item")(76,"nz-form-label",78),o(77,"Total desconto"),i(),n(78,"nz-form-control"),_(79,"input",79),i()()(),n(80,"div",53)(81,"nz-form-item")(82,"nz-form-label",80),o(83,"Total divida"),i(),n(84,"nz-form-control"),_(85,"input",81),i()()(),n(86,"div",53)(87,"nz-form-item")(88,"nz-form-label",82),o(89,"Valor entrada"),i(),n(90,"nz-form-control"),_(91,"input",83),i()()(),n(92,"div",53)(93,"nz-form-item")(94,"nz-form-label",84),o(95,"Quantidade de parcelas"),i(),n(96,"nz-form-control"),_(97,"nz-input-number",85),i()()(),n(98,"div",53)(99,"nz-form-item")(100,"nz-form-label",86),o(101,"Data primeira parcela"),i(),n(102,"nz-form-control"),_(103,"nz-date-picker",87),i()()(),n(104,"div",53)(105,"nz-form-item")(106,"nz-form-label",88),o(107,"Observa\xE7\xE3o"),i(),n(108,"nz-form-control"),_(109,"input",89),i()()(),n(110,"div",53)(111,"nz-form-item")(112,"nz-form-label",90),o(113,"Modelo confiss\xE3o d\xEDvida"),i(),n(114,"nz-form-control")(115,"nz-select",91),w(116,Rt,1,2,"nz-option",28,L),i()()()(),n(118,"div",53)(119,"nz-form-item")(120,"nz-form-label",92),o(121,"Empresa de cobran\xE7a"),i(),n(122,"nz-form-control")(123,"nz-select",93),w(124,Ot,1,2,"nz-option",28,L),i()()()(),n(126,"div",53)(127,"nz-form-item")(128,"nz-form-label",94),o(129,"Cedente"),i(),_(130,"app-filtro-contas-bancarias",95),i()()()()()),s&2){let e,t=f();d("nzGhost",!1),r(2),T(t.errorList),r(2),d("formGroup",t.agreementForm),r(20),d("options",C(22,E)),r(6),d("options",C(23,E)),r(6),d("options",C(24,E)),r(6),d("options",C(25,E)),r(6),d("options",C(26,E)),r(6),d("options",C(27,E)),r(6),d("options",C(28,E)),r(3),d("nzRequired",!0),r(3),d("nzMin",1)("nzStep",1),r(6),d("options",C(29,E)),r(),F(((e=t.agreementForm.get("valor_outros"))==null?null:e.value)>0?73:-1),r(6),d("options",C(30,E)),r(6),d("options",C(31,E)),r(6),d("options",C(32,E)),r(6),d("nzMin",1)("nzStep",1),r(19),T(t.modelsList),r(8),T(t.billingCompanies),r(6),d("condominio_uuid",t.enterpriseSelected)("condominiumParam",t.condominiumParamEnterprise)("bankAccountParam",t.bankAccountParam)}}function $t(s,c){if(s&1){let e=A();n(0,"nz-col",12)(1,"nz-alert",37),S("nzOnClose",function(){let a=z(e).$implicit,l=f(2);return b(l.closeErrorAlert(a))}),i()()}if(s&2){let e=c.$implicit;r(),j("nzMessage",e)}}function Ut(s,c){if(s&1){let e=A();n(0,"tr")(1,"td")(2,"nz-date-picker",106),V("ngModelChange",function(a){let l=z(e).$implicit;return k(l.vencimento,a)||(l.vencimento=a),b(a)}),i()(),n(3,"td")(4,"input",107),V("ngModelChange",function(a){let l=z(e).$implicit;return k(l.valor_parcela,a)||(l.valor_parcela=a),b(a)}),S("ngModelChange",function(a){z(e);let l=f(2);return b(l.onValueChangePlots(a))}),i()(),n(5,"td")(6,"input",107),V("ngModelChange",function(a){let l=z(e).$implicit;return k(l.valor_honorarios,a)||(l.valor_honorarios=a),b(a)}),S("ngModelChange",function(a){z(e);let l=f(2);return b(l.onValueChangePlots(a))}),i()(),n(7,"td")(8,"input",108),V("ngModelChange",function(a){let l=z(e).$implicit;return k(l.historico,a)||(l.historico=a),b(a)}),i()()()}if(s&2){let e=c.$implicit,t=f(2);r(2),d("nzDisabledDate",t.disabledDate),D("ngModel",e.vencimento),r(2),D("ngModel",e.valor_parcela),d("options",C(8,E)),r(2),D("ngModel",e.valor_honorarios),d("options",C(9,E)),r(2),d("disabled",!0),D("ngModel",e.historico)}}function Gt(s,c){if(s&1){let e=A();n(0,"nz-page-header",9)(1,"nz-page-header-content"),w(2,$t,2,1,"nz-col",12,L),n(4,"nz-collapse")(5,"nz-collapse-panel",98)(6,"div")(7,"nz-row",99)(8,"nz-col",100)(9,"strong"),o(10,"Data do acordo: "),i(),o(11),m(12,"date"),i(),n(13,"nz-col",100)(14,"strong"),o(15,"Tipo do acordo: "),i(),o(16),i(),n(17,"nz-col",100)(18,"strong"),o(19,"Total taxas: "),i(),o(20),m(21,"currency"),i(),n(22,"nz-col",100)(23,"strong"),o(24,"Total multa: "),i(),o(25),m(26,"currency"),i(),n(27,"nz-col",100)(28,"
1strong"),o(29,"Total juros: "),i(),o(30),m(31,"currency"),i(),n(32,"nz-col",100)(33,"strong"),o(34,"Total corre\xE7\xE3o monet\xE1ria: "),i(),o(35),m(36,"currency"),i(),n(37,"nz-col",100)(38,"strong"),o(39,"Total honor\xE1rios: "),i(),o(40),m(41,"currency"),i(),n(42,"nz-col",100)(43,"strong"),o(44,"Total enc. administrativo "),i(),o(45),m(46,"currency"),i(),n(47,"nz-col",100)(48,"strong"),o(49,"Total honor\xE1rios embutidos: "),i(),o(50),m(51,"currency"),i(),n(52,"nz-col",100)(53,"strong"),o(54,"Quantidade de parcelas honor\xE1rios: "),i(),o(55),i(),n(56,"nz-col",100)(57,"strong"),o(58,"Valor outros: "),i(),o(59),m(60,"currency"),i(),n(61,"nz-col",100)(62,"strong"),o(63,"Total divida: "),i(),o(64),m(65,"currency"),i(),n(66,"nz-col",100)(67,"strong"),o(68,"Valor entrada: "),i(),o(69),m(70,"currency"),i(),n(71,"nz-col",100)(72,"strong"),o(73,"Quantidade de parcelas: "),i(),o(74),i(),n(75,"nz-col",100)(76,"strong"),o(77,"Data primeira parcela: "),i(),o(78),m(79,"date"),i(),n(80,"nz-col",100)(81,"strong"),o(82,"Observa\xE7\xF5es: "),i(),o(83),i()()()()(),n(84,"nz-table",101,3)(86,"thead")(87,"tr")(88,"th",102),o(89,"Vencimento"),i(),n(90,"th",103),o(91,"Valor parcela"),i(),n(92,"th",103),o(93,"Valor honor\xE1rios"),i(),n(94,"th"),o(95,"Hist\xF3rico"),i()()(),n(96,"tbody"),w(97,Ut,9,10,"tr",null,L),i(),n(99,"tfoot")(100,"tr")(101,"td")(102,"strong"),o(103,"Total:"),i()(),n(104,"td",104),o(105),m(106,"currency"),i(),n(107,"td",104),o(108),m(109,"currency"),i(),n(110,"td")(111,"button",105),S("click",function(){z(e);let a=f();return b(a.createAgreement())}),o(112," Gerar acordo "),i()()()()()()()}if(s&2){let e,t,a=O(85),l=f();d("nzGhost",!1),r(2),T(l.errorList),r(5),d("nzGutter",C(69,vt)),r(4),y(" ",q(12,25,l.agreementForm.value.data_acordo,"dd/MM/yyyy","utc"),""),r(5),y(" ",l.agreementForm.value.tipo_acordo,""),r(4),y(" ",h(21,29,(e=l.agreementForm.get("valor_taxas"))==null?null:e.value,"BRL"),""),r(5),y(" ",h(26,32,l.agreementForm.value.valor_multa,"BRL"),""),r(5),y(" ",h(31,35,l.agreementForm.value.valor_juros,"BRL"),""),r(5),y(" ",h(36,38,l.agreementForm.value.valor_correcao_monetaria,"BRL"),""),r(5),y(" ",h(41,41,l.agreementForm.value.valor_honorarios,"BRL"),""),r(5),y(" ",h(46,44,l.agreementForm.value.valor_enc_administrativo,"BRL"),""),r(5),y(" ",h(51,47,l.agreementForm.value.honorarios_embutidos,"BRL"),""),r(5),y(" ",l.agreementForm.value.qtd_parcela_honorarios,""),r(4),te(" ",h(60,50,l.agreementForm.value.valor_outros,"BRL")," ",l.agreementForm.value.descricao_outros?l.agreementForm.value.descricao_outros:"",""),r(5),y(" ",h(65,53,(t=l.agreementForm.get("total_divida"))==null?null:t.value,"BRL"),""),r(5),y(" ",h(70,56,l.agreementForm.value.valor_entrada,"BRL"),""),r(5),y(" ",l.agreementForm.value.qtd_parcelas,""),r(4),y(" ",q(79,59,l.firstDatePlot,"dd/MM/yyyy","utc"),""),r(5),y(" ",l.agreementForm.value.observacoes,""),r(),d("nzData",l.listPlots)("nzLoading",l.isLoadingList)("nzFrontPagination",!1),r(13),T(a.data),r(8),g(h(106,63,l.totalPlots,"R$ ")),r(3),g(h(109,66,l.totalFees,"R$ ")),r(3),d("disabled",l.validateDisableButton())}}function jt(s,c){if(s&1&&(n(0,"div",109)(1,"div",110)(2,"strong"),o(3,"Totais:"),i()(),n(4,"div",110)(5,"nz-table",111)(6,"thead")(7,"tr")(8,"th",112),o(9,"Garantido:"),i(),n(10,"th",112),o(11,"Comprado:"),i(),n(12,"th",113),o(13,"N\xE3o Garantido:"),i(),n(14,"th",113),o(15,"Taxa Principal:"),i(),n(16,"th",114),o(17,"Multa:"),i(),n(18,"th",112),o(19,"Juros:"),i(),n(20,"th"),o(21,"C. Monet\xE1ria:"),i(),n(22,"th"),o(23,"Honor\xE1rios:"),i(),n(24,"th"),o(25,"Enc. Administrativo:"),i(),n(26,"th"),o(27,"Total:"),i()()(),n(28,"tbody")(29,"tr")(30,"td",40),o(31),m(32,"currency"),i(),n(33,"td",40),o(34),m(35,"currency"),i(),n(36,"td",40),o(37),m(38,"currency"),i(),n(39,"td",40),o(40),m(41,"currency"),i(),n(42,"td",40),o(43),m(44,"currency"),i(),n(45,"td",40),o(46),m(47,"currency"),i(),n(48,"td",40),o(49),m(50,"currency"),i(),n(51,"td",40),o(52),m(53,"currency"),i(),n(54,"td",40),o(55),m(56,"currency"),i(),n(57,"td",40),o(58),m(59,"currency"),i()()()()()()),s&2){let e=f(),t=O(19);r(5),d("nzNoResult",t),r(26),g(h(32,11,e.valuesTotals.guaranteed||0,"R$ ")),r(3),g(h(35,14,e.valuesTotals.purchasedRate||0,"R$ ")),r(3),g(h(38,17,e.valuesTotals.unGuaranteed||0,"R$ ")),r(3),g(h(41,20,e.valuesTotals.rate||0,"R$ ")),r(3),g(h(44,23,e.valuesTotals.fees||0,"R$ ")),r(3),g(h(47,26,e.valuesTotals.fine||0,"R$ ")),r(3),g(h(50,29,e.valuesTotals.monetaryCorrection||0,"R$ ")),r(3),g(h(53,32,e.valuesTotals.honorarium||0,"R$ ")),r(3),g(h(56,35,e.valuesTotals.encAdm||0,"R$ ")),r(3),g(h(59,38,e.valuesTotals.totalValues||0,"R$ "))}}function Ht(s,c){}var Mi=(()=>{class s{constructor(e,t,a,l,p){this.api=e,this.fb=t,this.modal=a,this.router=l,this.permissionService=p,this.steps=[{title:"Selecionar as cobran\xE7as",description:"Selecione o condom\xEDnio e a unidade"},{title:"Preencher os campos",description:"Preencha os campos do formul\xE1rio"},{title:"Gerar parcelas",description:"Confira as parcelas a serem geradas"}],this.currentStepIndex=0,this.isSubmiting=!1,this.index="First-content",this.charges=[],this.chargesUuids=[],this.errorList=[],this.destroy$=new Z,this.fieldRulesBound=!1,this.isLoadingList=!1,this.page={},this.pageIndex=1,this.pageSize=9999,this.pageTotal=0,this.checked=!1,this.setOfCheckedUuid=new Set,this.indeterminate=!1,this.billingCompanies=[],this.listPlots=[],this.expandSet=new Set,this.chargeCompositionList=[],this.compositionsCache=[],this.totalPlots=0,this.totalFees=0,this.accountCompany="",this.percentageGuaranteed=0,this.percentageNotGuaranteed=0,this.percentagePurchasedRate=0,this.compositionList=[],this.valuesTotals={rate:0,fine:0,fees:0,monetaryCorrection:0,honorarium:0,encAdm:0,totalValues:0,guaranteed:0,unGuaranteed:0,purchasedRate:0,embeddedHonorarium:0},this.calculatedChargesSnapshot={valor_multa_calculado:0,valor_juros_calculado:0,valor_correcao_monetaria_calculado:0,valor_honorarios_calculado:0,valor_enc_administrativo_calculado:0},this.firstDatePlot=new Date,this.modelsList=[],this.policyPreview=null,this.disabledDate=v=>ae(v,new Date)<0,this.nzData=X(pe,{optional:!0}),this.elegibleCharges=!1,this.unitOwnerOptions=[],this.showChargeResponsavel=!1,this.chargePersonFilter=null,this.searchChargesForm=this.fb.group({condominio:[null,x.required],unidade:[null,x.required],data_referencia:[new Date,x.required],titular_cobranca_id:[null],charge_person_filter:[null]}),this.agreementForm=this.fb.group({data_acordo:[new Date,x.required],tipo_acordo:[null,x.required],valor_taxas:[0],valor_multa:[0,x.required],valor_juros:[0,x.required],valor_correcao_monetaria:[0,x.required],valor_honorarios:[0,x.required],valor_enc_administrativo:[0,x.required],honorarios_embutidos:[0],qtd_parcela_honorarios:[null,x.required],valor_outros:[0],descricao_outros:[null],valor_desconto:[0],total_divida:[0,x.required],valor_entrada:[null],qtd_parcelas:[null,x.required],primeira_parcela:[null,x.required],observacoes:[null],empresa_cobranca_uuid:[null,x.required],conta_geracao_uuid:[null,x.required],modelo_uuid:[null,x.required]}),this.agreementForm.get("valor_taxas")?.disable(),this.agreementForm.get("total_divida")?.disable()}nextStep(){return Y(this,null,function*(){this.errorList=[],this.currentStepIndex==0&&(this.fieldRules(),this.setValuesTaxs(),this.calculateFields(),this.getContract(),this.getBillingCompanies(),this.getModels()),!(this.currentStepIndex===1&&!(yield this.validateDiscountPolicyOnNext(
1)))&&(this.currentStepIndex+1==2&&this.mountListsPlots(),this.currentStepIndex++)})}prevStep(){this.errorList=[],this.currentStepIndex>0&&(this.currentStepIndex==2&&this.agreementForm.patchValue({primeira_parcela:this.firstDatePlot}),this.bankAccountParam,this.currentStepIndex--)}canProceed(e){return e!==void 0&&this.currentStepIndex>e?!0:this.currentStepIndex===0?(this.getChargesSelected()??[]).length>0&&!!this.searchChargesForm.get("titular_cobranca_id")?.value:this.currentStepIndex===1?this.agreementForm.valid:!0}ngOnInit(){let e=nt("condominio");e?(this.condominiumSelected=e,this.condominiumParam={condominioUuid:e}):this.condominiumParam=void 0,this.nzData?.isModal&&(this.searchChargesForm.patchValue({unidade:this.nzData.unit_uuid,data_referencia:this.nzData.reference_date}),this.loadUnitOwners(this.nzData.unit_uuid),this.getCharges()),this.searchChargesForm.get("unidade")?.valueChanges.subscribe(t=>{this.unitOwnerOptions=[],this.chargePersonFilter=null,this.searchChargesForm.patchValue({titular_cobranca_id:null,charge_person_filter:null},{emitEvent:!1}),t&&this.loadUnitOwners(t)}),this.searchChargesForm.get("charge_person_filter")?.valueChanges.subscribe(t=>{this.chargePersonFilter=t??null,this.syncSelectionWithFilter(),this.paginate(1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get filteredCharges(){return this.chargePersonFilter==null?this.charges:this.charges.filter(e=>e.pessoa_has_unidade_id===this.chargePersonFilter)}loadUnitOwners(e){this.api.get(`/residences/responsibles/${e}`).subscribe({next:t=>{this.unitOwnerOptions=(t.data?.pessoas??[]).filter(p=>{let v=p.pessoas?.tipo?.nome;return p.id!=null&&p.pessoas?.id!=null&&(v==="proprietario"||v==="proprietario_anterior")}).map(p=>{let v=p.pessoas?.tipo?.nome??"",u=p.pessoas?.tipo?.descricao||(v==="proprietario_anterior"?"Propriet\xE1rio Anterior":"Propriet\xE1rio"),P=p.pessoas?.pessoa?.nome??"N\xE3o informado";return{pessoaHasUnidadeId:p.id,titularCobrancaId:p.pessoas.id,nome:P,tipoNome:v,tipoDescricao:u,label:`${P} \u2014 ${u}`}});let a=this.searchChargesForm.get("titular_cobranca_id")?.value;if(!this.unitOwnerOptions.some(p=>p.titularCobrancaId===a)){let p=this.unitOwnerOptions.find(v=>v.tipoNome==="proprietario")??this.unitOwnerOptions[0];this.searchChargesForm.patchValue({titular_cobranca_id:p?.titularCobrancaId??null},{emitEvent:!1})}},error:t=>{Array.isArray(t?.error?.message)?this.errorList=t.error.message:this.errorList=[t?.error?.message??"Erro ao carregar respons\xE1veis da unidade"]}})}syncSelectionWithFilter(){let e=new Set(this.filteredCharges.map(t=>t.cobranca_uuid).filter(t=>!!t));[...this.setOfCheckedUuid].forEach(t=>{(!t||!e.has(t))&&this.setOfCheckedUuid.delete(t)}),this.chargesUuids=Array.from(this.setOfCheckedUuid),this.refreshCheckedStatus(),this.recalculateTotalsFromSelection()}refreshCheckedStatus(){let e=this.filteredCharges.filter(t=>!t.checkboxDisabled&&!$(t));this.checked=e.length>0&&e.every(t=>this.setOfCheckedUuid.has(t.cobranca_uuid)),this.indeterminate=!this.checked&&e.some(t=>this.setOfCheckedUuid.has(t.cobranca_uuid))}resetTotals(){this.valuesTotals={rate:0,fees:0,fine:0,monetaryCorrection:0,honorarium:0,encAdm:0,totalValues:0,guaranteed:0,unGuaranteed:0,purchasedRate:0,embeddedHonorarium:0},this.calculatedChargesSnapshot={valor_multa_calculado:0,valor_juros_calculado:0,valor_correcao_monetaria_calculado:0,valor_honorarios_calculado:0,valor_enc_administrativo_calculado:0}}getChargeResponsavelTagColor(e){switch(e){case"proprietario":case"proprietario_anterior":return"blue";case"inquilino":return"orange";default:return"default"}}getChargeResponsavelTipoLabel(e){switch(e){case"proprietario":return"Propriet\xE1rio";case"proprietario_anterior":return"Propriet\xE1rio Anterior";case"inquilino":return"Inquilino";default:return e??"-"}}getCharges(e=1){let t=this.nzData?this.nzData.unit_uuid:this.searchChargesForm.get("unidade")?.value;this.errorList=[],this.isLoadingList=!0,this.compositionsCache=[],t&&this.loadUnitOwners(t),this.api.post("/charges/list-levy-agreement",{condominio_uuid:this.searchChargesForm.get("condominio")?.value,unidade_uuid:t,data_referencia:this.searchChargesForm.get("data_referencia")?.value,baixada:!1}).subscribe({next:a=>{this.permissionService.validate(rt.SelecionarCobrancaComBoletosAVencer,()=>{this.charges=a.data.map(l=>G(R({},l),{checkboxDisabled:!!l.cedida_divida})),this.afterChargesLoaded(),this.isLoadingList=!1},()=>{this.charges=a.data.map(l=>{let p=new Date(l.data_vencimento),B=(new Date().getTime()-p.getTime())/(1e3*60*60*24)<=25||!!l.cedida_divida;return G(R({},l),{checkboxDisabled:B})}),this.afterChargesLoaded(),this.isLoadingList=!1},!1)},error:a=>{this.isLoadingList=!1,Array.isArray(a.error.message)?this.errorList=a.error.message:this.errorList=[a.error.message]}})}afterChargesLoaded(){this.paginate(1),this.checked=!this.nzData,this.onAllChecked(!this.nzData)}mapCompositionsFromRaw(e){return e.map(t=>({desconto_a_conceder:t.composicao_desconto_a_conceder,composicao_parametro_contrato:t.composicao_parametro_contrato,valor:t.composicao_valor,uuid:t.composicao_uuid,descricao:t.composicao_descricao,unidade_codigo:t.unidade_codigo,plano_de_contas:{id:t.plano_de_conta_id,uuid:t.plano_de_conta_uuid,codigo:t.plano_de_conta_codigo,nome:t.plano_de_conta_nome,descricao:t.plano_de_conta_descricao,created_at:"any",ativo:!0,tipo_operacao:dt.Credito,padrao_acordo_garantido:t.padrao_acordo_garantido,padrao_acordo_nao_garantido:t.padrao_acordo_nao_garantido},cobranca:{juros_a_cobrar:t.cobranca_juros_a_cobrar,uuid:t.cobranca_uuid,competencia:t.cobranca_competencia,data_desconto:t.cobranca_data_desconto,data_vencimento:t.cobranca_data_vencimento,multa_a_cobrar:t.cobranca_multa_a_cobrar},juros:t.juros_calculado,multa:t.multa_calculada,correcao_monetaria:t.correcao_monetaria_calculada,honorarios:t.honorarios_calculado,honorario_embutido:t.honorario_embutido,encargo_administrativo:t.encargo_administrativo_calculado,encargos:t.encargos_calculado,desconto_aplicad
1o:t.desconto_aplicado,total:t.total_calculado,parcela:t.parcela,total_parcelas:t.total_parcelas,composicao_contrato_id:t.composicao_contrato_id,tipo_taxa:t.tipo_taxa,cedida_divida:t.cedida_divida}))}recalculateTotalsFromSelection(){let e=this.getChargesSelected()??[];if(!e.length){this.resetTotals(),this.percentageGuaranteed=0,this.percentagePurchasedRate=0,this.percentageNotGuaranteed=0;return}let t=u=>e.reduce((P,B)=>P+(Number(u(B))||0),0),a=t(u=>u.valor),l=t(u=>u.valor_garantido),p=t(u=>u.valor_nao_garantido),v=t(u=>u.valor_comprado);this.valuesTotals={rate:a,fees:t(u=>u.multa_calculada),fine:t(u=>u.juros_calculado),monetaryCorrection:t(u=>u.correcao_monetaria_calculada),honorarium:t(u=>u.honorarios_calculado),encAdm:t(u=>u.encargo_administrativo_calculado),totalValues:t(u=>u.total_calculado),guaranteed:l,unGuaranteed:p,purchasedRate:v,embeddedHonorarium:t(u=>u.honorario_embutido)},this.percentageGuaranteed=+(a?l*100/a:0).toFixed(2),this.percentagePurchasedRate=+(a?v*100/a:0).toFixed(2),this.percentageNotGuaranteed=+(a?p*100/a:0).toFixed(2)}getChargeCompositions(e){if(!e)return;let t=this.compositionsCache.filter(a=>a.cobranca?.uuid===e);if(t.length){this.chargeCompositionList=t;return}this.errorList=[],this.isLoadingList=!0,this.api.post("/charges-composition/list?page=99999&offset=99999",{reference_date:this.searchChargesForm.get("data_referencia")?.value,charge_uuid:e}).pipe(M(()=>this.isLoadingList=!1)).subscribe(a=>{let l=this.mapCompositionsFromRaw(a.data??[]);this.chargeCompositionList=l,this.compositionsCache=[...this.compositionsCache.filter(p=>p.cobranca?.uuid!==e),...l]})}getBillingCompanies(){this.isLoadingList=!0,this.api.post("/billing-companies/list-for-filters",{ativo:!0}).pipe(M(()=>this.isLoadingList=!1)).subscribe({next:e=>{this.billingCompanies=e.data},error:e=>{Array.isArray(e.error.message)?this.errorList=e.error.message:this.errorList=[e.error.message]}})}getContract(){this.isLoadingList=!0,this.api.post(`/contracts/list?page=${this.pageIndex}&offset=${this.pageSize}`,{condominio_uuid:this.searchChargesForm.get("condominio")?.value}).pipe(M(()=>this.isLoadingList=!1)).subscribe({next:e=>{this.accountCompany=e.data[0].empresa?.uuid||"",this.enterpriseSelected=this.accountCompany,this.condominiumParamEnterprise={condominioUuid:this.accountCompany},this.bankAccountParam={contaBancariaUuid:e.data[0].empresa?.contas_bancarias[0].uuid||""},this.agreementForm.patchValue({conta_geracao_uuid:e.data[0].empresa?.contas_bancarias[0].uuid})},error:e=>{Array.isArray(e.error.message)?this.errorList=e.error.message:this.errorList=[e.error.message]}})}getModels(){this.api.post("/models-pdf/list",{}).pipe(M(()=>this.isLoadingList=!1)).subscribe({next:e=>{this.modelsList=e.data;let t=this.modelsList.find(a=>a.padrao);t&&this.agreementForm.patchValue({modelo_uuid:t.uuid})},error:e=>{Array.isArray(e.error.message)?this.errorList=e.error.message:this.errorList=[e.error.message]}})}onAllChecked(e){if(this.setOfCheckedUuid.clear(),e){let t=this.filteredCharges,a=t.some(l=>$(l));t.forEach(({cobranca_uuid:l,checkboxDisabled:p,cedida_divida:v})=>{$({cedida_divida:v})||(p=p===void 0?!1:p,l&&p===!1&&this.setOfCheckedUuid.add(l))}),a&&Q(this.modal,J.ACORDO)}else if(this.nzData?.isModal){let t=new Set(this.filteredCharges.map(a=>a.cobranca_uuid));this.nzData.charges_selected.forEach(a=>{a&&t.has(a)&&this.setOfCheckedUuid.add(a)})}this.chargesUuids=Array.from(this.setOfCheckedUuid),this.refreshCheckedStatus(),this.recalculateTotalsFromSelection()}updateCheckedSet(e,t){if(!e)return;let a=this.filteredCharges.find(l=>l.cobranca_uuid===e);if(t&&$(a)){Q(this.modal,J.ACORDO);return}t&&a?.checkboxDisabled||(t?this.setOfCheckedUuid.add(e):this.setOfCheckedUuid.delete(e),this.chargesUuids=Array.from(this.setOfCheckedUuid),this.refreshCheckedStatus(),this.recalculateTotalsFromSelection())}getChargesSelected(){let e;return this.charges&&(e=this.charges.filter(t=>this.setOfCheckedUuid.has(t.cobranca_uuid))),e}setValuesTaxs(){this.calculatedChargesSnapshot={valor_multa_calculado:this.valuesTotals.fees||0,valor_juros_calculado:this.valuesTotals.fine||0,valor_correcao_monetaria_calculado:this.valuesTotals.monetaryCorrection||0,valor_honorarios_calculado:this.valuesTotals.honorarium||0,valor_enc_administrativo_calculado:this.valuesTotals.encAdm||0},this.agreementForm.patchValue({valor_taxas:this.valuesTotals.rate,valor_multa:this.valuesTotals.fees,valor_juros:this.valuesTotals.fine,valor_correcao_monetaria:this.valuesTotals.monetaryCorrection,valor_honorarios:this.valuesTotals.honorarium,valor_enc_administrativo:this.valuesTotals.encAdm,total_divida:this.valuesTotals.totalValues,honorarios_embutidos:this.valuesTotals.embeddedHonorarium})}calculateFields(){let e=this.agreementForm.get("valor_taxas")?.value;this.agreementForm.valueChanges.subscribe(t=>{let a=e+t.valor_multa+t.valor_juros+t.valor_correcao_monetaria+t.valor_honorarios+t.valor_enc_administrativo+t.valor_outros-t.valor_desconto;this.agreementForm.patchValue({total_divida:a},{emitEvent:!1})})}mountListsPlots(){let e=this.agreementForm.get("qtd_parcelas")?.value,t=this.agreementForm.get("qtd_parcela_honorarios")?.value,a=this.agreementForm.get("primeira_parcela")?.value,l=this.agreementForm.get("valor_entrada")?.value||0,p=this.agreementForm.get("total_divida")?.value,v=Math.max(1,e-(l>0?1:0)),u=(p-l)/v,P=Number(this.policyPreview?.limites_efetivos?.juros_parcelamento_percentual??0),B=Number(this.policyPreview?.limites_efetivos?.juros_parcelamento_por_parcela??0),pt=Number((u*(1+P/100)+B).toFixed(2)),ut=new Date(a);this.listPlots=Array.from({length:e},(Wt,U)=>({vencimento:this.addMonthsSafe(ut,U),valor_parcela:l>0&&U===0?l:Number(pt.toFixed(2)),valor_honorarios:t>U?(this.agreementForm.get("valor_honorarios")?.value+this.agreementForm.get("honorarios_embutidos")?.value)/t:0,historico:`Parcela ${U+1}/${e} do acordo ${this.agreementForm.get("tipo_acordo")?.value}`})),this.onValueChangePlots(),this.balancePlots()}onValueChangePlots(e){this.totalPlots=this.listPlots.reduce((t,a)=>t+a.valor_parcela,0),this.totalFees=this.listPlots.reduce((t,a)=>
1t+a.valor_honorarios,0),this.errorList=[],(Number(this.agreementForm.get("total_divida")?.value.toFixed(2))!==Number(this.totalPlots.toFixed(2))||Number((this.agreementForm.get("valor_honorarios")?.value+this.agreementForm.get("honorarios_embutidos")?.value).toFixed(2))!==Number(this.totalFees.toFixed(2)))&&this.errorList.push("Verifique se os valores totais das parcelas e honor\xE1rios conferem com os valores informados anteriormente.")}balancePlots(){let e=this.agreementForm.get("total_divida")?.value-this.totalPlots;this.listPlots[this.listPlots.length-1].valor_parcela+=e;let t=this.agreementForm.get("valor_honorarios")?.value+this.agreementForm.get("honorarios_embutidos")?.value-this.totalFees;this.listPlots[this.listPlots.length-1].valor_honorarios+=t,this.onValueChangePlots()}validateDisableButton(){return Number(this.agreementForm.get("total_divida")?.value.toFixed(2))!==Number(this.totalPlots.toFixed(2))||Number((this.agreementForm.get("valor_honorarios")?.value+this.agreementForm.get("honorarios_embutidos")?.value).toFixed(2))!==Number(this.totalFees.toFixed(2))}createAgreement(){this.isLoadingList=!0,this.errorList=[];let e=this.buildAgreementPayload();this.api.post("/agreement/validate-discount-policy",e).subscribe({next:t=>{let a=t?.data;if(a&&a.dentro_da_politica===!1){this.errorList=a.violacoes?.length?a.violacoes:[t.message||"Condi\xE7\xF5es fora da pol\xEDtica de desconto"],this.isLoadingList=!1;return}this.submitAgreement(e)},error:t=>{Array.isArray(t?.error?.message)?this.errorList=t.error.message:this.errorList=[t?.error?.message||"Erro ao validar pol\xEDtica de desconto"],this.isLoadingList=!1}})}buildAgreementPayload(){return G(R(R({cobrancas_uuids:this.chargesUuids,condominio_uuid:this.searchChargesForm.get("condominio")?.value,unidade_uuid:this.searchChargesForm.get("unidade")?.value,primeira_parcela:new Date(this.agreementForm.get("primeira_parcela")?.value),porcentagem_garantido:Number(this.percentageGuaranteed.toFixed(2)),porcentagem_nao_garantido:Number(this.percentageNotGuaranteed.toFixed(2)),porcentagem_comprado:Number(this.percentagePurchasedRate.toFixed(2)),parcelas:this.listPlots,total_parcelas:Number(this.totalPlots.toFixed(2)),valor_taxas:Number(this.agreementForm.get("valor_taxas")?.value.toFixed(2)),total_divida:Number(this.agreementForm.get("total_divida")?.value.toFixed(2)),total_honorarios:Number((this.agreementForm.get("valor_honorarios")?.value+this.agreementForm.get("honorarios_embutidos")?.value).toFixed(2)),conta_geracao_uuid:this.agreementForm.get("primeira_parcela")?.value},this.agreementForm.value),this.calculatedChargesSnapshot),{titular_cobranca_id:this.searchChargesForm.get("titular_cobranca_id")?.value})}submitAgreement(e){this.api.post("/agreement",e).pipe(M(()=>this.isLoadingList=!1)).subscribe({next:t=>{this.nzData?.isModal?(this.modal.closeAll(),window.open(`/app/acordos/detalhes/${t.data}`,"_blank")):this.router.navigate([`/app/acordos/detalhes/${t.data}`])},error:t=>{Array.isArray(t.error.message)?this.errorList=t.error.message:this.errorList=[t.error.message]}})}toggleDetail(e){this.isDetailExpanded(e)?this.expandSet.delete(e):(this.expandSet.clear(),this.expandSet.add(e),this.getChargeCompositions(e))}isDetailExpanded(e){return this.expandSet.has(e)}fieldRules(){this.fieldRulesBound||(this.fieldRulesBound=!0,this.agreementForm.valueChanges.pipe(K(this.destroy$)).subscribe({next:e=>{let{qtd_parcelas:t,qtd_parcela_honorarios:a,valor_desconto:l,honorarios_embutidos:p,valor_entrada:v}=e,u=this.agreementForm.get("total_divida")?.value;this.errorList=[],t&&(t<a||a>t)&&this.errorList.push("Quantidade de parcelas do acordo na\u0303o pode ser menor que a quantidade de parcelas de honor\xE1rios"),v>u&&this.errorList.push("Valor de entrada na\u0303o pode ser maior que o valor total da di\u0301vida"),l>=u&&this.errorList.push("Desconto na\u0303o pode ser maior ou igual ao valor total da di\u0301vida"),p>u&&this.errorList.push("Honor\xE1rios embutidos na\u0303o pode ser maior que o valor total da di\u0301vida"),e.valor_outros?this.agreementForm.get("descricao_outros")?.setValidators([x.required]):this.agreementForm.get("descricao_outros")?.clearValidators(),this.firstDatePlot=new Date(this.agreementForm.get("primeira_parcela")?.value)},error:e=>{Array.isArray(e.error.message)?this.errorList=e.error.message:this.errorList=[e.error.message]}}))}
1validateDiscountPolicyOnNext(){let e=this.buildPolicyPreviewPayload();return e?new Promise(t=>{this.api.post("/agreement/preview-discount-policy",e).subscribe({next:a=>{let l=a?.data;if(this.policyPreview=l??null,l&&l.dentro_da_politica===!1){this.errorList=l.violacoes?.length?[...l.violacoes]:[a.message||"Condi\xE7\xF5es fora da pol\xEDtica de desconto"],t(!1);return}t(!0)},error:a=>{let l=a?.error?.message;this.errorList=Array.isArray(l)?l:[l||"Erro ao validar pol\xEDtica de desconto"],t(!1)}})}):(this.errorList=["Preencha tipo de acordo e quantidade de parcelas para validar a pol\xEDtica."],Promise.resolve(!1))}buildPolicyPreviewPayload(){let e=this.searchChargesForm.get("condominio")?.value,t=this.searchChargesForm.get("unidade")?.value,a=this.agreementForm.get("tipo_acordo")?.value,l=Number(this.agreementForm.get("qtd_parcelas")?.value);if(!e||!t||!a||!Number.isFinite(l)||l<1)return null;let p=P=>Math.min(100,Math.max(0,Number.isFinite(P)?P:0)),v=this.agreementForm.get("valor_entrada")?.value,u=Number(v);return{condominio_uuid:e,unidade_uuid:t,tipo_acordo:a,qtd_parcelas:l,valor_desconto:Math.max(0,Number(this.agreementForm.get("valor_desconto")?.value)||0),total_divida:Math.max(0,Number(this.agreementForm.get("total_divida")?.value)||0),valor_entrada:Number.isFinite(u)&&u>0?u:null,valor_taxas:Math.max(0,Number(this.agreementForm.get("valor_taxas")?.value)||0),valor_honorarios:Math.max(0,Number(this.agreementForm.get("valor_honorarios")?.value)||0),valor_honorarios_calculado:Math.max(0,Number(this.calculatedChargesSnapshot?.valor_honorarios_calculado??this.agreementForm.get("valor_honorarios")?.value)||0),porcentagem_garantido:p(Number(this.percentageGuaranteed.toFixed(2))),porcentagem_nao_garantido:p(Number(this.percentageNotGuaranteed.toFixed(2))),porcentagem_comprado:p(Number(this.percentagePurchasedRate.toFixed(2))),cobrancas_uuids:this.chargesUuids?.length?[...this.chargesUuids]:void 0}}closeErrorAlert(e){this.errorList=this.errorList.filter(t=>t!==e)}paginate(e){this.pageTotal=this.filteredCharges.length,this.pageIndex=e,this.page[this.pageIndex]=this.filteredCharges.slice((this.pageIndex-1)*this.pageSize,this.pageIndex*this.pageSize),this.refreshCheckedStatus()}disabledComponents(){return!!(this.nzData&&this.nzData.isModal)}disabledBackIcon(){return this.nzData&&this.nzData.isModal?null:""}transformDescription(e,t,a,l){return at({parcela:e,totalParcelas:t,planoDeContas:a,descricao:l})}addMonthsSafe(e,t){let a=e.getFullYear(),l=e.getMonth()+t,p=e.getDate(),v=new Date(a,l,1),u=new Date(v.getFullYear(),v.getMonth()+1,0).getDate();return new Date(v.getFullYear(),v.getMonth(),Math.min(p,u))}static{this.\u0275fac=function(t){return new(t||s)(N(re),N(be),N(ue),N(oe),N(ot))}}static{this.\u0275cmp=ee({type:s,selectors:[["app-agreement-create"]],standalone:!1,decls:20,vars:8,consts:[["footerTemplate",""],["emptyList",""],["dynamicTable",""],["dynamicPlotsTable",""],[1,"site-page-header-ghost-wrapper"],[3,"nzGhost","nzBackIcon"],["nz-button","",3,"disabled"],["nzType","default",3,"nzCurrent"],[3,"nzDisabled","nzTitle"],[3,"nzGhost"],[2,"display","none"],["nz-button","",3,"click","disabled"],["nzSpan","24"],["nz-row","","nzGutter","14","nzAlign","bottom","nz-form","","nzLayout","vertical",3,"formGroup"],["nz-col","","nzSpan","7"],[2,"margin","0","padding","0"],["nzRequired","","for","condominio"],["label","Condom\xEDnio","formControlName","condominio",3,"required","selectMode","tiposPessoas","disableComponent"],["nzRequired","","for","unidade"],["label","Unidade","formControlName","unidade",3,"required","condominium_uuid","tiposPessoas","allowClear","unit_uuid","disableComponent"],["nzRequired","true","for","data_referencia"],["formControlName","data_referencia","nzFormat","dd/MM/yyyy",3,"nzDisabled"],["nz-col","","nzSpan","3"],["nz-button","","nzType","primary","type","submit","nzBlock","",3,"click","disabled"],["nz-icon","","nzType","search"],["nz-col","","nzSpan","8"],["nzRequired",""],["formControlName","titular_cobranca_id","nzShowSearch","","nzAllowClear","","nzPlaceHolder","Selecione o titular",2,"width","100%"],[3,"nzValue","nzLabel"],["formControlName","charge_person_filter","nzShowSearch","","nzAllowClear","","nzPlaceHolder","Todas as cobran\xE7as",2,"width","100%"],["nz-col","","nzSpan","8",1,"agreement-show-responsavel"],["nz-checkbox","",1,"agreement-show-responsavel-toggle",3,"ngModelChange","ngModel","ngModelOptions"],[1,"agreement-show-responsavel-toggle__content"],["nz-icon","","nzType","user","nzTheme","outline"],["nz-col","","nzSpan","24",2,"margin-bottom","16px"],["nzSize","small",3,"nzData","nzLoading","nzFrontPagination","nzFooter"],["nzLabel","Select all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],["nzShowIcon","","nzType","error","nzCloseable","",2,"margin-bottom","12px",3,"nzOnClose","nzMessage"],[1,"agreement-charge-responsavel-row"],[3,"nzCheckedChange","nzChecked","nzDisabled"],["nzAlign","right"],["nzAlign","center"],["nzColor","warning"],["nz-button","",3,"click","nzType"],["nz-icon","","nzTheme","outline",3,"nzType"],[3,"nzExpand"],["colspan","12",1,"agreement-charge-responsavel-row__content"],[1,"agreement-charge-responsavel-row__inner"],[1,"agreement-charge-responsavel-row__name"],[1,"agreement-charge-responsavel-row__tag",3,"nzColor"],[3,"nzData","nzShowPagination","nzFrontPagination","nzScroll"],["colSpan","2"],["colSpan","7"],["nz-col","","nzSpan","6"],["nzRequired","true","for","data_acordo"],["nzDisabled","","formControlName","data_acordo","nzFormat","dd/MM/yyyy"],["nzRequired","true","for","tipo_acordo"],["nzShowSearch","","nzAllowClear","","nzPlaceHolder","Selecione o tipo do acordo","formControlName","tipo_acordo"],["nzValue","Administrativo","nzLabel","Administrativo"],["nzValue","Juridico","nzLabel","Jur\xEDdico"],["nzRequired","true","for","valor_taxas"],["nz-input","","placeholder","Informe o valor da taxa","type","text","formControlName","valor_taxas","currencyMask","",3,"options"],["nzRequired","true","for","valor_multa"],["nz-input","","placeholder","Informe o valor das multas","type","text","formControlName","valor_multa","currencyMask","",3,"options"],["nzRequired","true","for","valor_juros"],["nz-input","","placeholder","Informe o valor do juros","type","text","formControlName","valor_juros","currencyMask","",3,"options"],["nzRequired","true","for","valor_correcao_monetaria"],["nz-input","","placeholder","Informe o valor da corre\xE7\xE3o monet\xE1ria","type","text","formControlName","valor_correcao_monetaria","currencyMask","",3,"options"],["nzRequired","true","for","valor_honorarios"],["nz-input","","placeholder","Informe o valor dos honor\xE1rios","type","text","formControlName","valor_honorarios","currencyMask","",3,"options"],["nzRequired","true","for","valor_enc_administrativo"],["nz-input","","placeholder","Informe o valor do encargo administrativo","type","text","formControlName","valor_enc_administrativo","currencyMask","",3,"options"],["for","honorarios_embutidos"],["nz-input","","placeholder","Informe a tarifa de cobran\xE7a","type","text","formControlName","honorarios_embutidos","currencyMask","",3,"options"],["for","qtd_parcela_honorarios",3,"nzRequired"],["nz-input","","placeholder","Informe a car\xEAncia","type","text","formControlName","qtd_parcela_honorarios",2,"width","100%",3,"nzMin","nzStep"],["for","valor_outros"],["nz-input","","placeholder","Informe o valor de outros","type","text","formControlName","valor_outros","currencyMask","",3,"options"],["for","valor_desconto"],["nz-input","","placeholder","Informe o valor dos descontos","type","text","formControlName","valor_desconto","currencyMask","",3,"options"],["nzRequired","true","for","total_divida"],["nz-input","","placeholder","Informe o valor total da divida","type","text","formControlName","total_divida","currencyMask","",3,"options"],["for","valor_entrada"],["nz-input","","placeholder","Informe o valor da entrada do acordo","type","text","formControlName","valor_entrada","currencyMask","",3,"options"],["nzRequired","true","for","qtd_parcelas"],["nz-input","","placeholder","Informe a quantidade de parcelas","type","text","formControlName","qtd_parcelas",2,"width","100%",3,"nzMin","nzStep"],["nzRequired","true","for","primeira_parcela"],["formControlName","primeira_parcela","nzFormat","dd/MM/yyyy"],["for","observacoes"],["nz-input","","formControlName","observacoes"],["nzRequired","","for","modelo_uuid"],["nzShowSearch","","nzAllowClear","","nzPlaceHolder","Selecione o modelo de confiss\xE3o d\xEDvida","formControlName","modelo_uuid"],["nzRequired","","for","empresa_cobranca_uuid"],["nzShowSearch","","nzAllowClear","","nzPlaceHolder","Selecione a empresa de cobran\xE7a","formControlName","empresa_cobranca_uuid"],["nzRequired","","for","conta_geracao_uuid"],["formControlName","conta_geracao_uuid",2,"width","100%",3,"condominio_uuid","condominiumParam","bankAccountParam"],["for","descricao_outros",3,"nzRequired"],["nz-input","","formControlName","descricao_outros"],["nzHeader","Resumo do acordo","nzActive","true"],[3,"nzGutter"],["nzSpan","8"],[3,"nzData","nzLoading","nzFrontPagination"],[2,"width","13%"],[2,"width","14%"],["nzAlign","right",1,"total"],["nz-button","","nzType","primary","type","submit","nzBlock","",2,"width","25%","position","absolute","right","10px","top","50px",3,"click","disabled"],["nzFormat","dd/MM/yyyy",3,"ngModelChange","nzDisabledDate","ngModel"],["nz-input","","type","text","currencyMask","",3,"ngModelChange","ngModel","options"],["nz-input","","type","text",3,"ngModelChange","disabled","ngModel"],["nz-row","","nzJustify","end",1,"total-footer"],["nz-col","","nzSpan","24"],[3,"nzNoResult"],[2,"width","10%"],[2,"width","12%"],[2,"width","11%"]],template:function(t,a){t&1&&(n(0,"div",4)(1,"nz-page-header",5)(2,"nz-page-header-title"),o(3,"Criar acordo"),i(),n(4,"nz-page-header-subtitle"),o(5," Voc\xEA pode criar um acordo "),i(),n(6,"nz-page-header-extra")(7,"nz-space"),I(8,zt,2,1,"button",6)(9,bt,2,1,"button",6),i()()(),n(10,"nz-steps",7),w(11,yt,1,2,"nz-step",8,L),i(),I(13,kt,82,27,"nz-page-header",9)(14,qt,131,33,"
1nz-page-header",9)(15,Gt,113,70,"nz-page-header",9)(16,jt,60,41,"ng-template",null,0,W)(18,Ht,0,0,"ng-template",10,1,W),i()),t&2&&(r(),d("nzGhost",!1)("nzBackIcon",a.disabledBackIcon()),r(7),F(a.currentStepIndex!==0?8:-1),r(),F(a.currentStepIndex!==a.steps.length-1&&a.canProceed(a.currentStepIndex)?9:-1),r(),d("nzCurrent",a.currentStepIndex),r(),T(a.steps),r(2),F(a.currentStepIndex==0?13:-1),r(),F(a.currentStepIndex==1?14:-1),r(),F(a.currentStepIndex==2?15:-1))},dependencies:[ve,he,_e,ge,ze,Ce,xe,fe,Le,me,de,ce,Ne,ke,De,Me,Se,ye,Fe,Ee,Te,we,le,Pe,Ve,$e,Be,Re,Oe,qe,Ae,Ie,se,Ge,Ue,Ke,je,We,He,et,Ze,Xe,tt,Qe,Ye,Je,it,ct,lt,mt,st,ne,ie],styles:[".page-header[_ngcontent-%COMP%]{margin:20px 20px 0 40px}.header-collapse[_ngcontent-%COMP%]{background-color:#fff;border:none}.no-margin[_ngcontent-%COMP%]{margin:0;padding:0}.mr-100[_ngcontent-%COMP%]{max-width:100px}.mr-200[_ngcontent-%COMP%]{max-width:200px}.mr-300[_ngcontent-%COMP%]{max-width:300px}.flex[_ngcontent-%COMP%]{display:flex;width:100vw}.form-item[_ngcontent-%COMP%]{max-width:50vw}.input-size[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{max-width:200px;text-align:center;border:none;box-shadow:0 0 3px #9b9ba380}input[_ngcontent-%COMP%]:focus{box-shadow:0 0 3px #9b9ba380;outline:none}.couple-margin[_ngcontent-%COMP%]{margin:8px} .ant-input-number-handler-wrap{display:none} .ant-input-number-input{text-align:right}.charge-row-blocked[_ngcontent-%COMP%]{background-color:#fff7e6}.agreement-show-responsavel[_ngcontent-%COMP%]{display:flex;align-items:flex-end}[_nghost-%COMP%] .agreement-show-responsavel-toggle{display:inline-flex;align-items:center;margin:0;padding:5px 12px 5px 8px;border-radius:6px;border:1px solid #d9d9d9;background:#fafafa;line-height:1.4}[_nghost-%COMP%] .agreement-show-responsavel-toggle .ant-checkbox{top:0;align-self:center}[_nghost-%COMP%] .agreement-show-responsavel-toggle .ant-checkbox+span{display:inline-flex;align-items:center;padding-inline-start:6px;padding-inline-end:0}[_nghost-%COMP%] .agreement-show-responsavel--active .agreement-show-responsavel-toggle{border-color:#1677ff;background:#e6f4ff;box-shadow:0 0 0 2px #1677ff1f}.agreement-show-responsavel-toggle__content[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:13px;color:#000000bf}.agreement-show-responsavel--active[_ngcontent-%COMP%] .agreement-show-responsavel-toggle__content[_ngcontent-%COMP%]{color:#0958d9;font-weight:500}.agreement-charge-responsavel-row__content[_ngcontent-%COMP%]{padding:4px 12px 4px 50px!important;border-bottom:1px solid #e8e8e8!important;background:linear-gradient(180deg,#fafafa,#f5f5f5)}.agreement-charge-responsavel-row__inner[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:24px}.agreement-charge-responsavel-row__name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:14px;font-weight:500;color:#000000bf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agreement-charge-responsavel-row__tag[_ngcontent-%COMP%]{flex:0 0 auto;margin:0!important;font-size:10px;line-height:16px;padding:0 6px}"]})}}return s})();export{Mi as 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.