PageSourceSearch

https://genesissa.com/_nuxt/BI2v_4Ch.js

js genesissa.com collected 2026-10-02 01:30:31 UTC 12,246 bytes, 1 lines download raw bytes

1import{M as L,cd as O,bU as U,c3 as q,b7 as R,x as i,u as t,a_ as w,bO as a,bE as e,H as f,w as c,b as G,bo as H,v as J,B as l,cu as K,bm as m,s as Q,bc as d}from"./BqRK_f-2.js";import{u as W}from"./C30BMck9.js";import{u as X}from"./DyTmvOMJ.js";import{r as Y}from"./DJOCsDZD.js";import{r as Z}from"./COXRqoIH.js";import{r as tt}from"./xVg5lwfs.js";import{r as et}from"./PYv6ZgKr.js";import{r as at}from"./Cd9l05fp.js";import{r as st}from"./BFYdUNtr.js";const rt={class:"assinatura-page min-h-screen"},ot={class:"mb-6 flex items-end justify-between gap-3"},nt={class:"min-w-0"},dt={class:"mt-0.5 text-sm text-[var(--muted)]"},it={key:0,class:"flex items-center justify-center py-12"},lt={key:1,class:"dashboard-card rounded-2xl p-8 text-center"},ct={class:"text-2xl font-bold text-[var(--text)] mb-2"},ut={class:"text-sm text-[var(--muted)] mb-6"},vt={key:2,class:"space-y-6"},mt={class:"rounded-2xl border border-[var(--border)] p-6 text-white shadow-[var(--shadow)]",style:{background:"var(--brand-gradient)"}},xt={class:"flex items-start justify-between mb-4"},bt={class:"text-2xl font-bold mb-1"},pt={class:"text-white/80"},_t={class:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold bg-white/25 text-white border border-white/40"},ft={class:"grid grid-cols-2 gap-4"},ht={class:"text-white/80 text-sm mb-1"},gt={class:"text-2xl font-bold"},yt={class:"text-sm text-white/80"},wt={class:"text-white/80 text-sm mb-1"},kt={class:"text-lg font-semibold"},Ct={class:"dashboard-card rounded-2xl p-4 md:p-6"},At={class:"text-lg font-bold text-[var(--text)] mb-4"},$t={class:"space-y-0"},jt={class:"flex justify-between py-3 border-b border-[var(--border)]"},zt={class:"text-sm text-[var(--muted)]"},Dt={class:"text-sm font-semibold text-[var(--text)]"},Et={class:"flex justify-between py-3 border-b border-[var(--border)]"},Vt={class:"text-sm text-[var(--muted)]"},St={class:"text-sm font-semibold text-[var(--text)]"},Mt={class:"flex justify-between py-3 border-b border-[var(--border)]"},Pt={class:"text-sm text-[var(--muted)]"},Tt={class:"text-sm font-semibold text-[var(--text)]"},Bt={class:"flex justify-between py-3 border-b border-[var(--border)]"},Nt={class:"text-sm text-[var(--muted)]"},It={key:0,class:"flex justify-between py-3"},Ft={class:"text-sm text-[var(--muted)]"},Lt={class:"text-sm font-semibold text-[var(--text)]"},Ot={class:"dashboard-card rounded-2xl p-4 md:p-6"},Ut={class:"text-lg font-bold text-[var(--text)] mb-4"},qt={class:"grid grid-cols-1 md:grid-cols-2 gap-3"},Rt={class:"text-sm text-[var(--text)]"},Gt={class:"dashboard-card rounded-2xl p-4 md:p-6"},Ht={class:"text-lg font-bold text-[var(--text)] mb-4"},Jt={class:"space-y-3"},Kt=["disabled"],Qt={key:1,class:"animate-spin h-5 w-5 border-2 border-white border-t-transparent rounded-full"},Wt={key:0,class:"mt-4 rounded-xl border border-[var(--status-warning)]/30 bg-[var(--status-warning)]/10 p-4"},Xt={class:"text-sm font-bold text-[var(--text)] mb-1"},Yt={class:"text-sm text-[var(--muted)] mb-3"},Zt={class:"text-[var(--text)]"},te=["disabled"],ee={key:0,class:"animate-spin h-3.5 w-3.5 border-2 border-current border-t-transparent rounded-full"},ae={key:1,class:"mt-4 pt-3 border-t border-[var(--border)]"},se={key:0,class:"mt-3"},re=["disabled"],oe={key:0,class:"animate-spin h-3.5 w-3.5 border-2 border-current border-t-transparent rounded-full"},ne={class:"rounded-xl border border-[var(--accent)]/30 bg-[var(--accent)]/10 p-4"},de={class:"flex items-start gap-3"},ie={class:"text-sm text-[var(--text)]"},le={class:"font-bold mb-1"},ce={class:"text-[var(--muted)]"},ue={class:"dashboard-card rounded-2xl max-w-md w-full p-6"},ve={class:"text-xl font-bold text-[var(--text)] mb-4"},me={class:"text-sm text-[var(--muted)] mb-6"},xe={key:0},be={class:"text-[var(--text)]"},pe={class:"flex gap-2"},_e=["disabled"],ze=L({__name:"gerenciar",setup(fe){const{tn:s}=O(),{minhaAssinatura:j,cancelarAssinatura:z,reativarAssinatura:D,atualizarAssinatura:E,formatarValor:k,formatarPeriodicidade:C,isLoading:V}=W(),A=U(),{isMarketing:S}=q(),{pageTitleClass:M}=X(),x=m(!1),u=m(!1),b=m(!1),p=m(!1),h=m(!1),g=m(void 0),o=Q(()=>g.value!==void 0?g.value:A.user?.assinatura?.assinatura??null),y=async()=>{try{const r=await j();g.value=r,await A.refreshUser()}catch(r){console.error("Erro ao carregar assinatura:",r),g.value=null}},P=async()=>{x.value=!0;try{await E(),await y()}catch(r){console.error("Erro ao atualizar dados:",r)}finally{x.value=!1}},T=()=>{p.value=!0},B=async()=>{u.value=!0;try{await z(),p.value=!1,await y()}catch(r){console.error("Erro ao cancelar assinatura:",r),alert("Erro ao cancelar assinatura. Tente novamente.")}finally{u.value=!1}},N=async()=>{b.value=!0;try{await D(),await y()}catch(r){console.error("Erro ao desfazer o cancelamento:",r),alert(r?.response?.data?.message||"Não foi possível desfazer o cancelamento. Tente novamente.")}finally{b.value=!1}},_=r=>{if(!r)return"-";const n=new Date(r);return new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"}).format(n)},I=r=>({ativa:"bg-[color-mix(in_srgb,var(--status-success)_20%,transparent)] text-[var(--status-success)] border border-[color-mix(in_srgb,var(--status-success)_30%,transparent)]",cancelada:"bg-[color-mix(in_srgb,var(--status-danger)_20%,transparent)] text-[var(--status-danger)] border border-[color-mix(in_srgb,var(--status-danger)_30%,transparent)]",suspensa:"bg-[color-mix(in_srgb,var(--status-warning)_20%,transparent)] text-[var(--status-warning)] border border-[color-mix(in_srgb,var(--status-warning)_30%,transparent)]",expirada:"bg-[var(--surface-2)] text-[var(--muted)] border border-[var(--border)]",aguardando_pagamento:"bg-[var(--accent)]/20 text-[var(--accent)] border border-[var(--accent)]/30"})[r]||"bg-[var(--surface-2)] text-[var(--muted)] border border-[var(--border)]",$=r=>({ativa:"Ativa",cancelada:"Cancelada",suspensa:"Suspensa",expirada:"Expirada",aguardando_pagamento:"Aguardando Pagamento"})[r]||r;return R(()=>{y()}),(r,n)=>(d(),i("div",rt,[t("div",{class:w(a(S)?"w-full":"max-w-[1320px] mx-auto px-4 md:px-6 py-4")},[t("header",ot,[t("div",nt,[t("h1",{class:w(a(M)??"text-xl md:text-2xl font-bold text-[var(--text)] tracking-tight")},e(a(s)("Gerenciar Assinatura")),3),t("p",dt,e(a(s)("Detalhes do plano e ações da sua conta")),1)]),t("button",{onClick:n[0]||(n[0]=v=>r.$router.back()),class:"shrink-0 p-2 rounded-xl text-[var(--muted)] hover:text-[var(--text)] hover:bg-[var(--surface-2)] transition duration-200"},[f(a(Y),{class:"w-5 h-5"})])]),a(V)?(d(),i("div",it,[...n[6]||(n[6]=[t("div",{class:"animate-spin rounded-full h-12 w-12 border-4 border-[var(--accent)] border-t-transparent"},null,-1)])])):o.value?(d(),i("div",vt,[t("div",mt,[t("div",xt,[t("div",null,[t("h2",bt,e(o.value.plano.nome),1),t("p",pt,e(o.value.plano.codigo),1)]),t("span",_t,e($(o.value.status)),1)]),t("div",ft,[t("div",null,[t("p",ht,e(a(s)("Valor")),1),t("p",gt,e(a(k)(o.value.valor)),1),t("p",yt,e(a(C)(o.value.periodicidade)),1)]),t("div",null,[t("p",wt,e(a(s)("Próxima Cobrança")),1),t("p",kt,e(_(o.value.data_proxima_cobranca)),1)])])]),t("div",Ct,[t("h3",At,e(a(s)("Detalhes da Assinatura")),1
1),t("div",$t,[t("div",jt,[t("span",zt,e(a(s)("Data de Início")),1),t("span",Dt,e(_(o.value.data_inicio)),1)]),t("div",Et,[t("span",Vt,e(a(s)("Periodicidade")),1),t("span",St,e(a(C)(o.value.periodicidade)),1)]),t("div",Mt,[t("span",Pt,e(a(s)("Valor")),1),t("span",Tt,e(a(k)(o.value.valor)),1)]),t("div",Bt,[t("span",Nt,e(a(s)("Status")),1),t("span",{class:w(["inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold",I(o.value.status)])},e($(o.value.status)),3)]),o.value.data_fim?(d(),i("div",It,[t("span",Ft,e(a(s)("Data de Término")),1),t("span",Lt,e(_(o.value.data_fim)),1)])):c("",!0)])]),t("div",Ot,[t("h3",Ut,e(a(s)("Funcionalidades Incluídas")),1),t("div",qt,[(d(!0),i(G,null,H(o.value.plano.funcionalidades,(v,F)=>(d(),i("div",{key:F,class:"flex items-center gap-3"},[f(a(st),{class:"w-5 h-5 text-[var(--status-success)] flex-shrink-0"}),t("span",Rt,e(v),1)]))),128))])]),t("div",Gt,[t("h3",Ht,e(a(s)("Ações")),1),t("div",Jt,[t("button",{onClick:P,disabled:x.value,class:"btn-primary-gradient w-full inline-flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-semibold transition duration-200 disabled:opacity-45 disabled:cursor-not-allowed"},[x.value?(d(),i("span",Qt)):(d(),J(a(tt),{key:0,class:"w-5 h-5"})),l(" "+e(x.value?"Atualizando...":"Atualizar Informações"),1)],8,Kt),t("button",{onClick:n[2]||(n[2]=v=>r.$router.push("/assinatura/planos")),class:"w-full py-2.5 rounded-xl text-sm font-semibold border border-[var(--border)] text-[var(--text)] hover:bg-[var(--surface-2)] transition duration-200"},e(a(s)("Ver Outros Planos")),1)]),o.value.cancelamento_agendado_para?(d(),i("div",Wt,[t("p",Xt,e(a(s)("Cancelamento agendado")),1),t("p",Yt,[l(e(a(s)("Sua assinatura não será renovada, e você continua com acesso completo até"))+" ",1),t("strong",Zt,e(_(o.value.cancelamento_agendado_para)),1),l(" "+e(a(s)(". Até lá, dá pra voltar atrás.")),1)]),t("button",{onClick:N,disabled:b.value,class:"inline-flex items-center gap-1.5 py-2 px-3 rounded-xl text-xs font-semibold border border-[var(--border)] text-[var(--text)] hover:bg-[var(--surface-2)] transition duration-200 disabled:opacity-45 disabled:cursor-not-allowed"},[b.value?(d(),i("span",ee)):c("",!0),l(" "+e(b.value?"Desfazendo...":"Manter minha assinatura"),1)],8,te)])):c("",!0),o.value.status==="ativa"&&!o.value.cancelamento_agendado_para?(d(),i("div",ae,[t("button",{onClick:n[3]||(n[3]=v=>
1h.value=!h.value),class:"inline-flex items-center gap-1 text-xs font-medium text-[var(--subtle)] hover:text-[var(--muted)] transition duration-200"},[f(a(et),{class:w(["h-3.5 w-3.5 transition-transform duration-200",h.value?"rotate-90":""])},null,8,["class"]),l(" "+e(a(s)("Mais opções")),1)]),h.value?(d(),i("div",se,[t("button",{onClick:T,disabled:u.value,class:"inline-flex items-center gap-1.5 text-xs font-medium text-[var(--subtle)] hover:text-[var(--status-danger)] underline-offset-4 hover:underline transition duration-200 disabled:opacity-45 disabled:cursor-not-allowed"},[u.value?(d(),i("span",oe)):c("",!0),l(" "+e(u.value?"Cancelando...":"Cancelar assinatura"),1)],8,re)])):c("",!0)])):c("",!0)]),t("div",ne,[t("div",de,[f(a(at),{class:"w-6 h-6 text-[var(--accent)] flex-shrink-0 mt-0.5"}),t("div",ie,[t("p",le,e(a(s)("Importante")),1),t("p",ce,e(a(s)("Ao cancelar, sua assinatura deixa de ser renovada — mas você continua usando o sistema normalmente até o fim do período já pago. Enquanto esse período não acabar, dá pra desfazer o cancelamento.")),1)])])])])):(d(),i("div",lt,[f(a(Z),{class:"w-16 h-16 text-[var(--subtle)] mx-auto mb-4"}),t("h2",ct,e(a(s)("Nenhuma Assinatura Ativa")),1),t("p",ut,e(a(s)("Você ainda não possui uma assinatura. Assine agora e tenha acesso a todas as funcionalidades!")),1),t("button",{onClick:n[1]||(n[1]=v=>r.$router.push("/assinatura/planos")),class:"btn-primary-gradient inline-flex items-center justify-center rounded-xl px-4 py-2 text-sm font-semibold transition duration-200"},e(a(s)("Ver Planos Disponíveis")),1)])),p.value?(d(),i("div",{key:3,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60",onClick:n[5]||(n[5]=K(v=>p.value=!1,["self"]))},[t("div",ue,[t("h3",ve,e(a(s)("Confirmar Cancelamento")),1),t("p",me,[l(e(a(s)("Sua assinatura deixa de ser renovada. Você continua com acesso completo até o fim do período que já pagou"))+" ",1),o.value?.data_proxima_cobranca?(d(),i("span",xe,[l(e(a(s)(", em"))+" ",1),t("strong",be,e(_(o.value.data_proxima_cobranca)),1)])):c("",!0),l(" "+e(a(s)(", e pode voltar atrás até lá.")),1)]),t("div",pe,[t("button",{onClick:n[4]||(n[4]=v=>p.value=!1),class:"flex-1 py-2.5 rounded-xl text-sm font-semibold border border-[var(--border)] text-[var(--text)] hover:bg-[var(--surface-2)] transition duration-200"},e(a(s)("Manter Assinatura")),1),t("button",{onClick:B,disabled:u.value,class:"flex-1 py-2.5 rounded-xl text-sm font-semibold text-white bg-[var(--status-danger)] hover:opacity-90 disabled:opacity-45 disabled:cursor-not-allowed transition duration-200"},e(u.value?"Cancelando...":"Sim, Cancelar"),9,_e)])])])):c("",!0)],2)]))}});export{ze 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.