PageSourceSearch

https://admin.servebolt.com/assets/CancellationAnalyticsView-5M4aI1p2.js

js servebolt.com collected 2026-09-24 19:45:36 UTC 8,702 bytes, 2 lines download raw bytes

1import{u as C}from"./vendor-i18n-BAJQGTf1.js";import{d as A,p as d,G as l,C as c,u as g,m as i,k,y as I,c as S,x as P,F as T,q as O,E as $,D as L,r as u,f as R,w as z,L as j}from"./vendor-D7HY6vXs.js";import{_ as F}from"./Table.vue_vue_type_style_index_0_lang-BOZ8abQF.js";import{_ as B}from"./Pagination.vue_vue_type_style_index_0_lang-BWltZzV2.js";import{a as U,e as K}from"./index-DAxIWTJb.js";import"./vendor-antdv-table-DFhwV24V.js";import"./vendor-antdv-base-QySV-hqZ.js";import"./vendor-lodash-BvL3EwUt.js";import"./vendor-auth0-B88dyU-W.js";import"./vendor-toast-BA6wVAZy.js";const W={class:"flex flex-col justify-between w-full py-3 px-6 bg-background border border-border rounded-base h-[77px]"},E={class:"text-14 text-primary"},M={class:"flex flex-row justify-between items-end gap-2 w-full"},V={class:"text-step-title text-primary leading-[110%]"},Q=A({__name:"StatCard",props:{card:{}},setup(t){const{t:e}=C();return(s,r)=>(i(),d("div",W,[l("span",E,c(g(e)(`cancellationAnalytics.stats.${t.card.labelKey}`)),1),l("div",M,[l("span",V,c(t.card.value),1)])]))}}),q={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"#FF9300","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"lucide lucide-external-link-icon lucide-external-link",viewBox:"0 0 24 24"};function G(t,e){return i(),d("svg",q,[...e[0]||(e[0]=[l("path",{d:"M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},null,-1)])])}const D={render:G},H={class:"flex flex-col gap-6 w-full"},Y={class:"w-full overflow-x-auto"},J={key:0,class:"flex flex-col"},X={class:"text-16 text-primary"},Z={class:"text-14 text-neutral"},ee={class:"text-16 text-primary underline"},te=["href"],ae={class:"text-16 text-primary underline"},se={key:1,class:"text-16 text-primary"},ne={key:3,class:"text-16 text-primary"},le={key:4,class:"text-16 text-primary"},oe={key:5,class:"flex flex-col"},ie={key:0,class:"text-14 text-neutral"},re={key:6,class:"flex flex-col"},ce={class:"text-16 text-primary"},de={class:"text-14 text-neutral"},ue={class:"flex flex-col gap-3 sm:flex-row sm:justify-between sm:items-center"},fe={class:"text-16 text-neutral"},pe=A({__name:"CancellationTable",props:{rows:{},totalRows:{},currentPage:{},pageSize:{}},emits:["update:currentPage"],setup(t,{emit:e}){const s={accepted:{class:"text-enable-bright",labelKey:"cancellationAnalytics.table.discountAccepted"},declined:{class:"text-danger",labelKey:"cancellationAnalytics.table.discountDeclined"},not_offered:{class:"text-neutral",labelKey:"cancellationAnalytics.table.discountNotOffered"}},r=t,h=e,{t:a}=C(),n=S(()=>Math.ceil(r.totalRows/r.pageSize)),y=S(()=>[{key:"user",title:a("cancellationAnalytics.table.headers.user"),dataIndex:"userName",minWidth:180},{key:"webhost",title:a("cancellationAnalytics.table.headers.webhost"),dataIndex:"webhostName"},{key:"plan",title:a("cancellationAnalytics.table.headers.plan"),dataIndex:"subscriptionPlan",minWidth:140},{key:"reason",title:a("cancellationAnalytics.table.headers.reason"),dataIndex:"reason",minWidth:200},{key:"feedbackDetail",title:a("cancellationAnalytics.table.headers.feedbackDetail"),dataIndex:"feedbackDetail",minWidth:300},{key:"feedback",title:a("cancellationAnalytics.table.headers.feedback"),dataIndex:"feedback",minWidth:200},{key:"discount",title:a("cancellationAnalytics.table.headers.discount"),dataIndex:"discount",minWidth:140},{key:"date",title:a("cancellationAnalytics.table.headers.date"),dataIndex:"date",minWidth:140}]);function x(m){const b=new Date(m);return Number.isNaN(b.getTime())?m:b.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function f(m){const b=new Date(m);return Number.isNaN(b.getTime())?"":b.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function _(m){const{percentage:b,period:w}=m.discount;if(b==null&&w==null)return"";const p=[];return b!=null&&p.push(`${b}%`),w!=null&&p.push(`${w} mo`),p.join(" / ")}function v(m){return`https://servebolt.chargebee.com/admin-console/subscriptions/${m}`}return(m,b)=>{const w=L("router-link");return i(),d("div",H,[l("div",Y,[k(F,{columns:y.value,data:t.rows,"row-key":"id",striped:!1},{bodyCell:I(({column:p,record:o})=>[p.key==="user"?(i(),d("div",J,[l("span",X,c(o.userName),1),l("span",Z,"#"+c(o.userId),1)])):p.key==="webhost"?(i(),P(w,{key:1,to:{name:"specific-bolt",params:{boltId:o.webhostId}},class:"flex flex-row items-center gap-2"},{default:I(()=>[l("span",ee,c(o.webhostName),1),k(g(D),{class:"w-4 h-4 text-secondary shrink-0"})]),_:2},1032,["to"])):p.key==="plan"?(i(),d(T,{key:2},[o.subscriptionId?(i(),d("a",{key:0,href:v(o.subscriptionId),target:"_blank",rel:"noopener noreferrer",class:"flex flex-row items-center gap-2"},[l("span",ae,c(o.subscriptionPlan),1),k(g(D),{class:"w-4 h-4 text-secondary shrink-0"})],8,te)):(i(),d("span",se,c(o.subscriptionPlan),1))],64)):p.key==="feedbackDetail"?(i(),d("span",ne,c((o.feedbackDetail??[]).join(", ")||"—"),1)):p.key==="feedback"?(i(),d("span",le,c(o.feedback??"—"),1)):p.key==="discount"?(i(),d("div",oe,[l("span",{class:O(["text-16",s[o.discount.status].class])},c(g(a)(s[o.discount.status].labelKey)),3),_(o)?(i(),d("span",ie,c(_(o)),1)):$("",!0)])):p.key==="date"?(i(),d("div",re,[l("span",ce,c(x(o.date)),1),l("span",de,c(f(o.date)),1)])):$("",!0)]),_:1}
1,8,["columns","data"])]),l("div",ue,[l("span",fe,c(g(a)("cancellationAnalytics.table.showing",{count:t.rows.length,total:t.totalRows})),1),k(B,{current:t.currentPage,total:t.totalRows,"page-size":t.pageSize,"last-page":n.value,onChange:b[0]||(b[0]=p=>h("update:currentPage",p))},null,8,["current","total","page-size","last-page"])])])}}}),N={search:"",month:"april-2026",dateRange:"last-30",reason:"",plan:"",status:"",country:"",partner:"",discount:"",mrrRange:"",activeTab:"all",sortBy:"recent",overviewDateRange:"last-30"};function me(){const t=u({...N}),e=u(1),s=u(10);function r(){t.value={...N},e.value=1}function h(n){t.value.activeTab=n,e.value=1}function a(n){Object.assign(t.value,n),Object.keys(n).every(x=>x==="sortBy")||(e.value=1)}return{filters:t,currentPage:e,pageSize:s,resetFilters:r,setTab:h,updateFilters:a}}const be=()=>new U().withAdminPrefix(!0),he=async t=>{const{data:e}=await be().getQuery(`offboardings?${t}`);return e};function ye(t){const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="").map(([s,r])=>[s,String(r)]);return new URLSearchParams(e).toString()}const ge=async t=>he(ye(t));function xe(t){return t.accepted?"accepted":t.percentage!==null||t.period!==null?"declined":"not_offered"}function _e(t){const e=t.attributes;return{id:t.id,userId:e.user.id,userName:e.user.name,webhostId:e.webhost.id,webhostName:e.webhost.name,subscriptionId:e.subscription.id,subscriptionPlan:e.subscription.plan,reason:e.reason,feedbackDetail:e.feedback_detail,feedback:e.feedback,discount:{status:xe(e.discount),percentage:e.discount.percentage,period:e.discount.period,periodUnit:e.discount.period_unit},date:e.date}}function we(t,e,s){const r=u([]),h=u(0),a=u(!1),n=u(null);async function y(){a.value=!0,n.value=null;try{const f=await ge({page:e.value,pageSize:s.value});r.value=f.data.map(_e),h.value=f.meta.total,s.value=f.meta.per_page}catch(f){n.value=f,K(f?.response)}finally{a.value=!1}}async function x(f){e.value=f,await y()}return R(y),{rows:r,total:h,isLoading:a,error:n,refetch:y,setPage:x}}function ke(t){const e=u([]),s=u([]),r=u([]),h=u(null),a=u(null),n=u(!1),y=u(null);async function x(){n.value=!0,y.value=null,n.value=!1}return z(()=>[t.value.overviewDateRange,t.value.month],()=>x(),{immediate:!0}),{statCards:e,reasons:s,cancellationsOverTime:r,mrr:h,discount:a,isLoading:n,error:y,refetch:x}}const ve={class:"flex flex-col items-start gap-9 w-full"},Se={class:"text-[32px] leading-10 tracking-[0.0075em] text-primary font-normal m-0"},Ce={class:"grid grid-cols-2 sm:grid-cols-3 xl:grid-cols-6 gap-4 w-full"},Ae={class:"flex flex-col items-center gap-6 w-full p-6 bg-background border border-border rounded-base box-border"},je=A({__name:"CancellationAnalyticsView",setup(t){const{t:e}=C(),{filters:s,currentPage:r,pageSize:h}=me(),{rows:a,total:n,setPage:y}=we(s,r,h),{statCards:x}=ke(s),f=S(()=>{const _=x.value.find(v=>v.labelKey==="totalCancellations");return _?[{..._,value:String(n.value)}]:[]});return(_,v)=>(i(),d("div",ve,[l("h1",Se,c(g(e)("cancellationAnalytics.pageTitle")),1),l("div",Ce,[(i(!0),d(T,null,j(f.value,m=>(i(),P(Q,{key:m.labelKey,card:m},null,8,["card"]))),128))]),l("section",Ae,[k(pe,{rows:g(a),"total-rows":g(n),"current-page":g(r),"page-size":g(h),"onUpdate:currentPage":g(y)},null,8,["rows","total-rows","current-page","page-size","onUpdate:currentPage"])])]))}});export{je as default};
2//# sourceMappingURL=CancellationAnalyticsView-5M4aI1p2.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.