PageSourceSearch

https://wildearth.tv/build/assets/UserEdit-BzKz5YtO.js

js wildearth.tv collected 2026-10-01 11:31:12 UTC 62,355 bytes, 5 lines download raw bytes

1import{d as Re,q as A,K as x,L as r,O as l,u as a,_ as s,P as c,a0 as d,M as n,$ as i,U as o,F as C,V as j,a3 as kt,b0 as bt,aa as wt,aA as Ct,n as St,l as R,aR as F,aC as te,a2 as Oe,aU as ye,bW as he,a1 as ke,a8 as b,b6 as $t,b2 as se,aV as Et,ac as Pt}from"./icons-Bgx76RDF.js";import{_ as Dt,g as Mt,h as Be,i as Rt,j as jt,k as Ft,l as At,f as be,a as we,b as Ce,c as Se,d as $e,e as Ee}from"./AppLayout.vue_vue_type_script_setup_true_lang-BvhncCaL.js";import{r as E,h as It,l as Pe}from"./app-1To86AzH.js";import{_ as y}from"./index-B_Re349R.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-DhF2TxEr.js";import{_ as Vt}from"./index-DRJF5lkF.js";import{_ as K}from"./Label.vue_vue_type_script_setup_true_lang-CQc2ZaV7.js";import{d as Nt,_ as Ut,a as Lt,b as Tt,c as zt}from"./index-CTNqJoAD.js";import{_ as L,a as V}from"./CardContent.vue_vue_type_script_setup_true_lang-CtmNO7J9.js";import{_ as W}from"./CardDescription.vue_vue_type_script_setup_true_lang-CsVFPsrL.js";import{_ as N}from"./CardHeader.vue_vue_type_script_setup_true_lang-Dpqv7VRL.js";import{_ as U}from"./CardTitle.vue_vue_type_script_setup_true_lang-DGevopHP.js";import{_ as h}from"./Badge.vue_vue_type_script_setup_true_lang-AIQeuGP0.js";import{_ as ae}from"./Separator.vue_vue_type_script_setup_true_lang-nLmhlkDy.js";import{_ as Ot,c as Bt,a as Gt,b as qt}from"./TooltipTrigger.vue_vue_type_script_setup_true_lang-XzAgB0RT.js";import{_ as De,a as Me}from"./DialogTrigger.vue_vue_type_script_setup_true_lang-CbMmgZGM.js";import{t as k}from"./index-ypZ4j5CC.js";import{_ as Wt}from"./index-Czve7zag.js";import{g as Yt}from"./useStaffSidebar-DBxGPlKt.js";import{_ as Ht,u as Jt}from"./usePaymentMethod-BGE9ECh7.js";import{a as Kt}from"./apps-BLCmMC78.js";import{f as Xt}from"./format-3F-nMLGt.js";import{p as Qt}from"./parseISO-BRHYAQRj.js";import"./utils-CDN07tui.js";import"./reka-ui-CxQDcGDz.js";import"./SheetTrigger.vue_vue_type_script_setup_true_lang-ClJRYQsn.js";import"./index-DgDhoHPE.js";import"./useInitials-C0AQeawK.js";import"./index-DQD3-gx9.js";import"./index-DzzYwkmi.js";const Zt={class:"flex flex-wrap items-center justify-between gap-2"},es={class:"divide-y divide-border rounded-lg border"},ts={class:"min-w-0 flex-1"},ss={class:"truncate text-sm font-medium"},as={key:0,class:"ml-2 text-xs font-normal text-green-600 dark:text-green-500"},ls={class:"truncate text-xs text-muted-foreground"},rs={key:0,class:"p-3 text-sm text-muted-foreground"},ns=Re({__name:"UserDevicesCard",props:{userId:{},devices:{}},setup(u){const f=u,X={app:Ct,tv:wt,web:bt},$=A(null),D=P=>P?new Date(P).toLocaleString():"unknown";function M(P){const I=P.kind==="web"?"Other browsers where they chose to stay signed in will also need to sign in again.":"It will stop receiving notifications too.";confirm(`Sign this user out of ${P.label}?
2
3${I}`)&&($.value=P.id,E.delete(route("admin.users.devices.destroy",{userId:f.userId,id:P.id}),{preserveScroll:!0,onSuccess:()=>k.success(`Signed out of ${P.label}`),onError:()=>k.error("Failed to sign out"),onFinish:()=>$.value=null}))}function p(){confirm(`Sign this user out of every app and browser?
4
5They will need to sign in again everywhere, and their devices stop receiving notifications.`)&&($.value="all",E.delete(route("admin.users.devices.destroyAll",f.userId),{preserveScroll:!0,onSuccess:()=>k.success("Signed out everywhere"),onError:()=>k.error("Failed to sign out"),onFinish:()=>$.value=null}))}return(P,I)=>(n(),x(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[s("div",Zt,[s("div",null,[l(a(U),{class:"text-base sm:text-lg"},{default:r(()=>[...I[0]||(I[0]=[d("Devices & browsers",-1)])]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...I[1]||(I[1]=[d("Everywhere this user is signed in, as they see it in their settings",-1)])]),_:1})]),u.devices.some(S=>!S.current)?(n(),x(a(y),{key:0,variant:"destructive",size:"sm",disabled:$.value!==null,onClick:p},{default:r(()=>[d(i($.value==="all"?"Signing out…":"Sign out everywhere"),1)]),_:1},8,["disabled"])):c("",!0)])]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>
5[s("ul",es,[(n(!0),o(C,null,j(u.devices,S=>(n(),o("li",{key:S.id,class:"flex items-center gap-3 p-3"},[(n(),x(kt(X[S.kind]),{class:"h-4 w-4 shrink-0 text-muted-foreground"})),s("div",ts,[s("p",ss,[d(i(S.label)+" ",1),S.current?(n(),o("span",as,"Your current browser")):c("",!0)]),s("p",ls,[d(" Last active "+i(D(S.last_active_at))+" ",1),S.first_seen_at?(n(),o(C,{key:0},[d(" · signed in "+i(D(S.first_seen_at)),1)],64)):c("",!0),S.location?(n(),o(C,{key:1},[d(" · "+i(S.location),1)],64)):c("",!0)])]),S.current?c("",!0):(n(),x(a(y),{key:0,variant:"ghost",size:"sm",class:"text-destructive hover:text-destructive",disabled:$.value!==null,onClick:le=>M(S)},{default:r(()=>[d(i($.value===S.id?"Signing out…":"Sign out"),1)]),_:2},1032,["disabled","onClick"]))]))),128)),u.devices.length===0?(n(),o("li",rs,"Not signed in anywhere.")):c("",!0)])]),_:1})]),_:1}))}}),is={key:0,class:"max-h-[360px] overflow-auto rounded-lg border"},os={class:"w-full text-xs sm:text-sm"},ds={class:"divide-y"},us={class:"p-2 whitespace-nowrap"},ms={class:"p-2 whitespace-nowrap"},cs={class:"p-2"},ps={key:0,class:"ml-1 font-mono text-[10px] text-muted-foreground"},fs={class:"p-2 whitespace-nowrap font-mono"},xs={key:1,class:"py-6 text-center text-xs sm:text-sm text-muted-foreground"},vs=Re({__name:"UserAppActivityCard",props:{rows:{}},setup(u){const f=$=>Xt(Qt($),"EEE d MMM yyyy"),X=($,D)=>$?D?`${$} (${D})`:$:"—";return($,D)=>(n(),x(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"text-base sm:text-lg"},{default:r(()=>[...D[0]||(D[0]=[d("App activity",-1)])]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...D[1]||(D[1]=[d("Days this user used an app in the last 90 days (recorded from 25 September 2026)",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>[u.rows.length>0?(n(),o("div",is,[s("table",os,[D[2]||(D[2]=s("thead",{class:"sticky top-0 bg-muted/80 backdrop-blur border-b"},[s("tr",null,[s("th",{class:"text-left p-2 font-medium"},"Day (UTC)"),s("th",{class:"text-left p-2 font-medium"},"Platform"),s("th",{class:"text-left p-2 font-medium"},"Device"),s("th",{class:"text-left p-2 font-medium"},"App version")])],-1)),s("tbody",ds,[(n(!0),o(C,null,j(u.rows,M=>{var p;return n(),o("tr",{key:M.id,class:"hover:bg-muted/30"},[s("td",us,i(f(M.date)),1),s("td",ms,i(M.platform?((p=a(Kt)[M.platform])==null?void 0:p.label)??M.platform:"—"),1),s("td",cs,[d(i(M.device??"—")+" ",1),M.device_model?(n(),o("span",ps,i(M.device_model),1)):c("",!0)]),s("td",fs,i(X(M.app_version,M.app_build)),1)])}),128))])])])):(n(),o("div",xs,"No app use recorded"))]),_:1})]),_:1}))}}),gs={class:"flex h-full w-full max-w-7xl mx-auto flex-1 flex-col gap-2 sm:gap-4 rounded-xl p-2 sm:p-4"},_s={class:"space-y-4 sm:space-y-6"},ys={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-3"},hs={class:"flex items-center gap-2"},ks={class:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"},bs={class:"space-y-1"},ws={class:"flex flex-wrap items-center gap-2"},Cs={class:"flex flex-wrap gap-2"},Ss={class:"space-y-2"},$s={class:"font-mono font-semibold"},Es={key:0,class:"flex flex-wrap gap-2"},Ps={key:1,class:"flex flex-wrap gap-2 w-full sm:w-auto"},Ds={class:"flex flex-col lg:flex-row gap-6 lg:gap-24"},Ms={class:"space-y-3 sm:space-y-4 flex-1 lg:max-w-xl"},Rs={class:"space-y-1.5"},js={class:"space-y-1.5"},Fs={class:"flex items-center gap-2"},As={class:"space-y-1.5"},Is={class:"space-y-1.5"},Vs={class:"space-y-4 text-xs sm:text-sm lg:w-100 mt-5"},Ns={class:"flex items-center justify-between sm:justify-start gap-2"},Us={class:"font-mono"},Ls={class:"flex items-center justify-between sm:justify-start gap-2"},Ts={class:"flex items-center justify-between sm:justify-start gap-2"},zs={class:"flex items-center justify-between sm:justify-start gap-2"},Os={class:"flex flex-wrap items-center gap-1"},Bs=["href"],Gs={key:1,class:"font-mono text-[10px] sm:text-xs"},qs={class:"flex flex-wrap items-center gap-1"},Ws=["href"],Ys={class:"flex flex-wrap items-center gap-1"}
5,Hs={key:0,class:"font-mono text-[10px] sm:text-xs truncate"},Js={key:1,class:"font-mono text-[10px] sm:text-xs"},Ks={class:"flex items-center justify-between sm:justify-start gap-2"},Xs={class:"flex items-center justify-between sm:justify-start gap-2"},Qs={class:"flex items-center justify-between sm:justify-start gap-2"},Zs={key:0,class:"flex items-center gap-1.5"},ea={key:1},ta={key:0},sa={class:"space-y-2 sm:space-y-3"},aa={class:"flex items-center justify-between gap-2"},la={class:"font-medium text-sm sm:text-base truncate"},ra={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},na={key:0,class:"sm:col-span-2 text-red-600 dark:text-red-400"},ia={key:1,class:"sm:col-span-2 text-blue-600 dark:text-blue-400"},oa={key:0},da={class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate"},ua={key:1,class:"mt-2 p-2 bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg"},ma={class:"flex items-center gap-2 mb-1"},ca={class:"text-xs text-purple-700 dark:text-purple-300 space-y-1"},pa={key:0},fa={key:1},xa={key:2,class:"font-mono text-[10px] text-purple-500"},va={key:0,class:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t"},ga={class:"space-y-2"},_a={class:"flex-1 min-w-0"},ya={key:0},ha={key:1},ka={class:"flex-1 min-w-0"},ba={key:0},wa={class:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t"},Ca={key:0,class:"flex items-center gap-2 sm:gap-3 p-2 sm:p-3 bg-muted/50 rounded-lg"},Sa={class:"min-w-0"},$a={class:"font-medium text-xs sm:text-sm truncate"},Ea={key:1,class:"text-xs sm:text-sm text-muted-foreground"},Pa={key:2},Da={class:"space-y-2 sm:space-y-3"},Ma={class:"flex items-center justify-between gap-2"},Ra={class:"font-medium text-sm sm:text-base truncate"},ja={class:"flex items-center gap-1 shrink-0"},Fa={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},Aa={key:0},Ia={key:0},Va={key:1},Na={key:2},Ua={key:3,class:"text-red-600 dark:text-red-400"},La={key:4},Ta={key:5,class:"sm:col-span-2 text-orange-600 dark:text-orange-400"},za={key:6},Oa={key:7},Ba={key:8},Ga={key:9},qa=["title"],Wa={key:4},Ya={class:"space-y-2 sm:space-y-3"},Ha={class:"flex items-center justify-between gap-2"},Ja={class:"font-medium text-sm sm:text-base truncate"},Ka={class:"flex items-center gap-1 shrink-0"},Xa={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},Qa={key:0},Za={key:1,class:"text-red-600 dark:text-red-400"},el={key:2},tl={key:3},sl={key:4},al={key:5},ll={key:6},rl={key:7},nl=["title"],il={key:0},ol={key:6},dl={class:"space-y-2 sm:space-y-3"},ul={class:"flex items-center justify-between gap-2"},ml={class:"font-medium text-sm sm:text-base truncate"},cl={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},pl={key:0},fl={class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate"},xl={key:7,class:"text-center text-muted-foreground py-6 sm:py-8 text-xs sm:text-sm"},vl={class:"flex gap-2"},gl={key:0},_l={class:"space-y-2 sm:space-y-3"},yl={class:"flex items-start sm:items-center justify-between gap-2"},hl={class:"font-medium text-sm sm:text-base"},kl={class:"flex items-center gap-1 sm:gap-2 shrink-0"},bl={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},wl={class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate"},Cl={key:2},Sl={class:"space-y-2 sm:space-y-3"},$l={class:"flex items-center justify-between gap-2"},El={class:"font-medium text-sm sm:text-base truncate"},Pl={class:"grid grid-cols-1 sm:grid-cols-2 gap-1 sm:gap-2 text-xs sm:text-sm text-muted-foreground"},Dl={key:0},Ml={class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate"},Rl={key:3,class:"text-center text-muted-foreground py-6 sm:py-8 text-xs sm:text-sm"},jl={key:0,class:"border rounded-lg overflow-hidden"},Fl={class:"overflow-x-auto"},Al={class:"w-full text-xs sm:text-sm"},Il={class:"divide-y"},Vl={class:"p-2"},Nl={class:"p-2 whitespace-nowrap"},Ul={key:0},Ll={key:1},Tl={class:"p-2 whitespace-nowrap text-[10px] sm:text-xs"},zl={class:"p-2 font-mono text-[10px] sm:text-xs text-muted-foreground hidden sm:table-cell"},Ol={class:"p-2 font-mono text-[10px] sm:text-xs text-muted-foreground hidden sm:table-cell"},Bl={key:1,class:"text-center text-muted-foreground py-6 sm:py-8 text-xs sm:text-sm"},Gl={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6"},ql={class:"space-y-3 text-xs sm:text-sm"},Wl={class:"flex items-center justify-between sm:justify-start gap-2"},Yl={class:"font-mono"},Hl={key:0,class:"flex items-center gap-2"},Jl={class:"space-y-3 text-xs sm:text-sm"},Kl={class:"flex items-center justify-between sm:justify-start gap-2"},Xl={key:1,class:"text-muted-foreground italic"},Ql={class:"flex items-center justify-between sm:justify-start gap-2"},Zl={class:"font-mono"},er={class:"flex items-center justify-between sm:justify-start gap-2"},tr={class:"flex items-center justify-between sm:justify-start gap-2"},sr={class:"flex items-center justify-between sm:justify-start gap-2"},ar={key:1,class:"text-muted-foreground"},lr={class:"flex flex-wrap items-center gap-2 mb-2 sm:mb-3"},rr={key:0,class:"border rounded-lg overflow-hidden"},nr={class:"overflow-x-auto"},ir={class:"w-full text-xs sm:text-sm"},or={class:"divide-y"},dr={class:"p-2"},ur={class:"p-2"},mr={class:"p-2 whitespace-nowrap text-[10px] sm:text-xs"},cr={class:"p-2 whitespace-nowrap text-[10px] sm:text-xs"},pr={key:1,class:"text-center text-muted-foreground py-6 sm:py-8 text-xs sm:text-sm"},fr={class:"border rounded-lg overflow-hidden"},xr={class:"overflow-x-auto"},vr={class:"w-full text-xs sm:text-sm"},gr={class:"divide-y"},_r={class:"p-2"},yr={class:"p-2 whitespace-nowrap text-xs"},hr={class:"p-2 text-right whitespace-nowrap"},kr={class:"p-2"},br={class:"p-2 font-mono text-[10px] sm:text-xs text-muted-foreground hidden sm:table-cell truncate max-w-[200px]"},wr=["href"],Cr={key:1},Sr={key:0,class:"space-y-2"},$r={class:"flex flex-wrap items-center gap-1.5 sm:gap-2 mb-1"},Er={class:"text-[10px] sm:text-xs text-muted-foreground"},Pr={key:0,class:"text-[10px] sm:text-xs text-muted-foreground mt-1 space-y-0.5"},Dr={class:"font-medium"},Mr={class:"break-all"},Rr={key:1,class:"text-[10px] sm:text-xs text-muted-foreground mt-1"},jr={key:1,class:"text-center text-muted-foreground py-6 sm:py-8 text-xs sm:text-sm"},Fr={class:"space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10"},Ar={class:"font-semibold"},Ir={class:"space-y-2"},Vr={class:"font-mono font-semibold"},fn=Re({layout:Dt,__name:"UserEdit",props:{user:{},appleSubscriptions:{},googleSubscriptions:{},eventLogs:{},eventTypes:{},paymentMethod:{},schedulePhases:{},referral:{},promoRedemptions:{},deletionPurgeAt:{},devices:{},appActivity:{}},setup(u){var Le;const f=u,X=Yt(),{getPaymentMethodDisplayName:$,getCardExpiration:D,isCardExpired:M}=Jt(),p=St({saving:!1,resettingPassword:!1,sendingResetEmail:!1,syncingCrm:!1,syncingStripe:!1,addingFreeService:!1,checkingCrmId:!1,savingCrmId:!1,creatingCrmId:!1,cancellingService:null,migratingService:null,impersonating:!1,deleting:!1,cancellingDeletion:!1,purging:!1}),P=A(""),I=A(""),S=A(!1),le=A(!1),re=A(!1),ne=A(!1),B=A(""),Q=A(!1),Z=A(""),w=A({name:f.user.name,display_name:f.user.display_name,email:f.user.email,role:((Le=f.user.role)==null?void 0:Le.role)||"none",notes:f.user.notes||""}),Ge=R(()=>{var m;return w.value.name!==f.user.name||w.value.display_name!==f.user.display_name||w.value.email!==f.user.email||w.value.role!==(((m=f.user.role)==null?void 0:m.role)||"none")||w.value.notes!==(f.user.notes||"")}),O=R(()=>{var m;return{name:w.value.name!==f.user.name,display_name:w.value.display_name!==f.user.display_name,email:w.value.email!==f.user.email,role:w.value.role!==(((m=f.user.role)==null?void 0:m.role)||"none"),notes:w.value.notes!==(f.user.notes||"")}}),je=R(()=>f.user.deletion_requested_at!==null),ee=R(()=>f.user.subscriptions.filter(m=>["active","trialing","past_due"].includes(m.status))),qe=R(()=>f.appleSubscriptions.filter(m=>m.is_active)),We=R(()=>f.appleSubscriptions.filter(m=>!m.is_active)),Ye=R(()=>f.user.subscriptions.length>0||f.appleSubscriptions.length>0||f.googleSubscriptions.length>0),He=m=>({ACTIVE:"default",IN_GRACE_PERIOD:"secondary",ON_HOLD:"destructive",PAUSED:"secondary",CANCELED:"outline",EXPIRED:"outline",PENDING:"secondary"})[m]||"outline",Je=m=>
5({active:"default",grace_period:"secondary",billing_retry:"destructive",expired:"outline",revoked:"destructive"})[m]||"outline",Ke=m=>m?{stripe:"Stripe",apple:"Apple",google:"Google",roku:"Roku",paypal:"PayPal",crm:"CRM",gift:"Gift",none:"None"}[m]??m:"None",ce=R(()=>f.user.subscriptions.filter(m=>!["active","trialing","past_due"].includes(m.status))),ie=R(()=>f.user.crm_services.filter(m=>m.state==="EFFECTIVE")),pe=R(()=>f.user.crm_services.filter(m=>m.state!=="EFFECTIVE")),Xe=R(()=>{var m;return(((m=f.schedulePhases)==null?void 0:m.length)??0)>0}),_=R(()=>{var m;return(m=f.schedulePhases)==null?void 0:m.find(e=>e.is_current)}),Qe=R(()=>{var m;return((m=f.schedulePhases)==null?void 0:m.filter(e=>!e.is_current))??[]}),v=m=>m?new Date(m).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A",T=m=>m?new Date(m).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A",Ze=m=>{var e;return((e=f.eventTypes[m])==null?void 0:e.label)||m},et=m=>{var e;return((e=f.eventTypes[m])==null?void 0:e.variant)||"outline"},Y=(m,e)=>`${parseFloat(m).toFixed(2)} ${e.toUpperCase()}`,oe=m=>({active:"default",trialing:"secondary",canceled:"destructive",past_due:"destructive",EFFECTIVE:"default"})[m]||"outline",H=async(m,e,t={},g="post",z,J=["user"])=>(p[m]=!0,new Promise((ue,yt)=>{const Te={preserveScroll:!0,onSuccess:me=>{const G=me.props.flash,ze=G==null?void 0:G.error,ht=(G==null?void 0:G.success)||z;if(ze){p[m]=!1,k.error(ze),ue(!1);return}k.success(ht),E.reload({only:J,onFinish:()=>{p[m]=!1,ue(!0)}})},onError:me=>{p[m]=!1;const G=Object.values(me).flat()[0]||`Failed to ${m}`;k.error(G),yt(me)}
5};g==="post"?E.post(e,t,Te):E.put(e,t,Te)})),tt=()=>{const{name:m,display_name:e,email:t,role:g,notes:z}=w.value;p.saving=!0,E.put(route("admin.users.update",f.user.id),{name:m,display_name:e,email:t,notes:z},{preserveScroll:!0,onSuccess:()=>E.put(route("admin.users.updateRole",f.user.id),{role:g==="none"?null:g},{preserveScroll:!0,onSuccess:()=>{var J;p.saving=!1,w.value={name:f.user.name,display_name:f.user.display_name,email:f.user.email,role:((J=f.user.role)==null?void 0:J.role)||"none",notes:f.user.notes||""},k.success("User updated successfully")},onError:()=>{p.saving=!1,k.error("Failed to update user role")}}),onError:J=>{p.saving=!1;const ue=Object.values(J).flat()[0]||"Failed to update user";k.error(ue)}})},st=()=>{ne.value=!0,B.value=""},at=()=>{ne.value=!1,B.value=""},Fe=()=>{B.value&&(p.resettingPassword=!0,E.post(route("admin.users.resetPassword",f.user.id),{password:B.value},{preserveScroll:!0,onSuccess:()=>{p.resettingPassword=!1,ne.value=!1,B.value="",k.success("Password reset successfully")},onError:m=>{var e;p.resettingPassword=!1,k.error(((e=m.password)==null?void 0:e[0])||"Failed to reset password")}}))},Ae=()=>H("syncingStripe",route("admin.users.syncStripe",f.user.id),{},"post","Stripe data synced successfully",["user","paymentMethod"]),lt=()=>H("syncingCrm",route("admin.users.syncCrmServices",f.user.id),{},"post","CRM services synced successfully"),rt=()=>H("addingFreeService",route("admin.users.addFreeCrmService",f.user.id),{},"post","Free access added successfully"),nt=m=>{p.cancellingService=m,E.post(route("admin.users.cancelCrmService",f.user.id),{crm_service_id:m},{preserveScroll:!0,onSuccess:e=>{const t=e.props.flash,g=t==null?void 0:t.error,z=(t==null?void 0:t.success)||"Service cancelled successfully";if(g){p.cancellingService=null,k.error(g);return}k.success(z),E.reload({only:["user"],onFinish:()=>{p.cancellingService=null}})},onError:e=>{p.cancellingService=null;const t=Object.values(e).flat()[0]||"Failed to cancel service";k.error(t)}})},it=m=>{p.migratingService=m,E.post(route("admin.users.migrateToStripe",f.user.id),{crm_service_id:m},{preserveScroll:!0,onSuccess:e=>{const t=e.props.flash,g=t==null?void 0:t.error,z=(t==null?void 0:t.success)||"Migrated to Stripe successfully";if(g){p.migratingService=null,k.error(g);return}k.success(z),E.reload({only:["user","paymentMethod"],onFinish:()=>{p.migratingService=null,Ae()}})},onError:e=>{p.migratingService=null;const t=Object.values(e).flat()[0]||"Failed to migrate to Stripe";k.error(t)}})},ot=()=>H("checkingCrmId",route("admin.users.checkCrmCustomerId",f.user.id),{},"post","CRM customer ID checked successfully"),dt=()=>H("creatingCrmId",route("admin.users.createCrmContact",f.user.id),{},"post","CRM contact created successfully"),ut=()=>{Z.value=f.user.crm_customer_id||"",Q.value=!0},mt=()=>{Q.value=!1,Z.value=""},ct=()=>{H("savingCrmId",route("admin.users.updateCrmCustomerId",f.user.id),{crm_customer_id:Z.value.trim()||null},"put","CRM customer ID updated successfully").then(()=>{Q.value=!1})},fe=A(!1);let xe=null;const pt=async()=>{if(f.referral.link)try{await navigator.clipboard.writeText(f.referral.link),fe.value=!0,k.success("Referral link copied"),xe&&clearTimeout(xe),xe=setTimeout(()=>{fe.value=!1},2e3)}catch{k.error("Failed to copy referral link")}},Ie=m=>m==="successful"?"default":m==="pending"?"secondary":"outline",ft=()=>E.visit(route("admin.users")),xt=()=>{p.impersonating=!0,E.post(route("admin.users.impersonate",f.user.id),{},{onError:()=>{p.impersonating=!1,k.error("Failed to impersonate user")}})},de=A(!1);let ve=null;const Ve=async()=>{try{await navigator.clipboard.writeText(f.user.email),de.value=!0,k.success("Email copied"),ve&&clearTimeout(ve),ve=setTimeout(()=>{de.value=!1},2e3)}catch{k.error("Failed to copy email")}},ge=R(()=>P.value.toLowerCase()===f.user.email.toLowerCase()),_e=R(()=>I.value.toLowerCase()===f.user.email.toLowerCase()),Ne=()=>{ge.value&&(p.deleting=!0,E.delete(route("admin.users.delete",f.user.id),{data:{confirm_email:P.value},onSuccess:()=>{p.deleting=!1,P.value="",S.value=!1,k.success("User marked for deleti
5on")},onError:m=>{p.deleting=!1;const e=Object.values(m).flat()[0]||"Failed to mark user for deletion";k.error(e)}}))},vt=()=>{p.cancellingDeletion=!0,E.post(route("admin.users.cancelDeletion",f.user.id),{},{preserveScroll:!0,onSuccess:()=>{p.cancellingDeletion=!1,le.value=!1,k.success("Deletion request cancelled")},onError:m=>{p.cancellingDeletion=!1;const e=Object.values(m).flat()[0]||"Failed to cancel deletion";k.error(e)}})},Ue=()=>{_e.value&&(p.purging=!0,E.delete(route("admin.users.purge",f.user.id),{data:{confirm_email:I.value},onSuccess:()=>{re.value=!1,k.success("User permanently purged")},onError:m=>{p.purging=!1;const e=Object.values(m).flat()[0]||"Failed to purge user";k.error(e)}}))},gt=()=>{P.value="",S.value=!1},_t=()=>{I.value="",re.value=!1};return(m,e)=>(n(),o(C,null,[l(a(It),{title:`Edit User - ${u.user.name}`},null,8,["title"]),s("div",gs,[l(a(At),null,{default:r(()=>[l(a(Mt),null,{default:r(()=>[l(a(Be),null,{default:r(()=>[l(a(Rt),{"as-child":""},{default:r(()=>[l(a(Pe),{href:"/admin/users",class:"cursor-pointer"},{default:r(()=>[...e[14]||(e[14]=[d("Users",-1)])]),_:1})]),_:1})]),_:1}),l(a(jt)),l(a(Be),null,{default:r(()=>[l(a(Ft),null,{default:r(()=>[d(i(u.user.name),1)]),_:1})]),_:1})]),_:1})]),_:1}),s("div",_s,[s("div",ys,[e[17]||(e[17]=s("div",null,null,-1)),s("div",hs,[l(a(y),{onClick:ft,variant:"outline",size:"sm",class:"sm:size-default"},{default:r(()=>[...e[15]||(e[15]=[d("Close",-1)])]),_:1}),l(a(y),{onClick:tt,disabled:!Ge.value||p.saving,size:"sm",class:"sm:size-default"},{default:r(()=>[p.saving?(n(),x(a(F),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):c("",!0),e[16]||(e[16]=d(" Save ",-1))]),_:1},8,["disabled"])])]),je.value?(n(),x(a(V),{key:0,class:"border-amber-300 bg-amber-50/60 dark:border-amber-800 dark:bg-amber-950/20"},{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[s("div",ks,[s("div",bs,[s("div",ws,[l(a(U),{class:"text-base text-amber-800 sm:text-lg dark:text-amber-300"},{default:r(()=>[...e[18]||(e[18]=[d("Account deletion pending",-1)])]),_:1}),l(a(h),{variant:"destructive"},{default:r(()=>[...e[19]||(e[19]=[d("Marked for deletion",-1)])]),_:1})]),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[d(" Requested "+i(T(u.user.deletion_requested_at))+". Scheduled for permanent purge "+i(T(u.deletionPurgeAt))+". ",1)]),_:1})]),s("div",Cs,[l(a(be),{open:le.value,"onUpdate:open":e[0]||(e[0]=t=>le.value=t)},{default:r(()=>[l(a(De),{"as-child":""},{default:r(()=>[l(a(y),{variant:"outline",size:"sm"},{default:r(()=>[...e[20]||(e[20]=[d("Cancel deletion",-1)])]),_:1})]),_:1}),l(a(we),null,{default:r(()=>[l(a(Ce),{class:"space-y-3"},{default:r(()=>[l(a(Se),null,{default:r(()=>[...e[21]||(e[21]=[d("Cancel this deletion request?",-1)])]),_:1}),l(a($e),null,{default:r(()=>[...e[22]||(e[22]=[d(" This restores login access immediately. Stripe cancellation or Apple authorization changes already sent to providers are not automatically reversed and may need separate support action. ",-1)])]),_:1})]),_:1}),l(a(Ee),{class:"gap-2"},{default:r(()=>[l(a(Me),{"as-child":""},{default:r(()=>[l(a(y),{variant:"secondary"},{default:r(()=>[...e[23]||(e[23]=[d("Keep deletion scheduled",-1)])]),_:1})]),_:1}),l(a(y),{disabled:p.cancellingDeletion,onClick:vt},{default:r(()=>[p.cancellingDeletion?(n(),x(a(F),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):c("",!0),e[24]||(e[24]=d(" Cancel deletion request ",-1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),l(a(be),{open:re.value,"onUpdate:open":e[3]||(e[3]=t=>re.value=t)},{default:r(()=>[l(a(De),{"as-child":""},{default:r(()=>[l(a(y),{variant:"destructive",size:"sm"},{default:r(()=>[l(a(te),{class:"mr-2 h-4 w-4"}),e[25]||(e[25]=d(" Purge now ",-1))]),_:1})]),_:1}),l(a(we),null,{default:r(()=>[l(a(Ce),{class:"space-y-3"},{default:r(()=>[l(a(Se),null,{default:r(()=>[...e[26]||(e[26]=[d("Permanently purge this user now?",-1)])]),_:1}),l(a($e),null,{default:r(()=>[...e[27]||(e[27]=[d(" This skips the remainder of the 30-day grace period. Local data will be permanently deleted and cannot be restored. Provider cleanup is attempted separately and any failures are reported in the application logs. ",-1)])]),_:1})]),_:1}),s("div",Ss,[l(a(K),{for:"purge-confirm-email",class:"flex flex-wrap items-center gap-1 text-sm"},{default:r(()=>[e[28]||(e[28]=d(" Type ",-1)),s("span",$s,i(u.user.email),1),l(a(y),{type:"button",variant:"ghost",size:"sm",class:"h-6 w-6 p-0","aria-label":"Copy email",title:"Copy email",onClick:Oe(Ve,["prevent"])},{default:r(()=>[de.value?(n(),x(a(ye),{key:0,class:"h-3.5 w-3.5 text-green-600"})):(n(),x(a(he),{key:1,class:"h-3.5 w-3.5"}))]),_:1}),e[29]||(e[29]=d(" to confirm: ",-1))]),_:1}),l(a(q),{id:"purge-confirm-email",modelValue:I.value,"onUpdate:modelValue":e[1]||(e[1]=t=>I.value=t),placeholder:"Enter user's email to confirm",onKeyup:e[2]||(e[2]=ke(t=>_e.value&&Ue(),["enter"]))},null,8,["modelValue"])]),l(a(Ee),{class:"gap-2"},{default:r(()=>[l(a(Me),{"as-child":""},{default:r(()=>[l(a(y),{variant:"secondary",onClick:_t},{default:r(()=>[...e[30]||(e[30]=[d("Cancel",-1)])]),_:1})]),_:1}),l(a(y),{variant:"destructive",disabled:!_e.value||p.purging,onClick:Ue},{default:r(()=>[p.purging?(n(),x(a(F),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):(n(),x(a(te),{key:1,class:"mr-2 h-4 w-4"})),e[31]||(e[31]=d(" Permanently purge ",-1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])])])]),_:1})]),_:1})):c("",!0),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 text-base sm:text-lg"},{default:r(()=>[e[35]||(e[35]=s("span",null,"Basic Information",-1)),ne.value?(n(),o("div",Ps,[l(a(q),{modelValue:B.value,"onUpdate:modelValue":e[4]||(e[4]=t=>B.value=t),type:"password",placeholder:"New password",onKeyup:ke(Fe,["enter"]),class:"flex-1 sm:flex-none sm:w-48 h-8 text-sm"},null,8,["modelValue"]),l(a(y),{size:"sm",onClick:Fe,disabled:!B.value||p.resettingPassword},{default:r(()=>[p.resettingPassword?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[33]||(e[33]=d(" Save ",-1))]),_:1},8,["disabled"]),l(a(y),{variant:"outline",size:"sm",onClick:at,disabled:p.resettingPassword},{default:r(()=>[...e[34]||(e[34]=[d(" Cancel ",-1)])]),_:1},8,["disabled"])])):(n(),o("div",Es,[l(a(y),{onClick:xt,disabled:p.impersonating,variant:"outline",size:"sm",class:"sm:size-default"},{default:r(()=>[p.impersonating?(n(),x(a(F),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):c("",!0),d(" Impersonate "+i(u.user.name),1)]),_:1},8,["disabled"]),l(a(y),{variant:"outline",size:"sm",onClick:st},{default:r(()=>[...e[32]||(e[32]=[d(" Reset Password ",-1)])]),_:1})]))]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0 space-y-4"},{default:r(()=>{var t;return[s("div",Ds,[s("div",Ms,[s("div",Rs,[l(a(K),{for:"name",class:b(["text-xs sm:text-sm",O.value.name?"text-blue-600 dar
5k:text-blue-400 font-medium":""])},{default:r(()=>[...e[36]||(e[36]=[d("Name",-1)])]),_:1},8,["class"]),l(a(q),{id:"name",modelValue:w.value.name,"onUpdate:modelValue":e[5]||(e[5]=g=>w.value.name=g),class:b(["h-8 sm:h-10 text-sm",O.value.name?"border-blue-500 focus-visible:ring-blue-500":""]),placeholder:"Username"},null,8,["modelValue","class"])]),s("div",js,[l(a(K),{for:"email",class:b(["text-xs sm:text-sm",O.value.email?"text-blue-600 dark:text-blue-400 font-medium":""])},{default:r(()=>[...e[37]||(e[37]=[d("Email",-1)])]),_:1},8,["class"]),s("div",Fs,[l(a(q),{id:"email",modelValue:w.value.email,"onUpdate:modelValue":e[6]||(e[6]=g=>w.value.email=g),type:"email",class:b(["h-8 sm:h-10 text-sm flex-1",O.value.email?"border-blue-500 focus-visible:ring-blue-500":""]),placeholder:"Email",disabled:""},null,8,["modelValue","class"]),l(a(Ot),{delayDuration:200},{default:r(()=>[l(a(Bt),null,{default:r(()=>[l(a(Gt),{"as-child":""},{default:r(()=>[l(a($t),{class:"h-4 w-4 text-muted-foreground cursor-help shrink-0"})]),_:1}),l(a(qt),null,{default:r(()=>[...e[38]||(e[38]=[s("p",null,"Email change by admin is disabled.",-1)])]),_:1})]),_:1})]),_:1})])]),s("div",As,[l(a(K),{for:"display_name",class:b(["text-xs sm:text-sm",O.value.display_name?"text-blue-600 dark:text-blue-400 font-medium":""])},{default:r(()=>[...e[39]||(e[39]=[d("Display Name",-1)])]),_:1},8,["class"]),l(a(q),{id:"display_name",modelValue:w.value.display_name,"onUpdate:modelValue":e[7]||(e[7]=g=>w.value.display_name=g),class:b(["h-8 sm:h-10 text-sm",O.value.display_name?"border-blue-500 focus-visible:ring-blue-500":""]),placeholder:"Display Name"},null,8,["modelValue","class"])]),s("div",Is,[l(a(K),{for:"role",class:b(["text-xs sm:text-sm",O.value.role?"text-blue-600 dark:text-blue-400 font-medium":""])},{default:r(()=>[...e[40]||(e[40]=[d("Role",-1)])]),_:1},8,["class"]),l(a(Nt),{modelValue:w.value.role,"onUpdate:modelValue":e[8]||(e[8]=g=>w.value.role=g)},{default:r(()=>[l(a(Ut),{class:b(["h-8 sm:h-10 text-sm",O.value.role?"border-blue-500 focus-visible:ring-blue-500 text-blue-500":""])},{default:r(()=>[l(a(Lt))]),_:1},8,["class"]),l(a(Tt),null,{default:r(()=>[(n(!0),o(C,null,j(a(X),g=>(n(),x(a(zt),{key:g.value,value:g.value},{default:r(()=>[d(i(g.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])])]),s("div",Vs,[s("div",Ns,[e[41]||(e[41]=s("span",{class:"text-muted-foreground"},"User ID:",-1)),s("span",Us,i(u.user.id),1)]),s("div",Ls,[e[42]||(e[42]=s("span",{class:"text-muted-foreground"},"Email Verified:",-1)),l(a(h),{variant:u.user.email_verified_at?"default":"secondary",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(u.user.email_verified_at?"Yes":"No"),1)]),_:1},8,["variant"])]),s("div",Ts,[e[43]||(e[43]=s("span",{class:"text-muted-foreground"},"Explorer Status:",-1)),l(a(h),{variant:(t=u.user.explorer_status)!=null&&t.includes("active")||u.user.explorer_status==="trial"||u.user.explorer_status==="gift"||u.user.explorer_status==="crm"||u.user.explorer_status==="free"?"default":u.user.explorer_status==="churned"?"destructive":"secondary",class:"text-[10px] sm:text-xs capitalize"},{default:r(()=>[d(i(u.user.explorer_status||"None"),1)]),_:1},8,["variant"])]),s("div",zs,[e[44]||(e[44]=s("span",{class:"text-muted-foreground"},"Billing:",-1)),l(a(h),{variant:"outline",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(Ke(u.user.billing_source)),1)]),_:1})]),s("div",Os,[e[45]||(e[45]=s("span",{class:"text-muted-foreground"},"Stripe:",-1)),u.user.stripe_customer_id?(n(),o("a",{key:0,href:`https://dashboard.stripe.com/acct_1LxSeXFwWLm7DSMf/customers/${u.user.stripe_customer_id}`,target:"_blank",class:"flex items-center gap-1 font-mono text-[10px] sm:text-xs hover:underline truncate"},[d(i(u.user.stripe_customer_id)+" ",1),l(a(se),{class:"h-3 w-3 shrink-0"})],8,Bs)):(n(),o("span",Gs,"None"))]),s("div",qs,[e[52]||(e[52]=s("span",{class:"text-muted-foreground"},"CRM:",-1)),u.user.crm_customer_id&&!Q.value?(n(),o(C,{key:0},[s("a",{href:`https://app.crm.com/contacts/contact/${u.user.crm_customer_id}`,target:"_blank",class:"flex items-center gap-1 font-mono text-[10px] sm:text-xs hover:underline truncate"},[d(i(u.user.crm_customer_id)+" ",1),l(a(se),{class:"h-3 w-3 shrink-0"})],8,Ws),l(a(y),{onClick:ut,variant:"ghost",size:"sm",class:"h-5 text-[10px] px-1"},{default:r(()=>[...e[46]||(e[46]=[d(" Edit ",-1)])]),_:1})],64)):Q.value?(n(),o(C,{key:1},[l(a(q),{modelValue:Z.value,"onUpdate:modelValue":e[9]||(e[9]=g=>Z.value=g),class:"h-6 text-[10px] font-mono flex-1 max-w-[200px]"},null,8,["modelValue"]),l(a(y),{onClick:ct,disabled:p.savingCrmId,variant:"outline",size:"sm",class:"h-5 text-[10px] px-2"},{default:r(()=>[p.savingCrmId?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[47]||(e[47]=d(" Save ",-1))]),_:1},8,["disabled"]),l(a(y),{onClick:mt,disabled:p.savingCrmId,variant:"ghost",size:"sm",class:"h-5 text-[10px] px-1"},{default:r(()=>[...e[48]||(e[48]=[d(" Cancel ",-1)])]),_:1},8,["disabled"])],64)):(n(),o(C,{key:2},[e[51]||(e[51]=s("span",{class:"font-mono text-[10px] sm:text-xs"},"None",-1)),l(a(y),{onClick:ot,disabled:p.checkingCrmId||p.creatingCrmId,variant:"outline",size:"sm",class:"h-5 text-[10px] px-2"},{default:r(()=>[p.checkingCrmId?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[49]||(e[49]=d(" Look up ",-1))]),_:1},8,["disabled"]),l(a(y),{onClick:dt,disabled:p.creatingCrmId||p.checkingCrmId,variant:"outline",size:"sm",class:"h-5 text-[10px] px-2"},{default:r(()=>[p.creatingCrmId?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[50]||(e[50]=d(" Create ",-1))]),_:1},8,["disabled"])],64))]),s("div",Ys,[e[53]||(e[53]=s("span",{class:"text-muted-foreground"},"Resend:",-1)),u.user.resend_id?(n(),o("span",Hs,i(u.user.resend_id),1)):(n(),o("span",Js,"None"))]),s("div",Ks,[e[54]||(e[54]=s("span",{class:"text-muted-foreground"},"Joined:",-1)),s("span",null,i(v(u.user.created_at)),1)]),s("div",Xs,[e[55]||(e[55]=s("span",{class:"text-muted-foreground"},"Last Access:",-1)),s("span",null,i(u.user.last_access_on?T(u.user.last_access_on):"Never"),1)]),s("div",Qs,[e[56]||(e[56]=s("span",{class:"text-muted-foreground"},"Country:",-1)),u.user.user_country?(n(),o("div",Zs,[l(a(h),{variant:"outline",class:"text-[10px] sm:text-xs font-mono"},{default:r(()=>[d(i(u.user.user_country),1)]),_:1}),s("span",null,i(u.user.country_name),1)])):(n(),o("span",ea,"-"))])])])]}),_:1})]),_:1}),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 text-base sm:text-lg"},{default:r(()=>[e[58]||(e[58]=s("span",null,"Subscriptions",-1)),u.user.stripe_customer_id?(n(),x(a(y),{key:0,onClick:Ae,disabled:p.syncingStripe,variant:"outline",size:"sm",class:"text-xs sm:text-[13px]"},{default:r(()=>[p.syncingStripe?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 sm:mr-2 animate-spin"})):c("",!0),e[57]||(e[57]=d(" Sync Stripe ",-1))]),_:1},8,["disabled"])):c("",!0)]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0 space-y-4"},{default:r(()=>[ee.value.length>0?(n(),o("div",ta,[e[64]||(e[64]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"}
5,"Active Subscriptions",-1)),s("div",sa,[(n(!0),o(C,null,j(ee.value,t=>(n(),o("div",{key:t.id,class:"border rounded-lg p-2.5 sm:p-4 space-y-2"},[s("div",aa,[s("div",la,i(t.plan_name),1),l(a(h),{variant:oe(t.status),class:"text-[10px] sm:text-xs shrink-0"},{default:r(()=>[d(i(t.status),1)]),_:2},1032,["variant"])]),s("div",ra,[s("div",null,i(Y(t.amount,t.currency))+" / "+i(t.interval),1),s("div",null,"Billing anchor: "+i(v(t.next_billing_date)),1),t.ends_at?(n(),o("div",na," Cancelled – expires on "+i(v(t.ends_at)),1)):t.upc_invoice_date||t.upc_invoice_amnt?(n(),o("div",ia,[d(" Upcoming payment: "+i(t.upc_invoice_amnt?Y(t.upc_invoice_amnt,t.currency):"N/A")+" ",1),t.upc_invoice_date?(n(),o("span",oa," on "+i(v(t.upc_invoice_date)),1)):c("",!0)])):c("",!0),s("div",da,i(t.stripe_subscription_id),1)]),t.trial_ends_at?(n(),x(a(h),{key:0,variant:"secondary",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(" Trial ends: "+i(v(t.trial_ends_at)),1)]),_:2},1024)):c("",!0),t.is_gift_subscription?(n(),o("div",ua,[s("div",ma,[l(a(h),{variant:"secondary",class:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200 text-[10px]"},{default:r(()=>[...e[59]||(e[59]=[d(" Gift Membership ",-1)])]),_:1})]),s("div",ca,[t.gift_ends_at?(n(),o("div",pa,"Gift ends: "+i(v(t.gift_ends_at)),1)):c("",!0),t.paid_resumes_at?(n(),o("div",fa,"Paid resumes: "+i(v(t.paid_resumes_at)),1)):c("",!0),t.stripe_schedule_id?(n(),o("div",xa," Schedule: "+i(t.stripe_schedule_id),1)):c("",!0)])])):c("",!0)]))),128))]),Xe.value?(n(),o("div",va,[e[62]||(e[62]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"Subscription Schedule",-1)),s("div",ga,[_.value?(n(),o("div",{key:0,class:b(["flex items-center gap-3 p-2 sm:p-3 border rounded-lg",{"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":_.value.type==="gift","bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800":_.value.type==="trial","bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800":_.value.type==="paid"||_.value.type==="unknown"}])},[s("div",{class:b(["w-2.5 h-2.5 rounded-full animate-pulse shrink-0",{"bg-amber-500":_.value.type==="gift","bg-orange-500":_.value.type==="trial","bg-green-500":_.value.type==="paid"||_.value.type==="unknown"}])},null,2),s("div",_a,[s("div",{class:b(["text-xs sm:text-sm font-medium",{"text-amber-900 dark:text-amber-100":_.value.type==="gift","text-orange-900 dark:text-orange-100":_.value.type==="trial","text-green-900 dark:text-green-100":_.value.type==="paid"||_.value.type==="unknown"}])},[d(i(_.value.type==="gift"?"Gift Phase":_.value.type==="trial"?"Trial Phase":_.value.type==="paid"?"Paid Phase":"Current Phase")+" ",1),s("span",{class:b(["font-normal",{"text-amber-700 dark:text-amber-300":_.value.type==="gift","text-orange-700 dark:text-orange-300":_.value.type==="trial","text-green-700 dark:text-green-300":_.value.type==="paid"||_.value.type==="unknown"}])}," - "+i(_.value.product_name),3)],2),s("div",{class:b(["text-[10px] sm:text-xs",{"text-amber-600 dark:text-amber-400":_.value.type==="gift","text-orange-600 dark:text-orange-400":_.value.type==="trial","text-green-600 dark:text-green-400":_.value.type==="paid"||_.value.type==="unknown"}])},[_.value.end_date?(n(),o("span",ya,"Ends: "+i(v(_.value.end_date)),1)):(n(),o("span",ha,"No end date (recurring)"))],2)]),l(a(h),{variant:"secondary",class:b(["text-[10px] shrink-0",{"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200":_.value.type==="gift","bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200":_.value.type==="trial","bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":_.value.type==="paid"||_.value.type==="unknown"}])},{default:r(()=>[...e[60]||(e[60]=[d(" Active ",-1)])]),_:1},8,["class"])],2)):c("",!0),(n(!0),o(C,null,j(Qe.value,(t,g)=>(n(),o("div",{key:g,class:b(["flex items-center gap-3 p-2 sm:p-3 border rounded-lg",{"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800":t.type==="paid","bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":t.type==="gift"}])},[s("div",{class:b(["w-2.5 h-2.5 rounded-full shrink-0",t.type==="paid"?"bg-green-500":"bg-amber-500"])},null,2),s("div",ka,[s("div",{class:b(["text-xs sm:text-sm font-medium",t.type==="paid"?"text-green-900 dark:text-green-100":"text-amber-900 dark:text-amber-100"])},[d(i(t.type==="gift"?"Gift Phase":t.type==="paid"?"Paid Phase":"Phase")+" ",1),s("span",{class:b(["font-normal",t.type==="paid"?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"])}," - "+i(t.product_name),3)],2),s("div",{class:b(["text-[10px] sm:text-xs",t.type==="paid"?"text-green-600 dark:text-green-400":"text-amber-600 dar
5k:text-amber-400"])},[d(" Starts: "+i(v(t.start_date))+" ",1),t.end_date?(n(),o("span",ba," • Ends: "+i(v(t.end_date)),1)):c("",!0)],2)]),l(a(h),{variant:"outline",class:b(["text-[10px] shrink-0",t.type==="paid"?"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300":"border-amber-300 text-amber-700 dark:border-amber-700 dark:text-amber-300"])},{default:r(()=>[...e[61]||(e[61]=[d(" Scheduled ",-1)])]),_:1},8,["class"])],2))),128))])])):c("",!0),s("div",wa,[e[63]||(e[63]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"Payment Method",-1)),u.paymentMethod?(n(),o("div",Ca,[l(a(Ht),{"payment-method":u.paymentMethod,size:"sm"},null,8,["payment-method"]),s("div",Sa,[s("div",$a,i(a($)(u.paymentMethod)),1),a(D)(u.paymentMethod)?(n(),o("div",{key:0,class:b(["text-[10px] sm:text-xs",a(M)(u.paymentMethod)?"text-red-500":"text-muted-foreground"])},i(a(M)(u.paymentMethod)?"Expired":"Expires")+" "+i(a(D)(u.paymentMethod)),3)):c("",!0)])])):(n(),o("div",Ea,"No payment method on file"))])])):c("",!0),ee.value.length>0&&u.appleSubscriptions.length>0?(n(),x(a(ae),{key:1})):c("",!0),u.appleSubscriptions.length>0?(n(),o("div",Pa,[e[67]||(e[67]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"App Store",-1)),s("div",Da,[(n(!0),o(C,null,j([...qe.value,...We.value],t=>(n(),o("div",{key:t.id,class:b(["border rounded-lg p-2.5 sm:p-4 space-y-2",t.is_active?"":"opacity-60"])},[s("div",Ma,[s("div",Ra,i(t.product),1),s("div",ja,[t.environment==="Sandbox"?(n(),x(a(h),{key:0,variant:"outline",class:"text-[10px] sm:text-xs"},{default:r(()=>[...e[65]||(e[65]=[d("Sandbox",-1)])]),_:1})):c("",!0),t.is_trial?(n(),x(a(h),{key:1,variant:"secondary",class:"text-[10px] sm:text-xs"},{default:r(()=>[...e[66]||(e[66]=[d("Trial",-1)])]),_:1})):c("",!0),l(a(h),{variant:Je(t.status),class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(t.status.replace("_"," ")),1)]),_:2},1032,["variant"])])]),s("div",Fa,[t.price&&t.currency?(n(),o("div",Aa,[d(i(Y(t.price,t.currency)),1),t.storefront?(n(),o("span",Ia," · "+i(t.storefront),1)):c("",!0)])):(n(),o("div",Va,"Price not reported yet")),t.is_active&&t.auto_renew&&t.expires_at?(n(),o("div",Na,"Renews: "+i(v(t.expires_at)),1)):t.is_active&&t.expires_at?(n(),o("div",Ua,"Cancelled – expires on "+i(v(t.expires_at)),1)):t.expires_at?(n(),o("div",La,"Ended: "+i(v(t.expires_at)),1)):c("",!0),t.grace_expires_at?(n(),o("div",Ta,"Grace period until "+i(v(t.grace_expires_at)),1)):c("",!0),t.original_purchase_at?(n(),o("div",za,"First purchased: "+i(v(t.original_purchase_at)),1)):c("",!0),t.trial_converted_at?(n(),o("div",Oa,"Trial converted: "+i(v(t.trial_converted_at)),1)):c("",!0),t.linked_at?(n(),o("div",Ba,"Linked to account: "+i(v(t.linked_at)),1)):c("",!0),t.last_notification_at?(n(),o("div",Ga,"Last update from Apple: "+i(T(t.last_notification_at)),1)):c("",!0),s("div",{class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate",title:t.product_id},i(t.product_id)+" · "+i(t.original_transaction_id),9,qa)])],2))),128))])])):c("",!0),u.googleSubscriptions.length>0&&(ee.value.length>0||u.appleSubscriptions.length>0)?(n(),x(a(ae),{key:3})):c("",!0),u.googleSubscriptions.length>0?(n(),o("div",Wa,[e[70]||(e[70]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"Google Play",-1)),s("div",Ya,[(n(!0),o(C,null,j(u.googleSubscriptions,t=>(n(),o("div",{key:t.id,class:b(["border rounded-lg p-2.5 sm:p-4 space-y-2",t.is_active?"":"opacity-60"])},[s("div",Ha,[s("div",Ja,i(t.base_plan_id?`${t.product_id} (${t.base_plan_id})`:t.product_id),1),s("div",Ka,[t.test_purchase?(n(),x(a(h),{key:0,variant:"outline",class:"text-[10px] sm:text-xs"},{default:r(()=>[...e[68]||(e[68]=[d("Test",-1)])]),_:1})):c("",!0),t.replaced_at?(n(),x(a(h),{key:1,variant:"outline",class:"text-[10px] sm:text-xs"},{default:r(()=>[...e[69]||(e[69]=[d("Replaced",-1)])]),_:1})):c("",!0),l(a(h),{variant:He(t.state),class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(t.state.replaceAll("_"," ").toLowerCase()),1)]),_:2},1032,["variant"])])]),s("div",Xa,[t.is_active&&t.auto_renewing&&t.expires_at?(n(),o("div",Qa,"Renews: "+i(v(t.expires_at)),1)):t.is_active&&t.expires_at?(n(),o("div",Za,"Cancelled – expires on "+i(v(t.expires_at)),1)):t.expires_at?(n(),o("div",el,"Ended: "+i(v(t.expires_at)),1)):c("",!0),t.offer_id?(n(),o("div",tl,"Offer: "+i(t.offer_id),1)):c("",!0),t.created_at?(n(),o("div",sl,"First seen: "+i(v(t.created_at)),1)):c("",!0),t.linked_at?(n(),o("div",al,"Linked to account: "+i(v(t.linked_at)),1)):c("",!0),t.replaced_at?(n(),o("div",ll,"Replaced: "+i(v(t.replaced_at)),1)):c("",!0),t.last_synced_at?(n(),o("div",rl,"Last update from Google: "+i(T(t.last_synced_at)),1)):c("",!0),s("div",{class:"sm:col-span-2 font-mono text-[10px] sm:text-xs truncate",title:t.package_name},[d(i(t.package_name),1),t.latest_order_id?(n(),o("span",il," · "+i(t.latest_order_id),1)):c("",!0)],8,nl)])],2))),128))])])):c("",!0),ee.value.length>0&&ce.value.length>0?(n(),x(a(ae),{key:5})):c("",!0),ce.value.length>0?(n(),o("div",ol,[e[71]||(e[71]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"}
5,"Past Subscriptions",-1)),s("div",dl,[(n(!0),o(C,null,j(ce.value,t=>(n(),o("div",{key:t.id,class:"border rounded-lg p-2.5 sm:p-4 space-y-2 opacity-60"},[s("div",ul,[s("div",ml,i(t.plan_name),1),l(a(h),{variant:oe(t.status),class:"text-[10px] sm:text-xs shrink-0"},{default:r(()=>[d(i(t.status),1)]),_:2},1032,["variant"])]),s("div",cl,[s("div",null,i(Y(t.amount,t.currency))+" / "+i(t.interval),1),t.ends_at?(n(),o("div",pl,"Ended: "+i(v(t.ends_at)),1)):c("",!0),s("div",fl,i(t.stripe_subscription_id),1)])]))),128))])])):c("",!0),Ye.value?c("",!0):(n(),o("div",xl," No subscriptions found "))]),_:1})]),_:1}),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 text-base sm:text-lg"},{default:r(()=>[e[74]||(e[74]=s("span",null,"CRM Services",-1)),s("div",vl,[ie.value.length===0?(n(),x(a(y),{key:0,onClick:rt,disabled:p.addingFreeService,variant:"outline",size:"sm",class:"text-xs sm:text-[13px]"},{default:r(()=>[p.addingFreeService?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 sm:mr-2 animate-spin"})):c("",!0),e[72]||(e[72]=d(" Free Access ",-1))]),_:1},8,["disabled"])):c("",!0),l(a(y),{onClick:lt,disabled:p.syncingCrm,variant:"outline",size:"sm",class:"text-xs sm:text-[13px]"},{default:r(()=>[p.syncingCrm?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 sm:mr-2 animate-spin"})):c("",!0),e[73]||(e[73]=d(" Sync ",-1))]),_:1},8,["disabled"])])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0 space-y-4"},{default:r(()=>[ie.value.length>0?(n(),o("div",gl,[e[77]||(e[77]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"Active Services",-1)),s("div",_l,[(n(!0),o(C,null,j(ie.value,t=>(n(),o("div",{key:t.id,class:"border rounded-lg p-2.5 sm:p-4 space-y-2"},[s("div",yl,[s("div",hl,i(t.product_name),1),s("div",kl,[l(a(h),{variant:oe(t.state),class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(t.state),1)]),_:2},1032,["variant"]),t.billing_type!=="FREE"?(n(),x(a(y),{key:0,onClick:g=>it(t.crm_service_id),disabled:p.migratingService===t.crm_service_id,variant:"outline",size:"sm",class:"h-5 sm:h-6 text-[10px] sm:text-xs px-1.5 sm:px-2"},{default:r(()=>[p.migratingService===t.crm_service_id?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[75]||(e[75]=d(" Migrate ",-1))]),_:2},1032,["onClick","disabled"])):c("",!0),l(a(y),{onClick:g=>nt(t.crm_service_id),disabled:p.cancellingService===t.crm_service_id,variant:"destructive",size:"sm",class:"h-5 sm:h-6 text-[10px] sm:text-xs px-1.5 sm:px-2"},{default:r(()=>[p.cancellingService===t.crm_service_id?(n(),x(a(F),{key:0,class:"h-3 w-3 mr-1 animate-spin"})):c("",!0),e[76]||(e[76]=d(" Cancel ",-1))]),_:2},1032,["onClick","disabled"])])]),s("div",bl,[s("div",null,i(Y(t.amount,t.currency))+" / "+i(t.interval),1),s("div",null,"Last billed: "+i(v(t.last_billing_date)),1),s("div",null,"Payment method: "+i(t.billing_type),1),s("div",null,"Next billing: "+i(v(t.
5next_billing_date)),1),s("div",null,"Started: "+i(v(t.started_at)),1),s("div",wl,i(t.crm_service_id),1)])]))),128))])])):c("",!0),ie.value.length>0&&pe.value.length>0?(n(),x(a(ae),{key:1})):c("",!0),pe.value.length>0?(n(),o("div",Cl,[e[78]||(e[78]=s("h4",{class:"text-xs sm:text-sm font-semibold mb-2 sm:mb-3"},"Past Services",-1)),s("div",Sl,[(n(!0),o(C,null,j(pe.value,t=>(n(),o("div",{key:t.id,class:"border rounded-lg p-2.5 sm:p-4 space-y-2 opacity-60"},[s("div",$l,[s("div",El,i(t.product_name),1),l(a(h),{variant:oe(t.state),class:"text-[10px] sm:text-xs shrink-0"},{default:r(()=>[d(i(t.state),1)]),_:2},1032,["variant"])]),s("div",Pl,[s("div",null,i(Y(t.amount,t.currency))+" / "+i(t.interval),1),s("div",null,i(t.billing_type),1),s("div",null,"Last billed: "+i(v(t.last_billing_date)),1),t.ended_at?(n(),o("div",Dl,"Ended: "+i(v(t.ended_at)),1)):c("",!0),s("div",null,"Started: "+i(v(t.started_at)),1),s("div",Ml,i(t.crm_service_id),1)])]))),128))])])):c("",!0),u.user.crm_services.length===0?(n(),o("div",Rl," No CRM services found ")):c("",!0)]),_:1})]),_:1}),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex items-center gap-2 text-base sm:text-lg"},{default:r(()=>[l(a(Et),{class:"h-4 w-4"}),e[79]||(e[79]=d(" Promo Codes ",-1))]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...e[80]||(e[80]=[d("Promo codes this user has redeemed",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>[u.promoRedemptions.length>0?(n(),o("div",jl,[s("div",Fl,[s("table",Al,[e[81]||(e[81]=s("thead",{class:"bg-muted/50 border-b"},[s("tr",null,[s("th",{class:"text-left p-2 font-medium"},"Code"),s("th",{class:"text-left p-2 font-medium"},"Discount"),s("th",{class:"text-left p-2 font-medium"},"Redeemed"),s("th",{class:"text-left p-2 font-medium hidden sm:table-cell"},"Subscription"),s("th",{class:"text-left p-2 font-medium hidden sm:table-cell"},"Coupon")])],-1)),s("tbody",Il,[(n(!0),o(C,null,j(u.promoRedemptions,t=>(n(),o("tr",{key:t.id,class:"hover:bg-muted/30"},[s("td",Vl,[l(a(h),{variant:"secondary",class:"text-[10px] font-mono"},{default:r(()=>[d(i(t.code||"Unknown"),1)]),_:2},1024)]),s("td",Nl,[t.discount_percent!=null?(n(),o("span",Ul,i(t.discount_percent)+"% off "+i(t.product)+"ly",1)):(n(),o("span",Ll,"-"))]),s("td",Tl,i(v(t.redeemed_at)),1),s("td",zl,i(t.subscription_id??"-"),1),s("td",Ol,i(t.stripe_coupon_id||"-"),1)]))),128))])])])])):(n(),o("div",Bl," No promo codes redeemed "))]),_:1})]),_:1}),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex items-center gap-2 text-base sm:text-lg"},{default:r(()=>[l(a(Pt),{class:"h-4 w-4"}),e[82]||(e[82]=d(" Referrals ",-1))]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...e[83]||(e[83]=[d("Referral code, attribution, and referred explorers",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0 space-y-4 sm:space-y-6"},{default:r(()=>[s("div",Gl,[s("div",ql,[e[85]||(e[85]=s("h4",{class:"text-xs sm:text-sm font-semibold"},"Referral Code",-1)),s("div",Wl,[e[84]||(e[84]=s("span",{class:"text-muted-foreground"},"Code:",-1)),s("span",Yl,i(u.referral.code||"None"),1)]),u.referral.link?(n(),o("div",Hl,[l(a(q),{"model-value":u.referral.link,readonly:"",class:"h-8 text-[10px] sm:text-xs font-mono flex-1"},null,8,["model-value"]),l(a(y),{variant:"outline",size:"sm",class:"h-8 shrink-0 px-2",onClick:pt},{default:r(()=>[fe.value?(n(),x(a(ye),{key:0,class:"h-3.5 w-3.5 text-green-600"})):(n(),x(a(he),{key:1,class:"h-3.5 w-3.5"}))]),_:1})])):c("",!0)]),s("div",Jl,[e[91]||(e[91]=s("h4",{class:"text-xs sm:text-sm font-semibold"},"Referred By",-1)),u.referral.referred_by_code?(n(),o(C,{key:0},[s("div",Kl,[e[86]||(e[86]=s("span",{class:"text-muted-foreground"},"Referrer:",-1)),u.referral.referred_by?(n(),x(a(Pe),{key:0,href:m.route("admin.users.show",u.referral.referred_by.id),class:"flex items-center gap-1 hover:underline"},{default:r(()=>[d(i(u.referral.referred_by.name)+" ",1),l(a(se),{class:"h-3 w-3 shrink-0"})]),_:1},8,["href"])):(n(),o("span",Xl,"Unknown (code no longer exists)"))]),s("div",Ql,[e[87]||(e[87]=s("span",{class:"text-muted-foreground"},"Via code:",-1)),s("span",Zl,i(u.referral.referred_by_code),1)]),s("div",er,[e[88]||(e[88]=s("span",{class:"text-muted-foreground"},"Status:",-1)),l(a(h),{variant:Ie(u.referral.status),class:"text-[10px] sm:text-xs capitalize"},{default:r(()=>[d(i(u.referral.status||"None"),1)]),_:1},8,["variant"])]),s("div",tr,[e[89]||(e[89]=s("span",{class:"text-muted-foreground"},"Referred on:",-1)),s("span",null,i(T(u.referral.referred_at)),1)]),s("div",sr,[e[90]||(e[90]=s("span",{class:"text-muted-foreground"},"Converted on:",-1)),s("span",null,i(u.referral.converted_at?T(u.referral.converted_at):"Not converted"),1)])],64)):(n(),o("div",ar,"Not referred by anyone."))])]),l(a(ae)),s("div",null,[s("div",lr,[e[92]||(e[92]=s("h4",{class:"text-xs sm:text-sm font-semibold"},"Referred Explorers",-1)),l(a(h),{variant:"outline",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(u.referral.referred_counts.total)+" total",1)]),_:1}),l(a(h),{variant:"secondary",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(u.referral.referred_counts.pending)+" pending",1)]),_:1}),l(a(h),{variant:"default",class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(u.referral.referred_counts.successful)+" successful",1)]),_:1})]),u.referral.referred_users.length>0?(n(),o("div",rr,[s("div",nr,[s("table",ir,[e[93]||(e[93]=s("thead",{class:"bg-muted/50 border-b"},[s("tr",null,[s("th",{class:"text-left p-2 font-medium"},"Explorer"),s("th",{class:"text-left p-2 font-medium"},"Status"),s("th",{class:"text-left p-2 font-medium"},"Referred"),s("th",{class:"text-left p-2 font-medium"}
5,"Converted")])],-1)),s("tbody",or,[(n(!0),o(C,null,j(u.referral.referred_users,t=>(n(),o("tr",{key:t.id,class:"hover:bg-muted/30"},[s("td",dr,[l(a(Pe),{href:m.route("admin.users.show",t.id),class:"flex items-center gap-1 hover:underline"},{default:r(()=>[d(i(t.name)+" ",1),l(a(se),{class:"h-3 w-3 shrink-0"})]),_:2},1032,["href"])]),s("td",ur,[l(a(h),{variant:Ie(t.status),class:"text-[10px] capitalize"},{default:r(()=>[d(i(t.status||"None"),1)]),_:2},1032,["variant"])]),s("td",mr,i(v(t.referred_at)),1),s("td",cr,i(t.converted_at?v(t.converted_at):"-"),1)]))),128))])])])])):(n(),o("div",pr," This user hasn't referred anyone yet. "))])]),_:1})]),_:1}),l(ns,{"user-id":u.user.id,devices:u.devices},null,8,["user-id","devices"]),l(vs,{rows:u.appActivity},null,8,["rows"]),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"text-base sm:text-lg"},{default:r(()=>[...e[94]||(e[94]=[d("Notes",-1)])]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...e[95]||(e[95]=[d("Internal notes (only visible to admins)",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>[l(a(Vt),{modelValue:w.value.notes,"onUpdate:modelValue":e[10]||(e[10]=t=>w.value.notes=t),placeholder:"Add notes about this user...",class:b(["min-h-[80px] sm:min-h-[120px] text-sm",O.value.notes?"border-blue-500 focus-visible:ring-blue-500":""])},null,8,["modelValue","class"])]),_:1})]),_:1}),u.user.payments.length>0?(n(),x(a(V),{key:1},{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"text-base sm:text-lg"},{default:r(()=>[...e[96]||(e[96]=[d("Payment History",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>[s("div",fr,[s("div",xr,[s("table",vr,[e[98]||(e[98]=s("thead",{class:"bg-muted/50 border-b"},[s("tr",null,[s("th",{class:"text-left p-2 font-medium"},"Platform"),s("th",{class:"text-left p-2 font-medium"},"Date"),s("th",{class:"text-right p-2 font-medium"},"Amount"),s("th",{class:"text-left p-2 font-medium"},"Method"),s("th",{class:"text-left p-2 font-medium hidden sm:table-cell"},"Reference")])],-1)),s("tbody",gr,[(n(!0),o(C,null,j(u.user.payments,t=>(n(),o("tr",{key:t.id,class:"hover:bg-muted/30"},[s("td",_r,[l(a(h),{variant:"secondary",class:"text-[10px] font-mono"},{default:r(()=>[d(i(t.source.toUpperCase()),1)]),_:2},1024)]),s("td",yr,i(T(t.posted_datetime)),1),s("td",hr,[s("span",{class:b(t.refunded_at?"line-through text-muted-foreground":"")},i(Y(t.amount,t.currency)),3),t.refunded_at?(n(),x(a(h),{key:0,variant:"destructive",class:"ml-1 text-[10px]",title:`Refunded ${T(t.refunded_at)}`},{default:r(()=>[...e[97]||(e[97]=[d("Refunded",-1)])]),_:1},8,["title"])):c("",!0)]),s("td",kr,[l(a(h),{variant:"outline",class:"text-[10px] font-mono"},{default:r(()=>[d(i(t.payment_method),1)]),_:2},1024)]),s("td",br,[t.external_reference&&t.payment_method==="PAYPAL"?(n(),o("a",{key:0,href:`https://www.paypal.com/billing/subscriptions/${t.external_reference}`,target:"_blank",class:"hover:underline flex items-center gap-1"},[d(i(t.external_reference)+" ",1),l(a(se),{class:"h-3 w-3 shrink-0"})],8,wr)):(n(),o("span",Cr,i(t.external_reference||"-"),1))])]))),128))])])])])]),_:1})]),_:1})):c("",!0),l(a(V),null,{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"text-base sm:text-lg"},{default:r(()=>[...e[99]||(e[99]=[d("Activity Log",-1)])]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...e[100]||(e[100]=[d("Recent user events and activities",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 sm:p-6 pt-0 sm:pt-0"},{default:r(()=>[u.eventLogs.length>0?(n(),o("div",Sr,[(n(!0),o(C,null,j(u.eventLogs,t=>(n(),o("div",{key:t.id,class:"p-2 sm:p-3 border rounded-lg"},[s("div",$r,[l(a(h),{variant:et(t.event_type),class:"text-[10px] sm:text-xs"},{default:r(()=>[d(i(Ze(t.event_type)),1)]),_:2},1032,["variant"]),s("span",Er,i(T(t.created_at)),1)]),t.event_data&&Object.keys(t.event_data).length>0?(n(),o("div",Pr,[(n(!0),o(C,null,j(t.event_data,(g,z)=>(n(),o("div",{key:z,class:"flex gap-1 flex-wrap"},[s("span",Dr,i(z)+":",1),s("span",Mr,i(typeof g=="object"?JSON.stringify(g):g),
51)]))),128))])):c("",!0),t.ip_address?(n(),o("div",Rr," IP: "+i(t.ip_address),1)):c("",!0)]))),128))])):(n(),o("div",jr," No activity logs found "))]),_:1})]),_:1}),je.value?c("",!0):(n(),x(a(V),{key:2,class:"border-red-200 dark:border-red-900/50"},{default:r(()=>[l(a(N),{class:"p-3 sm:p-6"},{default:r(()=>[l(a(U),{class:"flex items-center gap-2 text-base text-red-600 sm:text-lg dark:text-red-400"},{default:r(()=>[l(a(te),{class:"h-4 w-4"}),e[101]||(e[101]=d(" Delete User Account ",-1))]),_:1}),l(a(W),{class:"text-xs sm:text-sm"},{default:r(()=>[...e[102]||(e[102]=[d("Deactivate this account now and schedule permanent deletion after 30 days",-1)])]),_:1})]),_:1}),l(a(L),{class:"p-3 pt-0 sm:p-6 sm:pt-0"},{default:r(()=>[s("div",Fr,[e[110]||(e[110]=s("div",{class:"relative space-y-0.5 text-red-600 dark:text-red-100"},[s("p",{class:"font-medium"},"Warning"),s("p",{class:"text-sm"}," The user will be signed out on every device immediately. The request can be cancelled during the 30-day grace period. ")],-1)),l(a(be),{open:S.value,"onUpdate:open":e[13]||(e[13]=t=>S.value=t)},{default:r(()=>[l(a(De),{"as-child":""},{default:r(()=>[l(a(y),{variant:"destructive"},{default:r(()=>[l(a(te),{class:"mr-2 h-4 w-4"}),e[103]||(e[103]=d(" Mark for deletion ",-1))]),_:1})]),_:1}),l(a(we),null,{default:r(()=>[l(a(Ce),{class:"space-y-3"},{default:r(()=>[l(a(Se),null,{default:r(()=>[...e[104]||(e[104]=[d("Mark this user for deletion?",-1)])]),_:1}),l(a($e),null,{default:r(()=>[s("span",Ar,i(u.user.name),1),d(" ("+i(u.user.email)+") will be deactivated and signed out immediately. Permanent deletion is scheduled after 30 days. During the grace period an admin can cancel the request or deliberately purge early. ",1),e[105]||(e[105]=s("ul",{class:"mt-2 list-inside list-disc space-y-1"},[s("li",null,"Stripe subscriptions are scheduled to cancel at period end"),s("li",null,"Apple authorization revocation is attempted immediately"),s("li",null,"Permanent provider and local cleanup happens at purge")],-1))]),_:1})]),_:1}),s("div",Ir,[l(a(K),{for:"confirm-email",class:"flex flex-wrap items-center gap-1 text-sm"},{default:r(()=>[e[106]||(e[106]=d(" Type ",-1)),s("span",Vr,i(u.user.email),1),l(a(y),{type:"button",variant:"ghost",size:"sm",class:"h-6 w-6 p-0","aria-label":"Copy email",title:"Copy email",onClick:Oe(Ve,["prevent"])},{default:r(()=>[de.value?(n(),x(a(ye),{key:0,class:"h-3.5 w-3.5 text-green-600"})):(n(),x(a(he),{key:1,class:"h-3.5 w-3.5"}))]),_:1}),e[107]||(e[107]=d(" to confirm: ",-1))]),_:1}),l(a(q),{id:"confirm-email",modelValue:P.value,"onUpdate:modelValue":e[11]||(e[11]=t=>P.value=t),placeholder:"Enter user's email to confirm",onKeyup:e[12]||(e[12]=ke(t=>ge.value&&Ne(),["enter"]))},null,8,["modelValue"])]),l(a(Ee),{class:"gap-2"},{default:r(()=>[l(a(Me),{"as-child":""},{default:r(()=>[l(a(y),{variant:"secondary",onClick:gt},{default:r(()=>[...e[108]||(e[108]=[d("Cancel",-1)])]),_:1})]),_:1}),l(a(y),{variant:"destructive",disabled:!ge.value||p.deleting,onClick:Ne},{default:r(()=>[p.deleting?(n(),x(a(F),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):(n(),x(a(te),{key:1,class:"mr-2 h-4 w-4"})),e[109]||(e[109]=d(" Mark for deletion ",-1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])])]),_:1})]),_:1}))])]),l(a(Wt))],64))}});export{fn 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.