1"use strict";(self.webpackChunkquickmail=self.webpackChunkquickmail||[]).push([["default-app_javascript_angular-engine_projects_quickmail_app_app-components_app-forecast-sent-08c343"],{6256:(x,f,n)=>{n.d(f,{U:()=>L});var t=n(73664),P=n(24072),b=n(21413),D=n(84412),p=n(84572),g=n(18810),S=n(96354),v=n(56977),C=n(88141),u=n(52472),y=n(27165),l=n(2615),M=n(21232),O=n(84254),E=n(72200),R=n(61990),A=n(60117),I=n(69766),j=n(52072),k=n(12101),_=n(48578),T=n(11534);function i(s,d){if(1&s&&(t.j41(0,"p",6),t.EFF(1),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.SpI("Email ",e.attributionLabel())}}function c(s,d){if(1&s&&(t.j41(0,"p",6),t.EFF(1),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.SpI("LinkedIn ",e.attributionLabel())}}function o(s,d){if(1&s&&(t.j41(0,"p",6),t.EFF(1),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.SpI("All channels ",e.attributionLabel())}}function m(s,d){if(1&s&&(t.j41(0,"p",7),t.EFF(1),t.nI1(2,"number"),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.JRh(t.bMT(2,1,e.total||0))}}function B(s,d){if(1&s){const e=t.RV6();t.j41(0,"ui-icon-button",14),t.bIt("click",function(){const a=l.eBV(e).click;return l.Njj(a())}),t.k0s()}}function F(s,d){if(1&s&&(t.j41(0,"div"),t.nrm(1,"ui-button",15),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.Aen("danger"),t.Y8G("title","Delete tile")("icon","trash-alt")("onClick",e.delete.bind(e))("confirm",!0)("confirmTitle","Confirm delete")}}function U(s,d){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"ui-dropdown",8),t.DNE(2,B,1,0,"ng-template",9),t.j41(3,"div",10)(4,"span"),t.EFF(5,"Attribution type"),t.k0s(),t.nrm(6,"ui-icon",11),t.j41(7,"div",12)(8,"div",13),t.bIt("click",function(){l.eBV(e);const a=t.XpG();return l.Njj(a.changeAttributionType("sent_items"))}),t.EFF(9,"Per touch"),t.k0s(),t.j41(10,"div",13),t.bIt("click",function(){l.eBV(e);const a=t.XpG();return l.Njj(a.changeAttributionType("journey"))}),t.EFF(11,"Per lead"),t.k0s()()(),t.j41(12,"div",10)(13,"span"),t.EFF(14,"Channel type"),t.k0s(),t.nrm(15,"ui-icon",11),t.j41(16,"div",12)(17,"div",13),t.bIt("click",function(){l.eBV(e);const a=t.XpG();return l.Njj(a.changeChannelType("email"))}),t.EFF(18,"Email"),t.k0s(),t.j41(19,"div",13),t.bIt("click",function(){l.eBV(e);const a=t.XpG();return l.Njj(a.changeChannelType("linkedin"))}),t.EFF(20,"LinkedIn"),t.k0s(),t.j41(21,"div",13),t.bIt("click",function(){l.eBV(e);const a=t.XpG();return l.Njj(a.changeChannelType(null))}),t.EFF(22,"All channels"),t.k0s()()(),t.DNE(23,F,2,7,"div",3),t.k0s()()}if(2&s){const e=t.XpG();t.R7$(),t.Y8G("dropPosition","bottom-end"),t.R7$(5),t.Y8G("name","chevron-right")("size","xs"),t.R7$(2),t.Y8G("active",e.touchAttributionSelected(e.attributionType)),t.R7$(2),t.Y8G("active",e.leadAttributionSelected(e.attributionType)),t.R7$(5),t.Y8G("name","chevron-right")("size","xs"),t.R7$(2),t.Y8G("active",e.emailChannelSelected(e.channelType)),t.R7$(2),t.Y8G("active",e.linkedinChannelSelected(e.channelType)),t.R7$(2),t.Y8G("active",e.allChannelsSelected(e.channelType)),t.R7$(2),t.Y8G("ngIf",e.enableDeleting)}}function $(s,d){1&s&&(t.j41(0,"div",16)(1,"span",17),t.EFF(2,"Filter"),t.k0s()())}let L=(()=>{class s{accountService;organizationService;publicService;agencyId=null;channelType=null;attributionType="sent_items";workspaceId=null;campaignId=null;daysToDisplay=21;enableDeleting=!1;hideSentCount=!1;hideFiltersInfo=!1;readOnly=!1;public=!1;metricsViewSecret;onDelete=new t.bkB;onUpdate=new t.bkB;total;chartData$;startDate;endDate=(0,u.GP)(new Date,"yyyy-MM-dd");channelTypeSubject=new D.t(this.channelType);attributionTypeSubject=new D.t(this.attributionType);destroyed$=new b.B;constructor(e,r,a){this.accountService=e,this.organizationService=r,this.publicService=a}ngOnInit(){this.startDate=(0,u.GP)((0,y.e)(new Date,this.daysToDisplay),"yyyy-MM-dd"),null==this.attributionType&&(this.attributionType="sent_items",this.attributionTypeSubject.next(this.attributionType)),(0,p.z)([this.channelTypeSubject,this.attributionTypeSubject]).pipe((0,C.M)(()=>{this.chartData$=this.determineServiceMethod().pipe((0,S.T)(e=>{const r=e.map(h=>(0,u.GP)(new Date(h.date+"T00:00"),"MMM d").toUpperCase()),a=e.map(h=>h.count);return this.total=a.reduce((h,G)=>h+G,0),{labels:r,datasets:[{data:a}]}}))}),(0,v.Q)(this.destroyed$)).subscribe()}determineServiceMethod(){let e;return this.public?e={sent_items:()=>this.publicService.sentItemsPerDay(this.channelType,this.workspaceId,this.campaignId,this.startDate,this.endDate,this.metricsViewSecret),journey:()=>this.publicService.sentJourneysPerDay(this.channelType,this.workspaceId,this.campaignId,this.startDate,this.endDate,this.metricsViewSecret)}:(this.workspaceId&&(e={sent_items:()=>this.accountService.sentItemsPerDay(this.channelType,this.workspaceId,this.campaignId,this.startDate,this.endDate),journey:()=>this.accountService.sentJourneysPerDay(this.channelType,this.workspaceId,this.campaignId,this.startDate,this.endDate)}),this.agencyId&&(e={sent_items:()=>this.organizationService.sentItemsPerDay(this.channelType,this.agencyId,this.startDate,this.endDate),journey:()=>this.organizationService.sentJourneysPerDay(this.channelType,this.agencyId,this.startDate,this.endDate)})),e[this.attributionType]?e[this.attributionType]():(0,g.$)(new Error(`Invalid attribution type '${this.attributionType}'`))}attributionLabel(){switch(this.attributionType){case"sent_items":return"touches";case"journey":return"leads"}}changeChannelType(e){this.channelType="linkedin"==e?"linkedin":e,this.onUpdate.emit({setting:"channel_type",value:this.channelType}),this.channelTypeSubject.next(this.channelType)}changeAttributionType(e){this.attributionType=e,this.onUpdate.emit({setting:"attribution_type",value:this.attributionType}),this.attributionTypeSubject.next(this.attributionType)}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}delete(e){this.onDelete.emit()}leadAttributionSelected(e){return"journey"==e}touchAttributionSelected(e){return"sent_items"==e||null==e}linkedinChannelSelected(e){return"linkedin"==e}emailChannelSelected(e){return"email"==e}allChannelsSelected(e){return null==e}static \u0275fac=function(r){return new(r||s)(t.rXU(P.D),t.rXU(M.P),t.rXU(O.Z))};static \u0275cmp=t.VBU({type:s,selectors:[["app-sent-items-per-day"]],inputs:{agencyId:"agencyId",channelType:"channelType",attributionType:"attributionType",workspaceId:"workspaceId",campaignId:"campaignId",daysToDisplay:"daysToDisplay",enableDeleting:"enableDeleting",hideSentCount:"hideSentCount",hideFiltersInfo:"hideFiltersInfo",readOnly:"readOnly",public:"public",metricsViewSecret:"metricsViewSecret"},outputs:{onDelete:"onDelete",onUpdate:"onUpdate"},standalone:!1,decls:9,vars:8,consts:[[1,"flex","justify-between"],["class","text-sm text-purple-dark",4,"ngIf"],["class","text-3xl font-bold leading-10 text-black",4,"ngIf"],[4,"ngIf"],[3,"type","data$"],["class","mt-2 flex items-center gap-1 border-t border-gray-100 pt-3",4,"ngIf"],[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"dropPosition"],["dropdownButton",""],["dropdownItem",""],[3,"name","size"],["dropdownSubMenu",""],["dropdownItem","",3,"click","active"],[3,"click"],["dropdownItem","",3,"title","icon","onClick","confirm","confirmTitle"],[1,"mt-2","flex","items-center","gap-1","border-t","border-gray-100","pt-3"],[1,"pr-2","text-sm","text-blue-500"]],template:function(r,a){1&r&&(t.j41(0,"div",0)(1,"div"),t.DNE(2,i,2,1,"p",1)(3,c,2,1,"p",1)(4,o,2,1,"p",1)(5,m,3,3,"p",2),t.k0s(),t.DNE(6,U,24,11,"div",3),t.k0s(),t.nrm(7,"ui-chart",4),t.DNE(8,$,3,0,"div",5)),2&r&&(t.R7$(2),t.Y8G("ngIf",a.emailChannelSelected(a.channelType)),t.R7$(),t.Y8G("ngIf",a.linkedinChannelSelected(a.channelType)),t.R7$(),t.Y8G("ngIf",a.allChannelsSelected(a.channelType)),t.R7$(),t.Y8G("ngIf",!a.hideSentCount),t.R7$(),t.Y8G("ngIf",!a.readOnly),t.R7$(),t.Y8G("type","bar")("data$",a.
1chartData$),t.R7$(),t.Y8G("ngIf",!a.hideFiltersInfo))},dependencies:[E.bT,R.Q,A.Q,I.P,I.x,j.M,k.c,_.R,T.x,E.QX],encapsulation:2,changeDetection:0})}return s})()},45768:(x,f,n)=>{n.d(f,{l:()=>k});var t=n(73664),P=n(24072),b=n(84412),D=n(96354),p=n(2615),g=n(21232),S=n(84254),v=n(72200),C=n(61990),u=n(60117),y=n(69766),l=n(80680),M=n(52072),O=n(12101),E=n(48578),R=n(11534);function A(_,T){if(1&_){const i=t.RV6();t.j41(0,"ui-icon-button",14),t.bIt("click",function(){const o=p.eBV(i).click;return p.Njj(o())}),t.k0s()}}function I(_,T){if(1&_&&(t.qex(0),t.nrm(1,"div",15),t.j41(2,"div"),t.nrm(3,"ui-button",16),t.k0s(),t.bVm()),2&_){const i=t.XpG(2);t.R7$(3),t.Aen("danger"),t.Y8G("title","Delete tile")("icon","trash-alt")("onClick",i.delete.bind(i))("confirm",!0)("confirmTitle","Confirm delete")}}function j(_,T){if(1&_){const i=t.RV6();t.j41(0,"div")(1,"ui-dropdown",8),t.DNE(2,A,1,0,"ng-template",9),t.j41(3,"div",10)(4,"span"),t.EFF(5,"Data type"),t.k0s(),t.nrm(6,"ui-icon",11),t.j41(7,"div",12)(8,"div",13),t.bIt("click",function(){p.eBV(i);const o=t.XpG();return p.Njj(o.changeStat("future_emails"))}),t.EFF(9,"Future emails"),t.k0s(),t.j41(10,"div",13),t.bIt("click",function(){p.eBV(i);const o=t.XpG();return p.Njj(o.changeStat("future_journeys"))}),t.EFF(11,"Future leads"),t.k0s()()(),t.DNE(12,I,4,7,"ng-container",3),t.k0s()()}if(2&_){const i=t.XpG();t.R7$(),t.Y8G("dropPosition","bottom-end"),t.R7$(5),t.Y8G("name","chevron-right")("size","xs"),t.R7$(2),t.Y8G("active","future_emails"==i.selectedStat),t.R7$(2),t.Y8G("active","future_journeys"==i.selectedStat),t.R7$(2),t.Y8G("ngIf",i.enableDeleting)}}let k=(()=>{class _{accountService;organizationService;publicService;enableDeleting=!1;selectedStat="future_emails";agencyId=null;workspaceId=null;campaignId=null;daysToDisplay=7;public=!1;readOnly=!1;metricsViewSecret=null;onUpdate=new t.bkB;onDelete=new t.bkB;total;labels;chartData$;chartData;data={};constructor(i,c,o){this.accountService=i,this.organizationService=c,this.publicService=o}ngOnInit(){this.chartData=new b.t({});let i=null;this.agencyId&&(i="agency"),this.workspaceId&&(i="workspace"),this.public&&(i="public");const c=this.determineServiceMethod(i);this.chartData$=c().pipe((0,D.T)(o=>(this.labels=o.map(m=>m.wday.substring(0,3).toUpperCase()),this.data=o,this.chartData.next(this.computeChartData(this.data)),this.computeChartData(this.data))))}determineServiceMethod(i){if("public"==i)return()=>this.publicService.forecastSentEmails(this.workspaceId,this.campaignId,this.daysToDisplay,this.metricsViewSecret);const c=this.determineService(i);return()=>c.forecastSentEmails(this.workspaceId,this.campaignId,this.daysToDisplay)}determineService(i){return{agency:this.organizationService,workspace:this.accountService}[i]}ngOnChanges(i){i.selectedStat&&(this.selectedStat=i.selectedStat.currentValue||"future_emails")}computeChartData(i){let c;return c=i.map("future_emails"==this.selectedStat?o=>o.scheduled+o.follow_up:o=>o.scheduled),this.total=c.reduce((o,m)=>o+m,0),{labels:this.labels,datasets:[{data:c}]}}changeStat(i){this.onUpdate.emit({setting:"selected_stat",value:i}),this.selectedStat=i,this.chartData$=this.chartData.asObservable(),this.chartData.next(this.computeChartData(this.data))}delete(i){this.onDelete.emit()}static \u0275fac=function(c){return new(c||_)(t.rXU(P.D),t.rXU(g.P),t.rXU(S.Z))};static \u0275cmp=t.VBU({type:_,selectors:[["app-forecast-sent-emails"]],inputs:{enableDeleting:"enableDeleting",selectedStat:"selectedStat",agencyId:"agencyId",workspaceId:"workspaceId",campaignId:"campaignId",daysToDisplay:"daysToDisplay",public:"public",readOnly:"readOnly",metricsViewSecret:"metricsViewSecret"},outputs:{onUpdate:"onUpdate",onDelete:"onDelete"},standalone:!1,features:[t.OA$],decls:14,vars:9,consts:[[1,"flex","justify-between"],[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[4,"ngIf"],[3,"type","data$","dashedBorders"],[1,"mt-2","flex","items-center","gap-1","border-t","border-gray-100","pt-3"],[1,"pr-2","text-sm","text-blue-500"],[1,"rounded-full","bg-gray-100","px-2","py-1","text-sm","text-purple-dark"],[3,"dropPosition"],["dropdownButton",""],["dropdownItem",""],[3,"name","size"],["dropdownSubMenu",""],["dropdownItem","",3,"click","active"],[3,"click"],["dropdownDivider",""],["dropdownItem","",3,"title","icon","onClick","confirm","confirmTitle"]],template:function(c,o){1&c&&(t.j41(0,"div",0)(1,"div")(2,"p",1),t.EFF(3),t.k0s(),t.j41(4,"p",2),t.EFF(5),t.nI1(6,"number"),t.k0s()(),t.DNE(7,j,13,6,"div",3),t.k0s(),t.nrm(8,"ui-chart",4),t.j41(9,"div",5)(10,"span",6),t.EFF(11,"Filter"),t.k0s(),t.j41(12,"span",7),t.EFF(13),t.k0s()()),2&c&&(t.R7$(3),t.JRh("future_emails"==o.selectedStat?"Future emails":"Future leads"),t.R7$(2),t.JRh(t.bMT(6,7,o.total||0)),t.R7$(2),t.Y8G("ngIf",!o.readOnly),t.R7$(),t.Y8G("type","bar")("data$",o.chartData$)("dashedBorders",!0),t.R7$(5),t.JRh("future_emails"==o.selectedStat?"Future emails":"Future leads"))},dependencies:[v.bT,C.Q,u.Q,y.P,y.x,l.i,M.M,O.c,E.R,R.x,v.QX],encapsulation:2,changeDetection:0})}return _})()}}]);
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.