PageSourceSearch

https://subtiltee.com/_nuxt/B2_ER6Hx.js

js subtiltee.com collected 2026-10-02 00:33:46 UTC 7,455 bytes, 1 lines download raw bytes

1import{_ as ee}from"./B8Q9uicj.js";import{_ as te,a as ae}from"./CGHpCH_-.js";import{_ as se,a as oe}from"./Dvw-4f_m.js";import{_ as re}from"./gjK451-t.js";import{_ as ne,a as ie,b as le}from"./CpOJYhp6.js";import{b as ce,x as v,L as de,f as ue,a2 as me,a6 as pe,a7 as _e,ae as he,Y as fe,H as I,ac as be,I as ve,X as R,a3 as ge,M as ye,i as p,q as x,O as g,m as s,j as o,t as u,k as i,l as q,a9 as c,ad as we,o as d}from"./Ccw9mUhn.js";import{y as xe,X as Ae,af as Se}from"./D_rq7M5t.js";import"./JDdL6vyt.js";import"./DAFaHp-e.js";import"./svctphHa.js";import"./DuGk2X12.js";import"./D6KhxRPP.js";import"./B623BiJ6.js";const Ce={class:"min-h-screen bg-gray-50"},De={key:0,class:"min-h-screen flex items-center justify-center"},ke={class:"text-center"},$e={class:"mt-4 text-gray-600"},Ee={key:2,class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},Be={class:"mb-8"},Oe={class:"text-3xl font-bold text-gray-900"},Ie={class:"mt-2 text-gray-600"},Re={key:0,class:"mb-8 rounded-xl bg-red-50 border border-red-200 px-5 py-4 flex items-start gap-3"},qe={class:"flex-1 min-w-0"},Me={class:"text-sm font-semibold text-red-800"},Te={class:"text-sm text-red-700/80 mt-0.5"},He={class:"bg-white rounded-lg shadow-sm border p-6 mb-8"},Ne={class:"text-xl font-semibold text-gray-900 mb-4"},Pe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Le={class:"mt-6"},Fe={key:1,class:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm mb-8"},We={class:"px-6 pt-6 pb-2"},Ue={class:"text-xl font-bold text-gray-900 flex items-center gap-2"},ot=ce({__name:"dashboard",async setup(Ve){let _,A;const m=v(null),{t:M}=de();ue({title:`${M("subtiltee.dashboard.title")} - Subtiltee`,meta:[{name:"description",content:"Subtiltee user dashboard"}]}),me();const l=pe(),{signOut:T}=_e(),{openCustomerPortal:H}=he(),r=fe(),N=I(()=>{const e=l.getAppAccess(c),t=!!e.value;return console.log("📊 [DASHBOARD] hasSubtilteeAccess:",t,"appAccess:",e.value),t}),P=I(()=>{var t;const e=(t=l.getAppAccess(c))==null?void 0:t.value;return(e==null?void 0:e.has_active_access)||!1}),n=([_,A]=be(()=>we("/api/affiliate/dashboard",{server:!1,default:()=>({data:{credits:{regular_referrals:{available_credits:0,referral_code:null},custom_affiliates:{total_balance_cents:0,total_balance_euros:0,affiliates:[],can_withdraw:!1},summary:{has_credits:!1,has_custom_balance:!1,total_value_euros:0}}}}),timeout:3e4,transform:e=>(e==null?void 0:e.data)||e},"$lE-HAwt7tD")),_=await _,A(),_),h=v(!1),f=v(!1),y=v(!1),S=()=>{const e=document.getElementById("rewards");e&&e.scrollIntoView({behavior:"smooth",block:"start"})};ve(async()=>{await R(),L(),r.hash==="#rewards"&&setTimeout(()=>{S()},300)});const L=()=>{const e=ge();if(e&&(r.query.device_conflict==="1"&&(console.log("🔍 DASHBOARD: Device conflict detected in URL"),e.setDeviceConflictInfo({hasConflict:!0,anonymizedEmail:r.query.conflict_email||null,conflictDate:r.query.conflict_date||null,accountDeleted:r.query.account_deleted==="1",deviceFingerprint:null})),r.query.source==="activation"&&r.query.trial_granted==="false")){const t=r.query.trial_denied_reason;if(t==="device_recently_used_trial"||t==="email_already_used_trial"){console.log("🔍 DASHBOARD: Trial denied due to device/email conflict");let a=null;if(r.query.conflict_info)try{a=JSON.parse(r.query.conflict_info)}catch(w){console.error("❌ DASHBOARD: Failed to parse conflict_info:",w)}e.setDeviceConflictInfo({hasConflict:!0,anonymizedEmail:(a==null?void 0:a.anonymizedEmail)||null,conflictDate:(a==null?void 0:a.conflictDate)||null,accountDeleted:(a==null?void 0:a.accountDeleted)||!1,deviceFingerprint:(a==null?void 0:a.deviceFingerprint)||null})}}};ye(()=>n.pending.value,e=>{!e&&r.hash==="#rewards"&&R(()=>{S()})},{immediate:!0});const F=async()=>{try{await T()}catch(e){console.error("Sign out error:",e)}},W=()=>{var e,t,a;((a=(t=(e=n.data.value)==null?void 0:e.credits)==null?void 0:t.regular_referrals)==null?void 0:a.available_credits)>0&&(h.value=!0)},U=()=>{var e,t,a;(a=(t=(e=n.data.value)==null?void 0:e.credits)==null?void 0:t.custom_affiliates)!=null&&a.can_withdraw&&(f.value=!0)},V=async()=>{await n.refresh(),h.value=!1},z=async()=>{await n.refresh(),f.value=!1},X=async(e=null)=>{var t;y.value=!0;try{const a=await H(window.location.href,c,e);a.success||(console.error("Portal error:",a.error),alert("Error: "+(((t=a.error)==null?void 0:t.message)||"Failed to open customer portal")))}catch(a){console.error("Portal error:",a),alert("An error occurred while opening the customer portal")}finally{y.value=!1}};return(e,t)=>{var C,D,k,$,E,B,O;const a=ee,w=ae,j=se,G=te,J=re,Q=oe,Y=ne,K=ie,Z=le;return d(),p("div",Ce,[s(l).isBusinessDataLoading.value||s(l).isSigningOut.value?(d(),p("div",De,[o("div",ke,[t[4]||(t[4]=o("div",{class:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-emerald-600"},null,-1)),o("p",$e,u(s(l).isSigningOut.value?e.$t("subtiltee.authComponents.userMenu.signingOut"):e.$t("subtiltee.dashboard.profile.loading")),1)])])):s(N)?(d(),p("div",Ee,[o("div",Be,[o("h1",Oe,u(e.$t("subtiltee.dashboard.title")),1),o("p",Ie,u(e.$t("subtiltee.dashboard.subtitle")),1)]),s(m)?(d(),p("div",Re,[i(s(xe),{class:"w-5 h-5 text-red-500 shrink-0 mt-0.5"}),o("div",qe,[o("p",Me,u(s(m).title),1),o("p",Te,u(s(m).message),1)]),o("button",{onClick:t[0]||(t[0]=b=>m.value=null),class:"cursor-pointer text-red-500/60 hover:text-red-500 transition-colors shrink-0"},[i(s(Ae),{class:"w-4 h-4"})])])):g("",!0),o("div",He,[o("h2",Ne,u(e.$t("subtiltee.dashboard.userInfo.heading")),1),o("div",Pe,[i(w,{namespace:"subtiltee","icon-color":"text-emerald-700"}),i(j,{"app-id":s(c),namespace:"subtiltee","icon-color":"text-emerald-700","premium-badge-color":"bg-purple-100 text-purple-800"},null,8,["app-id"])]),o("div",Le,[i(G,{"app-id":s(c),namespace:"subtiltee","portal-loading":s(y),"primary-button-color":"bg-emerald-700","primary-button-hover-color":"hover:bg-emerald-700",onManagePortal:X,onSignOut:F},null,8,["app-id","portal-loading"])])]),s(P)?g("",!0):(d(),p("div",Fe,[o("div",We,[o("h2",Ue,[i(s(Se),{class:"w-5 h-5 text-gray-500"}),q(" "+u(e.$t("subtiltee.dashboard.subscription.title","Subscription & Plans")),1
1)])]),i(J,{mode:"billing","show-header":!1,onCheckoutError:t[1]||(t[1]=b=>m.value=b)})])),i(Q,{"extension-key":"subtiltee",namespace:"subtiltee","accent-color":"text-emerald-700","primary-button-color":"bg-emerald-700","primary-button-hover-color":"hover:bg-emerald-800",class:"mb-8"}),i(Y,{id:"rewards",namespace:"subtiltee","app-id":s(c),"credits-data":((C=s(n).data.value)==null?void 0:C.credits)??null,loading:s(n).pending.value,onUseCredits:W,onWithdraw:U,class:"mb-8"},null,8,["app-id","credits-data","loading"]),t[5]||(t[5]=q(" /> "))])):(d(),x(a,{key:1,"app-id":"ext_a"})),s(l).isBusinessDataLoading.value?g("",!0):(d(),x(K,{key:3,"is-open":s(h),"available-credits":(($=(k=(D=s(n).data.value)==null?void 0:D.credits)==null?void 0:k.regular_referrals)==null?void 0:$.available_credits)||0,"has-active-access":!!s(l).hasActiveAccess.value,"app-id":s(c),onClose:t[2]||(t[2]=b=>h.value=!1),onApplied:V},null,8,["is-open","available-credits","has-active-access","app-id"])),s(l).isBusinessDataLoading.value?g("",!0):(d(),x(Z,{key:4,"is-open":s(f),balance:((O=(B=(E=s(n).data.value)==null?void 0:E.credits)==null?void 0:B.custom_affiliates)==null?void 0:O.total_balance_euros)||0,"app-id":s(c),onClose:t[3]||(t[3]=b=>f.value=!1),onWithdrawn:z},null,8,["is-open","balance","app-id"]))])}}});export{ot 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.