PageSourceSearch

https://drophighlight.com/assets/SubscriptionSettings-C4Vf1Zua.js

js drophighlight.com collected 2026-09-30 06:37:18 UTC 9,277 bytes, 6 lines download raw bytes

1import{p as R,u as H,aM as P,a as L,r as C,j as s,B as n,X as S,C as h,l as p,h as b,i as g,k as N,R as k,o as E,aG as A,S as B,E as I}from"./index-P0N1Je5T.js";import{a as M}from"./internationalization-ClDqWLdo.js";import{A as _,a as $}from"./alert-BjIlbniu.js";import{S as z}from"./sparkles-Xyayynck.js";import{P as T}from"./PageHeader-zjaF7toz.js";import{C as V}from"./credit-card-BnnMqcPE.js";import{C as r}from"./circle-check-big-DjwoMmiM.js";import{C as F}from"./calendar-D19SFwpy.js";import{C as q}from"./circle-alert-CrhXFnHf.js";/**
2 * @license lucide-react v0.462.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 v=R("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]),G=({variant:e="banner",className:d=""})=>{const{user:t}=H(),{subscriptionData:i,createCheckout:a,loading:c}=P(),{t:l}=L(),[j,m]=C.useState(!1);C.useEffect(()=>{const u=localStorage.getItem("subscription-reminder-dismissed"),f=Date.now()-6*60*60*1e3;u&&parseInt(u)>f&&m(!0)},[]);const o=()=>{m(!0),localStorage.setItem("subscription-reminder-dismissed",Date.now().toString())},x=async()=>{await a("professional")};return!t||j||i&&i.subscribed?null:e==="banner"?s.jsxs(_,{className:`border-primary/50 bg-gradient-to-r from-primary/10 to-accent/10 ${d}`,children:[s.jsx(v,{className:"h-4 w-4 text-primary"}),s.jsxs($,{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("span",{className:"font-medium",children:"Desbloqueie recursos premium para sua empresa!"}),s.jsxs(n,{size:"sm",onClick:x,disabled:c,className:"bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary/70",children:[s.jsx(z,{className:"h-3 w-3 mr-1"}),l(c?"admin.forms.processing":"subscription.upgrade")]})]}),s.jsx(n,{variant:"ghost",size:"sm",onClick:o,className:"h-6 w-6 p-0",children:s.jsx(S,{className:"h-3 w-3"})})]})]}):s.jsx(h,{className:`border-primary/20 bg-gradient-to-br from-primary/5 to-accent/5 ${d}`,children:s.jsx(p,{className:"p-6",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:s.jsx(v,{className:"h-6 w-6 text-primary"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"font-semibold text-lg",children:"Potencialize Seus Resultados"}),s.jsx("p",{className:"text-muted-foreground",children:"Acesse recursos avançados: analytics detalhado, branding personalizado, armazenamento ilimitado e muito mais."}),s.jsxs(n,{onClick:x,disabled:c,className:"bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary/70",children:[s.jsx(z,{className:"h-4 w-4 mr-2"}),l(c?"admin.forms.processing":"subscription.upgradeNow")]})]})]}),s.jsx(n,{variant:"ghost",size:"sm",onClick:o,className:"h-8 w-8 p-0",children:s.jsx(S,{className:"h-4 w-4"})})]})})})},D=()=>{var y;const{t:e,language:d}=L(),{user:t}=H(),{subscriptionData:i,loading:a,checkSubscription:c,openCustomerPortal:l}=P(),j=async()=>{await c()},m=async()=>{await l()},o=w=>w?M(w,d,{year:"numeric",month:"long",day:"numeric"}):"N/A",x=()=>a?s.jsx(k,{className:"h-5 w-5 animate-spin"}):i!=null&&i.subscribed?s.jsx(r,{className:"h-5 w-5 text-green-600"}):s.jsx(q,{className:"h-5 w-5 text-primary"}),u=()=>a?e("admin.subscription.checking"):i!=null&&i.subscribed?e("admin.subscription.status.active"):e("admin.subscription.status.inactive"),f=()=>a?"outline":i!=null&&i.subscribed?"default":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsx(T,{title:e("admin.subscription.title"),subtitle:e("admin.subscription.subtitle")}),s.jsxs(h,{children:[s.jsx(b,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(v,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx(g,{children:e("admin.subscription.subscriptionStatus")}),s.jsx(N,{children:e("admin.subscription.currentSubscriptionInfo")})]})]}),s.jsxs(n,{variant:"outline",size:"sm",onClick:j,disabled:a,children:[s.jsx(k,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),e("admin.subscription.refresh")]})]})}),s.jsxs(p,{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:e("admin.subscription.status.label")}),s.jsxs("div",{className:"flex items-center space-x-2",children:[x(),s.jsx(E,{variant:f(),children:u()})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:e("admin.subscription.plan.label")}),s.jsx("div",{className:"font-medium",children:(i==null?void 0:i.subscription_tier)||e("admin.subscription.plan.starter")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:i!=null&&i.subscribed?e("admin.subscription.nextRenewal"):e("admin.subscription.noSubscription")}),s.jsx("div",{className:"font-medium",children:i!=null&&i.subscribed?o(i.subscription_end):e("admin.subscription.upgradeForPremium")})]})]}),s.jsx(A,{}),s.jsx("div",{className:"flex flex-col sm:flex-row gap-4",children:i!=null&&i.subscribed?s.jsxs(n,{onClick:m,disabled:a,className:"flex items-center",children:[s.jsx(B,{className:"h-4 w-4 mr-2"}),e("admin.subscription.manageSubscription"),s.jsx(I,{className:"h-3 w-3 ml-2"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:e("admin.subscription.usingFreePlan")}),s.jsx(G,{variant:"card"})]})})]})]}),s.jsxs(h,{children:[s.jsxs(b,{children:[s.jsxs(g,{className:"flex items-center",children:[s.jsx(V,{className:"h-5 w-5 mr-2"}),e("admin.subscription.accountInfo")]}),s.jsx(N,{children:e("admin.subscription.accountInfoDesc")})]}),s.jsxs(p,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:e("admin.subscription.email")}),s.jsx("div",{className:"font-medium",children:t==null?void 0:t.email})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:e("admin.subscription.customerId")}),s.jsxs("div",{className:"font-mono text-sm",children:[(y=t==null?void 0:t.id)==null?void 0:y.slice(0,8),"..."]})]})]}),(i==null?void 0:i.subscribed)&&s.jsxs(s.Fragment,{children:[s.jsx(A,{}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-medium",children:e("admin.subscription.planFeatures")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[i.subscription_tier==="Professional"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.unlimitedPhotosVideos")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.storage50gb")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.customBranding")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.detailedAnalytics")]})]}),i.subscription_tier==="Enterprise"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.professionalFeatures")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.storage500gb")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.whiteLabel")]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(r,{className:"h-4 w-4 text-green-600 mr-2"}),e("admin.subscription.features.dedicatedSupport")]})]})]})]})]})]})]}),s.jsxs(h,{children:[s.jsxs(b,{children:[s.jsxs(g,{className:"flex items-center",children:[s.jsx(F,{className:"h-5 w-5 mr-2"}),e("admin.subscription.billingHistory")]}),s.jsx(N,{children:e("admin.subscription.billingHistoryDesc")})]}),s.jsx(p,{children:s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(F,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),s.jsx("p",{children:e("admin.subscription.billingHistoryNote")}),(i==null?void 0:i.subscribed)&&s.jsxs(n,{variant:"outline",className:"mt-4",onClick:m,disabled:a,children:[e("admin.subscription.viewFullHistory"),s.jsx(I,{className:"h-3 w-3 ml-2"})]})]})})]})]})};export{D as SubscriptionSettings};

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.