1import{z as rs,p as ns,aN as ls,aH as is,a as cs,aM as ds,r as ie,j as e,B as l,ag as Ee,e as u,q as Re,R as O,Y as ce,V as z,i as _,h as Fe,S as De,_ as Ie,aQ as Le,ah as H,X as Be,b1 as V,b2 as q,b3 as K,b4 as W,L as M,a0 as Ue,a1 as Ye,a2 as Oe,a3 as ze,a4 as b,aF as de,G as os,I as ms,J as Q,K as G,C as T,b as $,c as C,k as xs,d as E,y as us,bN as _e,a5 as oe,bM as He,N as hs,b7 as Ve,bp as gs,aS as me,bP as bs,bQ as ps,al as ys,aG as js}from"./index-DGo-vssZ.js";import{u as vs,r as h,L as qe}from"./vendor-Qgthw7N1.js";import{P as Z}from"./pause-BtInyhHa.js";import{P as Ke}from"./play-Du1KHNWc.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const We=rs("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);function Cs(){var Ae,Me,Te,$e,Ce;const{user:j}=ns(),Qe=ls(),{manageBilling:Ge,freezeStatus:r,freezeLoading:Ze,freezeSubscription:xe,resumeSubscription:ue,isFreezing:D,isResuming:P,isOnTrial:d,isFrozen:n,isProcessingSubscriptionChange:Je}=is(),{toast:g}=cs();vs();const[c,L]=h.useState(!1),[Xe,R]=h.useState("overview"),[he,ge]=h.useState(""),[be,pe]=h.useState(""),[ye,F]=h.useState(!1),[je,I]=h.useState(!1),[B,ve]=h.useState(null),[J,X]=h.useState(""),[ee,se]=h.useState(""),[Ne,we]=h.useState(!1),[U,fe]=h.useState(!1),ae=ds(),{data:t,isLoading:es}=ie({queryKey:["/api/subscription/status"],retry:!1,staleTime:0,gcTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0}),{data:s,isLoading:ss}=ie({queryKey:["/api/pricing"],retry:!1}),{data:te,isLoading:Ns}=ie({queryKey:["/api/properties/owned"],retry:!1}),N=(j==null?void 0:j.planType)||(t==null?void 0:t.planType),ke=(t==null?void 0:t.subscriptionTier)||(j==null?void 0:j.subscriptionTier)||"base",p=ke==="premium",Pe=ps(ke),o=(t==null?void 0:t.subscriptionStatus)==="active"||(t==null?void 0:t.subscriptionStatus)==="suspended",re=(j==null?void 0:j.annualPriceSelected)||(t==null?void 0:t.annualPriceSelected);h.useEffect(()=>{const i=new URLSearchParams(window.location.search).get("payment");i==="cancelled"?(g({title:"Checkout Cancelled",description:"No charges were made. You can try again whenever you're ready.",variant:"default"}),window.history.replaceState({},"",window.location.pathname)):i==="success"&&(g({title:"Payment Successful",description:"Your subscription has been updated successfully.",variant:"default"}),window.history.replaceState({},"",window.location.pathname))},[g]);const m=o?N==="annual_plan_variable"||N==="premium_annual"?"annual":N==="monthly_plan"||N==="premium_monthly"?"monthly":re?"annual":"monthly":null,as=m,w=o&&!p,f=o&&p,v=(()=>{if(d&&(t!=null&&t.trialEndDate)){const a=new Date(t.trialEndDate),i=new Date,S=a.getTime()-i.getTime(),x=Math.floor(S/(1e3*60*60*24));return Math.max(0,x)}return null})();(a=>{const i=["All monthly features included","Advanced AI analysis and insights","REST API â connect your tools and automate workflows","Priority customer support"];return a>=120&&i.push("Enhanced analytics dashboard","Custom integrations","Dedicated account manager"),a>=140&&i.push("White-label branding","Full API Integration â build custom workflows","Advanced reporting suite"),i})((s==null?void 0:s.annualPriceMin)||100);const y=(()=>{if(N==="annual_plan_variable"&&re&&(t!=null&&t.subscriptionEndDate)){const a=new Date(t.subscriptionEndDate),i=new Date,S=new Date(i.getFullYear(),i.getMonth()+1,1),x=365,A=Math.max(0,Math.ceil((a.getTime()-S.getTime())/(1e3*60*60*24))),ts=re*A/x;return{remainingDays:A,creditAmount:Math.round(ts*100)/100,totalDays:x,nextMonthStart:S}}return null})(),ne=!n||!(t!=null&&t.subscriptionEndDate)?!1:new Date(t.subscriptionEndDate)<new Date,le=(()=>{if(!ne||!y||!(s!=null&&s.monthlyPrice))return null;const a=parseFloat(s.monthlyPrice.toString());return Math.floor(y.creditAmount/a)})(),k=async(a,i,S="base")=>{if(!s){g({title:"Error",description:"Pricing information not available. Please try again.",variant:"destructive"});return}if((t==null?void 0:t.subscriptionStatus)==="active"){ve({priceType:a,tier:S});return}L(!0);try{const x=window.location.origin,A=await ys({priceType:a,tier:S,successUrl:`${x}/manage-subscription?payment=success`,cancelUrl:`${x}/manage-subscription?payment=cancelled`});A.upgraded?(g({title:"Plan Updated",description:A.message||"Your subscription has been updated."}),ae.invalidateQueries({queryKey:["/api/subscription/status"]})):A.checkoutUrl&&(window.location.href=A.checkoutUrl)}
6catch(x){if(console.error("Upgrade error:",x),(x==null?void 0:x.status)===409){g({title:"Already on this plan",description:"You already have this subscription."});return}g({title:"Upgrade Error",description:x.message||"Failed to start upgrade process. Please try again.",variant:"destructive"})}finally{L(!1)}},Y=async()=>{L(!0);try{await Ge()}catch(a){console.error("Billing management error:",a),g({title:"Error",description:"Failed to open billing portal. Please try again.",variant:"destructive"})}finally{L(!1)}},Se=async()=>{fe(!0);try{const a=await js("POST","/api/user/cancel-account",{reason:J||void 0,details:ee||void 0,keepNewsletter:Ne}),i=await a.json();if(a.ok)g({title:"Account Cancellation Initiated",description:"Your account has been scheduled for deletion. You've been logged out."}),I(!1),X(""),se(""),we(!1),ae.clear(),window.location.href="/login?reason=account_canceled";else throw new Error(i.message||"Failed to cancel account")}catch(a){console.error("Account cancellation error:",a),g({title:"Cancellation Error",description:a.message||"Failed to cancel account. Please contact support.",variant:"destructive"})}finally{fe(!1)}};return es||ss?e.jsx("div",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"flex items-center justify-center min-h-[400px]",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-blue-600 border-t-transparent rounded-full"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading subscription details..."})]})}):e.jsxs(e.Fragment,{children:[Je&&e.jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm z-50 flex items-center justify-center",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-8 max-w-sm mx-4 text-center",children:[e.jsx("div",{className:"animate-spin h-12 w-12 border-4 border-blue-500 border-t-transparent rounded-full mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Updating Subscription"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"Please wait while we process your request and sync fresh data..."})]})}),Qe?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 px-4 py-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx(qe,{href:"/settings",children:e.jsxs(l,{variant:"ghost",size:"sm",className:"mb-4 -ml-2",children:[e.jsx(Ee,{className:"h-4 w-4 mr-2"}),"Back"]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Billing & Subscription"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Manage your subscription plan"})]}),e.jsxs("div",{className:"mt-6 bg-white dark:bg-gray-800 p-6",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white",children:n?"Subscription Paused":d?"Free Trial Active":o?`${Pe} â ${m==="annual"?"Annual":"Monthly"}`:"No Active Plan"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n?(Ae=r==null?void 0:r.activeFreeze)!=null&&Ae.freezeResumesAt?`Resumes ${new Date(r.activeFreeze.freezeResumesAt).toLocaleDateString()}`:"Paused - resume anytime":d?`${v} days remaining`:o?m==="annual"?`$${(t==null?void 0:t.annualPriceSelected)||(p?s==null?void 0:s.premiumAnnualPrice:s==null?void 0:s.annualPriceMin)||(p?279:100)}/year`:`$${p?(s==null?void 0:s.premiumMonthlyPrice)||29:(s==null?void 0:s.monthlyPrice)||10}/month`:"Start your subscription"})]}),e.jsx(u,{variant:n?"destructive":d?"secondary":o?"default":"outline",className:"ml-2",children:n?"Paused":d?"Trial":o?"Active":"Inactive"})]}),!n&&o&&(t==null?void 0:t.subscriptionEndDate)&&e.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Re,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),e.jsxs("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:["Next billing:"," ",new Date(t.subscriptionEndDate).toLocaleDateString()]})]})}),d&&v!==null&&v<=3&&e.jsxs(O,{className:"mt-4 border-orange-200 bg-orange-50 dark:bg-orange-900/20",children:[e.jsx(ce,{className:"h-4 w-4 text-orange-600"}),e.jsx(z,{className:"text-orange-800 dark:text-orange-200",children:"Trial ending soon! Choose a plan to continue using REPSShield."})]})]}),e.jsxs("div",{className:"mt-6 px-4",children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4",children:"Plans"}),d&&v!==null&&!n&&e.jsxs(O,{className:"mb-4 border-blue-200 bg-blue-50 dark:bg-blue-900/20",children:[e.jsx(_,{className:"h-4 w-4 text-blue-600"}),e.jsxs(z,{className:"text-blue-800 dark:text-blue-200",children:[e.jsxs("strong",{children:[v," days"]})," left on your free trial â choose a plan below to continue uninterrupted access."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:`relative flex flex-col rounded-xl border-2 transition-all duration-200 ${w?"border-green-500 bg-green-50/40 dark:bg-green-900/10":"border-border hover:border-green-300 bg-card"}`,children:[w&&e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:e.jsx(u,{className:`text-white px-3 py-0.5 text-xs ${n?"bg-orange-500":"bg-green-600"}`,children:n?"Paused":"Current Plan"})}),e.jsxs("div",{className:"p-5 pb-4 border-b border-border",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"Shield Essential"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",(s==null?void 0:s.monthlyPrice)||10]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["or $",(s==null?void 0:s.annualPriceMin)||100,"/yr"]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"Track hours, stay organized, and generate audit-ready reports."})]})]}),e.jsxs("div",{className:"p-5 flex flex-col",children:[e.jsx("ul",{className:"space-y-2.5 text-sm",children:["Smart time tracking with AI","Audit-ready documentation","Gmail & Calendar sync","Voice-to-text logging","CSV & evidence exports","Analytics dashboard","REST API â connect your tools"].map((a,i)=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(Fe,{className:"h-4 w-4 text-green-500 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:a})]},i))}),e.jsxs("div",{className:"mt-5 space-y-2",children:[(()=>{const a=w&&m==="monthly";return e.jsx(l,{onClick:()=>k("monthly"),disabled:c||a,variant:a?"default":"outline",className:`w-full text-sm ${a?"bg-green-600 hover:bg-green-700 text-white":"border-green-600 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20"}`,children:c?"Processing...":a?"Current (Monthly)":`Monthly â $${(s==null?void 0:s.monthlyPrice)||10}/mo`})})(),(()=>{const a=w&&m==="annual",i=(s==null?void 0:s.annualPriceMin)||100;return e.jsx(l,{onClick:()=>k("annual"),disabled:c||a,className:"w-full text-sm bg-green-600 hover:bg-green-700 text-white",children:c?"Processing...":a?"Current (Annual)":`Annual â $${i}/yr`})})()]})]})]}),e.jsxs("div",{className:`relative flex flex-col rounded-xl border-2 transition-all duration-200 ${f?"border-green-500 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/20 dark:to-blue-900/20":"border-green-200 hover:border-green-400 bg-gradient-to-br from-green-50/50 to-blue-50/50 dark:from-green-900/10 dark:to-blue-900/10"}`,children:[e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:f?e.jsx(u,{className:`text-white px-3 py-0.5 text-xs flex items-center gap-1 ${n?"bg-orange-500":"bg-green-600"}`,children:n?"Paused":"Current Plan"}):e.jsxs(u,{className:"bg-green-600 text-white px-3 py-0.5 text-xs flex items-center gap-1",children:[e.jsx(De,{className:"h-3 w-3"}),"Most Popular"]})}),e.jsxs("div",{className:"p-5 pb-4 border-b border-green-200 dark:border-green-700 pt-7",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-green-700 dark:text-green-400 mb-1",children:"Shield Advisor"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",(s==null?void 0:s.premiumMonthlyPrice)||29]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),e.jsxs("p",{className:"text-xs text-green-600 dark:text-green-400 font-medium",children:["or $",(s==null?void 0:s.premiumAnnualPrice)||279,"/yr (save $",((s==null?void 0:s.premiumMonthlyPrice)||29)*12-((s==null?void 0:s.premiumAnnualPrice)||279),")"]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"AI advisor + audit scoring â know
6where you stand before the IRS does."})]})]}),e.jsxs("div",{className:"p-5 flex flex-col",children:[e.jsx("p",{className:"text-xs font-semibold text-green-700 dark:text-green-400 mb-2.5 uppercase tracking-wide",children:"Everything in Shield Essential, plus:"}),e.jsx("ul",{className:"space-y-2.5 text-sm",children:["AI Tax Advisor â ask REPS questions, get answers with IRS citations","Audit readiness score â know your risk before the IRS does","Personalized analysis based on your properties & hours","Full API Integration â build custom workflows and sync with your CPA's tools","Priority support from our team"].map((a,i)=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"flex items-center justify-center h-5 w-5 rounded-full bg-yellow-400 flex-shrink-0 mt-0.5",children:e.jsx(Ie,{className:"h-3 w-3 text-white"})}),e.jsx("span",{children:a})]},i))}),e.jsxs("div",{className:"mt-5 space-y-2",children:[(()=>{const a=f&&m==="monthly";return e.jsx(l,{onClick:()=>k("monthly",void 0,"premium"),disabled:c||a,variant:"outline",className:`w-full text-sm ${a?"bg-green-600 hover:bg-green-700 text-white border-green-600":"border-green-300 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20"}`,children:c?"Processing...":a?"Current (Monthly)":`Monthly â $${(s==null?void 0:s.premiumMonthlyPrice)||29}/mo`})})(),(()=>{const a=f&&m==="annual";return e.jsx(l,{onClick:()=>k("annual",(s==null?void 0:s.premiumAnnualPrice)||279,"premium"),disabled:c||a,className:`w-full text-sm bg-green-600 hover:bg-green-700 text-white ${a?"opacity-80":""}`,children:c?"Processing...":a?"Current (Annual)":`Annual â $${(s==null?void 0:s.premiumAnnualPrice)||279}/yr`})})()]})]})]})]})]}),o&&e.jsxs("div",{className:"mt-6 bg-white dark:bg-gray-800",children:[e.jsx("div",{className:"px-4 py-2",children:e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Account Actions"})}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700",children:[!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Y,disabled:c,className:"w-full flex items-center justify-between px-4 py-4 hover:bg-gray-50 dark:hover:bg-gray-700/50 active:bg-gray-100 dark:active:bg-gray-700 transition-colors min-h-[56px] border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Le,{className:"h-5 w-5 text-gray-400"}),e.jsx("span",{className:"text-base font-medium text-gray-900 dark:text-white",children:"Manage Billing"})]}),e.jsx(H,{className:"h-5 w-5 text-gray-400"})]}),e.jsxs("button",{onClick:()=>F(!0),disabled:D,className:"w-full flex items-center justify-between px-4 py-4 hover:bg-gray-50 dark:hover:bg-gray-700/50 active:bg-gray-100 dark:active:bg-gray-700 transition-colors min-h-[56px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Z,{className:"h-5 w-5 text-gray-400"}),e.jsx("span",{className:"text-base font-medium text-gray-900 dark:text-white",children:"Pause Subscription"})]}),e.jsx(H,{className:"h-5 w-5 text-gray-400"})]})]}),n&&e.jsxs("button",{onClick:()=>ue(),disabled:P,className:"w-full flex items-center justify-between px-4 py-4 hover:bg-gray-50 dark:hover:bg-gray-700/50 active:bg-gray-100 dark:active:bg-gray-700 transition-colors min-h-[56px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ke,{className:"h-5 w-5 text-gray-400"}),e.jsx("span",{className:"text-base font-medium text-gray-900 dark:text-white",children:P?"Resuming...":"Resume Subscription"})]}),e.jsx(H,{className:"h-5 w-5 text-gray-400"})]})]})]}),e.jsxs("div",{className:"mt-6 bg-white dark:bg-gray-800",children:[e.jsx("div",{className:"px-4 py-2",children:e.jsx("h2",{className:"text-xs font-semibold text-red-600 dark:text-red-400 uppercase tracking-wider",children:"Danger Zone"})}),e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700",children:e.jsxs("button",{onClick:()=>I(!0),className:"w-full flex items-center justify-between px-4 py-4 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 transition-colors min-h-[56px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Be,{className:"h-5 w-5 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-base font-medium text-red-600 dark:text-red-400",children:"Cancel Account"})]}),e.jsx(H,{className:"h-5 w-5 text-red-600 dark:text-red-400"})]})})]}),e.jsx(V,{open:ye,onOpenChange:F,children:e.jsxs(q,{className:"max-w-md",children:[e.jsx(K,{children:e.jsx(W,{children:"Pause Subscription"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"You can pause your subscription temporarily. Your access will continue until the end of the current billing period."}),e.jsx(l,{onClick:async()=>{await xe(),F(!1)},disabled:D,className:"w-full",children:D?"Pausing...":"Confirm Pause"})]})]})}),e.jsx(V,{open:je,onOpenChange:I,children:e.jsxs(q,{className:"max-w-md",children:[e.jsx(K,{children:e.jsx(W,{className:"text-red-600",children:"Cancel Account"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(O,{variant:"destructive",children:[e.jsx(ce,{className:"h-4 w-4"}),e.jsx(z,{children:"This will permanently delete your account and all data. This action cannot be undone."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(M,{children:"Reason for canceling (optional)"}),e.jsxs(Ue,{value:J,onValueChange:X,children:[e.jsx(Ye,{children:e.jsx(Oe,{placeholder:"Select a reason"})}),e.jsxs(ze,{children:[e.jsx(b,{value:"too_expensive",children:"Too expensive"}),e.jsx(b,{value:"not_using",children:"Not using enough"}),e.jsx(b,{value:"missing_features",children:"Missing features"}),e.jsx(b,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{children:[e.jsx(M,{children:"Additional details (optional)"}),e.jsx(de,{value:ee,onChange:a=>se(a.target.value),placeholder:"Tell us more...",rows:3})]})]}),e.jsx(l,{onClick:Se,disabled:U,variant:"destructive",className:"w-full",children:U?"Canceling...":"Yes, Cancel My Account"})]})]})})]}):e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsx(qe,{href:"/settings",children:e.jsxs(l,{variant:"outline",size:"sm",children:[e.jsx(Ee,{className:"h-4 w-4 mr-2"}),"Back to Settings"]})}),e.jsxs("div",{className:"text-right",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-gray-100",children:"Billing & Subscription"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"Manage your subscription plan and billing settings"})]})]}),e.jsxs(os,{value:Xe,onValueChange:R,className:"space-y-6",children:[e.jsxs(m
6s,{className:"grid w-full grid-cols-4",children:[e.jsx(Q,{value:"overview",children:"Overview"}),e.jsx(Q,{value:"plans",children:"Plans & Billing"}),e.jsxs(Q,{value:"history",disabled:!0,className:"relative",children:["Billing History",e.jsx(u,{variant:"secondary",className:"absolute -top-2 -right-2 text-xs",children:"Coming Soon"})]}),e.jsxs(Q,{value:"payment",disabled:!0,className:"relative",children:["Payment Methods",e.jsx(u,{variant:"secondary",className:"absolute -top-2 -right-2 text-xs",children:"Coming Soon"})]})]}),e.jsx(G,{value:"overview",className:"space-y-6",children:e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs(T,{className:"lg:col-span-2",children:[e.jsx($,{children:e.jsxs(C,{className:"flex items-center space-x-2",children:[e.jsx(xs,{className:"h-5 w-5 text-yellow-500"}),e.jsx("span",{children:"Current Subscription"})]})}),e.jsx(E,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold",children:n?"Subscription Paused":d?"Free Trial":o?`${Pe} â ${m==="annual"?"Annual":"Monthly"}`:"No Active Plan"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:n?(Me=r==null?void 0:r.activeFreeze)!=null&&Me.freezeResumesAt?`Resumes on ${new Date(r.activeFreeze.freezeResumesAt).toLocaleDateString()}`:"Paused indefinitely - resume anytime":d?`${v} days remaining`:o?m==="annual"?`$${(t==null?void 0:t.annualPriceSelected)||(p?s==null?void 0:s.premiumAnnualPrice:s==null?void 0:s.annualPriceMin)||(p?279:100)}/year`:`$${p?(s==null?void 0:s.premiumMonthlyPrice)||29:(s==null?void 0:s.monthlyPrice)||10}/month`:"Start your subscription today"})]}),e.jsx(u,{variant:P?"secondary":n?"destructive":d?"secondary":o?"default":"outline",className:P?"animate-pulse":"",children:P?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin h-3 w-3 border border-current border-t-transparent rounded-full mr-1"}),"Resuming..."]}):n?"Paused":d?"Trial":o?(t==null?void 0:t.subscriptionStatus)==="active"?"Active":"Paused":"Inactive"})]}),!n&&o&&(t==null?void 0:t.subscriptionEndDate)&&e.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx(Re,{className:"h-4 w-4 text-green-600"}),e.jsx("span",{className:"font-medium text-green-800 dark:text-green-200",children:"Next Billing Date"})]}),e.jsx("p",{className:"text-green-700 dark:text-green-300",children:new Date(t.subscriptionEndDate).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),n&&((Te=r==null?void 0:r.activeFreeze)==null?void 0:Te.creditAmount)&&as==="annual"&&e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx(us,{className:"h-4 w-4 text-blue-600"}),e.jsx("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:"Available Credit"})]}),e.jsxs("p",{className:"text-blue-700 dark:text-blue-300",children:["$",r.activeFreeze.creditAmount," ","available for future subscription"]})]}),n&&e.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg border border-yellow-200 dark:border-yellow-800",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx(Z,{className:"h-4 w-4 text-yellow-600"}),e.jsx("span",{className:"font-medium text-yellow-800 dark:text-yellow-200",children:"Subscription Paused"})]}),e.jsxs("p",{className:"text-yellow-700 dark:text-yellow-300",children:["Your subscription has been paused since"," ",($e=r==null?void 0:r.activeFreeze)!=null&&$e.freezeStartedAt?new Date(r.activeFreeze.freezeStartedAt).toLocaleDateString():"recently",".",((Ce=r==null?void 0:r.activeFreeze)==null?void 0:Ce.reason)&&e.jsxs("span",{className:"block mt-1",children:[e.jsx("strong",{children:"Reason:"})," ",r.activeFreeze.reason]})]}),e.jsx(l,{onClick:()=>R("plans"),className:"mt-3 bg-yellow-600 hover:bg-yellow-700",size:"sm",children:"Manage Subscription"})]}),d&&!n&&e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx(_,{className:"h-4 w-4 text-blue-600"}),e.jsx("span",{className:"font-medium text-blue-800 dark:text-blue-200",children:"Trial Status"})]}),e.jsxs("p",{className:"text-blue-700 dark:text-blue-300",children:["Your free trial expires in ",v," days"]}),e.jsx(l,{onClick:()=>R("plans"),className:"mt-3 bg-blue-600 hover:bg-blue-700",size:"sm",children:"Upgrade Now"})]})]})})]}),e.jsxs(T,{children:[e.jsx($,{children:e.jsx(C,{className:"text-sm font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide",children:"Qu
6ick Actions"})}),e.jsxs(E,{className:"space-y-3",children:[e.jsxs(l,{onClick:()=>R("plans"),variant:"outline",className:"w-full justify-start",children:[e.jsx(Le,{className:"h-4 w-4 mr-2"}),"Change Plan"]}),e.jsxs(l,{onClick:()=>R("history"),variant:"outline",className:"w-full justify-start",children:[e.jsx(We,{className:"h-4 w-4 mr-2"}),"View Billing History"]}),e.jsxs(l,{onClick:()=>R("payment"),variant:"outline",className:"w-full justify-start",children:[e.jsx(_e,{className:"h-4 w-4 mr-2"}),"Manage Payment Methods"]}),(t==null?void 0:t.subscriptionStatus)==="active"&&e.jsxs(l,{onClick:Y,disabled:c,variant:"outline",className:"w-full justify-start",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),c?"Opening...":"Billing Portal"]})]})]})]})}),e.jsx(G,{value:"plans",className:"space-y-6",children:e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[d&&v!==null&&!n&&e.jsxs(O,{className:"border-blue-200 bg-blue-50 dark:bg-blue-900/20",children:[e.jsx(_,{className:"h-4 w-4 text-blue-600"}),e.jsxs(z,{className:"text-blue-800 dark:text-blue-200",children:[e.jsxs("strong",{children:[v," days"]})," left on your free trial â choose a plan below to continue uninterrupted access."]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 items-stretch",children:[e.jsxs("div",{className:`relative flex flex-col rounded-xl border-2 transition-all duration-200 ${w?"border-green-500 bg-green-50/40 dark:bg-green-900/10":"border-border hover:border-green-300 hover:shadow-md bg-card"}`,children:[w&&e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:e.jsx(u,{className:`text-white px-3 py-0.5 text-xs ${n?"bg-orange-500":"bg-green-600"}`,children:n?"Paused":"Current Plan"})}),e.jsxs("div",{className:"p-5 pb-4 border-b border-border",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"Shield Essential"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",(s==null?void 0:s.monthlyPrice)||10]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["or $",(s==null?void 0:s.annualPriceMin)||100,"/yr"]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"Track hours, stay organized, and generate audit-ready reports."})]})]}),e.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[e.jsx("ul",{className:"space-y-2.5 flex-grow text-sm",children:["Smart time tracking with AI","Audit-ready documentation","Gmail & Calendar sync","Voice-to-text logging","CSV & evidence exports","Analytics dashboard","REST API â connect your tools"].map((a,i)=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(Fe,{className:"h-4 w-4 text-green-500 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:a})]},i))}),e.jsxs("div",{className:"mt-5 space-y-2",children:[(()=>{const a=w&&m==="monthly";return e.jsx(l,{onClick:()=>k("monthly"),disabled:c||a,variant:a?"default":"outline",className:`w-full text-sm ${a?"bg-green-600 hover:bg-green-700 text-white":"border-green-600 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20"}`,children:c?"Processing...":a?"Current (Monthly)":`Monthly â $${(s==null?void 0:s.monthlyPrice)||10}/mo`})})(),(()=>{const a=w&&m==="annual",i=(s==null?void 0:s.annualPriceMin)||100;return e.jsx(l,{onClick:()=>k("annual"),disabled:c||a,className:"w-full text-sm bg-green-600 hover:bg-green-700 text-white",children:c?"Processing...":a?"Current (Annual)":`Annual â $${i}/yr`})})()]})]})]}),e.jsxs("div",{className:`relative flex flex-col rounded-xl border-2 transition-all duration-200 ${f?"border-green-500 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/20 dark:to-blue-900/20":"border-green-200 hover:border-green-400 hover:shadow-md bg-gradient-to-br from-green-50/50 to-blue-50/50 dark:from-green-900/10 dark:to-blue-900/10"}`,children:[e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:f?e.jsx(u,{className:`text-white px-3 py-0.5 text-xs flex items-center gap-1 ${n?"bg-orange-500":"bg-green-600"}`,children:n?"Paused":"Current Plan"}):e.jsxs(u,{className:"bg-green-600 text-white px-3 py-0.5 text-xs flex items-center gap-1",children:[e.jsx(De,{className:"h-3 w-3"}),"Most Popular"]})}),e.jsxs("div",{className:"p-5 pb-4 border-b border-green-200 dark:border-green-700 pt-7",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-green-700 dark:text-green-400 mb-1",children:"Shield Advisor"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",(s==null?void 0:s.premiumMonthlyPrice)||29]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),e.jsxs("p",{className:"text-xs text-green-600 dark:text-green-400 font-medium",children:["or $",(s==null?void 0:s.premiumAnnualPrice)||279,"/yr (save $",((s==null?void 0:s.premiumMonthlyPrice)||29)*12-((s==null?void 0:s.premiumAnnualPrice)||279),")"]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:"AI advisor + audit scoring â know
6where you stand before the IRS does."})]})]}),e.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[e.jsx("p",{className:"text-xs font-semibold text-green-700 dark:text-green-400 mb-2.5 uppercase tracking-wide",children:"Everything in Shield Essential, plus:"}),e.jsx("ul",{className:"space-y-2.5 flex-grow text-sm",children:["AI Tax Advisor â ask REPS questions, get answers with IRS citations","Audit readiness score â know your risk before the IRS does","Personalized analysis based on your properties & hours","Full API Integration â build custom workflows and sync with your CPA's tools","Priority support from our team"].map((a,i)=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"flex items-center justify-center h-5 w-5 rounded-full bg-yellow-400 flex-shrink-0 mt-0.5",children:e.jsx(Ie,{className:"h-3 w-3 text-white"})}),e.jsx("span",{children:a})]},i))}),e.jsxs("div",{className:"mt-5 space-y-2",children:[(()=>{const a=f&&m==="monthly";return e.jsx(l,{onClick:()=>k("monthly",void 0,"premium"),disabled:c||a,variant:"outline",className:`w-full text-sm ${a?"bg-green-600 hover:bg-green-700 text-white border-green-600":"border-green-300 text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20"}`,children:c?"Processing...":a?"Current (Monthly)":`Monthly â $${(s==null?void 0:s.premiumMonthlyPrice)||29}/mo`})})(),(()=>{const a=f&&m==="annual";return e.jsx(l,{onClick:()=>k("annual",(s==null?void 0:s.premiumAnnualPrice)||279,"premium"),disabled:c||a,className:`w-full text-sm bg-green-600 hover:bg-green-700 text-white ${a?"opacity-80":""}`,children:c?"Processing...":a?"Current (Annual)":`Annual â $${(s==null?void 0:s.premiumAnnualPrice)||279}/yr`})})()]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(T,{children:[e.jsx($,{children:e.jsx(C,{className:"text-sm font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide",children:"Subscription Details"})}),e.jsx(E,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Status"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${n?"bg-red-500":d?"bg-blue-500":(t==null?void 0:t.subscriptionStatus)==="active"?"bg-green-500":"bg-gray-400"}`}),e.jsx("span",{className:"font-medium",children:n?"Paused":d?"Trial":(t==null?void 0:t.subscriptionStatus)==="active"?"Active":"Inactive"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Billing Currency"}),e.jsx("p",{className:"font-medium",children:"USD ($)"})]}),(t==null?void 0:t.subscriptionStatus)==="active"&&!n&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Next Payment"}),e.jsxs("p",{className:"font-medium",children:["$",m==="annual"?p?(t==null?void 0:t.annualPriceSelected)||(s==null?void 0:s.premiumAnnualPrice)||279:(t==null?void 0:t.annualPriceSelected)||(s==null?void 0:s.annualPriceMin)||100:p?(s==null?void 0:s.premiumMonthlyPrice)||29:(s==null?void 0:s.monthlyPrice)||10,".00"]})]})]})})]}),e.jsxs(T,{children:[e.jsx($,{children:e.jsx(C,{className:"text-sm font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide",children:"Subscription Management"})}),e.jsxs(E,{className:"space-y-3",children:[Ze?e.jsxs(l,{variant:"outline",className:"w-full",disabled:!0,children:[e.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-gray-400 border-t-transparent rounded-full mr-2"}),"Loading..."]}):r!=null&&r.freezeActive?e.jsx(l,{onClick:()=>{ue()},disabled:P,className:"w-full bg-green-600 hover:bg-green-700 text-white",children:P?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full mr-2"}),"Resuming..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ke,{className:"h-4 w-4 mr-2"}),ne&&le?`Convert Credits to ${le} Months Service`:"Resume Subscription"]})}):e.jsx("div",{className:"space-y-3",children:ne&&y&&e.jsx("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-lg text-sm",children:e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(ce,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-amber-800",children:"Subscription
6Expired During Pause"}),e.jsxs("p",{className:"text-amber-700 mt-1",children:["Your subscription expired on"," ",new Date((t==null?void 0:t.subscriptionEndDate)||"").toLocaleDateString(),". When you resume, your $",y.creditAmount," credit will provide ",le," months of service at the monthly rate."]})]})]})})}),r!=null&&r.canFreeze?e.jsxs(V,{open:ye,onOpenChange:F,children:[e.jsx(He,{asChild:!0,children:e.jsxs(l,{variant:"outline",className:"w-full border-yellow-400 text-yellow-700 hover:bg-yellow-50",children:[e.jsx(Z,{className:"h-4 w-4 mr-2"}),"Pause Subscription"]})}),e.jsxs(q,{className:"sm:max-w-[425px]",children:[e.jsx(K,{children:e.jsx(W,{children:"Pause my subscription"})}),e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground mb-4",children:[e.jsx("div",{children:"Need to take a break for whatever reason, but don't want us to delete your data? You can pause your subscription indefinitely."}),N==="annual_plan_variable"&&y&&e.jsxs("div",{children:["You will be credited"," ",e.jsxs("strong",{className:"text-foreground",children:["$",y.creditAmount]})," ","for unused time starting from"," ",y.nextMonthStart?new Date(y.nextMonthStart).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"next month"," ","through"," ",t!=null&&t.subscriptionEndDate?new Date(t.subscriptionEndDate).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"your subscription end date",". You may use this towards future subscription dues whenever you're ready to come back!"]}),N==="monthly_plan"&&e.jsxs("div",{children:["Your monthly billing will stop immediately. Your current billing period will remain active until"," ",t!=null&&t.subscriptionEndDate?new Date(t.subscriptionEndDate).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"the end of your current period","."]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(M,{htmlFor:"modalReason",children:"Reason for pausing (optional)"}),e.jsx(de,{id:"modalReason",placeholder:"e.g., Vacation, temporary break, etc.",value:he,onChange:a=>ge(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(M,{htmlFor:"modalResumeDate",children:"Auto-resume date (optional)"}),e.jsx(hs,{id:"modalResumeDate",type:"date",value:be,onChange:a=>pe(a.target.value),min:new Date().toISOString().split("T")[0]}),e.jsx("div",{className:"text-xs text-gray-500",children:"Leave empty to manually resume later"})]})]})}),e.jsxs(Ve,{className:"gap-3",children:[e.jsx(l,{onClick:()=>F(!1),variant:"outline",className:"flex-1 bg-orange-400 hover:bg-orange-500 text-white border-orange-400 hover:border-orange-500",children:"CANCEL"}),e.jsx(l,{onClick:async()=>{F(!1),ge(""),pe(""),await new Promise(a=>setTimeout(a,200)),xe({reason:he||void 0,resumeDate:be||void 0})},disabled:D,className:"flex-1 bg-green-600 hover:bg-green-700 text-white",children:D?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full mr-2"}),"PAUSING..."]}):e.jsx(e.Fragment,{children:N==="annual_plan_variable"&&y?`CLAIM $${y.creditAmount} CREDIT & PAUSE`:"PAUSE SUBSCRIPTION"})})]})]})]}):e.jsxs(l,{variant:"outline",className:"w-full border-gray-300 text-gray-500",disabled:!0,children:[e.jsx(Z,{className:"h-4 w-4 mr-2"}),"Pause Not Available"]}),e.jsxs(V,{open:je,onOpenChange:I,children:[e.jsx(He,{asChild:!0,children:e.jsxs(l,{variant:"destructive",className:"w-full",children:[e.jsx(Be,{className:"h-4 w-4 mr-2"}),"Cancel Account"]})}),e.jsxs(q,{className:"sm:max-w-[500px]",children:[e.jsx(K,{children:e.jsx(W,{children:"Account Cancellation"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-4 border border-red-200 bg-red-50 dark:bg-red-900/20 rounded-lg",children:e.jsxs("p",{className:"text-sm text-red-800 dark:text-red-200",children:["Please confirm that you'd like to delete your REP Tracker account and all associated data.",e.jsxs("strong",{children:[" ","Your data will be purged and unrecoverable within 48 hours."]})]})}),te&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"All properties and data you own (listed below) will be deleted as well, including those in collaboration with others. Properties you do not own will not be affected."}),e.jsx("div",{className:"max-h-24 overflow-y-auto bg-gray-50 dark:bg-gray-900 rounded p-2",children:e.jsx("ul",{className:"text-xs space-y-1",children:te.map(a=>e.jsxs("li",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"w-2 h-2 bg-red-500 rounded-full"}),e.jsx("span",{children:a.nickname||a.address})]},a.id))})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"We would appreciate it if you could spare a moment to let us know why you're canceling or what we could improve on!"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(M,{htmlFor:"cancelReason",children:"Which statement do you agree with the most?"}),e.jsxs(Ue,{value:J,onValueChange:X,children:[e.jsx(Ye,{children:e.jsx(Oe,{placeholder:"Select a reason"})}),e.jsxs(ze,{children:[e.jsx(b,{value:"too-expensive",children:"Too expensive"}),e.jsx(b,{value:"not-enough-features",children:"Not enough features"}),e.jsx(b,{value:"found-alternative",children:"Found a better alternative"}),e.jsx(b,{value:"no-longer-needed",children:"No longer need the service"}),e.jsx(b,{value:"difficult-to-use",children:"Difficult to use"}),e.jsx(b,{value:"technical-issues",children:"Too many technical issues"}),e.jsx(b,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(M,{htmlFor:"cancelDetails",children:"Please provide more details (optional)"}),e.jsx(de,{id:"cancelDetails",placeholder:"Tell us more about your experience or what we could improve...",value:ee,onChange:a=>se(a.target.value),rows:3})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(gs,{id:"newsletter",checked:Ne,onCheckedChange:we}),e.jsx(M,{htmlFor:"newsletter",className:"text-sm",children:"KEEP ME ON THE NEWSLETTER FOR LATEST UPDATES"})]})]})]}),e.jsxs(Ve,{className:"gap-3",children:[e.jsx(l,{onClick:()=>I(!1),variant:"outline",className:"flex-1 bg-orange-400 hover:bg-orange-500 text-white border-orange-400 hover:border-orange-500",children:"CANCEL"}),e.jsx(l,{onClick:Se,disabled:U,className:"flex-1 bg-red-600 hover:bg-red-700 text-white",children:U?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent roun
6ded-full mr-2"}),"DELETING..."]}):"DELETE MY ACCOUNT"})]})]})]})]})]}),(r==null?void 0:r.freezeHistory)&&r.freezeHistory.length>0&&e.jsxs(T,{children:[e.jsxs($,{children:[e.jsxs(C,{className:"flex items-center space-x-2",children:[e.jsx(_,{className:"h-5 w-5 text-gray-500"}),e.jsx("span",{children:"Pause History"})]}),e.jsx(me,{children:"Your recent subscription pauses"})]}),e.jsx(E,{children:e.jsx("div",{className:"space-y-3",children:r.freezeHistory.slice(0,3).map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg bg-gray-50 dark:bg-gray-900",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(u,{variant:a.status==="active"?"default":"secondary",children:a.status}),e.jsx("span",{className:"text-sm text-gray-600",children:new Date(a.freezeStartedAt).toLocaleDateString()})]}),a.reason&&e.jsx("p",{className:"text-xs text-gray-500",children:a.reason})]}),e.jsx("div",{className:"text-right text-xs text-gray-500",children:a.freezeResumesAt?e.jsxs(e.Fragment,{children:["Resumed:"," ",new Date(a.freezeResumesAt).toLocaleDateString()]}):a.status==="active"?"Active":"Manual"})]},a.id))})})]})]})]})}),e.jsx(G,{value:"history",className:"space-y-6",children:e.jsxs(T,{children:[e.jsxs($,{children:[e.jsxs(C,{className:"flex items-center space-x-2",children:[e.jsx("span",{children:"Billing History"}),e.jsx(u,{variant:"secondary",children:"Coming Soon"})]}),e.jsx(me,{children:"Advanced billing history and invoice management features are in development"})]}),e.jsx(E,{children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx(We,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Enhanced Billing History"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"We're building advanced billing history features including detailed invoice management, payment tracking, and downloadable reports."}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-600 dark:text-gray-400",children:[e.jsx("p",{children:"â Detailed invoice history"}),e.jsx("p",{children:"â PDF invoice downloads"}),e.jsx("p",{children:"â Payment method tracking"}),e.jsx("p",{children:"â Billing analytics"})]}),e.jsx("div",{className:"mt-6",children:e.jsxs(l,{onClick:Y,disabled:c,variant:"outline",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),"View Current Billing in Stripe Portal"]})})]})})]})}),e.jsx(G,{value:"payment",className:"space-y-6",children:e.jsxs(T,{children:[e.jsxs($,{children:[e.jsxs(C,{className:"flex items-center space-x-2",children:[e.jsx("span",{children:"Payment Methods"}),e.jsx(u,{variant:"secondary",children:"Coming Soon"})]}),e.jsx(me,{children:"Enhanced payment method management and billing features are in development"})]}),e.jsx(E,{children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx(_e,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Advanced Payment Management"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"We're developing comprehensive payment method management features for enhanced security and convenience."}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-600 dark:text-gray-400",children:[e.jsx("p",{children:"â Multiple payment method support"}),e.jsx("p",{children:"â Automatic backup payment methods"}),e.jsx("p",{children:"â Payment method security verification"}),e.jsx("p",{children:"â Billing address management"})]}),e.jsx("div",{className:"mt-6",children:e.jsxs(l,{onClick:Y,disabled:c,variant:"outline",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),"Manage Current Payment Methods in Stripe Portal"]})})]})})]})})]})]}),B&&e.jsx(bs,{isOpen:B!==null,onClose:()=>ve(null),targetPriceType:B.priceType,targetTier:B.tier,onSuccess:()=>{ae.invalidateQueries({queryKey:["/api/subscription/status"]}),g({title:"Subscription Updated",description:"Your plan has been changed successfully."})}})]})}export{Cs 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.