1import{u as M,y as F,aG as R,Q as D,bU as H,ai as U,o as V,at as j,ao as Y,c as n,h as t,t as s,g as o,e as c,j as q,F as p,m as _,k as w,w as k,B as S,i as z,C as G,a7 as O,n as Q,f as J,q as l,v as a,a8 as K}from"./CujwEPkh.js";const W={class:"min-h-screen bg-fh-ground px-4 py-10 sm:py-16"},X={class:"text-2xl font-bold text-gray-900 text-center mb-6"},Z={key:0,class:"bg-white rounded-3xl shadow-sm p-6 sm:p-8 text-center"},ee={class:"text-base font-semibold text-gray-900 mb-1"},te={class:"text-sm text-gray-600"},se={key:1,class:"flex items-center justify-center py-16"},ae={key:2,class:"bg-white rounded-3xl shadow-sm p-6 sm:p-8 text-center"},ne={class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-emerald-100 dark:bg-emerald-500/20"},oe={class:"text-lg font-bold text-gray-900 mb-1"},le={class:"text-sm text-gray-600 mb-3"},ie={class:"inline-flex items-center gap-1.5 rounded-full bg-amber-100 dark:bg-amber-400/15 px-3 py-1 text-xs font-semibold text-amber-800 dark:text-amber-200"},re={class:"text-lg font-bold text-gray-900 mb-1"},ce={class:"text-sm text-gray-600 mb-2"},ue={key:0,class:"text-xs text-gray-400 mb-5"},de={key:1,class:"mb-5"},me={key:0},pe={key:2,class:"mt-3 text-sm text-red-600 dark:text-red-300"},ye={__name:"index",setup(_e){const{t:C}=M(),b=F(),I=R(),$=K(),y=D(),{loading:x,error:f,goToStripe:P}=H(),u=U.isNativePlatform(),d=J(!0),i=l(()=>y.paywallStatus),h=l(()=>!!i.value?.subscription_status?.has_active_subscription),N=l(()=>i.value?.subscription_status?.plan_type==="Lifetime"),v=l(()=>i.value?.subscription_status?.seat_no??null),B=l(()=>i.value?.downloads_used??0),g=l(()=>i.value?.downloads_limit??null),L=l(()=>{const e=$?.public||{};return{monthly:e.BASIC_MONTHLY_PRICE_ID||"",yearly:e.BASIC_YEARLY_PRICE_ID||"",lifetime:e.LIFETIME_PRICE_ID||""}});function T(){P(L.value.yearly)}return V(async()=>{if(u){d.value=!1;return}if(!I.value?.id){await j({path:b("/signin"),query:{redirect:"/subscription"}});return}try{await y.fetchPaywallStatus()}finally{d.value=!1}}),Y({title:C("subscription.title")+" · FriendHike",meta:[{name:"robots",content:"noindex"}]}),(e,r)=>{const m=q,A=z,E=G;return a(),n("div",W,[t("div",{class:Q(["mx-auto w-full",h.value||o(u)?"max-w-md":"max-w-3xl"])},[t("h1",X,s(e.$t("subscription.title")),1),o(u)?(a(),n("div",Z,[t("p",ee,s(e.$t("paywall.nativeTitle")),1),t("p",te,s(e.$t("paywall.nativeSubtitle")),1)])):d.value?(a(),n("div",se,[...r[0]||(r[0]=[t("div",{class:"w-8 h-8 border-2 border-gray-300 border-t-emerald-600 rounded-full animate-spin"},null,-1)])])):h.value?(a(),n("div",ae,[t("div",ne,[c(m,{name:"check",class:"h-8 w-8 text-emerald-600 dark:text-emerald-300"})]),r[1]||(r[1]=t("p",{class:"text-emerald-700 dark:text-emerald-400 text-xs font-semibold uppercase tracking-widest mb-1"},"FriendHike Premium",-1)),N.value?(a(),n(p,{key:0},[t("h2",oe,s(e.$t("paywall.lifetimeMember")),1),t("p",le,s(e.$t("paywall.lifetimeMemberSubtitle")),1),t("div",null,[t("span",ie,[c(m,{name:"star",class:"w-3.5 h-3.5"}
1),_(" "+s(e.$t("paywall.foundingMember")),1),v.value?(a(),n(p,{key:0},[_(" #"+s(v.value),1)],64)):w("",!0)])])],64)):(a(),n(p,{key:1},[t("h2",re,s(e.$t("paywall.activeSubscription")),1),t("p",ce,s(e.$t("subscription.manageSubtitle")),1),g.value!==null?(a(),n("p",ue,s(e.$t("paywall.usageThisPeriod",{used:B.value,limit:g.value})),1)):(a(),n("div",de)),c(A,{onClick:T,disabled:o(x),class:"w-full"},{default:k(()=>[o(x)?(a(),S(m,{key:1,name:"spinner",class:"animate-spin h-5 w-5"})):(a(),n("span",me,s(e.$t("paywall.manageSubscription")),1))]),_:1},8,["disabled"]),o(f)?(a(),n("p",pe,s(o(f)),1)):w("",!0)],64)),c(E,{to:o(b)("/account"),class:"mt-5 inline-block text-sm text-emerald-700 dark:text-emerald-400 hover:text-emerald-800 dark:hover:text-emerald-300 underline"},{default:k(()=>[_(s(e.$t("subscription.goToAccount")),1)]),_:1},8,["to"])])):(a(),S(O,{key:3,inline:"","is-open":!0,status:i.value,context:"general"},null,8,["status"]))],2)])}}};export{ye 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.