PageSourceSearch

https://analitas.com/js/5525.10e3ddb2.chunk.js

js analitas.com collected 2026-10-08 23:43:34 UTC 12,647 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5525],{37333(e,a,t){t.d(a,{A:()=>c});var n=t(92047),s=t(74848);const c=(0,n.A)((0,s.jsx)("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonAdd")},12122(e,a,t){t.d(a,{A:()=>c});var n=t(92047),s=t(74848);const c=(0,n.A)((0,s.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm1 10h-4v1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1h-1v1h-2v-1H9v-2h4v-1h-3c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1h1V9h2v1h2zm-2-4V3.5L17.5 8z"}),"RequestQuote")},92916(e,a,t){t.d(a,{Ge:()=>d,K3:()=>l,Pj:()=>s,Sj:()=>u,cS:()=>c,nX:()=>o,wd:()=>i,yb:()=>r});var n=t(71182);const s=async function(){let{startDate:e="",endDate:a=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t={};e&&a?(t.dateWindow="custom",t.startDate=e,t.endDate=a):t.dateWindow="today";const s=await n.SP.get("/admin/users/stats",{params:t});return(0,n.w0)(s)}catch(e){return(0,n.t6)(e)}},c=async function(){let{page:e=1,limit:a=50,search:t="",sortBy:s="createdAt",sortOrder:c="DESC",country:l="",status:i="",startDate:o="",endDate:r=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const d=await n.SP.get("/admin/users",{params:{page:e,limit:a,search:t,sortBy:s,sortOrder:c,country:l,status:i,startDate:o,endDate:r}});return(0,n.w0)(d)}catch(e){return(0,n.t6)(e)}},l=async function(){let{startDate:e="",endDate:a=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t={};e&&(t.startDate=e),a&&(t.endDate=a);const s=await n.SP.get("/admin/users/summary",{params:t});return(0,n.w0)(s)}catch(e){return(0,n.t6)(e)}},i=async function(){let{page:e=1,limit:a=50,startDate:t=null,endDate:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const c={page:e,limit:a};t&&(c.startDate=t),s&&(c.endDate=s);const l=await n.SP.get("/admin/subscriptions",{params:c});return(0,n.w0)(l)}catch(e){return(0,n.t6)(e)}},o=async e=>{try{const a=await n.SP.get("/admin/users/".concat(e));return(0,n.w0)(a)}catch(e){return(0,n.t6)(e)}},r=async function(){let{page:e=1,limit:a=50,startDate:t=null,endDate:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const c={page:e,limit:a};t&&(c.startDate=t),s&&(c.endDate=s);const l=await n.SP.get("/admin/cancellations",{params:c});return(0,n.w0)(l)}catch(e){return(0,n.t6)(e)}},d=async function(){let{startDate:e=null,endDate:a=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t={};e&&(t.startDate=e),a&&(t.endDate=a);const s=await n.SP.get("/admin/credits",{params:t});return(0,n.w0)(s)}catch(e){return(0,n.t6)(e)}},u=async function(){let{startDate:e=null,endDate:a=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t={};e&&(t.startDate=e),a&&(t.endDate=a);const s=await n.SP.get("/admin/financials",{params:t});return(0,n.w0)(s)}catch(e){return(0,n.t6)(e)}}},35525(e,a,t){t.a(e,async(e,n)=>{try{t.r(a),t.d(a,{default:()=>A});var s=t(96540),c=t(61225),l=t(47767),i=t(74209),o=t(92916),r=t(22957),d=t(93950),u=t(72425),m=t(66277),h=t(8047),v=t(34337),g=t(16317),y=t(37333),p=t(62168),x=t(12122),j=t(65300),N=t(85100),f=t(74848),w=e([i]),D=w.then?(await w)():w;i=D[0];const A=()=>{var e,a,t,n,w,D;const A=(0,l.Zp)(),[P,S]=(0,s.useState)([]),[C,b]=(0,s.useState)(!0),[k,T]=(0,s.useState)(0),[F,I]=(0,s.useState)(null),[L,M]=(0,s.useState)(null),[O,q]=(0,s.useState)(0),_=(0,c.d4)(e=>e.user),R=(0,c.d4)(e=>e.date);(0,s.useEffect)(()=>{if(_&&"owner"===_.type){(async()=>{b(!0);try{let e="",a="";if(R&&"object"==typeof R&&R.date){if(R.date.start){e=new Date(R.date.start).toISOString()}if(R.date.end){a=new Date(R.date.end).toISOString()}}const t=await(0,o.yb)({page:1,limit:25,startDate:e,endDate:a});200===t.status?(S(t.message.cancellations||[]),T(t.message.total||0),I(t.message.stats||null),M(t.message.graphData||null),q(e=>e+1)):r.A.setNotification({message:t.message||"Failed to load cancellations",isError:!0})}catch(e){r.A.setNotification({message:e.message||"Failed to load cancellations",isError:!0})}finally{b(!1)}})()}},[_,R]);const U=e=>
1{e.userId&&A("/owner/user-details?userId=".concat(e.userId))};if(!_||"owner"!==_.type)return(0,f.jsx)("div",{className:"access-denied",children:(0,f.jsx)(i.mV,{title:"Access Denied",description:"Owner privileges required to access this page."})});const B=e=>e?e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"Unknown",E=[(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(v.A,{className:"header-icon"}),"User Email"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(h.A,{className:"header-icon"}),"Plan"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(m.A,{className:"header-icon"}),"Price"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(j.A,{className:"header-icon"}),"Periodicity"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(g.A,{className:"header-icon"}),"Cancellation Details"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(p.A,{className:"header-icon"}),"Country"]}),(0,f.jsxs)("div",{className:"header-with-icon",children:[(0,f.jsx)(y.A,{className:"header-icon"}),"Canceled"]})],V=e=>{if(!e)return"Never";const a=new Date(e),t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=new Date(n.getTime()-864e5),c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),l=a.toLocaleString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),i=a.getDate(),o=a.toLocaleString("en-US",{month:"long"}),r=a.getFullYear(),d=t.getFullYear();if(c.getTime()===n.getTime())return"".concat(l," Today");if(c.getTime()===s.getTime())return"".concat(l," Yesterday");{const e="".concat(i).concat((e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}})(i));return r===d?"".concat(l," on ").concat(e," ").concat(o):"".concat(l," on ").concat(e," ").concat(o," ").concat(r)}};return(0,f.jsxs)("div",{className:"cancellations-page",children:[(0,f.jsx)(i.lZ,{title:"Cancellations Management",description:"View cancellation statistics and manage all cancellations",icon:(0,f.jsx)(h.A,{})}),(0,f.jsx)("div",{className:"small-margin"}),(0,f.jsxs)("div",{className:"stats-row",children:[(0,f.jsx)(i.ro,{title:"Canceled",value:(null==F?void 0:F.canceled)||0,tag:(0,d.j)(R),primary:!0,isLoading:C,icon:(0,f.jsx)(h.A,{}),comparison:null!=F&&F.canceledPercentage?"".concat(F.canceledPercentage>0?"+":"").concat(F.canceledPercentage,"%"):null,lowerIsBetter:!0}),(0,f.jsx)(i.ro,{title:"Overdue Payment",value:(null==F?void 0:F.overduePayment)||0,tag:(0,d.j)(R),primary:!0,isLoading:C,icon:(0,f.jsx)(g.A,{}),comparison:null!=F&&F.overduePaymentPercentage?"".concat(F.overduePaymentPercentage>0?"+":"").concat(F.overduePaymentPercentage,"%"):null,lowerIsBetter:!0}),(0,f.jsx)(i.ro,{title:"Requested",value:(null==F?void 0:F.requested)||0,tag:(0,d.j)(R),primary:!0,isLoading:C,icon:(0,f.jsx)(x.A,{}),comparison:null!=F&&F.requestedPercentage?"".concat(F.requestedPercentage>0?"+":"").concat(F.requestedPercentage,"%"):null,lowerIsBetter:!0}),(0,f.jsx)(i.ro,{title:"Lost MRR",value:null!=F&&F.lostMoney?"$".concat((F.lostMoney/100).toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g,",")):"$0",tag:(0,d.j)(R),primary:!0,isLoading:C,icon:(0,f.jsx)(N.A,{}),comparison:null!=F&&F.lostMoneyPercentage?"".concat(F.lostMoneyPercentage>0?"+":"").concat(F.lostMoneyPercentage,"%"):null,lowerIsBetter:!0})]}),(L||C)&&(0,f.jsxs)("div",{className:"cancellation-graph-section",children:[(0,f.jsx)("div",{className:"small-margin"}),(0,f.jsx)(i.TS,{title:"Cancellations Over Time",subtitle:null!=F&&F.isToday?"Cancellation data for today and the last 7 days":"Cancellation data for the selected period (last ".concat((null==L||null===(e=L.xAxis)||void 0===e?void 0:e.length)||7," days)"),xAxis:(null==L?void 0:L.xAxis)||[],yAxis:{data:null!=L&&null!==(a=L.yAxis)&&void 0!==a&&a.data?[{label:"Total Cancellations",values:(null===(t=L.yAxis.data.find(e=>"Total Cancellations"===e.label))||void 0===t?void 0:t.values)||[],color:(0,u.tN)("--red-color"),style:"solid"},{label:"Overdue Payment",values:(null===(n=L.yAxis.data.find(e=>"Overdue Payment"===e.label))||void 0===n?void 0:n.values)||[],color:(0,u.tN)("--warning-color"),style:"dashed"},{label:"Requested",values:(null===(w=L.yAxis.data.find(e=>"Requested"===e.label))||void 0===w?void 0:w.values)||[],color:(0,u.tN)("--secondary-color"),style:"dashed"}]:[]},isLoading:C,prefix:"",dynamicScale:!0})]}),(0,f.jsxs)("div",{className:"cancellations-table-section",children:[(0,f.jsx)("div",{className:"small-margin"}),(0,f.jsx)("div",{className:"cancellations-actions",children:(0,f.jsx)("div",{className:"cancellations-count",children:(0,f.jsxs)("h3",{children:["Cancellations - ",(0,d.j)(R)," (",k,")"]})})}),(0,f.jsx)(i.XI,{headers:E,data:P,fetchData:async e=>{let{limit:a,offset:t}=e;try{let e="",n="";if(R&&"object"==typeof R&&R.date){if(R.date.start){e=new Date(R.date.start).toISOString()}if(R.date.end){n=new Date(R.date.end).toISOString()}}const s=Math.floor(t/a)+1,c=await(0,o.yb)({page:s,limit:a,startDate:e,endDate:n});return 200===c.status?{items:c.message.cancellations||[],total:c.message.total||0}:(r.A.setNotification({message:c.message||"Failed to load cancellations",isError:!0}),{items:[],total:0})}catch(e){return r.A.setNotification({message:e.message||"Failed to load cancellations",isError:!0}),{items:[],total:0}}},isLoading:C,totalItems:k,itemsPerPage:25,transformRow:e=>{var a,t,n,s,c,l,i;const o=null!==(a=e.user)&&void 0!==a&&a.country?(e=>{if(!e||"string"!=typeof e)return"🌐";try{const a=[...e.toUpperCase()].map(e=>127397+e.charCodeAt(0));return String.fromCodePoint(...a)}catch(e){return console.error("Error converting country code to flag:",e),"🌐"}})(e.user.country):"🌐",r=e.price?"$".concat((e.price/100).toFixed(2)):"Free",d=e.metadata||{},u="overdue"===e.cancellationType?"Overdue Payment":"User Requested",y="overdue"===e.cancellationType?(0,f.jsx)(g.A,{}):(0,f.jsx)(x.A,{}),p=B(d.cancellation_reason||d.stripe_cancellation_reason||e.cancellationReason),N=d.stripe_cancellation_feedback?B(d.stripe_cancellation_feedback):null,w=d.stripe_cancellation_comment||null;return[(0,f.jsxs)("div",{className:"user-email-container clickable-cell",onClick:()=>U(e),children:[(0,f.jsx)(v.A,{className:"content-icon"}),(0,f.jsx)("h5",{className:"user-email",children:(null===(t=e.user)||void 0===t?void 0:t.email)||"N/A"})]}),(0,f.jsxs)("div",{className:"cancellation-plan-container clickable-cell",onClick:()=>U(e),children:[(0,f.jsx)(h.A,{className:"content-icon"}
1),(0,f.jsxs)("div",{className:"cancellation-details",children:[(0,f.jsx)("h5",{className:"cancellation-plan ".concat(e.status),children:(null===(n=e.plan)||void 0===n?void 0:n.charAt(0).toUpperCase())+(null===(s=e.plan)||void 0===s?void 0:s.slice(1))||"Free"}),(0,f.jsx)("small",{className:"cancellation-status",children:null===(c=e.status)||void 0===c?void 0:c.toUpperCase()})]})]}),(0,f.jsxs)("div",{className:"cancellation-price-container clickable-cell",onClick:()=>U(e),children:[(0,f.jsx)(m.A,{className:"content-icon"}),(0,f.jsx)("h5",{className:"cancellation-price",children:r})]}),(0,f.jsxs)("div",{className:"cancellation-periodicity-container clickable-cell",onClick:()=>U(e),children:[(0,f.jsx)(j.A,{className:"content-icon"}),(0,f.jsx)("h5",{className:"cancellation-periodicity",children:(null===(l=e.periodicity)||void 0===l?void 0:l.charAt(0).toUpperCase())+(null===(i=e.periodicity)||void 0===i?void 0:i.slice(1))||"N/A"})]}),(0,f.jsxs)("div",{className:"cancellation-info-container clickable-cell",onClick:()=>U(e),children:[y,(0,f.jsxs)("div",{className:"cancellation-info-details",children:[(0,f.jsx)("h5",{className:"cancellation-type ".concat(e.cancellationType),children:u}),(0,f.jsx)("small",{className:"cancellation-reason-main",children:p}),N&&(0,f.jsxs)("small",{className:"cancellation-feedback",children:[(0,f.jsx)("strong",{children:"Feedback:"})," ",N]}),w&&(0,f.jsxs)("small",{className:"cancellation-comment",children:[(0,f.jsx)("strong",{children:"Comment:"})," ",w]})]})]}),(0,f.jsx)("div",{className:"user-country-container clickable-cell",onClick:()=>U(e),children:(0,f.jsx)("span",{className:"country-flag",children:o})}),(0,f.jsx)("h5",{className:"cancellation-canceled clickable-cell",onClick:()=>U(e),children:V(e.canceledAt)})]},emptyStateTitle:"No Cancellations Found",emptyStateDescription:"There are no cancellations for ".concat(null===(D=(0,d.j)(R))||void 0===D?void 0:D.toLowerCase(),".")},O)]})]})};n()}catch(e){n(e)}})}}]);

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.