PageSourceSearch

https://creditos.somosziro.com/chunk-LTMC6XOM.js

js somosziro.com collected 2026-10-07 04:18:36 UTC 34,576 bytes, 2 lines download raw bytes

1import{a as k}from"./chunk-VTYGPYPM.js";import{a as Me}from"./chunk-22FV26ZM.js";import{a as _e}from"./chunk-KBWFHLV4.js";import"./chunk-2HTL3M2B.js";import"./chunk-QUZH6MJZ.js";import{b as ve,c as G,d as ye,f as be,g as Se,j as Ee}from"./chunk-GNZRJHE2.js";import{a as he,b as xe}from"./chunk-WFT7SD4B.js";import"./chunk-WB6LGH64.js";import"./chunk-RTURDZUQ.js";import"./chunk-HZB6WFJ5.js";import"./chunk-2SBVJNLP.js";import"./chunk-5EVUOSO3.js";import{a as R,b as fe}from"./chunk-GJLUVOSS.js";import"./chunk-NUC6BEEO.js";import"./chunk-DNNY4O57.js";import{a as H}from"./chunk-NPABV3IJ.js";import{d as p,l as pe,m as ge,n as ue,t as T}from"./chunk-GBJFERBN.js";import{a as Ce}from"./chunk-TLJ5UPI2.js";import"./chunk-TZF5454P.js";import{Da as s,Ea as C,Gb as I,Ib as v,Jb as se,Mb as me,Mc as W,Na as x,Pb as ce,Sa as f,Wa as B,Xa as Z,Y as oe,Za as h,_a as F,a as q,ab as E,b as X,ba as S,bb as D,c as ie,cb as a,cc as V,db as i,eb as g,ha as re,ia as w,ib as O,ja as P,kb as M,lb as c,lc as de,ob as le,rc as A,vb as o,wb as j,xb as d,ya as K,yb as z,za as $}from"./chunk-4P234F3D.js";function ke(n,t){n&1&&(a(0,"div",9)(1,"div",13),g(2,"i",14),o(3," \xA1No hay clientes para crear el Diagrama circular! "),i()(),a(4,"div",6)(5,"p",15),o(6," Totales "),a(7,"b"),o(8," 0"),i()()())}function we(n,t){if(n&1&&(a(0,"div",6)(1,"p",15),o(2," Totales "),a(3,"b"),o(4),i()()()),n&2){let e=c();s(4),d(" ",e.totalCustomers," ")}}function Pe(n,t){if(n&1&&(a(0,"p",16)(1,"span"),o(2," Proveedor: "),i(),o(3),i(),a(4,"p",16)(5,"span"),o(6," Valor: "),i(),o(7),i(),a(8,"p",16)(9,"span"),o(10," Fecha entrega: "),i(),o(11),i(),a(12,"p",16)(13,"span"),o(14," # de orden: "),i(),o(15),i(),a(16,"p",16)(17,"span"),o(18," Estado: "),i(),o(19),i(),a(20,"p",16)(21,"span"),o(22," Fecha limite de pago: "),i(),o(23),i(),g(24,"hr")),n&2){let e=t.$implicit,r=c(3);s(3),d(" ",e.shopCommerceName," "),s(4),d(" ",r.transformMoney(e.valueCredit)," "),s(4),d(" ",r.transformDate(e.deliveryDate)," "),s(4),d(" ",e.orderNumber," "),s(4),d(" ",e.creditState," "),s(4),d(" ",r.transformDate(e.deadline)," ")}}function Fe(n,t){if(n&1&&(a(0,"tr")(1,"td"),o(2),i(),a(3,"td"),o(4),i(),a(5,"td"),o(6),i(),a(7,"td"),E(8,Pe,25,6,null,null,F),i()()),n&2){let e=t.$implicit;s(2),j(e.customerName+" "+e.customerLastName),s(2),d(" ",e.identification," "),s(2),j(e.phone),s(2),D(e.credits)}}function Oe(n,t){if(n&1&&(a(0,"table",12)(1,"thead")(2,"tr")(3,"th"),o(4,"Nombre"),i(),a(5,"th"),o(6,"Identificaci\xF3n"),i(),a(7,"th"),o(8,"Telefono"),i(),a(9,"th"),o(10,"Creditos"),i()()(),a(11,"tbody"),E(12,Fe,10,3,"tr",null,F),i()()),n&2){let e=c();s(12),D(e.customers)}}G.register(...Ee);var U=class n{constructor(t,e,r,l){this.activeModal=t;this.dailyManagementService=e;this.loaderService=r;this.modalService=l;G.register(ye,Se,be,ve)}management;messagesManagement;myChart;colors=["#f66b7e","#f6ba22","#00cdd5","#a095ff","#1fe679","#064853"];customers;totalCustomers=0;ngOnInit(){this.messagesManagement.length>0&&this.createPieChart()}ngOnDestroy(){this.myChart&&this.myChart.destroy()}closeModal(){this.activeModal.dismiss()}createPieChart(){let t=this.messagesManagement.map(m=>`${m.scheduleName}: ${m.totalRelatedCredits}`),e=this.messagesManagement.map(m=>m.totalRelatedCredits);this.totalCustomers=e.reduce((m,_)=>m+_,0);let r=this.getColors(e.length),l=document.getElementById("myPieChart");this.myChart=new G(l,{type:"pie",data:{labels:t,datasets:[{label:"Cantidad de Clientes",data:e,backgroundColor:r,hoverOffset:4}]},options:{responsive:!0,plugins:{tooltip:{callbacks:{label:function(m){return m.label||""}}}},onClick:(m,_)=>this.handleChartClick(m,_)}})}getColors(t){let e=this.colors.length,r=[];for(let l=0;l<t;l++)r.push(this.colors[l%e]);return r}handleChartClick(t,e){if(e.length>0){let r=e[0].index,l=this.messagesManagement[r].id;this.getCustomersByMessageManagementId(l)}}getCustomersByMessageManagementId(t){p(this.loaderService,!0,"Cargando creditos de los clientes..."),this.dailyManagementService.getMessagesCustomersCredits(t).subscribe(e=>{p(this.loaderService,!1),e.ok?this.customers=e.data:this.modalService.openModal("Error","Error al obtener los creditos de los clientes: "+e.message,"error")},e=>{p(this.loaderService,!1),this.modalService.openModal("Error","Error al obtener los creditos de los clientes: "+e.message,"error")})}transformMoney(t){if(typeof t=="string"&&(t=parseFloat(t)),isNaN(t)||t===null)return"-";let e=t.toFixed(2).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),"$"+e.join(",")}transformDate(t){let e=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"];if(typeof t!="string"||!t.includes("-"))return"Fecha inv\xE1lida";let r=t.split("-");if(r.length!==3)return"Fecha inv\xE1lida";let l=parseInt(r[1])-1;return l<0||l>11?"Fecha inv\xE1lida":r[2]+" de "+e[l]+" "+r[0]}static \u0275fac=function(e){return new(e||n)(C(R),C(k),C(T),C(H))};static \u0275cmp=S({type:n,selectors:[["app-cs-daily-management-estadistics"]],inputs:{management:"management",messagesManagement:"messagesManagement"},standalone:!0,features:[I],decls:18,vars:3,consts:[[1,"container-fluid"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body"],[1,"d-flex","flex-column","gap-2",2,"width","100%"],[1,"d-flex","flex-column"],[1,"w-100","fs-6","text-black","m-0","p-0"],[1,"w-100","m-0","p-0"],[1,"d-flex","justify-content-center","align-items-center","py-5","fs-6h-100"],[1,"canvas-container"],["id","myPieChart","width","400","height","200"],[1,"table"],[1,"d-flex","align-items-center","justify-content-center","flex-column","gap-4","h-100"],[1,"fa-solid","fa-chart-pie",2,"font-size","30px"],[1,"w-100","m-0","p-0","fs-5"],[1,"content-table"]],template:function(e,r){e&1&&(a(0,"div",0)(1,"div",1)(2,"h4",2),o(3),i(),a(4,"button",3),M("click",function(){return r.closeModal()}),i()(),a(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7),o(9,"Calculo"),i(),a(10,"p",8),o(11,"Numero de clientes por Gesti\xF3n."),i()(),a(12,"div",9)(13,"div",10),g(14,"canvas",11),i()(),x(15,ke,9,0)(16,we,5,1,"div",6)(17,Oe,14,0,"table",12),i()()()),e&2&&(s(3),d(" ",r.management.name," "),s(12),h(r.messagesManagement.length===0?15:16),s(2),h(r.customers&&r.customers.length>0?17:-1))},dependencies:[A],styles:[".content-table[_ngcontent-%COMP%]{font-size:14px;margin-bottom:14px}.content-table[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-weight:700}"]})};var Ae=(n,t)=>t.id,b=n=>({"bg-success":n});function Le(n,t){n&1&&g(0,"th")}function $e(n,t){if(n&1){let e=O();a(0,"td",9)(1,"input",14),M("change",function(l){w(e);let m=c(),_=m.$implicit,u=m.$index,N=c(2);return P(N.onCheckboxChange(l,_,u))}),i()()}if(n&2){let e=c().$implicit;f("ngClass",v(2,b,e.called)),s(),f("checked",e.called)}}function ze(n,t){if(n&1){let e=O();a(0,"button",15),M("click",function(){w(e);let l=c().$implicit,m=c(2);return P(m.showSingularMessage(l))}),g(1,"i"),i()}if(n&2){let e=c().$implicit,r=c(2);Z("btn btn-",r.currentShowSingularMessage.id===e.id?"warning":"info"," btn-xs me-1 mb-1"),s(),Z("fas fa-eye",r.currentShowSingularMessage.id===e.id?"-slash":"","")}}function Be(n,t){if(n&1){let e=O();a(0,"tr"),x(1,$e,2,4,"td",9),a(2,"td",9),o(3),i(),a(4,"td",9),o(5),i(),a(6,"td",9),o(7),i(),a(8,"td",10),o(9),i(),a(10,"td",10),o(11),i(),a(12,"td",10),o(13),i(),a(14,"td",10),o(15),i(),a(16,"td",10)(17,"button",11),M("click",function(){let l=w(e).$implicit,m=c(2);return P(m.onclickManaganementCustomer(l.customerId))}),g(18,"i",12),i(),x(19,ze,2,6,"button",13),i()()}if(n&2){let e=t.$implicit,r=c(2);s(),h(r.messageManagamentSelected.type_management==="Llamada"?1:-1),s(),f("ngClass",v(17,b,e.called)),s(),d(" ",e.customerName," "),s(),f("ngClass",v(19,b,e.called)),s(),d(" ",e.identification," "),s(),f("ngClass",v(21,b,e.called)),s(),d(" ",e.phone," "),s(),f("ngClass",v(23,b,e.called)),s(),d(" ",e.approvedQuota," "),s(),f("ngClass",v(25,b,e.called)),s(),d(" ",e.availableQuota," "),s(),f("ngClass",v(27,b,e.called)),s(),d(" ",e.actionPerfomed==="Y"?"Si":"No"," "),s(),f("ngClass",v(29,b,e.called)),s(),d(" ",r.formatCustomerError(e.error)," "),s(),f("ngClass",v(31,b,e.called)),s(3),h(r.messageManagamentSelected.type_management!=="Llamada"&&e.actionPerfomed==="Y"?19:-1)}}function Ve(n,t){if(n&1&&(a(0,"table",5)(1,"thead")(2,"tr"),x(3,Le,1,0,"th"),a(4,"th"),o(5,"Nombre"),i(),a(6,"th"),o(7,"Identificacion"),i(),a(8,"th"),o(9,"Celular"),i(),a(10,"th",8),o(11,"Cupo aprobado"),i(),a(12,"th",8),o(13,"Cupo disponible"),i(),a(14,"th"),o(15,"Enviado?"),i(),a(16,"th"),o(17,"Error"),i(),a(18,"th",8),o(19,"Acciones"),i()()(),a(20,"tbody"),E(21,Be,20,33,"tr",null,Ae),i()()),n&2){let e=c();s(3),h(e.messageManagamentSelected.type_management==="Llamada"?3:-1),s(18),D(e.dayManagementCustomers)}}function We(n,t){n&1&&(a(0,"div",6),g(1,"i",16),a(2,"span",17),o(3,"No se encontraron clientes en este mensaje"),i()())}function He(n,t){if(n&1&&g(0,"img",22),n&2){let e=c(4);f("src",e.template==null?null:e.template.template_media_link,$)}}function Re(n,t){if(n&1&&(a(0,"video",23),g(1,"source",30),o(2," Tu navegador no soporta videos MP4. "),i()),n&2){let e=c(4);s(),f("src",e.template==null?null:e.template.template_media_link,$)}}function Ge(n,t){if(n&1&&(a(0,"a",24)(1,"div",31)(2,"p"),o(3,"Descargar documento"),i(),g(4,"i",32),i()()),n&2){let e=c(4);f("href",e.template==null?null:e.template.template_media_link,$)}}function Ue(n,t){if(n&1&&(a(0,"p",25),o(1),i()),n&2){let e=c(4);s(),d(" ",e.template==null||e.template.components[0]==null?null:e.template.components[0].text," ")}}function Ye(n,t){if(n&1&&(a(0,"p",27),o(1),i()),n&2){let e=c(4);s(),d(" ",e.template.components[2].text," ")}}function Je(n,t){if(n&1&&(a(0,"div",29),g(1,"i",33),a(2,"a",34)(3,"p",35),o(4),i()()()),n&2){let e=t.$implicit;s(2),le("href",e.url,$),s(2),d(" ",e.text," ")}}function Qe(n,t){if(n&1&&(a(0,"div",20),x(1,He,1,1,"img",22)(2,Re,3,1,"video",23)(3,Ge,5,1,"a",24)(4,Ue,2,1,"p",25),g(5,"div",26),x(6,Ye,2,1,"p",27),a(7,"div",28),o(8),me(9,"date"),i(),E(10,Je,5,2,"div",29,F),i()),n&2){let e=c(3);s(),h(e.typeFile==="IMAGE"?1:e.typeFile==="VIDEO"?2:e.typeFile==="DOCUMENT"?3:-1),s(3),h((e.template==null?null:e.template.body)==="TEXT"?4:-1),s(),f("innerHTML",e.transformText(e.currentShowSingularMessage.id===0?e.template==null?null:e.template.body:e.currentShowSingularMessage.message),K),s(),h(e.template!=null&&e.template.components[2]?6:-1),s(2),d(" ",ce(9,5,e.currentDate,"shortTime","-0500")," "),s(2),D((e.template==null||e.template.components[1]==null?null:e.template.components[1].buttons)||(e.template==null||e.template.components[2]==null?null:e.template.components[2].buttons)||(e.template==null||e.template.components[3]==null?null:e.template.components[3].buttons))}}function qe(n,t){if(n&1&&(a(0,"div",21),g(1,"div",36),i()),n&2){let e=c(3);s(),f("innerHtml",e.currentShowSingularMessage.id===0?e.template:e.currentShowSingularMessage.message,K)}}function Xe(n,t){if(n&1&&x(0,Qe,12,9,"div",20)(1,qe,2,1,"div",21),n&2){let e=c(2);h(e.messageManagament.managementType==="WhatsApp"?0:e.messageManagament.managementType==="Correo"?1:-1)}}function Ke(n,t){n&1&&g(0,"div",19)}function Ze(n,t){if(n&1&&(a(0,"div",7)(1,"div",18),x(2,Xe,2,1)(3,Ke,1,0,"div",19),i()()),n&2){let e=c();s(2),h(e.serachingTempleate?3:2)}}var J=class n{constructor(t,e,r,l){this.templateService=t;this.loaderService=e;this.router=r;this.dailyManagementService=l}dayManagementCustomers;messageManagament;serachingTempleate=!1;typeFile="";currentDate=new Date;template;colors=["bg-color-0","bg-color-1","bg-color-2","bg-color-3","bg-color-4","bg-color-5","bg-color-6","bg-color-7"];messageManagamentSelected;currentShowSingularMessage={id:0,message:""};ngOnChanges(t){t.dayManagementCustomers&&(this.dayManagementCustomers=t.dayManagementCustomers.currentValue,this.getTemplate()),t.messageManagament&&(this.messageManagamentSelected=t.messageManagament.currentValue)}getColorClass(t){return this.colors[t%this.colors.length]}getTemplate(){this.messageManagament.managementType==="WhatsApp"?(this.serachingTempleate=!0,this.typeFile="",this.templateService.getTemplateByName(this.messageManagament.templateName).subscribe(t=>
1{p(this.loaderService,!1),JSON.parse(t.data.components).forEach(r=>{r.type==="HEADER"&&(this.typeFile=r.format)}),this.template=t.data,this.serachingTempleate=!1},t=>{p(this.loaderService,!1),console.error(t)})):this.messageManagament.managementType==="Correo"?(this.serachingTempleate=!0,this.templateService.getTemplateEmailById(this.messageManagament.emailTemplateId).subscribe(t=>{p(this.loaderService,!1),this.serachingTempleate=!1,t.ok?this.template=t.data.body:console.error("Error al obtener el template con id "+this.messageManagament.emailTemplateId,t)})):setTimeout(()=>{p(this.loaderService,!1)},100)}onclickManaganementCustomer(t){let e=`/cobranza/arbol-gestion/${t}`;window.open(this.router.createUrlTree([e]).toString(),"_blank")}showSingularMessage(t){console.log(t),t.id!==this.currentShowSingularMessage.id?(this.currentShowSingularMessage.id=t.id,this.currentShowSingularMessage.message=t.executionResult):(this.currentShowSingularMessage.id=0,this.currentShowSingularMessage.message="")}onCheckboxChange(t,e,r){let l=t.target;p(this.loaderService,!0),this.dailyManagementService.setCalledCustomer(e.id,l.checked).subscribe(m=>{p(this.loaderService,!1),e.called=l.checked})}transformText(t){return t.replace(/\*(.*?)\*/g,"<b>$1</b>").split(`
2`).join("<br>")}formatCustomerError(t){return t==null?"-":String(t).trim()||"-"}static \u0275fac=function(e){return new(e||n)(C(_e),C(T),C(W),C(k))};static \u0275cmp=S({type:n,selectors:[["app-cs-daily-management-customers-data"]],inputs:{dayManagementCustomers:"dayManagementCustomers",messageManagament:"messageManagament"},standalone:!0,features:[re,I],decls:14,vars:5,consts:[[1,"w-100","m-0","p-0","fs-6"],[2,"font-size","13px"],[1,"row"],[1,"content-table","d-flex","justify-content-center","align-items-center"],[1,"scroll"],[1,"table","table-striped","p-0","m-0"],[1,"d-flex","justify-content-center","align-items-center","flex-column",2,"background-color","#f6f6f6","height","630px"],[1,"col-6","col-lg-5"],[1,"text-center"],[3,"ngClass"],[1,"text-center",3,"ngClass"],["type","button",1,"btn","btn-warning","btn-xs","me-1","mb-1",3,"click"],[1,"fas","fa-tasks"],["type","button",3,"class"],["type","checkbox",1,"form-check-input",3,"change","checked","value"],["type","button",3,"click"],[1,"fa-solid","fa-people-pulling",2,"font-size","30px"],[1,"text-muted",2,"font-size","12px","text-align","center"],[1,"content-background"],[1,"loader"],[1,"content-message","scroll"],[1,"position-relative","scroll-whatsapp","border","rounded-1",2,"background-color","#efeae2"],[1,"img-preview","mb-2",2,"max-width","100%","height","auto","border-radius","8px",3,"src"],["controls","","autoplay","",1,"w-100","rounded-3","mb-2"],["target","_blank",3,"href"],[1,"chat-title","text-break","m-0","p-0","lh-sm","pb-1"],[1,"text-break",3,"innerHTML"],[1,"chat-footer","text-break","m-0","p-0"],[1,"chat-metadata"],[1,"p-0","m-0","d-flex","justify-content-center","align-items-start","gap-2","border-top","py-2"],["type","video/mp4",3,"src"],[1,"document"],[1,"fa-solid","fa-download"],[1,"fa-solid","fa-arrow-up-right-from-square","text-info","pt-1"],["target","_blank","rel","noopener noreferrer",3,"href"],[1,"m-0","p-0","text-info"],[1,"div-container",3,"innerHtml"]],template:function(e,r){e&1&&(a(0,"p",0),o(1,"Informaci\xF3n"),i(),a(2,"span",1),o(3," Mensaje "),a(4,"b"),o(5),i(),o(6," fue enviado a estos clientes: "),i(),a(7,"div",2)(8,"div")(9,"div",3)(10,"div",4),x(11,Ve,23,1,"table",5)(12,We,4,0,"div",6),i()()(),x(13,Ze,4,1,"div",7),i()),e&2&&(s(5),d(" ",r.messageManagament.scheduleName," "),s(3),B(r.messageManagamentSelected.type_management==="Llamada"?"col-12":"col-6 col-lg-7"),s(3),h(r.dayManagementCustomers&&r.dayManagementCustomers.length>0?11:12),s(2),h(r.messageManagamentSelected.type_management!=="Llamada"?13:-1))},dependencies:[A,V,de],styles:[".content-background[_ngcontent-%COMP%]{background-image:url(/assets/img/background_whatsapp.png);background-size:cover;background-repeat:no-repeat;background-color:#bbffbf;padding:20px 15px;border-radius:5px;overflow-y:hidden;height:630px;position:relative}.content-background[_ngcontent-%COMP%]   .content-message[_ngcontent-%COMP%]{background-color:#fff;border-radius:5px;padding:15px 15px 22px;position:relative;min-height:37px;min-width:100px;max-width:100%;overflow-y:auto;max-height:590px}.content-background[_ngcontent-%COMP%]   .content-message[_ngcontent-%COMP%]   .text-break[_ngcontent-%COMP%]{font-size:13px}
2.content-background[_ngcontent-%COMP%]   .content-message[_ngcontent-%COMP%]   .chat-metadata[_ngcontent-%COMP%]{font-size:12px;display:flex;justify-content:flex-end}.content-table[_ngcontent-%COMP%]{overflow:hidden;height:630px}.content-table[_ngcontent-%COMP%]   .scroll[_ngcontent-%COMP%]{overflow:auto;height:630px}.loader[_ngcontent-%COMP%]{position:absolute;top:102px;left:40%;transform:translate(-50%);width:50px;aspect-ratio:1;border-radius:50%;border:8px solid #064853;animation:_ngcontent-%COMP%_l20-1 .8s infinite linear alternate,_ngcontent-%COMP%_l20-2 1.6s infinite linear}@keyframes _ngcontent-%COMP%_l20-1{0%{clip-path:polygon(50% 50%,0 0,50% 0%,50% 0%,50% 0%,50% 0%,50% 0%)}12.5%{clip-path:polygon(50% 50%,0 0,50% 0%,100% 0%,100% 0%,100% 0%,100% 0%)}25%{clip-path:polygon(50% 50%,0 0,50% 0%,100% 0%,100% 100%,100% 100%,100% 100%)}50%{clip-path:polygon(50% 50%,0 0,50% 0%,100% 0%,100% 100%,50% 100%,0% 100%)}62.5%{clip-path:polygon(50% 50%,100% 0,100% 0%,100% 0%,100% 100%,50% 100%,0% 100%)}75%{clip-path:polygon(50% 50%,100% 100%,100% 100%,100% 100%,100% 100%,50% 100%,0% 100%)}to{clip-path:polygon(50% 50%,50% 100%,50% 100%,50% 100%,50% 100%,50% 100%,0% 100%)}}@keyframes _ngcontent-%COMP%_l20-2{0%{transform:scaleY(1) rotate(0)}49.99%{transform:scaleY(1) rotate(135deg)}50%{transform:scaleY(-1) rotate(0)}to{transform:scaleY(-1) rotate(-135deg)}}"]})};var L=class n{prepareExcelData(t,e){let r=["#FF6F61","#FF9F80","#FFFFC1","#98FB98","#B8E6E0","#CCE2F7","#E6CCFF"],l={},m=0,_=[{sheetName:"Gesti\xF3n",data:[{Nombre:e.name,"Tipo clientes":e.typeChedules,Estado:e.state,"Total Programados":t.length,Usuario:e.userName,Creaci\u00F3n:e.createdAt}],columns:[{header:"Nombre",key:"Nombre"},{header:"Tipo clientes",key:"Tipo clientes"},{header:"Estado",key:"Estado"},{header:"Total Programados",key:"Total Programados"},{header:"Usuario",key:"Usuario"},{header:"Creaci\xF3n",key:"Creaci\xF3n"}]},{sheetName:"Mensajes Programados",data:t.map((u,N)=>(l[u.name]||(l[u.name]=r[m%r.length],m++),X(q({},u),{rowColor:l[u.name],Estado:u.error?"Error":u.cronJob==="si"&&(u.totalMessagesSent||0)>0?"Enviado":"No enviado",Tipo:u.managementType,"Tipo Cliente":u.customerType,Agente:u.agentName||"Sin definir",Mensaje:u.scheduleName,"Plantilla / Email":u.templateName||"Sin definir",D\u00EDas:u.minDays!==null&&u.maxDays!==null?`${u.minDays}/${u.maxDays}`:"/",Clientes:u.customersScheduledSents.length,Agendados:u.totalCustomersScheduled||0,Enviados:u.totalMessagesSent||0,Hora:u.executionTime}))),columns:[{header:"Estado",key:"Estado"},{header:"Tipo",key:"Tipo"},{header:"Tipo Cliente",key:"Tipo Cliente"},{header:"Agente",key:"Agente"},{header:"Mensaje",key:"Mensaje"},{header:"Plantilla / Email",key:"Plantilla / Email"},{header:"D\xEDas",key:"D\xEDas"},{header:"Clientes",key:"Clientes"},{header:"Agendados",key:"Agendados"},{header:"Enviados",key:"Enviados"},{header:"Hora",key:"Hora"}]},{sheetName:"Detalles de Clientes",data:t.reduce((u,N)=>(N.customersScheduledSents.forEach(y=>{u.push(X(q({},y),{rowColor:l[N.name],Gesti\u00F3n:e.name,Mensaje:N.scheduleName,Nombre:y.customerName,Identificaci\u00F3n:y.identification,Celular:y.phone,"Cupo aprobado":y.approvedQuota,"Cupo disponible":y.availableQuota,"Enviado?":y.action_perfomed==="Y"?"S\xED":"No",Error:y.error?y.error:"No"}))}),u),[]),columns:[{header:"Gesti\xF3n",key:"Gesti\xF3n"},{header:"Mensaje",key:"Mensaje"},{header:"Nombre",key:"Nombre"},{header:"Identificaci\xF3n",key:"Identificaci\xF3n"},{header:"Celular",key:"Celular"},{header:"Cupo aprobado",key:"Cupo aprobado"},{header:"Cupo disponible",key:"Cupo disponible"},{header:"Enviado?",key:"Enviado?"},{header:"Error",key:"Error"}]}];ge(_,"Gestion diaria full.xlsx")}exportExcel(t,e){t.forEach(l=>{l.created=l?.messageWhatsapp?l.messageWhatsapp.createdAt.split(" ")[1]:null,l.status=l?.messageWhatsapp?l.messageWhatsapp.messageStatus:null});let r=[{header:"Nombre",key:"customerName"},{header:"Cedula",key:"identification"},{header:"Correo",key:"email"},{header:"Telefono",key:"phone"},{header:"Enviado",key:"actionPerfomed"},{header:"Estado",key:"status"},{header:"Mensaje",key:"executionResult"},{header:"Hora",key:"created"},{header:"Error",key:"error"},{header:"Plantilla",key:"templateBody"},{header:"Parametros",key:"parameters"}];t.forEach(l=>{Object.keys(l).forEach(m=>{typeof l[m]=="string"&&(l[m]==="Y"?l[m]="S\xED":l[m]==="N"?l[m]="No":l[m]=ue(l[m]))})}),pe(t,`${e}.xlsx`,"Mensajes",r,!0)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var et=(n,t)=>({"btn-warning":n,"btn-info":t});function tt(n,t){if(n&1&&(a(0,"div",18),g(1,"i",27),a(2,"span"),o(3),i()()),n&2){let e=c().$implicit;s(3),z(" Enviado a ",e.totalMessagesSent," de ",e.totalCustomersScheduled," clientes ")}}function nt(n,t){if(n&1&&o(0),n&2){let e=c(2).$implicit;d(" ",e.error," ")}}function at(n,t){if(n&1&&(a(0,"div",19),g(1,"i",28),a(2,"span"),o(3),x(4,nt,1,1),i()()),n&2){let e=c().$implicit;s(3),z(" Enviado parcialmente a ",e.totalMessagesSent," de ",e.totalCustomersScheduled," clientes. "),s(),h(e.error?4:-1)}}function it(n,t){if(n&1&&(a(0,"div",20),g(1,"i",28),a(2,"span"),o(3),i()()),n&2){let e=c().$implicit;
2s(3),d(" No enviado: ",e.error," ")}}function ot(n,t){if(n&1&&(a(0,"div",18),g(1,"i",29),a(2,"span"),o(3),i()()),n&2){let e=c().$implicit;s(3),z(" Se enviara a ",e.totalCustomersScheduled," clientes a las ",e.executionTime," horas ")}}function rt(n,t){n&1&&g(0,"i",21)}function lt(n,t){n&1&&g(0,"i",22)}function st(n,t){n&1&&g(0,"i",23)}function mt(n,t){if(n&1){let e=O();a(0,"button",30),M("click",function(){w(e);let l=c().$implicit,m=c();return P(m.downloadExcel(l))}),g(1,"i",31),a(2,"span"),o(3," Descargar excel "),i()()}}function ct(n,t){if(n&1){let e=O();a(0,"tr",16)(1,"td",15),x(2,tt,4,2,"div",18)(3,at,5,3,"div",19)(4,it,4,1,"div",20)(5,ot,4,2,"div",18),i(),a(6,"td",15)(7,"div",18),x(8,rt,1,0,"i",21)(9,lt,1,0,"i",22)(10,st,1,0,"i",23),a(11,"span"),o(12),i()()(),a(13,"td"),o(14),i(),a(15,"td",24),o(16),i(),a(17,"td",24),o(18),i(),a(19,"td",24),o(20),i(),a(21,"td",15),o(22),i(),a(23,"td",15),o(24),i(),a(25,"td",15),o(26),i(),a(27,"td",15),o(28),i(),a(29,"td",15),o(30),i(),a(31,"td",15)(32,"button",25),M("click",function(){let l=w(e).$implicit,m=c();return P(m.showInfoCustomers(l))}),g(33,"i"),a(34,"span"),o(35," Clientes "),i()(),x(36,mt,4,0,"button",26),i()()}if(n&2){let e,r,l=t.$implicit,m=t.$index,_=c();f("ngClass",_.getColorClass(m)),s(2),h(_.isScheduleFullySent(l)?2:_.hasScheduleWarning(l)?3:_.isScheduleFailed(l)?4:5),s(6),h(l.managementType==="WhatsApp"?8:l.managementType==="Llamada"?9:l.managementType==="Correo"?10:-1),s(4),d(" ",l.managementType," "),s(2),j(l.customerType),s(2),d(" ",l.agent||"Sin definir"," "),s(2),d(" ",l.scheduleName," "),s(2),d(" ",l.templateName||"Sin definir"," "),s(2),z(" ",l.minDays," / ",l.maxDays," "),s(2),d(" ",l.totalCustomersScheduled," "),s(2),d(" ",l.totalCustomersScheduled," "),s(2),d(" ",(e=l.totalMessagesSent)!==null&&e!==void 0?e:0," "),s(2),j(l.executionTime),s(2),f("ngClass",se(18,et,l&&l===_.messageManagamentSelected,l&&l!==_.messageManagamentSelected)),s(),B(l&&l===_.messageManagamentSelected?"fa-solid fa-eye-slash":"fa-solid fa-eye"),s(3),h(((r=l.totalMessagesSent)!==null&&r!==void 0?r:0)>0?36:-1)}}function dt(n,t){if(n&1&&g(0,"app-cs-daily-management-customers-data",17),n&2){let e=c();f("dayManagementCustomers",e.dayManagementCustomers)("messageManagament",e.messageManagamentSelected)}}var Q=class n{constructor(t,e,r,l){this.activeModal=t;this.loaderService=e;this.dailyManagementService=r;this.exportService=l}management;messagesManagament;messageManagamentSelected=null;dayManagementCustomers=null;colors=["bg-color-0","bg-color-1","bg-color-2","bg-color-3","bg-color-4","bg-color-5","bg-color-6","bg-color-7"];closeModal(){this.activeModal.dismiss()}getColorClass(t){return this.colors[t%this.colors.length]}isScheduleFullySent(t){let e=t.totalMessagesSent??0,r=t.totalCustomersScheduled??0;return t.cronJob==="si"&&e>0&&!this.hasScheduleWarning(t)&&(r===0||e>=r)}hasScheduleWarning(t){let e=t.totalMessagesSent??0,r=t.totalCustomersScheduled??0,l=!!t.error?.trim();return t.cronJob==="si"&&e>0&&(l||r>0&&e<r)}isScheduleFailed(t){return!!t.error?.trim()&&(t.totalMessagesSent??0)===0}showInfoCustomers(t){this.messageManagamentSelected===t?(this.messageManagamentSelected=null,this.dayManagementCustomers=null):(this.messageManagamentSelected=t,p(this.loaderService,!0,"Cargando datos..."),this.dailyManagementService.getMessagesCustomers(t.id).subscribe(e=>{this.dayManagementCustomers=e.data},e=>{p(this.loaderService,!1),console.error("Error al obtener collections_message_management",e)}))}downloadExcel(t){p(this.loaderService,!0,"Exportando reporte de clientes"),this.dailyManagementService.exportExcel(t.id).subscribe({next:e=>{let r=Array.isArray(e?.data)?e.data:[];this.exportService.exportExcel(r,t.scheduleName),p(this.loaderService,!1)},error:e=>{p(this.loaderService,!1)}})}static \u0275fac=function(e){return new(e||n)(C(R),C(T),C(k),C(L))};static \u0275cmp=S({type:n,selectors:[["app-cs-daily-management-schedules-made"]],inputs:{management:"management",messagesManagament:"messagesManagament"},standalone:!0,features:[I],decls:48,vars:2,consts:[[1,"container-fluid"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body"],[1,"d-flex","flex-column","gap-2","content-schedules-made",2,"width","100%"],[1,"d-flex","justify-content-between","flex-wrap"],[1,"left"],[1,"w-100","m-0","p-0","fs-6"],[2,"font-size","13px"],[1,"button"],[1,"btn","btn-secondary"],[1,"content-table"],[1,"table","align-middle"],[1,"table-light"],[1,"text-center"],[3,"ngClass"],[3,"dayManagementCustomers","messageManagament"],[1,"target-top"],[1,"target-top","text-warning"],[1,"target-top","text-danger"],[1,"fa-brands","fa-whatsapp","fs-4"],[1,"fa-solid","fa-phone-volume","fs-5"],[1,"fa-solid","fa-envelope","fs-5"],[1,"text-break","truncate-text"],["insert","","type","button",1,"btn","btn-xs","me-1","mb-1","button-helps",3,"click","ngClass"],["
2insert","","type","button",1,"btn","btn-dark","btn-xs","me-1","mb-1","button-helps"],[1,"fa-solid","fa-paper-plane","fs-5"],[1,"fa-solid","fa-triangle-exclamation","fs-5"],[1,"fa-regular","fa-clock","fs-5"],["insert","","type","button",1,"btn","btn-dark","btn-xs","me-1","mb-1","button-helps",3,"click"],[1,"fa-solid","fa-file-excel"]],template:function(e,r){e&1&&(a(0,"div",0)(1,"div",1)(2,"h4",2),o(3),i(),a(4,"button",3),M("click",function(){return r.closeModal()}),i()(),a(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"p",8),o(10,"Programaciones realizadas."),i(),a(11,"span",9),o(12," Enviadas y configuradas a clientes "),i()(),a(13,"div",10)(14,"span",11),o(15," Programaciones/ "),i()()(),a(16,"div",12)(17,"table",13)(18,"thead",14)(19,"tr")(20,"th"),o(21,"Estado"),i(),a(22,"th"),o(23,"Tipo"),i(),a(24,"th"),o(25,"Tipo Cliente"),i(),a(26,"th"),o(27,"Agente"),i(),a(28,"th"),o(29,"Mensaje"),i(),a(30,"th"),o(31,"Plantilla / Email"),i(),a(32,"th"),o(33,"D\xEDas"),i(),a(34,"th"),o(35,"Clientes"),i(),a(36,"th"),o(37,"Agendados"),i(),a(38,"th"),o(39,"Enviados"),i(),a(40,"th",15),o(41,"Hora"),i(),a(42,"th"),o(43,"Acciones"),i()()(),a(44,"tbody"),E(45,ct,37,21,"tr",16,F),i()()(),x(47,dt,1,2,"app-cs-daily-management-customers-data",17),i()()()),e&2&&(s(3),d(" ",r.management.name," "),s(42),D(r.messagesManagament),s(2),h(r.dayManagementCustomers&&r.messageManagamentSelected?47:-1))},dependencies:[A,V,J],styles:[".bg-color-0[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#ff6f61!important}.bg-color-1[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#ff9f80!important}.bg-color-2[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#fffacd!important}.bg-color-3[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#98fb98!important}.bg-color-4[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#afeeee!important}.bg-color-5[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#b0e6cb!important}.bg-color-6[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{background-color:#e6e6fa!important}.content-schedules-made[_ngcontent-%COMP%]{overflow-x:hidden}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]{overflow-x:scroll}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px;height:5px}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#0000001b;border-radius:5px}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]::-webkit-scrollbar-track{background-color:transparent;padding:3px}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{flex-wrap:nowrap;text-wrap:nowrap}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]   .target-top[_ngcontent-%COMP%]{position:relative}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]   .target-top[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:none;position:absolute;left:1px;top:calc(50% - 38px);background-color:#fff;z-index:1;font-size:10px;text-wrap:nowrap;padding:1px 5px;border-radius:3px}.content-schedules-made[_ngcontent-%COMP%]   .content-table[_ngcontent-%COMP%]   .target-top[_ngcontent-%COMP%]:hover   span[_ngcontent-%COMP%]{display:block}"]})};var ae=class n{constructor(t,e,r,l,m,_,u){this.router=t;this.modalService=e;this.tableService=r;this.loaderService=l;this.modalAlertService=m;this.exportService=_;this.dailyManagementService=u}currentPage=1;date="";ngOnInit(){this.getDailyManagement(),this.subscribeToTableActions()}subscriptions=[];ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}subscribeToTableActions(){this.subscriptions.push(this.tableService.actionsInTable$.subscribe(this.handleTableAction.bind(this)))}getDailyManagement(){p(this.loaderService,!0,"Cargando gestiones diarias"),this.dailyManagementService.getDailyManagement(this.currentPage,this.date).subscribe(t=>{if(p(this.loaderService,!1),t.ok){p(this.loaderService,!1);let e=t.data,{data:r}=e,l=ie(e,["data"]);this.dataTable.table.body=t.data.data,this.dataTable.table.paginator=l,this.tableService.infoTable(this.dataTable)}else this.modalAlertService.openModal("Error","Hubo un error al obtener los clientes","error")},t=>{p(this.loaderService,!1),this.modalAlertService.openModal("Error","Hubo un error en la solicitud","error"),console.error(t)})}handleTableAction(t){if(!t)return;let r={refresh:()=>{this.date="",this.currentPage=1,this.getDailyManagement()},search:()=>{this.date=t.data.form.date,this.currentPage=1,this.getDailyManagement()},create_daily_management:()=>{this.router.navigate(["/servicio-cliente/gestion-diaria/crear"])},create_template:()=>{this.createTemplateWhatsapp()},export_daily_management:()=>this.downloadDailyManagement(t.data),estadistics:()=>this.showManagementStadistic(t.data),messages_calls:()=>this.showSchedulesMade(t.data),page:()=>{this.currentPage=t.data.page,this.getDailyManagement()}}[t.action];r&&r()}createTemplateWhatsapp(){let t=this.modalService.open(Me,{size:"xl",centered:!0});t.componentInstance.template=null}downloadDailyManagement(t){p(this.loaderService,!0,"Descargando Gestion diaria..."),this.dailyManagementService.getTotalDataDailyCustomer(t.id).subscribe({next:e=>{p(this.loaderService,!1),this.exportService.prepareExcelData(e.data,t)},error:e=>{p(this.loaderService,!1),console.error(e),this.modalAlertService.openModal("Error","Hubo un error en la solicitud","error")}})}showManagementStadistic(t){p(this.loaderService,!0),this.dailyManagementService.getCollectionsMessageManagement(t.id).subscribe({next:e=>{p(this.loaderService,!1);let r=this.modalService.open(U,{size:"xl",centered:!0});r.componentInstance.management=t,r.componentInstance.messagesManagement=e.data},error:e=>{console.error("Error al obtener collections_message_management",e),p(this.loaderService,!1)}})}showSchedulesMade(t){p(this.loaderService,!0),this.dailyManagementService.getCollectionsMessageManagement(t.id).subscribe({next:e=>{p(this.loaderService,!1);let r=this.modalService.open(Q,{size:"xl",centered:!0});r.componentInstance.management=t,r.componentInstance.messagesManagament=e.data},error:e=>{console.error("Error al obtener collections_message_management",e),p(this.loaderService,!1)}})}breadcrumbItems=[{label:"Gesti\xF3n Diaria",url:"/"}];dataTable={table:{header:[{name:"Nombre",code:"name"},{name:"Tipo cliente",code:"typeChedules"},{name:"Estado",code:"state"},{name:"Total Programados",code:"totalCustomersScheduled"},{name:"Usuarios",code:"userName"},{name:"Creaci\xF3n",code:"managementDate"}],body:[],buttons:[{label:"Mensajes y llamadas",icon:"fa-solid fa-layer-group",action:"messages_calls",color:"warning",role:""},{label:"Estadisticas",icon:"fa-solid fa-chart-pie",action:"estadistics",color:"success",role:""},{label:"Exportar gesti\xF3n diaria",icon:"fa-solid fa-file-excel",action:"export_daily_management",color:"secondary",role:""}],paginator:{}},search:{dataForm:[{label:"D\xEDa",control:"date",type:"date"}],importsActions:[],buttonsSearch:[],otherActions:[{label:"Crear gesti\xF3n",icon:"fa-solid fa-plus",action:"create_daily_management",color:"success"},{label:"Crear Plantilla",icon:"fa-brands fa-whatsapp",action:"create_template",color:"secondary"}]}};static \u0275fac=function(e){return new(e||n)(C(W),C(fe),C(he),C(T),C(H),C(L),C(k))};static \u0275cmp=S({type:n,selectors:[["app-cs-daily-management-list-index"]],standalone:!0,features:[I],decls:5,vars:1,consts:[["title","Administraci\xF3n de Gesti\xF3n Diaria",3,"items"],[1,"content-credit-list","px-3"],[1,"card-shadow"],[1,"card-body"]],template:function(e,r){e&1&&(g(0,"app-breadcrumb",0),a(1,"div",1)(2,"div",2)(3,"div",3),g(4,"app-table"),i()()()),e&2&&f("items",r.breadcrumbItems)},dependencies:[xe,Ce]})};export{ae as default};

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.