PageSourceSearch

https://app.xgrowing.ai/assets/Billing-Bs_u1aIk.js

js xgrowing.ai collected 2026-10-02 00:42:45 UTC 14,855 bytes, 1 lines download raw bytes

1import{_ as de,I as ue,j as _,c as d,k as Y,l as pe,K as me,a as l,b as a,d as c,u as i,g as p,t as o,h as m,F as L,r as E,w as g,b6 as ge,b7 as he,o as t,s as v,T as y,f as K,e as z,ad as _e,p as ve,i as ye}from"./index-DbI8qXff.js";import{a as M,s as be}from"./index-D8wW4mtT.js";import{s as we}from"./index-BzspaYgf.js";import{s as ke}from"./index-CL1T964V.js";import{s as W}from"./index-BP5LkFUS.js";import{c as fe,g as Se,a as xe}from"./stripe-BWFJnLfg.js";import"./index-B_ah9EZZ.js";import"./index-ezpxFum_.js";import"./index-Nhe9hxW4.js";import"./index-CeOVvV2O.js";import"./index-B6Ewnmxb.js";import"./index-7u6av153.js";import"./index-BG8Cu20R.js";import"./index-B8oBAXSr.js";import"./index-HiCaXGwc.js";const r=N=>(ve("data-v-2d185368"),N=N(),ye(),N),Ne={class:"billing-page"},Ce={class:"card billing-heading"},Pe=r(()=>a("div",null,[a("span",{class:"page-eyebrow"},"Account"),a("h1",null,"Plan & billing"),a("p",null,"Review your plan, usage, payment method, and invoices.")],-1)),Fe={class:"billing-overview-grid"},Ue={key:1,class:"card membership-summary-card"},$e={class:"plan-card-topline"},Ie=r(()=>a("span",{class:"plan-icon"},[a("i",{class:"pi pi-crown"})],-1)),Ae={class:"membership-plan-main"},Be=r(()=>a("span",{class:"card-label"},"Current plan",-1)),Le={class:"plan-price"},Me={class:"membership-detail-list"},De={class:"membership-renewal"},Re=r(()=>a("span",{class:"renewal-icon"},[a("i",{class:"pi pi-calendar"})],-1)),Te={class:"card-label"},Xe={key:0},Oe={key:1},Ve={key:0,class:"payment-method-row"},Ye=r(()=>a("span",{class:"payment-method-icon"},[a("i",{class:"pi pi-credit-card"})],-1)),Ee=r(()=>a("div",null,[a("span",{class:"card-label"},"Payment method"),a("strong",null,"Managed securely by Stripe")],-1)),Ke={class:"membership-actions"},ze={class:"card usage-section"},We={class:"section-heading"},je=r(()=>a("span",{class:"page-eyebrow"},"This billing period",-1)),Ge=r(()=>a("h2",null,"Usage this billing period",-1)),qe={key:0},He={key:1},Je={key:1,class:"usage-groups"},Qe={key:0,class:"connect-account-note"},Ze=r(()=>a("span",null,[a("i",{class:"pi pi-link"})],-1)),ea=r(()=>a("div",null,[a("strong",null,"Free plan allowance"),a("p",null,"These limits and permissions are ready for your first connected X account.")],-1)),aa={key:1,class:"usage-group"},sa={class:"usage-group-heading"},na=r(()=>a("div",null,[a("i",{class:"pi pi-sparkles"}),a("strong",null,"Automation")],-1)),ta={class:"usage-grid"},ia={class:"usage-card-heading"},la={class:"usage-icon"},oa={key:2,class:"usage-group"},ra=r(()=>a("header",{class:"usage-group-heading"},[a("div",null,[a("i",{class:"pi pi-box"}),a("strong",null,"Included tools")])],-1)),ca={class:"usage-grid included-tools-grid"},da={class:"usage-card-heading"},ua={class:"usage-icon"},pa={key:3,class:"usage-group higher-plan-group"},ma={class:"usage-group-heading"},ga=r(()=>a("div",null,[a("i",{class:"pi pi-lock"}),a("strong",null,"Available with a higher plan")],-1)),ha={class:"usage-grid upgrade-feature-grid"},_a={class:"usage-card-heading"},va={class:"usage-icon"},ya={key:2,class:"usage-empty"},ba={class:"card invoice-section"},wa={class:"section-heading invoice-heading"},ka=r(()=>a("div",null,[a("span",{class:"page-eyebrow"},"Payment records"),a("h2",null,"Billing history"),a("p",null,"Open an invoice to view or download it securely from Stripe.")],-1)),fa={class:"invoice-count"},Sa=r(()=>a("div",{class:"invoice-empty"},[a("i",{class:"pi pi-receipt"}),a("strong",null,"No invoices yet"),a("span",null,"Your paid invoices will appear here.")],-1)),xa={class:"invoice-date"},Na=r(()=>a("i",{class:"pi pi-calendar"},null,-1)),Ca=["href"],Pa=r(()=>a("i",{class:"pi pi-external-link"},null,-1)),Fa={key:1,class:"invoice-unavailable"},Ua={class:"cancel-dialog-content"},$a=r(()=>a("p",null,"You can change your mind before the billing period ends by contacting support.",-1)),Ia={__name:"Billing",setup(N){const C=ue(),u=_(""),h=_(null),S=_([]),b=_(!0),x=_(!1),P=_(!1),D=_(!1),j=d(()=>!!u.value),G={0:{name:"Free",price:0,period:"month"},1:{name:"Starter",price:19,period:"month"},2:{name:"Standard",price:49,period:"month"},3:{name:"Starter",price:182,period:"year"}
1,4:{name:"Standard",price:382,period:"year"}},F=d(()=>{var e;return G[(e=h.value)==null?void 0:e.level]||G[0]}),w=d(()=>F.value.name==="Free"),q=d(()=>{var e;return((e=h.value)==null?void 0:e.vip_end_time)||""}),H=d(()=>{var e;return((e=h.value)==null?void 0:e.next_reset_time)||""}),ee={smart_follows:"Accounts followed",smart_replies:"Replies sent",smart_likes:"Posts liked",dm:"Message automation",automation:"Automation",automation_dm:"Message automation",block_list:"Safety Filters",blacklist:"Safety Filters",rag:"Brand Knowledge",knowledge_base:"Brand Knowledge"},U=d(()=>{var e;return(((e=h.value)==null?void 0:e.features)||[]).filter(n=>Y.messages||!["dm","automation_dm"].includes(n.name))}),ae=[...Y.messages?["automation_dm"]:[],"smart_likes","smart_follows","smart_replies"],se=new Set(["automation","automation_dm","dm","smart_likes","smart_follows","smart_replies"]),ne=d(()=>U.value.find(e=>e.name==="automation")),R=d(()=>{const e=U.value,n=e.find(s=>s.name==="automation_dm")||e.find(s=>s.name==="dm");return ae.map(s=>s==="automation_dm"?n:e.find(f=>f.name===s)).filter(Boolean)}),T=d(()=>U.value.filter(e=>!se.has(e.name))),te=d(()=>R.value.length||T.value.length),ie=[{name:"smart_likes",description:"Like relevant posts automatically.",availableOn:"Starter and Standard"},...Y.messages?[{name:"automation_dm",description:"Send a message after following an account.",availableOn:"Starter and Standard"}]:[],{name:"rag",description:"Use webpages and documents as brand context.",availableOn:"Starter and Standard"}],J=d(()=>{if(!w.value)return[];const e=new Set(U.value.map(n=>n.name));return e.has("dm")&&e.add("automation_dm"),e.has("knowledge_base")&&e.add("rag"),ie.filter(n=>!e.has(n.name))});function X(e){return ee[e]||String(e||"Feature").replaceAll("_"," ").replace(/\b\w/g,n=>n.toUpperCase())}function k(e){return Number(e==null?void 0:e.max_usage)===1e4}function $(e){return Number(e==null?void 0:e.max_usage)===1}function I(e){return(e==null?void 0:e.usage_available)!==!1}function A(e){if(k(e))return 0;const n=Number((e==null?void 0:e.max_usage)||0);return n?Math.min(Math.round(Number((e==null?void 0:e.current_usage)||0)/n*100),100):0}function Q(e){return $(e)?"Available with your plan":I(e)?k(e)?`${Number((e==null?void 0:e.current_usage)||0).toLocaleString()} used · No limit`:`${Number((e==null?void 0:e.current_usage)||0).toLocaleString()} of ${Number((e==null?void 0:e.max_usage)||0).toLocaleString()} used`:`${Number((e==null?void 0:e.max_usage)||0).toLocaleString()} per month`}function le(e){var s;const n=((s=e==null?void 0:e.data)==null?void 0:s.url)||(e==null?void 0:e.url)||(typeof(e==null?void 0:e.data)=="string"?e.data:"");try{const f=new URL(n);return f.protocol==="https:"&&(f.hostname==="stripe.com"||f.hostname.endsWith(".stripe.com"))?f.toString():""}catch{return""}}async function oe(){if(u.value){D.value=!0;try{const e=await fe(u.value,`${window.location.origin}/Billing`),n=le(e);if(!n)throw new Error("Stripe portal URL was not returned");window.location.assign(n)}catch(e){console.error("Unable to open payment settings:",e),C.add({severity:"error",summary:"Payment settings unavailable",detail:"Please try again or contact support.",life:3500})}finally{D.value=!1}}}function O(e){return e==="smart_follows"?"pi-user-plus":e==="smart_replies"?"pi-comments":e==="smart_likes"?"pi-heart":e==="dm"||e==="automation_dm"?"pi-envelope":e==="block_list"||e==="blacklist"?"pi-shield":e==="rag"||e==="knowledge_base"?"pi-database":"pi-sparkles"}function B(e){if(!e)return"Not scheduled";const n=new Date(e);return Number.isNaN(n.getTime())?"Not scheduled":n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function re(e){const n=String((e==null?void 0:e.currency)||"USD").toUpperCase(),s=Number((e==null?void 0:e.amount)||0);try{return new Intl.NumberFormat(void 0,{style:"currency",currency:n}).format(s)}catch{return`${n} ${s.toFixed(2)}`}}async function V(e=""){b.value=!0;try{if(u.value=String(e||localStorage.getItem("current_x_account")||""),!u.value){h.value={level:0,vip_end_time:"",next_reset_time:"",features:ge()},S.value=[];return}const[n,s]=await Promise.allSettled([he(u.value),Se(u.value)]);if(n.status==="fulfilled")h.value=n.value;else throw n.reason;S.value=s.status==="fulfilled"?s.value:[]}catch(n){console.error("Unable to load billing information:",n),C.add({severity:"error",summary:"Billing unavailable",detail:"We could not load your plan information.",life:3e3})}finally{b.value=!1}}function Z(e){var s;const n=String(((s=e==null?void 0:e.detail)==null?void 0:s.accountId)||localStorage.getItem("current_x_account")||"");n===u.value&&h.value||V(n)}async function ce(){P.value=!0;try{await xe(u.value,!0),x.value=!1,C.add({severity:"success",summary:"Cancellation scheduled",detail
1:"Your plan will remain active until the end of this billing period.",life:4e3}),await V()}catch(e){console.error("Unable to cancel subscription:",e),C.add({severity:"error",summary:"Cancellation failed",detail:"Please try again or contact support.",life:3e3})}finally{P.value=!1}}return pe(()=>{window.addEventListener("xg-current-account-changed",Z),V()}),me(()=>window.removeEventListener("xg-current-account-changed",Z)),(e,n)=>(t(),l(L,null,[a("main",Ne,[a("section",Ce,[Pe,c(i(v),{as:"router-link",to:"/pricing",label:"Compare plans",icon:"pi pi-arrow-up-right",iconPos:"right"})]),a("div",Fe,[b.value?(t(),p(i(W),{key:0,height:"100%",class:"overview-skeleton"})):(t(),l("section",Ue,[a("div",$e,[Ie,c(i(y),{value:"Active",severity:"success",rounded:""})]),a("div",Ae,[a("div",null,[Be,a("h2",null,o(F.value.name),1)]),a("div",Le,[a("strong",null,"$"+o(F.value.price),1),a("span",null,"/ "+o(F.value.period),1)])]),a("div",Me,[a("div",De,[Re,a("div",null,[a("span",Te,o(w.value?"Plan status":"Next renewal"),1),a("strong",null,o(w.value?"No payment scheduled":B(q.value)),1),w.value?(t(),l("p",Xe,"Upgrade when you need higher activity limits.")):(t(),l("p",Oe,"Your current access remains active through this date."))])]),w.value?m("",!0):(t(),l("div",Ve,[Ye,Ee,c(i(v),{label:"Manage payment method",icon:"pi pi-external-link",iconPos:"right",severity:"secondary",text:"",size:"small",loading:D.value,onClick:oe},null,8,["loading"])]))]),a("div",Ke,[c(i(v),{as:"router-link",to:"/pricing",label:"Change plan",icon:"pi pi-arrow-right",iconPos:"right",outlined:""}),w.value?m("",!0):(t(),l("button",{key:0,type:"button",class:"cancel-subscription-link",onClick:n[0]||(n[0]=s=>x.value=!0)},"Cancel subscription"))])])),a("section",ze,[a("header",We,[a("div",null,[je,Ge,j.value?(t(),l("p",qe,o(H.value?`Resets on ${B(H.value)}.`:"Resets at the start of your next billing period."),1)):(t(),l("p",He,"Your Free plan limits will start being tracked after you connect an X account."))])]),b.value?(t(),p(i(W),{key:0,height:"10rem"})):te.value?(t(),l("div",Je,[j.value?m("",!0):(t(),l("div",Qe,[Ze,ea,c(i(v),{as:"router-link",to:"/AddnewXaccount",label:"Connect X account",icon:"pi pi-arrow-right",iconPos:"right",size:"small"})])),R.value.length?(t(),l("section",aa,[a("header",sa,[na,ne.value?(t(),p(i(y),{key:0,value:"Included",severity:"success",rounded:""})):m("",!0)]),a("div",ta,[(t(!0),l(L,null,E(R.value,s=>(t(),l("article",{key:s.name,class:"usage-card"},[a("div",ia,[a("span",la,[a("i",{class:K(["pi",O(s.name)])},null,2)]),a("div",null,[a("strong",null,o(X(s.name)),1),a("span",null,o(Q(s)),1)]),!$(s)&&!k(s)&&I(s)?(t(),p(i(y),{key:0,value:`${A(s)}%`,severity:A(s)>=100?"danger":A(s)>=80?"warn":"secondary",rounded:""},null,8,["value","severity"])):!$(s)&&!I(s)?(t(),p(i(y),{key:1,value:"Monthly limit",severity:"secondary",rounded:""})):(t(),p(i(y),{key:2,value:k(s)?"No limit":"Included",severity:"success",rounded:""},null,8,["value"]))]),!$(s)&&I(s)?(t(),p(i(ke),{key:0,value:k(s)?0:A(s),showValue:!1,class:"usage-progress"},null,8,["value"])):m("",!0)]))),128))])])):m("",!0),T.value.length?(t(),l("section",oa,[ra,a("div",ca,[(t(!0),l(L,null,E(T.value,s=>(t(),l("article",{key:s.name,class:"usage-card"},[a("div",da,[a("span",ua,[a("i",{class:K(["pi",O(s.name)])},null,2)]),a("div",null,[a("strong",null,o(X(s.name)),1),a("span",null,o(Q(s)),1)]),c(i(y),{value:k(s)?"No limit":"Included",severity:"success",rounded:""},null,8,["value"])])]))),128))])])):m("",!0),J.value.length?(t(),l("section",pa,[a("header",ma,[ga,c(i(v),{as:"router-link",to:"/pricing",label:"Compare plans",icon:"pi pi-arrow-right",iconPos:"right",severity:"secondary",text:"",size:"small"})]),a("div",ha,[(t(!0),l(L,null,E(J.value,s=>(t(),l("article",{key:s.name,class:"usage-card upgrade-feature-card"},[a("div",_a,[a("span",va,[a("i",{class:K(["pi",O(s.name)])},null,2)]),a("div",null,[a("strong",null,o(X(s.name)),1),a("span",null,o(s.description),1)]),c(i(y),{value:s.availableOn,severity:"secondary",rounded:""},null,8,["value"])])]))),128))])])):m("",!0)])):b.value?m("",!0):(t(),l("div",ya,"Usage details are not available for this plan."))])]),a("section",ba,[a("header",wa,[ka,a("span",fa,o(S.value.length)+" invoice"+o(S.value.length===1?"":"s"),1)]),b.value?(t(),p(i(W),{key:0,height:"12rem"})):(t(),p(i(be),{key:1,value:S.value,dataKey:"id",paginator:"",rows:10,rowsPerPageOptions:[10,25,50],class:"invoice-table",responsiveLayout:"scroll"},{empty:g(()=>[Sa]),default:g(()=>
1[c(i(M),{header:"Billing date",style:{"min-width":"11rem"}},{body:g(s=>[a("span",xa,[Na,z(o(B(s.data.createat)),1)])]),_:1}),c(i(M),{field:"product",header:"Plan",style:{"min-width":"12rem"}},{body:g(s=>[a("strong",null,o(s.data.product||"XGrowing plan"),1)]),_:1}),c(i(M),{header:"Amount",style:{"min-width":"9rem"}},{body:g(s=>[a("strong",null,o(re(s.data)),1)]),_:1}),c(i(M),{header:"Invoice",style:{width:"9rem"}},{body:g(s=>[s.data.invoice_hosted_url?(t(),l("a",{key:0,href:s.data.invoice_hosted_url,target:"_blank",rel:"noopener noreferrer",class:"invoice-link"},[z("View invoice "),Pa],8,Ca)):(t(),l("span",Fa,"Unavailable"))]),_:1})]),_:1},8,["value"]))])]),c(i(_e),{visible:x.value,"onUpdate:visible":n[2]||(n[2]=s=>x.value=s),modal:"",header:"Cancel subscription?",style:{width:"min(28rem, calc(100vw - 2rem))"}},{footer:g(()=>[c(i(v),{label:"Keep subscription",severity:"secondary",text:"",disabled:P.value,onClick:n[1]||(n[1]=s=>x.value=!1)},null,8,["disabled"]),c(i(v),{label:"Schedule cancellation",severity:"danger",loading:P.value,onClick:ce},null,8,["loading"])]),default:g(()=>[a("div",Ua,[c(i(we),{severity:"warn",icon:"pi pi-exclamation-triangle"},{default:g(()=>[z(" Your plan will remain active until "+o(B(q.value))+". After that, your account will move to the Free plan and its activity limits. ",1)]),_:1}),$a])]),_:1},8,["visible"])],64))}},ja=de(Ia,[["__scopeId","data-v-2d185368"]]);export{ja 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.