PageSourceSearch

https://app.churnkey.co/assets/dashboard-DnQkmzkB.js

js churnkey.co collected 2026-09-24 20:14:01 UTC 42,762 bytes, 2 lines download raw bytes

1import{I as pe,J as Me,d as Y,s as v,K as Oe,c as F,a as y,o as h,l as d,b as e,j as f,E as j,w as U,i as G,L as ee,M as V,N as re,O as me,P as be,Q as Re,R as ke,v as fe,T as Ne,e as X,q as ne,F as K,r as Q,U as De,t as L,V as ie,W as ve,n as $e,X as le,Y as He,f as te,Z as Se,$ as he,m as M,a0 as Ee,a1 as Ae,a2 as de,a3 as Fe,k as D,a4 as Ue,D as ge,x as Le,a5 as Ie,a6 as Be,a7 as Ve,_ as xe,g as ye,a8 as Pe}from"./index-V_hZsPnK.js";import{_ as Z}from"./OverallLoader.vue_vue_type_script_setup_true_lang-DCNbYOR0.js";import{_ as W}from"./HeaderLoader.vue_vue_type_script_setup_true_lang-Cd386vNl.js";import{_ as _e}from"./MultiSelect.vue_vue_type_script_setup_true_lang-De1jHZcB.js";import{l as je,_ as Ye}from"./VueVegaEmbed.vue_vue_type_style_index_0_lang-DH3mBbaZ.js";import{A as I,_ as We,C as qe}from"./TotalCard.vue_vue_type_script_setup_true_lang-pdR6fmkj.js";import{_ as we,a as ze}from"./SingleSelect.vue_vue_type_script_setup_true_lang-DURlqluC.js";import{l as Ge}from"./basis-CZbLjyGK.js";import{s as Te}from"./savvy-cal-C76SeZ9s.js";import{_ as Ze}from"./stripe-h_pt9y31.js";import{_ as Xe,a as Je}from"./paddle-icon-NKkcVByE.js";import"./index-XKhu8ZSs.js";import"./min-CDqligTH.js";import"./vis-shared-Ln2C303P.js";(function(){try{var c=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};c.SENTRY_RELEASE={id:"[email protected]"}}catch{}})();try{(function(){var c=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new c.Error().stack;l&&(c._sentryDebugIds=c._sentryDebugIds||{},c._sentryDebugIds[l]="ab803bf7-1ff0-4185-a729-2f797df05dda",c._sentryDebugIdIdentifier="sentry-dbid-ab803bf7-1ff0-4185-a729-2f797df05dda")})()}catch{}var z=(c=>(c.CHURN_RATE="ChurnRate",c.REVENUE_CHURNED="RevenueChurned",c.SUBSCRIPTIONS_CHURNED="SubscriptionsChurned",c.GROSS_MONTHLY_CHURN="GrossMonthlyChurn",c))(z||{});const se={ChurnRate:"Revenue Churn Rate",RevenueChurned:"Revenue Churned",SubscriptionsChurned:"Subscriptions Churned",GrossMonthlyChurn:"Gross Monthly Churn"};var oe=(c=>(c.MONTH_0="MONTH_0",c.MONTH_1="MONTH_1",c.MONTH_2="MONTH_2",c.MONTH_3="MONTH_3",c.MONTH_4="MONTH_4",c.MONTH_5="MONTH_5",c.MONTH_6="MONTH_6",c.MONTH_7="MONTH_7",c.MONTH_8="MONTH_8",c.MONTH_9="MONTH_9",c.MONTH_10="MONTH_10",c.MONTH_11="MONTH_11",c.MONTH_12="MONTH_12",c))(oe||{});const ce={MONTH_0:"0",MONTH_1:"1",MONTH_2:"2",MONTH_3:"3",MONTH_4:"4",MONTH_5:"5",MONTH_6:"6",MONTH_7:"7",MONTH_8:"8",MONTH_9:"9",MONTH_10:"10",MONTH_11:"11",MONTH_12:"12"};function Ke(){return{$schema:"https://vega.github.io/schema/vega/v6.json",description:"A heatmap.",padding:{left:5,right:5,top:5,bottom:5},config:{legend:{labelFont:"General Sans",titleFont:"General Sans",cornerRadius:2}},signals:[{name:"palette",value:"magma"}],data:[{name:"cells",values:[{x:"row",y:"column",count:5}]}],scales:[{name:"xscale",type:"band",range:"width",domain:{data:"cells",field:"x"}},{name:"yscale",type:"band",range:"height",domain:{data:"cells",field:"y"}},{name:"colorscale",type:"linear",domain:{data:"cells",field:"count"},zero:!0}],axes:[{scale:"xscale",orient:"bottom",tickCount:5,tickColor:"#F0F3F7",domainColor:"none",tickSize:2,offset:2,labelColor:"#6D6156",labelFontWeight:600,titleColor:"#6D6156",titleFontWeight:"bold",titleFontSize:12,titlePadding:8,labelAlign:"right",labelLimit:70},{scale:"yscale",orient:"left",tickCount:5,tickColor:"#F0F3F7",domainColor:"none",offset:2,labelColor:"#6D6156",labelFontWeight:"bold",titleColor:"#6D6156",titleFontWeight:800,titleFontSize:12,titlePadding:8}],legends:[{title:"Count",fill:"colorscale",type:"gradient",titleFontWeight:"bold",titleColor:"#82756c",titlePadding:10,titleLimit:200,titleLineHeight:35,gradientLength:{signal:"height - 20"}}],marks:[{type:"rect",from:{data:"cells"},encode:{enter:{x:{scale:"xscale",field:"x",offset:1},y:{scale:"yscale",field:"y",offset:2},width:{scale:"xscale",band:1,offset:-2},height:{scale:"yscale",band:1,offset:-1},fill:{scale:"colorscale",field:"count"},tooltip:{signal:"{ 'title': datum.x + ' - ' + datum.y, 'Count': datum.count }"}}}}]}}function ue(c){const l=Ke(),w=c.series.reduce((s,a)=>{const u=c.features.map(b=>({x:a.label,y:`${b.label}`,count:b.valueAccessor(a),secondaryLabel:b.secondaryLabel}));return s.concat(u)},[]),o={...l.axes[0],title:c.xAxisTitle},_={...l.axes[1],title:c.yAxisTitle,encode:{labels:{enter:{text:{signal:"datum.secondaryLabel ? datum.y + ' 
1(' + datum.secondaryLabel + ')' : datum.label"}},update:{text:{signal:"datum.secondaryLabel ? datum.y + ' (' + datum.secondaryLabel + ')' : datum.label"}}}}},t={...l.scales[0]},T={...l.scales[1]},x={...l.legends[0],title:c.legendTitle},O=c.colorScale||["white","#414AC8"],$={...l.scales[2],range:typeof O=="string"?{scheme:O}:O},S={...je(),group:{fill:"#F7FAFF"}},N=[...l.marks];let C="{'X': datum.x, 'Y': datum.y, 'Count': datum.count, 'Start Count': datum.secondaryLabel }";if(c.tooltipFields&&(C=`{${c.tooltipFields.map(a=>a.format?a.format==="percent"?`'${a.title}': format(datum.${a.field}, '0.1f') + '%'`:`'${a.title}': format(datum.${a.field}, '${a.format}')`:`'${a.title}': datum.${a.field}`)}}`),N[0]&&(N[0].encode={...N[0].encode,enter:{...N?.[0].encode?.enter,tooltip:{signal:C},fillOpacity:{value:.9}}}),c.dataLabels){let s;c.dataFormat===I.AMOUNT?s="format(datum.count, '$,.2f')":c.dataFormat===I.PERCENT?s="format(datum.count, '.1f') + '%'":s="format(datum.count, '.1')",N.push({type:"text",from:{data:"cells"},encode:{enter:{x:{scale:"xscale",field:"x",band:.5},y:{scale:"yscale",field:"y",band:.5},align:{value:"center"},baseline:{value:"middle"},fontWeight:{value:"bold"}},update:{text:[{test:"datum.count > 0",signal:s},{value:""}],fill:[{test:"datum.count > 0 && datum.count < 50",value:"#061137"},{test:"datum.count > 0",value:"white"},{value:"transparent"}]}}})}return{...l,axes:[o,_],scales:[t,T,$],autosize:"fit",width:c.width||"container",height:c.height||"container",config:S,data:[{name:"cells",values:w}],marks:[...N],legends:x}}function Qe(c,l,w=0){let o=null,_=null;function t(x){w>0?(_&&clearTimeout(_),_=setTimeout(()=>{l.value=x},w)):l.value=x}function T(){o&&(o.disconnect(),o=null),_&&(clearTimeout(_),_=null)}pe(c,(x,O)=>{O&&o&&T(),x&&(o=new ResizeObserver($=>{const S=$[0];S&&t(S.contentRect.width)}),o.observe(x),l.value=x.clientWidth)},{immediate:!0}),Me(T)}const et={key:0,class:"space-y-4"},tt={key:1},st={class:"space-y-4"},at={class:"sm:flex sm:items-center sm:justify-between space-y-3 pb-5 sm:space-y-0"},nt={class:"flex justify-end grow"},lt={class:"flex items-center space-x-2 brand-input"},ot=Y({__name:"ChurnRetentionCohort",setup(c){const l=v([]),w=v("Retention Cohort"),o=v([]),_=Oe("heatMapRef"),t=v(0);Qe(_,t,100);const T=v(!1),x=v([]);async function O(){T.value=!0;const C=await ee.billingMetricsRetentionCohort({}),r=C.map(b=>({label:V(new Date(b.COHORT_MONTH)),value:b.COHORT_MONTH}));l.value=r;const s=new Date,a=new Date(s.getFullYear(),s.getMonth(),0),u=new Date(a.getFullYear(),a.getMonth()-12,1);o.value=r.filter(b=>{const R=new Date(b.value);return R>=u&&R<=a}).map(b=>b.value),x.value=C,T.value=!1}O();const $=F(()=>{const C=x.value.flatMap(u=>({label:V(new Date(u.COHORT_MONTH)),secondaryLabel:u.COHORT_SIZE,valueAccessor:b=>b.data[u.COHORT_MONTH]})),s=Object.values(oe).map(u=>{const b=x.value.reduce((R,i)=>({...R,[i.COHORT_MONTH]:i[u]}),{});return{label:ce[u],data:b}});return ue({series:s,features:C,colorScale:["#ECF0FF","#3C5CCF"],legendTitle:"% Retained",dataLabels:C.length<=24,dataFormat:I.PERCENT,xAxisTitle:"Retention Month",yAxisTitle:"Acquisition Month",tooltipFields:[{field:"y",title:"Aquisition Month"},{field:"x",title:"Retention Month",type:"quantitative"},{field:"secondaryLabel",title:"Cohort Size",type:"quantitative"},{field:"count",title:"% Subscriptions Retained",format:"percent",type:"quantitative"}]})}),S=F(()=>{if(o.value.length>0){const C=o.value,r=x.value.filter(b=>C.includes(b.COHORT_MONTH)).flatMap(b=>({label:V(new Date(b.COHORT_MONTH)),secondaryLabel:b.COHORT_SIZE,valueAccessor:R=>R.data[b.COHORT_MONTH]})),a=Object.values(oe).map(b=>{const R=x.value.filter(i=>C.includes(i.COHORT_MONTH)).reduce((i,n)=>({...i,[n.COHORT_MONTH]:n[b]}),{});return{label:ce[b],data:R}});return ue({series:a,features:r,colorScale:["#ECF0FF","#3C5CCF"],legendTitle:"% Retained",dataLabels:!0,dataFormat:I.PERCENT,xAxisTitle:"Retention Month",yAxisTitle:"Acquisition Month",tooltipFields:[{field:"y",title:"Aquisition Month"},{field:"x",title:"Retention Month",type:"quantitative"},{field:"secondaryLabel",title:"Cohort Size",type:"quantitative"},{field:"count",title:"% Subscriptions Retained",format:"percent",type:"quantitative"}]})}else return $.value});function N(){let C=[],r=[];x.value.length&&(C=o.value.length?x.value.filter(s=>o.value.includes(s.COHORT_MONTH)):x.value,r=r.concat(Object.keys(C[0])),re("churn-retention-cohort",C.sort((s,a)=>new Date(s.COHORT_MONTH).getTime()-new Date(a.COHORT_MONTH).getTime()),{fields:r,csv:!0}))}return(C,r)=>(h(),y("div",null,[T.value?(h(),y("div",et,[d(W),d(Z)])):(h(),y("div",tt,[e("div",st,[e("div",at,[r[3]||(r[3]=e("div",{class:"space-x-6 flex items-center justify-between grow"},[e("p",{class:"inline title"},"Retained Subscriptions")],-1)),e("div",nt,[e("div",lt,[d(_e,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),options:l.value,placeholder:w.value},null,8,["modelValue","options","placeholder"]),d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"},onClick:r[1]||(r[1]=s=>N())},{default:U(()=>[...r[2]||(r[2]=[e("span",{class:"text-s text-brand-blue font-medium"},"Export Data",-1)])]),_:1})])])])]),e("div",{ref_key:"heatMapRef",ref:_,class:"space-y-4 mb-4 w-full"},[(h(),G(Ye,{key:o.value.join("-"),spec:S.value,width:t.value,height:400},null,8,["spec","width"]))],512)]))]))}}),rt={key:0,class:"space-y-4"},it={key:1},dt={class:"space-y-4"},ct={class:"sm:flex sm:items-center sm:justify-between space-y-3 pb-5 sm:space-y-0"},ut={class:"flex justify-end grow"},pt={class:"flex items-center space-x-2 brand-input"},mt={class:"space-y-4 mb-4"},bt=Y({__name:"ChurnRetainedRevenue",setup(c){const l=["#ECF0FF","#4AA771"],w=v([]),o=v("Retention Cohort"),_=v(!1),t=v([]),T=v([]),x=v("YEAR"),O=v("YEAR"),$=i=>O.value==="MONTH"?new Date(i.REVENUE_MONTH).getTime():new Date(i.REVENUE_YEAR,0,1).getTime(),S=i=>i.MRR,N=i=>me(i),C=i=>i>=1e6?`$${(i/1e6).toFixed(1)}m`:i>=1e3?`$${Math.round(i/1e3)}
1k`:be(i),r=v([]),s=v([]);async function a(){_.value=!0;const i=await ee.billingMetricsRetainedRevenue({});if(i.length){const n=i.map(m=>V(new Date(m.COHORT_MONTH))).filter((m,p,H)=>H.indexOf(m)===p),g=i.map(m=>m.REVENUE_MONTH).filter((m,p,H)=>H.indexOf(m)===p);if(t.value=n,x.value=n.length<24?"MONTH":"YEAR",O.value=g.length<24?"MONTH":"YEAR",x.value=="MONTH")w.value=n.sort((m,p)=>new Date(m).getTime()-new Date(p).getTime()).map(m=>({value:m,label:m}));else{const m=i.map(p=>new Date(p.COHORT_MONTH).getUTCFullYear()).filter((p,H,k)=>k.indexOf(p)===H).sort((p,H)=>new Date(p).getTime()-new Date(H).getTime());T.value=m,w.value=m.map(p=>({value:p,label:p}))}}s.value=i,_.value=!1}a();const u=F(()=>{const i=[],n=s.value,g=x.value==="MONTH"?t.value:T.value.map(Number),m=Ge().domain([0,g.length-1]).range(l);return g.forEach((p,H)=>{const k=m(H),E=Re(k)?.formatHex()??l[0];if(x.value==="MONTH")i.push({id:p.toString(),label:V(new Date(p)),shortLabel:ke(new Date(p)),stroke:E,fill:E,color:E,data:n.filter(P=>V(new Date(P.COHORT_MONTH))===p)});else if(O.value==="MONTH"){const P=n.filter(A=>new Date(A.COHORT_MONTH).getUTCFullYear()===p),J=[];P.map(A=>V(new Date(A.REVENUE_MONTH))).filter((A,B,q)=>q.indexOf(A)===B).forEach(A=>{J.push({COHORT_YEAR:p,MRR:P.filter(B=>V(new Date(B.REVENUE_MONTH))===A).reduce((B,q)=>B+q.MRR,0),REVENUE_MONTH:A})}),i.push({id:p.toString(),label:p.toString(),shortLabel:p.toString(),stroke:E,fill:E,color:E,data:J})}else{const P=n.filter(A=>new Date(A.COHORT_MONTH).getUTCFullYear()===p),J=[];P.map(A=>
1new Date(A.REVENUE_MONTH).getUTCFullYear()).filter((A,B,q)=>q.indexOf(A)===B).forEach(A=>{J.push({COHORT_YEAR:p,MRR:P.filter(B=>new Date(B.REVENUE_MONTH).getUTCFullYear()===A).reduce((B,q)=>B+q.MRR,0),REVENUE_YEAR:A})}),i.push({id:p.toString(),label:p.toString(),shortLabel:p.toString(),stroke:E,fill:E,color:E,data:J})}}),i}),b=F(()=>r.value.length>0?u.value.filter(n=>r.value.map(String).includes(n.id)):u.value);function R(){let i=[],n=[];s.value.length&&(i=r.value.length?s.value.filter(g=>x.value==="YEAR"?r.value.includes(new Date(g.COHORT_MONTH).getUTCFullYear()):r.value.includes(g.COHORT_MONTH)):s.value,n=n.concat(Object.keys(i[0])),re("churn-retained-revenue",i.sort((g,m)=>new Date(g.COHORT_MONTH).getTime()-new Date(m.COHORT_MONTH).getTime()),{fields:n,csv:!0}))}return(i,n)=>(h(),y("div",null,[_.value?(h(),y("div",rt,[d(W),d(Z)])):(h(),y("div",it,[e("div",dt,[e("div",ct,[n[2]||(n[2]=e("div",{class:"space-x-6 flex items-center justify-between grow"},[e("p",{class:"inline title"},"Retained Revenue")],-1)),e("div",ut,[e("div",pt,[d(_e,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=g=>r.value=g),options:w.value,placeholder:o.value},null,8,["modelValue","options","placeholder"]),d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"},onClick:R},{default:U(()=>[...n[1]||(n[1]=[e("span",{class:"text-s text-brand-blue font-medium"},"Export Data",-1)])]),_:1})])])])]),e("div",mt,[(h(),G(we,{key:r.value.join("-"),series:b.value,"x-field":$,"value-accessor":S,"x-type":"temporal",height:400,"value-format":N,"tooltip-value-format":C},null,8,["series"]))])]))]))}}),ft={key:0,class:"brand-card-lg"},vt={class:"space-y-4"},ht={class:"space-y-3 pt-2"},gt={key:1,class:"brand-card-lg"},xt={class:"overflow-x-auto"},yt={class:"w-full table-fixed"},_t={class:"border-b border-brand-sand"},wt={class:"text-right pb-2 pr-6 text-xs font-semibold text-brand-brown whitespace-nowrap"},Tt={class:"py-3 pr-6"},Ct={class:"font-bold text-brand-black text-sm truncate"},Mt={class:"py-3 pr-6 hidden sm:table-cell"},Ot={class:"font-medium text-brand-brown text-sm"},Rt={class:"py-3 pr-6 text-right"},kt={class:"font-medium text-brand-blue text-sm"},Nt={class:"py-3 pr-6 text-right"},Dt={class:"py-3 pl-6 hidden lg:table-cell"},$t={key:0,class:"flex items-end gap-[2px] h-[24px] min-w-[100px]"},Ht={key:1,class:"text-sm text-brand-brown/50"},St={key:0,class:"pt-4 text-center"},Et=5,At=8,Ft=1,ae=10,Ut=Y({__name:"ChurnPlanLevelRates",setup(c){const l=v([]),w=v(!0),o=v(!1);fe(async()=>{try{l.value=await Ne()}catch{o.value=!0}finally{w.value=!1}});function _(r){return!r||r==="Unknown"?"Unknown Plan":r.replace(/^\d+\s*[×x]\s*/,"").replace(/\s*\(at\s+.+?\)\s*$/,"").trim()||r}const t=F(()=>{const r=new Date;return`${r.getUTCFullYear()}-${String(r.getUTCMonth()+1).padStart(2,"0")}`});function T(r){return[r.planProductId??"Unknown",r.planUnitAmount??"",r.planInterval??""].join("::")}const x=F(()=>{if(!l.value.length)return[];const r=new Map;for(const s of l.value){const a=T(s);r.has(a)||r.set(a,[]),r.get(a).push(s)}return Array.from(r.entries()).map(([s,a])=>{const u=new Map;for(const k of a){const E=u.get(k.startDate)??{startDate:k.startDate,startActiveSubscriptions:0,churnedSubscriptions:0};E.startActiveSubscriptions+=k.startActiveSubscriptions,E.churnedSubscriptions+=k.churnedSubscriptions,u.set(k.startDate,E)}const R=Array.from(u.values()).sort((k,E)=>k.startDate.localeCompare(E.startDate)).filter(k=>!k.startDate.startsWith(t.value)),i=R[R.length-1],n=i&&i.startActiveSubscriptions>0?i.churnedSubscriptions/i.startActiveSubscriptions*100:null,g=R.filter(k=>k.startActiveSubscriptions>0).map(k=>Number((k.churnedSubscriptions/k.startActiveSubscriptions*100).toFixed(1))),m=a[0],p=_(m.planName);let H="—";return m.planUnitAmount&&m.planUnitAmount>0&&m.planInterval?H=ie(m.planUnitAmount,m.planCurrency,m.planInterval,1):m.planStartsAtAmount&&m.planStartsAtAmount>0&&m.planInterval&&(H=`Starts at ${ie(m.planStartsAtAmount,m.planCurrency,m.planInterval,1)}`),{key:s,planName:p,price:H,activeSubs:m.currentActiveSubscriptions??0,churnRate:n,trendValues:g}}).filter(s=>s!==null&&s.activeSubs>=Ft).sort((s,a)=>a.activeSubs-s.activeSubs)}),O=v(!1),$=F(()=>O.value?x.value:x.value.slice(0,ae)),S=F(()=>{let r=1;for(const s of x.value)for(const a of s.trendValues)a>r&&(r=a);return r});function N(r){const s=S.value;return s<=0?10:Math.max(Math.round(r/s*100),10)}function C(r){return r==null?"text-brand-brown":r>=At?"text-brand-red":r>=Et?"text-brand-yellow":"text-brand-green"}return(r,s)=>w.value?(h(),y("div",ft,[e("div",vt,[d(W),e("div",ht,[s[2]||(s[2]=ne('<
1div class="flex gap-6"><div class="h-3 bg-brand-sand/60 rounded w-[30%]"></div><div class="h-3 bg-brand-sand/60 rounded w-[12%]"></div><div class="h-3 bg-brand-sand/60 rounded w-[14%]"></div><div class="h-3 bg-brand-sand/60 rounded w-[14%]"></div><div class="h-3 bg-brand-sand/60 rounded flex-1 hidden lg:block"></div></div>',1)),(h(),y(K,null,Q(5,a=>e("div",{key:a,class:"flex gap-6 py-2"},[...s[1]||(s[1]=[ne('<div class="h-4 bg-brand-sand/40 rounded w-[30%]"></div><div class="h-4 bg-brand-sand/40 rounded w-[12%]"></div><div class="h-4 bg-brand-sand/40 rounded w-[14%]"></div><div class="h-4 bg-brand-sand/40 rounded w-[14%]"></div><div class="h-4 bg-brand-sand/40 rounded flex-1 hidden lg:block"></div>',5)])])),64))])])])):!o.value&&x.value.length?(h(),y("div",gt,[s[10]||(s[10]=e("div",{class:"sm:flex sm:items-center sm:justify-between space-y-3 pb-5 sm:space-y-0"},[e("div",null,[e("p",{class:"title"},"Churn by Plan"),e("p",{class:"subtitle mt-4"}," Current active subscribers; churn rate for the last completed month. ")])],-1)),e("div",xt,[e("table",yt,[s[9]||(s[9]=e("colgroup",null,[e("col",{style:{width:"30%"}}),e("col",{style:{width:"12%"}}),e("col",{style:{width:"14%"}}),e("col",{style:{width:"14%"}}),e("col")],-1)),e("thead",null,[e("tr",_t,[s[5]||(s[5]=e("th",{class:"text-left pb-2 pr-6 text-xs font-semibold text-brand-brown"},"Plan",-1)),s[6]||(s[6]=e("th",{class:"text-left pb-2 pr-6 text-xs font-semibold text-brand-brown hidden sm:table-cell"}," Price ",-1)),e("th",wt,[d(f(De),{effect:"dark",placement:"top","popper-class":"brand-tooltip"},{content:U(()=>[...s[3]||(s[3]=[e("div",{class:"max-w-[240px]"}," Active and past-due subscriptions only — excludes trials, unpaid, and canceled. ",-1)])]),default:U(()=>[s[4]||(s[4]=e("span",{class:"cursor-help border-b border-dotted border-brand-brown/40"},"Active Subs",-1))]),_:1})]),s[7]||(s[7]=e("th",{class:"text-right pb-2 pr-6 text-xs font-semibold text-brand-brown whitespace-nowrap"}," Churn Rate ",-1)),s[8]||(s[8]=e("th",{class:"text-left pb-2 pl-6 text-xs font-semibold text-brand-brown hidden lg:table-cell"}," Trend ",-1))])]),e("tbody",null,[(h(!0),y(K,null,Q($.value,a=>(h(),y("tr",{key:a.key,class:"border-b border-brand-sand/50"},[e("td",Tt,[e("p",Ct,L(a.planName),1)]),e("td",Mt,[e("p",Ot,L(a.price),1)]),e("td",Rt,[e("p",kt,L(f(ve)(a.activeSubs)),1)]),e("td",Nt,[e("p",{class:$e(["font-semibold text-sm",C(a.churnRate)])},L(a.churnRate!=null?f(le)(a.churnRate/100,1):"—"),3)]),e("td",Dt,[a.trendValues.length>1?(h(),y("div",$t,[(h(!0),y(K,null,Q(a.trendValues,(u,b)=>(h(),y("div",{key:b,class:"flex-1 rounded-t-[2px] bg-brand-blue",style:He({height:`${N(u)}%`})},null,4))),128))])):(h(),y("span",Ht,"—"))])]))),128))])])]),x.value.length>ae?(h(),y("div",St,[e("button",{type:"button",class:"text-sm font-semibold text-brand-blue hover:underline",onClick:s[0]||(s[0]=a=>O.value=!O.value)},L(O.value?"Show less":`Show ${x.value.length-ae} more`),1)])):X("",!0)])):X("",!0)}}),Lt={key:0,class:"space-y-4"},It={key:1},Bt={class:"space-y-4"},Vt={class:"grid grid-cols-3 gap-x-4"},Pt={class:"pt-4"},jt={class:"text-xl text-brand-brown font-semibold leading-8"},Yt={class:"text-brand-black font-bold"},Wt={class:"text-brand-black font-bold"},qt={class:"text-brand-black font-bold"},zt={class:"text-brand-black font-bold"},Gt={class:"text-brand-black font-bold"},Zt=Y({__name:"ChurnOverallStatistics",props:{metrics:{}},setup(c){const l=c,w=v(!1),o=v(0),_=v(0),t=v(0),T=v(0),x=v(0),O=v(null),$=v(""),S=te(),N=v(""),C=Se.MONTH;if(l.metrics.length){o.value=l.metrics.reduce((u,b)=>u+b.churnedMrr,0),_.value=l.metrics.reduce((u,b)=>u+b.churnedSubscriptions,0),t.value=l.metrics.reduce((u,b)=>u+b.voluntaryChurnMrr,0),T.value=l.metrics.reduce((u,b)=>u+b.involuntaryChurnMrr,0);const s=he(new Date(new Date().getFullYear(),new Date().getMonth()-1,1)),a=l.metrics.find(u=>u.startDate==s);O.value=a||null,$.value=V(new Date(a?.startDate??new Date)),N.value=V(new Date(Math.min(...l.metrics.map(u=>new Date(u?.startDate??new Date).getTime())))),a&&(x.value=a?.churnedMrr/a?.startMrr)}const r=F(()=>{const s=[],a=O.value;if(l.metrics.length&&a){const u=l.metrics.map(i=>({timeFrame:i.startDate,value:i.churnedMrr/i.startMrr}));u.sort((i,n)=>new Date(i.timeFrame).getTime()-new Date(n.timeFrame).getTime()),s.push({key:z.CHURN_RATE,title:se[z.CHURN_RATE],content:le(x.value,1),titleTooltipContent:`Revenue Churn Rate for the previous month (${$.value})`,trendData:u,trendDataFormat:I.PERCENT});const b=l.metrics.map(i=>({timeFrame:i.startDate,value:i.churnedMrr}));b.sort((i,n)=>new Date(i.timeFrame).getTime()-new Date(n.timeFrame).getTime()),s.push({key:z.REVENUE_CHURNED,title:se[z.REVENUE_CHURNED],content:Ae(a?.churnedMrr),titleTooltipContent:`Total MRR Churned for the previous month (${$.value})`,trendData:b,trendDataFormat:I.AMOUNT});const R=l.metrics.map(i=>({timeFrame:i.startDate,value:i.churnedSubscriptions}));R.sort((i,n)=>new Date(i.timeFrame).getTime()-new Date(n.timeFrame).getTime()),s.push({key:z.SUBSCRIPTIONS_CHURNED,title:se[z.SUBSCRIPTIONS_CHURNED],content:ve(a?.churnedSubscriptions),titleTooltipContent:`Total Subscriptions Churned for the previous month (${$.value})`,trendData:R,trendDataFormat:I.COUNT})}return s});return(s,a)=>(h(),y("div",null,[w.value?(h(),y("div",Lt,[d(W),d(Z)])):(h(),y("div",It,[e("div",Bt,[e("div",Vt,[(h(!0),y(K,null,Q(r.value,u=>(h(),y("div",{key:u.key,class:"basis-1/3 flex"},[(h(),G(We,{key:u.key,"card-title":u.title,"card-content":u.content,"card-title-tooltip":u.titleTooltipContent,"card-trend-data":u.trendData,"card-trend-data-format":u.trendDataFormat,"card-trend-time-interval":f(C)},null,8,["card-title","card-content","card-title-tooltip","card-trend-data","card-trend-data-format","card-trend-time-interval"]))]))),128))]),e("div",Pt,[e("p",jt,[a[0]||(a[0]=M(" The monthly churn rate of ",-1)),e("span",Yt,L(f(S).companyName),1),a[1]||(a[1]=M(" at the end of ",-1)),e("span",Wt,L($.value),1),a[2]||(a[2]=M(" was ",-1)),e("span",qt,L(f(le)(x.value,1)),1),M(". From "+L(N.value)+" through "+L(f(V)(new Date))+", ",1),e("span",zt,L(f(S).companyName),1),a[3]||(a[3]=M(" has lost ",-1)),e("span",Gt,L(f(Ee)(o.value))+" in MRR",1),a[4]||(a[4]=M(" because of revenue churn. ",-1))])])])]))]))}}),Xt={key:0,class:"space-y-4"},Jt={key:1},Kt={class:"space-y-4"},Qt={class:"sm:flex sm:items-center sm:justify-between space-y-3 pb-5 sm:space-y-0"},es={class:"flex justify-end grow"},ts={class:"flex items-center space-x-2 brand-input"},ss={class:"space-y-4 mb-4"},as=Y({__name:"ChurnBreakdown",props:{metrics:{}},setup(c){const l=c,w=v([]),o=v(qe),_=v("By # or $"),t=v(I.AMOUNT),T=v(!1),x=v(0),O=v(0),$=v(0),S=v(0),N=v(0),C=v(0),r=n=>new Date(n.startDate).getTime(),s=n=>t.value===I.AMOUNT?n.amount:n.count,a=n=>t.value===I.AMOUNT?me(n):de(n),u=n=>t.value===I.AMOUNT?be(n):de(n);l.metrics.length&&(x.value=l.metrics.reduce((n,g)=>n+g.churnedMrr,0),O.value=l.metrics.reduce((n,g)=>n+g.voluntaryChurnMrr,0),$.value=l.metrics.reduce((n,g)=>n+g.involuntaryChurnMrr,0),S.value=l.metrics.reduce((n,g)=>n+g.churnedSubscriptions,0),N.value=l.metrics.reduce((n,g)=>n+g.voluntaryChurnedSubscriptions,0),C.value=l.metrics.reduce((n,g)=>n+g.involuntaryChurnedSubscriptions,0));const b=F(()=>{const n=[],g=l.metrics.map(m=>({startDate:m.startDate,count:m.involuntaryChurnedSubscriptions+m.voluntaryChurnedSubscriptions,amount:m.involuntaryChurnMrr+m.voluntaryChurnMrr})).sort((m,p)=>new Date(m.startDate).getTime()-new Date(p.startDate).getTime());return n.push({id:"total_churn",label:"",shortLabel:"",stroke:"#BB6BD9",fill:"#BB6BD9",patternFill:"solid",color:"#BB6BD9",data:g}),n}),R=F(()=>w.value.length>0?b.value.filter(n=>
1w.value.includes(n.id)):b.value);function i(){let n=[],g=[];l.metrics.length&&(n=l.metrics.map(p=>p.startDate).filter((p,H,k)=>k.indexOf(p)===H).map(p=>({startDate:p})),g.push("startDate"),g=g.concat(R.value.map(p=>p.id)),R.value.forEach(p=>{const H=p.id;p.data.map(k=>{const E=n.find(P=>P.startDate==k.startDate);return E[H]=t.value===I.AMOUNT?k.amount:k.count,E})}),re("churn-breakdown",n.sort((p,H)=>new Date(p.startDate).getTime()-new Date(H.startDate).getTime()),{fields:g,csv:!0}))}return(n,g)=>(h(),y("div",null,[T.value?(h(),y("div",Xt,[d(W),d(Z)])):(h(),y("div",Jt,[e("div",Kt,[e("div",Qt,[g[2]||(g[2]=e("div",{class:"space-x-6 flex items-center justify-between grow"},[e("p",{class:"inline title"},"Churned Revenue")],-1)),e("div",es,[e("div",ts,[d(ze,{modelValue:t.value,"onUpdate:modelValue":g[0]||(g[0]=m=>t.value=m),options:o.value,placeholder:_.value},null,8,["modelValue","options","placeholder"]),d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"},onClick:i},{default:U(()=>[...g[1]||(g[1]=[e("span",{class:"text-s text-brand-blue font-medium"},"Export Data",-1)])]),_:1})])])])]),e("div",ss,[(h(),G(we,{key:t.value,series:R.value,"x-field":r,"value-accessor":s,"x-type":"temporal",height:400,"value-format":a,"tooltip-value-format":u,"point-radius":3},null,8,["series"]))])]))]))}}),ns={key:0,class:"mb-2"},ls={class:"bg-brand-sand text-brand-black py-3 px-4 flex items-center space-x-4 rounded-md"},os={class:"space-y-2"},rs={key:0,class:"text-sm text-brand-brown font-medium pb-1"},is={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},ds={class:"brand-card-lg grow"},cs={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},us={class:"brand-card-lg grow"},ps={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},ms={class:"brand-card-lg grow"},bs={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},fs={class:"brand-card-lg grow"},vs=Y({__name:"ChurnMetricsDashboard",props:{metrics:{},lastUpdatedAt:{}},setup(c){const l=te(),w=c,o=Fe("%b %d, %Y, at %I:%M %p"),_=F(()=>{if(!w.lastUpdatedAt)return null;const t=new Date(w.lastUpdatedAt);return Number.isNaN(t.getTime())?null:o(t)});return(t,T)=>(h(),y("div",null,[f(l).org?.churnMetricsEnabled?X("",!0):(h(),y("div",ns,[e("div",ls,[d(f(Ue),{class:"text-4xl w-12 shrink-0"},{default:U(()=>[d(f(D),{icon:["fas","circle"],class:"text-teal-300"}),d(f(D),{icon:["fas","chart-pie"],class:"text-teal-800 text-opacity-70 text-xl pl-0.5 pb-0.5"})]),_:1}),T[0]||(T[0]=e("p",{class:"font-semibold text-brand-brown"}," This view is available as an admin. This is not the default state for the customer. It is will only be displayed to the customer if the feature flag for Churn Metrics is enabled, the customer does not have a payment provider of braintree or paddle classic and the customer has backfilled data. ",-1))])])),e("div",os,[_.value?(h(),y("div",rs," Last updated on "+L(_.value),1)):X("",!0),e("div",is,[e("div",ds,[d(Zt,{metrics:t.metrics},null,8,["metrics"])])]),e("div",cs,[e("div",us,[d(as,{metrics:t.metrics},null,8,["metrics"])])]),d(Ut),e("div",ps,[e("div",ms,[d(bt)])]),e("div",bs,[e("div",fs,[d(ot)])])])]))}}),hs="/assets/metrics-hero-BL1JP_p9.svg",gs="/assets/churn-metrics-sample-chart-CyyvXWHI.svg",xs={class:"lg:flex lg:space-x-2 lg:justify-between pb-2 space-y-6 lg:space-y-0"},ys={class:"brand-card-local grow"},_s={class:"flex flex-row space-x-4 justify-stretch overflow-hidden"},ws={class:"basis-1/3 flex-col pl-10 pt-10 pb-10 pr-0"},Ts={key:0},Cs={class:"text-brand-green mb-2 font-bold flex items-center"},Ms={class:"text-brand-brown text-sm font-semibold space-y-2"},Os={class:"pb-1"},Rs={class:"pb-1"},ks={class:"pb-1"},Ns={key:1},Ds={class:"text-brand-purple mb-2 font-bold flex items-center gap-1"},$s={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-4 space-y-6 lg:space-y-0"},Hs={class:"brand-card-local grow divide-brand-sand divide-y"},Ss={class:"flex flex-row justify-stretch divide-x divide-brand-sand"},Es={class:"basis-1/3 p-10"},As={class:"text-brand-blue font-bold mb-2 flex items-center"},Fs={class:"text-brand-brown mb-8 font-semibold text-sm"},Us={class:"flex items-center mb-2"},Ls={class:"flex items-center mb-2"},Is={class:"flex items-center mb-2"},Bs={class:"flex items-center"},Vs={class:"basis-1/3 p-10"},Ps={class:"text-brand-blue font-bold mb-2 flex items-center"},js={class:"text-brand-brown mb-8 font-semibold text-sm"},Ys={class:"flex items-center mb-2"},Ws={class:"flex items-center mb-2"},qs={class:"flex items-center"},zs={class:"basis-1/3 p-10"},Gs={class:"text-brand-blue font-bold mb-2 flex items-center"},Zs={class:"text-brand-brown mb-8 font-semibold text-sm"},Xs={class:"flex items-center mb-2"},Js={class:"flex items-center mb-2"},Ks={class:"flex items-center"},Qs={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-4 space-y-6 lg:space-y-0"},ea={class:"brand-card-local grow"},ta={class:"flex flex-row space-x-4 justify-stretch pr-6"},sa={class:"basis-2/3 flex-col px-10 pt-8 pb-10"},aa=Y({__name:"ChurnMetricsLoadingState",props:{dataBackfillError:{type:Boolean}},setup(c){const l=c,w=te(),o=F(()=>{const _=w.org?.paymentProvider;return _?_.charAt(0).toUpperCase()+_.slice(1):""});return(_,t)=>{const T=ge("RouterLink");return h(),y("div",null,[e("div",xs,[e("div",ys,[e("div",_s,[e("div",ws,[l.dataBackfillError?X("",!0):(h(),y("div",Ts,[e("div",Cs,[t[2]||(t[2]=e("span",{class:"text-lg transition-colors text-green-500 pr-2"},[e("svg",{width:"24",height:"24",class:"animate-[spin_3s_linear_infinite]",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M12 4C10.77 3.99922 9.55634 4.28244 8.4537 4.8276C7.35107 5.37276 6.38919 6.16514 5.643 7.143L8 9.5H2V3.5L4.219 5.719C5.15534 4.55673 6.34044 3.61927 7.68705 2.97564C9.03366 2.33202 10.5075 1.99862 12 2C17.523 2 22 6.477 22 12H20C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84286 14.1217 4 12 4ZM4 12C3.99996 13.673 4.52441 15.3039 5.49958 16.6633C6.47475 18.0227 7.85155 19.0422 9.43632 19.5783C11.0211 20.1144 12.734 20.1402 14.3342 19.6521C15.9344 19.1639 17.3413 18.1864 18.357 16.857L16 14.5H22V20.5L19.781 18.281C18.8447 19.4433 17.6596 20.3807 16.313 21.0244C14.9663 21.668 13.4925 22.0014 12 22C6.477 22 2 17.523 2 12H4Z",fill:"#28A671"})])],-1)),M(" Importing your "+L(o.value)+" data... ",1)]),t[6]||(t[6]=e("div",null,[e("h2",{class:"text-brand-black text-3xl font-bold mb-2 pt-2 leading-normal"}," We're on it. "),e("p",{class:"text-brand-brown text-lg font-semibold mb-4 pb-2 pt-2"}," We'll email you once your metrics are ready, so it's safe to navigate away. Among other benefits, you'll: ")],-1)),e("div",null,[e("ul",Ms,[e("li",Os,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-1"}),t[3]||(t[3]=M(" Identify the origins of your churn problem ",-1))]),e("li",Rs,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-1"}),t[4]||(t[4]=M(" Understand how your churn shifted over time ",-1))]),e("li",ks,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-1"}),t[5]||(t[5]=M(" Visualize the health of your revenue retention ",-1))])])])])),l.dataBackfillError?(h(),y("div",Ns,[e("div",Ds,[d(f(D),{icon:["fas","exclamation"]}),M(" "+L(o.value)+" report creation is taking a little longer than expected. ",1)]),e("div",null,[t[8]||(t[8]=e("h2",{class:"text-brand-black text-3xl font-bold mb-2 pt-2 leading-normal"}," In the meantime, go ahead and get started with Churnkey. ",-1)),t[9]||(t[9]=e("p",{class:"text-brand-brown text-lg font-semibold mb-4 pb-2 pt-2"}," Feel free to explore our platform while we work on building your reports. If you have any questions, our team is here to help. ",-1)),d(f(j),{t
1ype:"primary",class:"large",style:{height:"40px"},onClick:t[0]||(t[0]=x=>f(Le).open())},{default:U(()=>[...t[7]||(t[7]=[e("span",{class:"text-md text-brand-white font-bold"},"Chat With Our Team →",-1)])]),_:1})])])):X("",!0)]),t[10]||(t[10]=e("div",{class:"basis-2/3 flex-col pl-8"},[e("img",{src:hs,alt:"Dashboard Preview",class:"text-center w-full mt-10 md:-mb-44"})],-1))])])]),e("div",$s,[e("div",Hs,[t[34]||(t[34]=e("div",{class:"space-x-6 flex-row items-center justify-between grow p-10"},[e("div",{"flex-col":""},[e("h2",{class:"text-brand-black text-3xl font-bold mb-2"}," Meanwhile, see how Churnkey can help you grow. "),e("p",{class:"text-brand-brown text-lg font-semibold"}," We're your go-to retention platform. ")])],-1)),e("div",Ss,[e("div",Es,[e("div",As,[d(Ie),t[11]||(t[11]=e("span",{class:"pl-2"},"Cancel Flows",-1))]),t[18]||(t[18]=e("h3",{class:"text-brand-black text-xl font-bold mb-2"}," Retain up to 54% of your cancellations. ",-1)),t[19]||(t[19]=e("p",{class:"text-brand-brown text-base font-semibold mb-4"}," Collect essential product improvement feedback, present dynamic offers, and increase LTV. ",-1)),e("ul",Fs,[e("li",Us,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[12]||(t[12]=M(" Personalize every session automatically ",-1))]),e("li",Ls,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[13]||(t[13]=M(" Effortlessly increase customer loyalty ",-1))]),e("li",Is,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[14]||(t[14]=M(" Extend LTV every month ",-1))]),e("li",Bs,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[15]||(t[15]=e("span",{class:"inline-block bg-brand-blue text-white text-[10px] font-bold uppercase tracking-wide rounded-full px-2 py-0.5 mr-2"},"NEW",-1)),t[16]||(t[16]=M(" Go live with a hosted URL — no code needed ",-1))])]),d(T,{to:"/cancellation"},{default:U(()=>[d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"}},{default:U(()=>[...t[17]||(t[17]=[e("span",{class:"text-brand-blue font-bold"},"Explore Cancel Flows →",-1)])]),_:1})]),_:1})]),e("div",Vs,[e("div",Ps,[d(Be),t[20]||(t[20]=e("span",{class:"pl-2"},"Payment Recovery",-1))]),t[25]||(t[25]=e("h3",{class:"text-brand-black text-xl font-bold mb-2"}," Recover up to 89% of failed payments. ",-1)),t[26]||(t[26]=e("p",{class:"text-brand-brown text-base font-semibold mb-4"}," Optimized by ML models for your business' bespoke needs, ready to go in no time. ",-1)),e("ul",js,[e("li",Ys,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[21]||(t[21]=M(" Recover across multiple channels ",-1))]),e("li",Ws,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[22]||(t[22]=M(" See immediate ROI on day one ",-1))]),e("li",qs,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[23]||(t[23]=M(" Always fixed fees, never take a rate ",-1))])]),d(T,{to:"/dunning"},{default:U(()=>[d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"}},{default:U(()=>[...t[24]||(t[24]=[e("span",{class:"text-brand-blue font-bold"},"Explore Payment Recovery →",-1)])]),_:1})]),_:1})]),e("div",zs,[e("div",Gs,[d(Ve),t[27]||(t[27]=e("span",{class:"pl-2"},"Customer Reactivations",-1))]),t[32]||(t[32]=e("h3",{class:"text-brand-black text-xl font-bold mb-2"}," Win back up to 34% of past customers. ",-1)),t[33]||(t[33]=e("p",{class:"text-brand-brown text-base font-semibold mb-4"}," It's five times cheaper to win back former customers than it is to attract new ones. ",-1)),e("ul",Zs,[e("li",Xs,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[28]||(t[28]=M(" Launch recurring or one-time campaigns ",-1))]),e("li",Js,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[29]||(t[29]=M(" Personalize on cancellation reasons ",-1))]),e("li",Ks,[d(f(D),{icon:["fas","check"],class:"text-green-500 text-xs pr-2"}),t[30]||(t[30]=M(" Effortless targeting ",-1))])]),d(T,{to:"/reactivation/preview"},{default:U(()=>[d(f(j),{class:"border-brand-gray-blue border-2 large",style:{height:"40px"}},{default:U(()=>[...t[31]||(t[31]=[e("span",{class:"text-brand-blue font-bold"},"Explore Reactivations →",-1)])]),_:1})]),_:1})])])])]),e("div",Qs,[e("div",ea,[e("div",ta,[t[37]||(t[37]=e("div",{class:"basis-1/3 flex overflow-hidden bgimg"},[e("img",{src:gs,class:"px-10 pt-8 pb-10"})],-1)),e("div",sa,[t[36]||(t[36]=e("div",null,[e("h2",{class:"text-brand-black text-3xl font-bold leading-normal mb-2"}," Why not see how Churnkey outsmarts legacy churn software? "),e("p",{class:"text-brand-brown text-base font-semibold mb-4 pb-2"}," We'll take you on a quick, friendly, no-pressure walkthrough of what we do. And you'll see why so many companies are graduating to Churnkey's churn management software to boost revenue, recover failed payments and make customers happier. ")],-1)),d(f(j),{t
1ype:"primary",class:"large",style:{height:"40px"},onClick:t[1]||(t[1]=x=>f(Te).open("churnkey-team/product-demo"))},{default:U(()=>[...t[35]||(t[35]=[e("span",{class:"text-md text-brand-white font-bold"},"Book a Demo →",-1)])]),_:1})])])])])])}}}),na=xe(aa,[["__scopeId","data-v-51078fa6"]]),la={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-4 space-y-6 lg:space-y-0"},oa={class:"brand-card-local p-10 grow"},ra={class:"grid grid-cols-1 md:grid-cols-2 gap-x-2"},ia={class:"text-brand-brown text-base font-semibold space-y-1"},da={class:"pb-1"},ca={class:"pb-1"},ua={class:"pb-1"},pa={class:"pb-1"},ma={class:"mt-6"},ba={class:"mt-2"},fa={class:"border-brand-sand border-2 rounded-lg font-semibold p-8"},va={class:"flex pt-8"},ha={class:"mx-10 mt-8 text-center"},ga={class:"text-brand-brown text-xs font-semibold leading-normal"},xa=Y({__name:"ChurnMetricsNoProviderState",setup(c){const l=ye();return(w,o)=>{const _=ge("RouterLink");return h(),y("div",null,[e("div",la,[e("div",oa,[e("div",ra,[e("div",null,[o[9]||(o[9]=e("div",null,[e("h2",{class:"text-brand-black text-3xl font-bold mb-2 leading-snug"}," Welcome. We're ready for you to connect. "),e("p",{class:"text-brand-brown text-lg font-semibold mb-4 pb-2 pt-2"}," By connecting your billing provider, you'll be able to: ")],-1)),e("div",null,[e("ul",ia,[e("li",da,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-2"}),o[2]||(o[2]=M(" Identify the origins of your churn problems ",-1))]),e("li",ca,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-2"}),o[3]||(o[3]=M(" Understand how your churn has changed over time ",-1))]),e("li",ua,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-2"}),o[4]||(o[4]=M(" Visualize the health of your net revenue retention ",-1))]),e("li",pa,[d(f(D),{icon:["fas","check"],class:"text-brand-green text-xs pr-2"}),o[5]||(o[5]=M(" Unlock access to our retention-boosting platform ",-1))])]),e("div",ma,[o[7]||(o[7]=e("span",{class:"inline-block align-middle bg-brand-blue text-white text-xs font-bold uppercase tracking-wide rounded-full px-2.5 py-0.5 mr-2"},"NEW",-1)),o[8]||(o[8]=e("span",{class:"text-brand-brown font-semibold"}," Go live with Cancel Flows using just a URL — no code required. ",-1)),e("div",ba,[d(_,{to:"/cancellation/hosted",class:"text-brand-blue font-semibold hover:underline"},{default:U(()=>[...o[6]||(o[6]=[M(" Learn more → ",-1)])]),_:1})])])])]),e("div",null,[e("div",fa,[o[11]||(o[11]=ne('<div class="grid grid-cols-1 md:grid-cols-3 gap-x-2 gap-y-6" data-v-1f27a787><div data-v-1f27a787><img src="'+Ze+'" width="40" height="40" class="mr-2" data-v-1f27a787><p class="text-brand-brown font-bold mt-2 content-center" data-v-1f27a787>Stripe</p></div><div data-v-1f27a787><img src="'+Xe+'" width="40" height="40" class="mr-2" data-v-1f27a787><p class="text-brand-brown font-bold mt-2 content-center" data-v-1f27a787>Chargebee</p></div><div data-v-1f27a787><img src="'+Je+'" width="40" height="40" class="mr-2 rounded-lg" data-v-1f27a787><p class="text-brand-brown font-bold mt-2 content-center" data-v-1f27a787>Paddle Billing</p></div></div>',1)),e("div",va,[d(f(j),{type:"primary",class:"pb-6 large align-middle",style:{padding:"18px","flex-grow":"1"},onClick:o[0]||(o[0]=t=>f(l).push("/settings/billing-provider"))},{default:U(()=>[...o[10]||(o[10]=[e("span",{class:"text-base text-brand-white font-bold leading-none"},"Connect Billing Provider →",-1)])]),_:1})])]),e("div",ha,[e("p",ga,[o[12]||(o[12]=M(" Using another provider? ",-1)),e("span",{class:"cursor-pointer text-brand-blue",onClick:o[1]||(o[1]=t=>f(Te).open("churnkey-team/product-demo"))},"Let's talk"),o[13]||(o[13]=M(". ",-1))])])])])])])])}}}),ya=xe(xa,[["__scopeId","data-v-1f27a787"]]),_a={key:0},wa={key:0,class:"space-y-4"},Ta={class:"space-y-2"},Ca={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},Ma={class:"brand-card-lg grow"},Oa={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},Ra={class:"brand-card-lg grow"},ka={class:"lg:flex lg:space-x-2 lg:justify-between lg:pb-0 space-y-6 lg:space-y-0"},Na={class:"brand-card-lg grow"},Da={key:1},$a={class:"min-h-screen max-w-(--breakpoint-2xl) relative"},Ha={key:1},za=Y({__name:"dashboard",setup(c){const l=te(),w=Pe(),o=ye(),_=v(!1),t=v(!1),T=v(!1),x=F(()=>l.isAdmin||w.features.features.metricsDashboard),O=F(()=>l.org?.paymentProvider??l.org?.provider?.type),$=F(()=>l.org?.provider?.type?!0:l.org?.stripeAuthorized||l.org?.chargebeeAuthorized),S=v([]),N=v(null),C=F(()=>
1{if(O.value){if(!w.features.features.metricsDashboard)return"redirectToCancellationFlows";if($.value)return _.value?"metricsDashboard":"loadingStateDashboard"}return"noProviderDashboard"});fe(()=>{r()}),pe(()=>w.features.features.metricsDashboard,s=>{O.value&&!s&&o.push("/cancellation/flows")},{immediate:!0});async function r(){T.value=!0;try{if((await ee.syncStatus()).status==="error"){t.value=!0;return}const a=await ee.billingMetricsTimeseries(),u=a.data;if(N.value=a.lastSyncedAt,u.length){S.value=u;const b=he(new Date(new Date().getFullYear(),new Date().getMonth()-1,1)),R=u.find(n=>n.startDate==b),i=u.reduce((n,g)=>n+g.startMrr,0);R&&i>0&&(_.value=!0),(i==0||R==null)&&(t.value=!0)}}catch{return[]}finally{T.value=!1}}return(s,a)=>x.value?(h(),y("div",_a,[T.value?(h(),y("div",wa,[e("div",Ta,[e("div",Ca,[e("div",Ma,[d(W),d(Z)])]),e("div",Oa,[e("div",Ra,[d(W),d(Z)])]),e("div",ka,[e("div",Na,[d(W),d(Z)])])])])):(h(),y("div",Da,[e("div",$a,[C.value==="metricsDashboard"?(h(),G(vs,{key:0,metrics:S.value,"last-updated-at":N.value},null,8,["metrics","last-updated-at"])):C.value==="loadingStateDashboard"?(h(),G(na,{key:1,"data-backfill-error":t.value},null,8,["data-backfill-error"])):C.value==="noProviderDashboard"?(h(),G(ya,{key:2})):X("",!0)])]))])):(h(),y("div",Ha,"Your billing provider doesn't support these metrics"))}});export{za as default};
2//# sourceMappingURL=dashboard-DnQkmzkB.js.map

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.