PageSourceSearch

https://portal.clickheredigital.com/assets/LsaReport-CFs29E1d.js

js clickheredigital.com collected 2026-10-01 16:31:08 UTC 9,491 bytes, 1 lines download raw bytes

1import{b as n,e as _,j as p,O as H,c as y,d as P,_ as K,f as a,bn as A,t as m,y as g,aW as M,bl as E,g as C,w as u,h as b,an as O,bm as V,at as U,G as W,v as w,F as T,e4 as J,r as N,u as Q,a4 as X,m as Z,k as ee,aK as te}from"./index-DUWew8AW.js";import{C as ae}from"./ClientReportsResource-CqxAyEoA.js";import{R as se}from"./ReportState-D-eTEtEn.js";import{_ as oe}from"./CsvExport-Bi2HZRvg.js";import{_ as le}from"./PdfCover-C-sFq0YP.js";import{_ as re}from"./InsightBox-Bm_IHTbs.js";import{_ as B}from"./InsightSection-DABUc2ZI.js";import{_ as ne}from"./InsightSummary-D7MkgAi8.js";import{_ as de}from"./bar-chart-BoacuKXw.js";import"./PartnerResource-CkZM66x5.js";import"./VRating-BWqBPr2Z.js";import"./useChart-D3rrKuZG.js";import"./Chart-BU8UWJuK.js";const ce={__name:"LeadsChart",props:["leads","pdf"],setup(s){const d=s,c={legend:{display:!0},events:[],animation:{duration:1,onComplete(){const e=this.chart,{ctx:i}=e;i.textAlign="center",i.textBaseline="bottom",this.data.datasets.forEach((h,t)=>{e.controller.getDatasetMeta(t).data.forEach((v,k)=>{if(h.data[k]>0){const S=h.data[k];i.fillText(S,v._model.x,v._model.y)}})})}}},f=y(()=>({labels:Object.keys(d.leads).map(e=>P(e).format("MM/DD")),datasets:[{backgroundColor:"#36A3EB",borderColor:"#36A3EB",label:"Charged Leads",data:Object.values(d.leads)}]}));return(e,i)=>(n(),_("div",{class:"mt-6",style:H({width:s.pdf?"1400px":"100%"})},[p(de,{data:f.value,options:c},null,8,["data"])],4))}},ie={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"100%",height:"450",viewBox:"0 0 2000 1600",style:{"enable-background":"new 0 0 2000 1600"},"xml:space":"preserve"},ue={id:"Layer_2"},pe={transform:"matrix(1 0 0 1 748.1041 407.7881)",class:"st8 st9 st10 st11"},me={transform:"matrix(1 0 0 1 870.9062 717.3613)",class:"st8 st9 st10 st11"},ge={transform:"matrix(1 0 0 1 910.4872 1028.7344)",class:"st8 st9 st10 st11"},fe={__name:"LeadsFunnel",props:{totalSpend:{type:Number,required:!0},totalLeads:{type:Number,required:!0},chargedLeads:{type:Number,required:!0}},setup(s){return(d,c)=>(n(),_("div",null,[(n(),_("svg",ie,[a("g",ue,[a("g",null,[c[0]||(c[0]=A('<polygon class="st1" points="1859.64,193.98 127.72,193.98 281.31,460 1706.05,460 		" data-v-6abe3061></polygon><polygon class="st2" points="461.5,772.1 1525.86,772.1 1679.45,506.08 307.91,506.08 		" data-v-6abe3061></polygon><polygon class="st3" points="641.69,1084.2 1345.67,1084.2 1499.26,818.18 488.1,818.18 		" data-v-6abe3061></polygon><polygon class="st4" points="821.88,1396.3 1165.48,1396.3 1319.07,1130.28 668.29,1130.28 		" data-v-6abe3061></polygon><polygon class="st5" points="1319.07,1130.28 732.97,1130.28 641.69,1084.2 1227.73,1084.2 		" data-v-6abe3061></polygon><polygon class="st6" points="1499.26,818.18 557.02,818.18 461.5,772.1 1405.04,772.1 		" data-v-6abe3061></polygon><polygon class="st7" points="1679.45,506.08 378.13,506.08 281.31,460 1582.19,460 		" data-v-6abe3061></polygon>',7)),a("g",null,[a("g",null,[a("text",pe,m(g(M)(s.totalSpend)),1)])]),c[1]||(c[1]=A('<g data-v-6abe3061><g data-v-6abe3061><text transform="matrix(1 0 0 1 878.7606 302.701)" class="st8 st9 st12 st13" data-v-6abe3061> SPEND </text></g></g><g data-v-6abe3061><g data-v-6abe3061><text transform="matrix(1 0 0 1 765.4185 610.2832)" class="st8 st9 st12 st13" data-v-6abe3061> TOTAL LEADS </text></g></g><g data-v-6abe3061><g data-v-6abe3061><text transform="matrix(1 0 0 1 721.7531 923.2568)" class="st8 st9 st12 st13" data-v-6abe3061> CHARGED LEADS </text></g></g><g data-v-6abe3061><g data-v-6abe3061><text transform="matrix(1 0 0 1 880.4448 1232.6387)" class="st8 st9 st12 st13 st15" data-v-6abe3061> SIGNED </text><text transform="matrix(1 0 0 1 853.4448 1332.6387)" class="st8 st9 st12 st13 st15" data-v-6abe3061> CLIENTS </text></g></g>',4)),a("g",null,[a("g",null,[a("text",me,m(g(E)(s.totalLeads)),1)])]),a("g",null,[a("g",null,[a("text",ge,m(g(E)(s.chargedLeads)),1)])])])])]))]))}},_e=K(fe,[["__scopeId","data-v-6abe3061"]]),he={class:"capitalize"},ve={__name:"LeadsTable",props:["leads","pdf"],setup(s){const d=[{title:"Location",key:"location",headerProps:{class:"bg-gray-200"}},{title:"Phone Number",key:"consumer_phone_number",headerProps:{class:"bg-gray-200"}},{title:"Category",key:"lead_category",headerProps:{class:"bg-gray-200"}},{title:"Date",key:"report_date",headerProps:{class:"bg-gray-200"}}];function c(f){var e;return((e=f==null?void 0:f.split("_"))==null?void 0:e.join(" "))||"N/A"}return(f,e)=>(n(),C(U,{items:s.leads,headers:d,"items-per-page":s.pdf?-1:10,"hide-default-footer":s.pdf,"items-per-page-options":[10,25,50,100],class:"mb-3"},{"item.consumer_phone_number":u(({item:i})=>[b(m(g(V)(i.consumer_phone_number,!0)),1)]),"item.lead_category":u(({item:i})=>[a("div",he,m(c(i.lead_category)),1)]),"item.report_date":u(({item:i})=>[b(m(g(O)(i.report_date,"MM/DD/YYYY")),1)]),_:1},8,["items","items-per-page","hide-default-footer"]))}},be={__name:"LocationsTable",props:["locations"],setup(s){const d=[{title:"Location",key:"location",headerProps:{class:"bg-gray-200"}},{title:"Spend",key:"spend",headerProps:{class:"bg-gray-200"}},{title:"Leads Charged",key:"leadsCharged",headerProps:{class:"bg-gray-200"}},{title:"Avg. CPL",key:"avgCpl",headerProps:{class:"bg-gray-200"}}];return(c,f)=>(n(),C(U,{items:s.locations,headers:d,"items-per-page":-1,"hide-default-footer":!0,class:"mb-3"},{"item.spend":u(({item:e})=>[b(m(g(M)(e.spend)),1)]),"item.avgCpl":u(({item:e})=>[b(m(g(M)(e.avgCpl)),1)]),_:1},8,["items"]))}},ye={class:"reports"},xe={key:0},Le={key:2,class:"my-3 mx-3 md:mx-4 lg:mx-6 bg-red-700 text-white p-3 font-bold rounded-sm animate-pulse text-lg uppercase"},Ce={key:0,ref:"lsaReport",class:"p-3 pb-12 md:p-4 lg:p-6 space-y-2"},De={class:"flex items-start justify-between"},ke={class:"flex flex-wrap justify-end sm:pl-8"},we={class:"alwaysbreak"},Ne={class:"w-full flex justify-end mb-3 hide-for-print"},Ue={__name:"LsaReport",props:{client:{type:Object},startDate:{type:String},endDate:{type:String},formattedReportMonth:{type:String},formattedPreviousMonth:{type:String}},setup(s){const d=s,c=X(),{showErrorNotification:f}=Q(),{isNotPDFUser:e}=J(),{currentUser:i}=te(),h=N(!1),t=N({locations:null,daily:null,chargedLeads:null,totals:null}),D=N(!1),v=N(!1),k=y(()=>`${P(d.startDate).format("MMMM DD, YYYY")} to ${P(d.endDate).format("MMMM DD, YYYY")}`),S=y(()=>{var o,r,l;return[{label:"Total Leads",current:((o=t.value.totals)==null?void 0:o.totalLeadsCount)||0,previous:null,mtd:!1},{label:"Charged Leads",current:((r=t.value.totals)==null?void 0:r.chargedLeadsCount)||0,previous:null,mtd:!1},{label:"Avg. CPL",current:M(((l=t.value.totals)==null?void 0:l.averageCostPerLead)||0),previous:null,mtd:!1}]});function q(o){var l;return(((l=o==null?void 0:o.split("_"))==null?void 0:l.join(" "))||"N/A").split(" ").map(x=>x.charAt(0).toUpperCase()+x.slice(1)).join(" ")}const $=y(()=>{var o,r;return(r=(o=t.value)==null?void 0:o.chargedLeads)==null?void 0:r.map(l=>({location:l.location||"",full_consumer_phone_number:V(l.full_consumer_phone_number)||"",lead_category:q(l.lead_category)||"",report_date:O(l.report_date,"MM/DD/YYYY")||""}))}),F=y(()=>"Charged Leads"),I={location:{title:"Location"},full_consumer_phone_number:{title:"Phone Number"},lead_category:{title:"Category"},report_date:{title:"Date"}},G=y(()=>{var o,r;return((r=(o=i.value)==null?void 0:o.UserType)==null?void 0:r.name)==="Employee"});function z(){D.value=c.query.recache!==void 0}async function Y(){h.value=!0,t.value={};const{startDate:o,endDate:r}=d;z(),t.value=await ae.getLsaReport(d.client.id,{startDate:o,endDate:r,recache:D.value}).then(l=>(v.value=!1,l.data)).catch(()=>{f(),h.value=!1,v.value=!0}),!v.value&&(h.value=!1,D.value=!1)}return W(()=>c.query,()=>{Y()}),Y(),(o,r)=>(n(),_("section",ye,[g(e)?w("",!0):(n(),_("div",xe,[p(le,{title:"Local Service Ads"},{header:u(()=>[b(m(s.client.name),1)]),subheader:u(()=>[b(m(k.value),1)]),_:1})])),h.value&&Object.keys(t.value).length===0?(n(),C(se,{key:1,state:"loading"})):w("",!0),v.value?(n(),_("div",Le," There was an error while getting the data. Please refresh this page and try again! ")):(n(),_(T,{key:3},[t.value.totals?(n(),_("div",Ce,[p(B,{title:"Local Service Ads"},{default:u(()=>{var l,x,R,j;return[a("div",De,[p(ne,{title:"Total Spend",amount:((l=t.value.totals)==null?void 0:l.spend)||0,month:s.formattedReportMonth,class:"sm:pl-6"},null,8,["amount","month"]),a("div",ke,[(n(!0),_(T,null,Z(S.value,L=>(n(),C(re,{key:L.label,label:L.label,current:L.current,previous:L.previous,"show-mtd-label":L.mtd},null,8,["label","current","previous","show-mtd-label"]))),128))])]),a("div",null,[p(_e,{"total-leads":((x=t.value.totals)==null?void 0:x.totalLeadsCount)||0,"total-spend":((R=t.value.totals)==null?void 0:R.spend)||0,"charged-leads":((j=t.value.totals)==null?void 0:j.chargedLeadsCount)||0},null,8,["total-leads","total-spend","charged-leads"])]),a("div",we,[p(be,{locations:t.value.locations},null,8,["locations"]),p(ce,{leads:t.value.daily,pdf:!g(e)},null,8,["leads","pdf"])])]}),_:1}),p(B,{title:"Charged Leads",class:"alwaysbreak"},{default:u(()=>[a("div",Ne,[$.value.length>0&&G.value?(n(),C(oe,{key:0,"json-data":$.value,labels:I,"csv-title":F.value},{default:u(()=>[p(ee,{color:"success"},{default:u(()=>[...r[0]||(r[0]=[b("Download",-1)])]),_:1})]),_:1},8,["json-data","csv-title"])):w("",!0)]),p(ve,{leads:t.value.chargedLeads,pdf:!g(e)},null,8,["leads","pdf"])]),_:1})],512)):w("",!0)],64))]))}};export{Ue 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.