1import{r as j,c as S,o as a,f as r,b as t,F as W,j as U,n as v,a as A,e as E,t as i,g as p,s as to,k as Wo,w as R,d as u,u as c,p as To,E as Lo,h as X,y as Uo}from"./runtime-dom.esm-bundler-BFbfmLfl.js";import{l as I}from"./index.esm-C8-Okse2.js";import{_ as Io}from"./AdminLayout-Cgk7W50i.js";import{C as $o,c as Do,d as Fo,P as Mo,a as Po,b as Vo,A as Oo,f as Bo,p as No,g as Ho,i as Eo}from"./chart-Cv9xaQMa.js";import{L as xt,D as eo,B as qo}from"./index-BMafh1R5.js";import{_ as so}from"./InfoTooltip-DAxg17YF.js";import{_ as co}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{U as $}from"./users-DYBNM71i.js";import{U as Zo}from"./user-cog-DiQjNlCF.js";import{C as q}from"./circle-user-DMKCWv9T.js";import{G as et}from"./globe-BUoYScDl.js";import{M as vt}from"./MobileChartContainer-C1YFWu8Y.js";import{C as Go}from"./ConversationSlidePanel-BLAv8eN2.js";import{A as bt}from"./activity-BSQ_zaAq.js";import{C as Ko}from"./chevron-left-BqH44XVe.js";import{R as oo}from"./refresh-cw-BJBMRU9v.js";import{A as at,C as Jo}from"./circle-alert-ByG7DPjo.js";import{B as rt}from"./bot-CxYjJeh9.js";import{T as lt,K as Yo,M as Qo}from"./LoginModal-BMeMPme8.js";import{T as io}from"./trending-down-C9nvmhlF.js";import{M as ht,C as tt}from"./app-Dvzl3QXw.js";import{C as Xo}from"./clock-wtOYjiba.js";import{P as ti}from"./pound-sterling-DallvfDR.js";import{S as no}from"./sparkles-B9lXBQmj.js";import{C as ao}from"./credit-card-Dn2M7EkH.js";import{U as ei}from"./user-minus-BeGFarJF.js";import{A as gt}from"./arrow-down-DLiNSFmf.js";import{S as ro}from"./settings-kph8Slzw.js";import{T as lo}from"./target-CZ1Df2lJ.js";import{E as ft}from"./eye-hgQz1Bz5.js";import{S as si}from"./server-B4Aakc-R.js";import{Z as oi}from"./zap-BONcfJMP.js";import{T as ii}from"./triangle-alert-P9kpP2tT.js";import{F as ni}from"./file-text-CxktRaAP.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./DashboardLayout-Czs4Ae1a.js";import"./calculator-CW_pbNuI.js";import"./createLucideIcon-H8VPBXjN.js";import"./phone-_6yHEIlu.js";import"./camera-Dqs6fn23.js";import"./palette-BHFj3Xy0.js";import"./paintbrush-ChFJNe41.js";import"./wrench-DklhqLlS.js";import"./piggy-bank-C2v63urG.js";import"./house-BnH-U5r3.js";import"./map-8n63qlK3.js";import"./compass-CH8J464A.js";import"./tag-BO3kPXxQ.js";import"./pin-Ck_QWSJO.js";import"./flag-1_ebRH_b.js";import"./flame-BPccTQZg.js";import"./rocket-DtFw-SME.js";import"./inbox-CFZTkSBv.js";import"./archive-BeRbhDRR.js";import"./box-390yTOQ1.js";import"./package-Bs-_yP79.js";import"./layers-DhAcOZAq.js";import"./bookmark-BPpFaTpS.js";import"./star-DLmgYZpv.js";import"./square-check-big-Bg8cLZ7q.js";import"./folder-open-WStbupck.js";import"./folder-c0CtBhoz.js";import"./search-DRuNnyPk.js";import"./x-gRRgfAF8.js";import"./layout-grid-DSsqyLnZ.js";import"./loader-circle-BOF4Rcg5.js";import"./check-CYOYuDcY.js";import"./lock-BQyHxR7C.js";import"./minus-D_MNsdVR.js";import"./chevron-right-DQnPt1ZE.js";import"./chevron-down-CV0HnoXa.js";import"./folder-plus-7oO0Nbpu.js";import"./type-CyecaIdB.js";import"./plus-D8BOBnMI.js";import"./useMailBase-CRpcoWb6.js";import"./addressFormat-BzTudlB8.js";import"./echo-Cx0reEeH.js";import"./HangoutCallWindow-CvgLhoKS.js";import"./useToast-B-YAj-IO.js";import"./Avatar-cwwpNdqk.js";import"./Icon-Bd2Gfizk.js";import"./video-off-DUi-TqVn.js";import"./video-DypzJN3I.js";import"./monitor-yKdQgZ09.js";import"./grip-vertical-Czq8Uo7j.js";import"./send-DBmxMqjs.js";import"./circle-question-mark-BzZXs17c.js";import"./upload-C7tYkjtk.js";import"./AnimatedLogoMini-B6zedGia.js";/* empty css */import"./tooltip-7U8-rvad.js";import"./circle-check-xzHgMljH.js";import"./file-search-Bn3ZsYEQ.js";import"./wallet-DfN8xEQC.js";import"./circle-x-DYwMKyLl.js";import"./image-CU5BZ3Wb.js";import"./cpu-bOvzqt6k.js";import"./dialog-CW5w_wTh.js";import"./open-closed-CiJKRND1.js";import"./keyboard-CM8jW1Gj.js";import"./active-element-history-1SsHkF75.js";import"./disposables-JVzIyaVR.js";import"./description-CH7CIC-A.js";import"./transition-D0CE30sk.js";import"./receipt-text-CdpPiafr.js";import"./FollowUpTaskModal.vue_vue_type_script_setup_true_lang-CMXAHDky.js";import"./Button-tIgTMB06.js";
1import"./utils-Dj5kSLHa.js";import"./index-Cb8geMzt.js";import"./index-BUhRIvLQ.js";import"./index-CroEGN42.js";import"./check-check-BBacMcIT.js";import"./user-plus-BIIFrZm8.js";import"./trash-2-CuFI4esy.js";import"./SurveyorAvatar-COM6-DaG.js";import"./useTelephony-Gb9WDNb-.js";import"./phone-call-BrB6ewD1.js";import"./history-DpuVT1DJ.js";import"./phone-incoming-xz_1cgpx.js";import"./pause-DhX5YGt5.js";import"./save-DnETlemW.js";import"./users-round-G_G1fxZF.js";import"./useChatHub-efociDyw.js";import"./shield-check-CDldKyok.js";import"./handshake-GPX40eLA.js";import"./file-key-D00z6oeF.js";import"./user-x-CheJ_1T4.js";import"./message-circle-oPrxIruY.js";import"./award-DVmYzLJc.js";import"./menu-C8BKYvlP.js";import"./book-open-Dsi24aWS.js";import"./bell-BnmfLsAP.js";import"./gem-CM6kv8YR.js";import"./calendar-check-qXulTrFv.js";import"./log-out-CydYSR5l.js";import"./sliders-horizontal-jU65eH4z.js";import"./radio-BNkVfxOF.js";import"./plane-CGVQem9a.js";import"./film-BsJDSHaz.js";import"./printer-QRwqB39C.js";import"./pen-tool-z8iWES5d.js";import"./megaphone-DN1OxKmL.js";import"./map-pinned-DdKkn8oh.js";import"./library-DoVZTJ3d.js";import"./file-pen-line-D68orQJK.js";import"./list-checks--ElNPh6C.js";import"./shield-xlcuWJAH.js";import"./play-CCXnbaPm.js";import"./code-xml-DNQCXKmA.js";import"./heart-pulse--V4ckXZW.js";import"./git-branch-hxJW-6BD.js";import"./pen-line-NGtLVT8C.js";import"./lightbulb-D3MrsQxk.js";import"./at-sign-d7fVKctX.js";import"./grid-2x2-D6YE8xw7.js";import"./circle-NE3so71u.js";import"./calendar-clock-BpBm_Pbs.js";import"./house-heart-BOl5N1QW.js";import"./layout-dashboard-BZkek7_4.js";import"./info-CloN_0vb.js";import"./PublicArtifactRenderer-BJzhLPPh.js";import"./MapArtifact.vue_vue_type_style_index_0_lang-BMLTxuJo.js";import"./chart-pie-DekE5H0B.js";import"./chart-line-BIqoQxG6.js";import"./image-down-E0AsqY8k.js";import"./copy-oFYRDY3C.js";import"./download-Bnm-PHbZ.js";import"./gauge-DqmFKwCB.js";/* empty css */import"./map-pin-7NBWNz8E.js";import"./external-link-NmwK4u3x.js";import"./share-2-BTXmrOMz.js";import"./bed-QJSSLFd_.js";import"./bath-BVk93Uiu.js";import"./table-2-Bm-HEJ6h.js";import"./publicAiMessage-Bx816r2u.js";import"./code-6H4M1b1N.js";/* empty css */import"./listingImageRemint-DdzXd0Qc.js";import"./key-round-CDOVxIO1.js";import"./SavePropertyModal-C2h6jxhG.js";const ai={class:"space-y-2"},ri={class:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0 scrollbar-hide"},li={class:"flex items-center gap-1 rounded-lg bg-stone-100 p-1 min-w-max"},di=["onClick"],ci={key:0,class:"flex items-center gap-1 ml-4"},ui=["onClick"],mi={__name:"UserTypeFilter",props:{modelValue:{type:String,default:"all"},showConsumerSubtypes:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(Z,{emit:N}){const B=Z,n=N,D=[{value:"all",label:"All Users",icon:$,color:"gray"},{value:"agent",label:"Agents",icon:Zo,color:"blue"},{value:"admin",label:"Admins",icon:q,color:"purple"},{value:"consumer",label:"Consumers",icon:q,color:"green"},{value:"anonymous",label:"Anonymous",icon:et,color:"amber"}],H=[{value:"homebuyer",label:"Homebuyers"},{value:"homeseller",label:"Homesellers"},{value:"renter",label:"Renters"},{value:"landlord",label:"Landlords"},{value:"first_time_buyer",label:"First-time Buyers"},{value:"investor",label:"Investors"}],b=j(null);S(()=>D.find(T=>T.value===B.modelValue)||D[0]);const z=T=>{n("update:modelValue",T),n("change",T),T!=="consumer"&&(b.value=null)},F=T=>{b.value=T,n("change",B.modelValue,T)},M=(T,P=!1)=>P?"bg-white text-stone-900 ring-stone-200":"text-stone-500 hover:text-stone-800";return(T,P)=>(a(),r("div",ai,[t("div",ri,[t("div",li,[(a(),r(W,null,U(D,C=>t("button",{key:C.value,onClick:dt=>z(C.value),type:"button",class:v(["flex items-center gap-1.5 rounded-md min-h-[44px] px-3 py-2 text-sm font-medium transition-all whitespace-nowrap active:scale-95",Z.modelValue===C.value?M(C.color,!0)+" ring-1 shadow-sm":M(C.color,!1)])},[(a(),A(E(C.icon),{class:"size-4 shrink-0"})),t("span",null,i(C.label),1)],10,di)),64))])]),Z.showConsumerSubtypes&&Z.modelValue==="consumer"?(a(),r("div",ci,[P[1]||(P[1]=t("span",{class:"text-xs text-stone-500 mr-2"}
1,"Filter by:",-1)),(a(),r(W,null,U(H,C=>t("button",{key:C.value,onClick:dt=>F(C.value),class:v(["rounded-full px-2.5 py-1 text-xs font-medium transition-colors",b.value===C.value?"bg-stone-900 text-white":"bg-stone-100 text-stone-600 hover:bg-stone-200"])},i(C.label),11,ui)),64)),b.value?(a(),r("button",{key:0,onClick:P[0]||(P[0]=C=>F(null)),class:"text-xs text-stone-400 hover:text-stone-600 ml-2"}," Clear ")):p("",!0)])):p("",!0)]))}},pi=co(mi,[["__scopeId","data-v-7c681852"]]),_i={class:"mb-5 sm:mb-6 space-y-4"},xi={class:"relative overflow-hidden rounded-3xl bg-white border border-stone-100 shadow-sm"},vi={class:"relative p-5 sm:p-8 lg:flex lg:items-center lg:justify-between gap-6"},bi={class:"flex items-center gap-3 sm:gap-4 min-w-0"},hi={class:"flex size-12 sm:size-14 items-center justify-center rounded-2xl bg-gradient-to-br from-pink-500 via-rose-500 to-orange-500 shadow-sm shadow-pink-500/20 flex-shrink-0"},gi={class:"mt-5 lg:mt-0 flex flex-col sm:flex-row items-stretch sm:items-center gap-2 flex-shrink-0"},fi={class:"relative"},yi=["value"],wi=["disabled"],ki={key:0,class:"flex items-center justify-center py-32"},Ci={key:1,class:"py-32 text-center"},Ai={class:"text-stone-500"},zi={key:2,class:"space-y-4 sm:space-y-6"},Ri={key:0,class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-3 sm:gap-4"},ji={class:"group relative rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md"},Si={class:"flex items-start justify-between"},Wi={class:"mt-2 text-3xl font-semibold text-stone-900"},Ti={class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},Li={class:"rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md"},Ui={class:"flex items-start justify-between"},Ii={class:"mt-2 text-3xl font-semibold text-stone-900"},$i={class:"mt-3 flex items-center gap-1.5 text-xs"},Di={class:"rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md"},Fi={class:"flex items-start justify-between"},Mi={class:"mt-2 text-3xl font-semibold text-stone-900"},Pi={class:"mt-3 flex items-center gap-1.5 text-xs"},Vi={class:"text-stone-500"},Oi={class:"rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md"},Bi={class:"flex items-start justify-between"},Ni={class:"mt-2 text-3xl font-semibold text-stone-900"},Hi={class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},Ei={class:"rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md"},qi={class:"flex items-start justify-between"},Zi={class:"mt-2 text-3xl font-semibold text-stone-900"},Gi={class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},Ki={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4"},Ji={class:"flex items-start justify-between"},Yi={class:"mt-2 text-3xl font-semibold text-stone-900"},Qi={class:"mt-3 flex items-center gap-1.5 text-xs"},Xi={class:"text-stone-400"},tn={class:"flex items-start justify-between"},en={class:"mt-2 text-3xl font-semibold text-stone-900"},sn={class:"flex items-start justify-between"},on={class:"mt-2 text-3xl font-semibold text-stone-900"},nn={class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},an={class:"text-green-600"},rn={class:"flex items-start justify-between"},ln={class:"mt-2 text-3xl font-semibold text-stone-900"},dn={class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},cn={key:1,class:"flex h-full items-center justify-center text-stone-400"},un={key:1,class:"rounded-3xl bg-gradient-to-br from-pink-50/60 via-white to-orange-50/40 p-4 sm:p-6 border border-pink-100/60 shadow-sm"},mn={class:"mb-4 sm:mb-6 flex items-start gap-3"},pn={class:"rounded-xl bg-gradient-to-br from-pink-500 via-rose-500 to-orange-500 p-2 shrink-0 shadow-sm shadow-pink-500/20"},_n={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-4 mb-4 sm:mb-6"},xn={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},vn={class:"flex items-center gap-2"},bn={class:"mt-2 text-2xl font-semibold text-stone-900"},hn={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},gn={class:"flex items-center gap-2"},fn={class:"mt-2 text-2xl font-semibold text-stone-900"},yn={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},wn={class:"flex items-center gap-2"},kn={class:"mt-2 text-2xl font-semibold text-stone-900"},Cn={class:"mt-1 text-xs text-stone-400"},An={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},zn={class:"flex items-center gap-2"},Rn={class:"mt-2 text-2xl font-semibold text-stone-900"},jn={class:"mt-1 text-xs text-stone-400"},Sn={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},Wn={class:"flex items-center gap-2"},Tn={class:"mt-2 text-2xl font-semibold text-stone-900"},Ln={key:0},Un={class:"flex flex-col sm:flex-row items-stretch gap-3 sm:gap-4"},In={class:"flex-1 min-w-0"},$n={key:0,class:"flex flex-row sm:flex-col items-center justify-center sm:justify-start gap-2 sm:gap-0 -my-2 sm:my-0"},Dn={class:"text-xs font-medium text-stone-500"},Fn={class:"mb-4 flex items-center justify-between"},Mn={class:"flex items-center gap-3"},Pn={class:"flex items-center gap-1.5 text-xs"},Vn={class:"font-semibold text-stone-900"},On={class:"h-64 sm:h-72"},Bn={key:1,class:"flex h-full items-center justify-center text-stone-400"},Nn={class:"mt-4 flex items-center justify-center gap-6 text-sm"}
1,Hn={key:0,class:"flex items-center gap-2"},En={class:"font-semibold"},qn={key:1,class:"flex items-center gap-2"},Zn={class:"font-semibold"},Gn={class:"font-bold text-stone-900"},Kn={key:0,class:"rounded-2xl bg-white p-4 sm:p-6 border border-stone-100 shadow-sm"},Jn={class:"h-48 sm:h-56"},Yn={key:1,class:"flex h-full items-center justify-center text-stone-400"},Qn={key:0,class:"mt-4 space-y-2"},Xn={class:"flex items-center justify-between text-sm"},ta={class:"flex items-center gap-2"},ea={class:"font-semibold"},sa={class:"text-stone-400 text-xs"},oa={class:"flex items-center justify-between text-sm"},ia={class:"flex items-center gap-2"},na={class:"font-semibold"},aa={class:"text-stone-400 text-xs"},ra={class:"pt-2 mt-2 border-t border-stone-100"},la={class:"flex flex-wrap gap-1"},da={key:2,class:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6"},ca={class:"rounded-2xl bg-white p-4 sm:p-6 border border-stone-100 shadow-sm"},ua={class:"mb-4 flex items-center justify-between"},ma={class:"h-56 sm:h-48"},pa={key:1,class:"flex h-full items-center justify-center text-stone-400"},_a={class:"mt-4 text-center text-sm text-stone-500"},xa={class:"lg:col-span-2 grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4"},va={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},ba={class:"flex items-center gap-2 mb-3"},ha={class:"text-3xl font-bold text-stone-900"},ga={class:"mt-1 text-sm text-stone-500"},fa={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},ya={class:"flex items-center gap-2 mb-3"},wa={class:"text-3xl font-bold text-stone-900"},ka={class:"mt-1 text-sm text-stone-500"},Ca={class:"rounded-xl bg-white p-4 border border-stone-100 shadow-sm"},Aa={class:"flex items-center gap-2 mb-3"},za={class:"text-3xl font-bold text-stone-900"},Ra={class:"mt-1 text-sm text-stone-500"},ja={class:"rounded-2xl bg-white p-4 sm:p-6 border border-stone-100 shadow-sm"},Sa={class:"mb-4 sm:mb-6 flex items-start gap-2"},Wa={class:"flex flex-col sm:flex-row items-stretch gap-3 sm:gap-4"},Ta={class:"flex-1 min-w-0"},La={key:0,class:"flex flex-row sm:flex-col items-center justify-center sm:justify-start gap-2 sm:gap-0 -my-2 sm:my-0"},Ua={class:"text-xs font-medium text-stone-500"},Ia={class:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6"},$a={key:1,class:"flex h-full items-center justify-center text-stone-400"},Da={key:1,class:"flex h-full items-center justify-center text-stone-400"},Fa={class:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6"},Ma={class:"lg:col-span-2 rounded-2xl bg-white border border-stone-100 shadow-sm"},Pa={class:"flex flex-col gap-3 border-b border-stone-100 p-4 sm:px-6 sm:py-4"},Va={class:"flex items-center justify-between gap-3"},Oa={class:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0 scrollbar-hide"},Ba={class:"flex rounded-lg bg-stone-100 p-1 gap-1 min-w-max"},Na=["onClick"],Ha={class:"divide-y divide-stone-100 max-h-[600px] overflow-y-auto"},Ea={class:"size-9 sm:size-10 overflow-hidden rounded-full bg-stone-100 shrink-0"},qa=["src","alt"],Za={key:1,class:"flex size-full items-center justify-center text-xs sm:text-sm font-medium text-stone-400"},Ga={class:"min-w-0 flex-1"},Ka={class:"truncate text-xs sm:text-sm text-stone-500 mt-0.5"},Ja={class:"text-right shrink-0"},Ya={class:"text-base sm:text-lg font-semibold text-stone-900"},Qa={class:"hidden md:block w-32 text-right"},Xa={class:"text-sm font-medium text-stone-600"},tr={class:"text-xs text-stone-400"},er={key:0},sr={key:1},or={key:2},ir={key:3},nr={key:4},ar={key:5},rr={class:"hidden sm:block w-20 text-right shrink-0"},lr={class:"text-xs text-stone-400"},dr=["src","alt"],cr={class:"min-w-0 flex-1"},ur={class:"font-medium text-sm sm:text-base text-stone-900 line-clamp-1"},mr={class:"truncate text-xs sm:text-sm text-stone-500 mt-0.5"},pr={class:"text-right shrink-0"},_r={class:"text-base sm:text-lg font-semibold text-stone-900"},xr={class:"hidden md:block w-40 text-right"},vr={class:"text-xs text-stone-400"},br={key:0},hr={key:1},gr={key:2},fr={key:3},yr={class:"hidden sm:block w-20 text-right shrink-0"},wr={class:"text-xs text-stone-400"},kr={class:"flex size-9 sm:size-10 items-center justify-center rounded-full bg-stone-100 shrink-0"},Cr={class:"min-w-0 flex-1"},Ar={class:"font-medium text-sm sm:text-base text-stone-900 line-clamp-1"},zr={class:"truncate text-xs sm:text-sm text-stone-500 mt-0.5"},Rr={class:"text-right shrink-0"},jr={class:"text-base sm:text-lg font-semibold text-stone-900"},Sr={class:"hidden md:block w-40 text-right"},Wr={class:"text-sm font-medium text-stone-600"},Tr={class:"text-xs text-stone-400"},Lr={key:0},Ur={key:1},Ir={key:2},$r={key:3},Dr={class:"hidden sm:block w-20 text-right shrink-0"},Fr={class:"text-xs text-stone-400"},Mr={key:3,class:"flex flex-col items-center justify-center py-12"},Pr={class:"mt-3 text-sm text-stone-500"},Vr={key:4,class:"flex justify-center py-4 border-t border-stone-100"},Or=["disabled"],Br={class:"rounded-2xl bg-white border border-stone-100 shadow-sm"},Nr={class:"flex items-center justify-between border-b border-stone-100 px-4 sm:px-6 py-3 sm:py-4"},Hr={class:"divide-y divide-stone-100"},Er={class:"flex items-start gap-2 sm:gap-3"},qr={class:"min-w-0 flex-1"},Zr={class:"flex items-start sm:items-center gap-2 flex-wrap"},Gr={class:"text-xs sm:text-sm font-medium text-stone-900 line-clamp-1"},Kr={class:"mt-1 flex items-center gap-1.5 sm:gap-2 text-[10px] sm:text-xs text-stone-500 flex-wrap"},Jr={key:0,class:"truncate max-w-[150px]"},Yr={key:1},Qr={class:"whitespace-nowrap"},Xr=["onClick"],tl={key:0,class:"flex flex-col items-center justify-center py-12"},el={__name:"Index",setup(Z){$o.register(Do,Fo,Mo,Po,Vo,Oo,Bo,No,Ho,Eo);const N=j(!0),B=j(null),n=j(null),D=j("30d"),H=j(!1),b=j("all"),z=j("agent"),F=j(10),M=j(!1),T=[{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}],P=S(()=>{const s=new Date,e=s.toISOString().split("T")[0];let l;switch(D.value){case"7d":l=new Date(s.setDate(s.getDate()-7)).toISOString().split("T")[0];break;case"90d":l=new Date(s.setDate(s.getDate()-90)).toISOString().split("T")[0];break;default:l=new Date(s.setDate(s.getDate()-30)).toISOString().split("T")[0]}const d={from:l,to:e,leaderboard_limit:F.value};
1return b.value&&b.value!=="all"&&(d.user_type=b.value),d}),C=async()=>{M.value=!0,F.value+=10,await G(),M.value=!1},dt=s=>{const e=s.overview||{},l=s.funnel||{},d=s.activity_by_category||{},_=s.top_agents||[],f=s.top_tools||[],w=s.recent_activities||[],x=s.revenue||{},k=s.unified||{},g=k.public_ai||{},it=s.public_ai_funnel||{},nt=s.user_type_distribution||{};return{metrics:{active_agents:{total:e.total_agents||0,dau:e.active_agents_dau||0,wau:e.active_agents_wau||0,mau:e.active_agents_mau||0},ai_adoption_rate:e.ai_adoption_rate||0,ai_adoption_trend:0,ai_chats_today:e.total_ai_chats||0,ai_chats_yesterday:0,ai_chats_change:0,avg_session_duration:e.avg_session_duration||0,avg_pages_per_session:e.avg_messages_per_session||0,retention_30d:e.retention_30d||0,retention_7d:e.retention_7d||0},revenue:{mrr:x.mrr||0,mrr_previous:x.mrr_previous||0,mrr_growth:x.mrr_growth||0,mrr_growth_percent:x.mrr_growth_percent||0,arr:x.arr||0,active_subscriptions:x.active_subscriptions||0,trialing_subscriptions:x.trialing_subscriptions||0,churned_this_month:x.churned_this_month||0,churn_rate:x.churn_rate||0,new_subscriptions:x.new_subscriptions_this_month||0,subscribers_by_plan:x.subscribers_by_plan||{}},mrr_trend:s.mrr_trend||{},adoption_funnel:{signed_up:l.signed_up||0,logged_in:l.logged_in||0,used_ai:l.used_ai||0,power_user:l.power_user||0},activity_by_date:d,top_ai_tools:f.map(y=>({name:y.tool_name??y.name,count:y.usage_count??y.total_uses??y.count??0,unique_users:y.unique_users??null,success_rate:y.success_rate??null})),top_agents:_.map(y=>({id:y.id,name:y.name,avatar:y.avatar,company_name:y.company_name||"Unknown",total_activities:y.total_activities||y.conversation_count||0,ai_chats:y.ai_chats||y.conversation_count||0,ai_valuations:y.ai_valuations||0,widgets:y.widgets||0,articles:y.articles||0,last_active_at:y.last_active_at||y.last_activity})),recent_activities:w,public_ai:{total_sessions:g.total_sessions||0,total_conversations:g.total_conversations||0,total_messages:g.total_messages||0,unique_visitors:g.unique_visitors||0,converted_sessions:g.converted_sessions||0,conversion_rate:g.conversion_rate||0,avg_messages_per_session:g.avg_messages_per_session||0,total_tokens:g.total_tokens||0,user_type_breakdown:g.user_type_breakdown||{},dau_trend:g.dau_trend||[]},public_ai_funnel:it.funnel||[],user_type_distribution:nt,unified_totals:k.totals||{},top_users_by_type:s.top_users_by_type||{},chat_trends:s.chat_trends||{by_date:{},live:{},totals:{}},consumer_type_distribution:s.consumer_type_distribution||{groups:{},breakdown:{},total:0}}},G=async()=>{try{const s=await Uo.get("/admin/api/activity-dashboard/stats",{params:P.value});n.value=dt(s.data),B.value=null}catch(s){B.value="Failed to load dashboard data",console.error("Error fetching stats:",s)}finally{N.value=!1,H.value=!1}},uo=()=>{H.value=!0,G()},h=s=>s==null?"0":s>=1e6?(s/1e6).toFixed(1)+"M":s>=1e3?(s/1e3).toFixed(1)+"K":s.toLocaleString(),V=s=>s==null?"0%":s.toFixed(1)+"%",ct=s=>s==null?"£0":new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0,maximumFractionDigits:0}).format(s),mo=s=>{if(!s||s<1)return"< 1m";if(s<60)return`${Math.round(s)}m`;const e=Math.floor(s/60),l=Math.round(s%60);return l>0?`${e}h ${l}m`:`${e}h`},st=s=>{if(!s)return"Never";const e=new Date(s),d=new Date-e,_=Math.floor(d/6e4),f=Math.floor(d/36e5),w=Math.floor(d/864e5);return _<1?"Just now":_<60?`${_}m ago`:f<24?`${f}h ago`:w<7?`${w}d ago`:e.toLocaleDateString("en-GB",{day:"numeric",month:"short"})},yt=s=>s?s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?",wt=S(()=>{var w;const s=((w=n.value)==null?void 0:w.activity_by_date)||{},e=Object.keys(s).sort(),l=[{key:"ai_chats",label:"AI Chats"},{key:"valuations",label:"Valuations"},{key:"widgets",label:"Widgets"},{key:"articles",label:"Articles"}],d={ai_chats:{border:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},valuations:{border:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},widgets:{border:"#6366f1",bg:"rgba(99, 102, 241, 0.1)"},articles:{border:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"}},_=l.filter(x=>e.some(k=>{var g;return(((g=s[k])==null?void 0:g[x.key])||0)>0})).map(x=>({label:x.label,data:e.map(k=>{var g;return((g=s[k])==null?void 0:g[x.key])||0}),borderColor:d[x.key].border,backgroundColor:d[x.key].bg,fill:!0,tension:.4,pointRadius:0,pointHoverRadius:4})),f=_.length>0?_:[{label:"AI Chats",data:e.map(x=>{var k;return((k=s[x])==null?void 0:k.ai_chats)||0}),borderColor:d.ai_chats.border,backgroundColor:d.ai_chats.bg,fill:!0,tension:.4,pointRadius:0,pointHoverRadius:4}];return{labels:e.map(x=>ut(x)),datasets:f}}),po={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{usePointStyle:!0,padding:window.innerWidth<640?8:16,font:{size:window.innerWidth<640?10:11},boxWidth:window.innerWidth<640?8:12}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8}},scales:{x:{grid:{display:!1},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?5:10,maxRotation:window.innerWidth<640?45:0,minRotation:window.innerWidth<640?45:0}},y:{beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.05)"},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?5:8}}}},ut=s=>new Date(s).toLocaleDateString("en-GB",{day:"numeric",month:"short"}),_o=S(()=>{var l;const s=((l=n.value)==null?void 0:l.mrr_trend)||{},e=Object.keys(s).sort();return{labels:e.map(d=>ut(d)),datasets:[{label:"MRR",data:e.map(d=>{var _;return((_=s[d])==null?void 0:_.mrr)||0}),borderColor:"#10b981",backgroundColor:"rgba(16, 185, 129, 0.1)",fill:!0,tension:.4,pointRadius:2,pointHoverRadius:5,yAxisID:"y"},{label:"Subscriptions",data:e.map(d=>{var _;return((_=s[d])==null?void 0:_.subscriptions)||0}),borderColor:"#6366f1",backgroundColor:"transparent",borderDash:[5,5],tension:.4,pointRadius:2,pointHoverRadius:5,yAxisID:"y1"}]}}),xo={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{usePointStyle:!0,padding:window.innerWidth<640?8:16,font:{size:window.innerWidth<640?10:11},boxWidth:window.innerWidth<640?8:12}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8,callbacks:{label:s=>
1s.dataset.label==="MRR"?`MRR: £${s.raw.toLocaleString()}`:`${s.dataset.label}: ${s.raw}`}}},scales:{x:{grid:{display:!1},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?5:10,maxRotation:window.innerWidth<640?45:0,minRotation:window.innerWidth<640?45:0}},y:{type:"linear",display:!0,position:"left",beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.05)"},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?4:6,callback:s=>window.innerWidth<640?`£${(s/1e3).toFixed(0)}K`:`£${s.toLocaleString()}`}},y1:{type:"linear",display:window.innerWidth>=768,position:"right",beginAtZero:!0,grid:{drawOnChartArea:!1},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?4:6}}}},kt=S(()=>{var e;const s=((e=n.value)==null?void 0:e.top_ai_tools)||[];return{labels:s.slice(0,10).map(l=>l.name),datasets:[{label:"Usage Count",data:s.slice(0,10).map(l=>l.count),backgroundColor:"#ec4899",borderRadius:4}]}}),vo={indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8,callbacks:{afterLabel:s=>{var l,d;const e=(d=(l=n.value)==null?void 0:l.top_ai_tools)==null?void 0:d[s.dataIndex];return e?`${e.unique_users} unique users`:""}}}},scales:{x:{beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.05)"},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?4:6}},y:{grid:{display:!1},ticks:{font:{size:window.innerWidth<640?10:11},callback:function(s,e,l){const d=this.getLabelForValue(s);return window.innerWidth<640&&d.length>15?d.substring(0,15)+"...":d}}}}},K=S(()=>{var e;const s=((e=n.value)==null?void 0:e.adoption_funnel)||{};return[{label:"Signed Up",value:s.signed_up||0,color:"bg-stone-50"},{label:"Logged In",value:s.logged_in||0,color:"bg-stone-100"},{label:"Used AI",value:s.used_ai||0,color:"bg-stone-200"},{label:"Power User",value:s.power_user||0,color:"bg-gradient-to-r from-pink-500 to-orange-500 text-white"}]}),bo=s=>{const e=K.value;if(s>=e.length-1)return null;const l=e[s].value,d=e[s+1].value;return l===0?0:(d/l*100).toFixed(1)},ho=s=>({ai:rt,visibility:ft,traffic:bt,prompts:ht,valuations:tt,valuation:tt,widgets:tt,crm:ni,email:Qo,listings:tt,analytics:tt,account:$,team:$,settings:ro,auth:Yo,opportunities:lo,errors:ii,payments:ao,integrations:oi,jobs:si,public_ai:rt,property_search:ft,property_view:ft,agent_discovery:$,conversion:lo,admin_review:q,admin_moderation:Jo,admin_config:ro})[s]||bt,go=s=>({errors:!0,payments:!0})[s]?"bg-red-50 text-red-500":"bg-stone-100 text-stone-500",Ct=S(()=>{var f;const s=((f=n.value)==null?void 0:f.user_type_distribution)||{},e=[],l=[],d=[];return Object.entries({agent:{label:"Agents",color:"#3b82f6"},consumer:{label:"Consumers",color:"#10b981"},anonymous:{label:"Anonymous",color:"#f59e0b"}}).forEach(([w,x])=>{var k;((k=s[w])==null?void 0:k.count)>0&&(e.push(x.label),l.push(s[w].count),d.push(x.color))}),{labels:e,datasets:[{data:l,backgroundColor:d,borderWidth:0}]}}),fo={responsive:!0,maintainAspectRatio:!1,cutout:"65%",plugins:{legend:{position:window.innerWidth<640?"bottom":"right",labels:{usePointStyle:!0,padding:window.innerWidth<640?12:16,font:{size:window.innerWidth<640?10:11},boxWidth:window.innerWidth<640?10:12}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8,callbacks:{label:s=>{var f,w;const e=((f=n.value)==null?void 0:f.user_type_distribution)||{},d=["agent","consumer","anonymous"][s.dataIndex],_=((w=e[d])==null?void 0:w.percentage)||0;return`${s.label}: ${s.raw.toLocaleString()} (${_}%)`}}}}},yo=S(()=>{var _,f,w,x;const s=((f=(_=n.value)==null?void 0:_.chat_trends)==null?void 0:f.by_date)||{},e=((x=(w=n.value)==null?void 0:w.chat_trends)==null?void 0:x.showing)||{public:!0,agent:!0},l=Object.keys(s).sort(),d=[];return e.public&&d.push({label:"Public AI Chats",data:l.map(k=>{var g;return((g=s[k])==null?void 0:g.public)||0}),borderColor:"#06b6d4",backgroundColor:"rgba(6, 182, 212, 0.1)",fill:!0,tension:.4,pointRadius:2,pointHoverRadius:5}),e.agent&&d.push({label:"Agent AI Chats",data:l.map(k=>{var g;return((g=s[k])==null?void 0:g.agent)||0}),borderColor:"#8b5cf6",backgroundColor:"rgba(139, 92, 246, 0.1)",fill:!0,tension:.4,pointRadius:2,pointHoverRadius:5}),{labels:l.map(k=>ut(k)),datasets:d}}),wo={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{usePointStyle:!0,padding:window.innerWidth<640?8:16,font:{size:window.innerWidth<640?10:11},boxWidth:window.innerWidth<640?8:12}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8}},scales:{x:{grid:{display:!1},ticks:{font:{size:window.innerWidth<640?9:10},maxTicksLimit:window.innerWidth<640?5:10}},y:{beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.05)"},ticks:{font:{size:window.innerWidth<640?9:10},stepSize:1}}}},ko=S(()=>{var e,l,d,_;const s=((l=(e=n.value)==null?void 0:e.consumer_type_distribution)==null?void 0:l.groups)||{};return{labels:["Pro","Property Hunter"],datasets:[{data:[((d=s.pro)==null?void 0:d.count)||0,((_=s.property_hunter)==null?void 0:_.count)||0],backgroundColor:["#f59e0b","#3b82f6"],borderWidth:0}]}}),Co={responsive:!0,maintainAspectRatio:!1,cutout:"60%",plugins:{legend:{position:window.innerWidth<640?"bottom":"right",labels:{usePointStyle:!0,padding:window.innerWidth<640?12:16,font:{size:window.innerWidth<640?10:12},boxWidth:window.innerWidth<640?10:12}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8,callbacks:{label:s=>{var _,f,w;const e=((f=(_=n.value)==null?void 0:_.consumer_type_distribution)==null?void 0:f.groups)||{},l=s.dataIndex===0?"pro":"property_hunter",d=((w=e[l])==null?void 0:w.percentage)||0;return`${s.label}
1: ${s.raw.toLocaleString()} (${d}%)`},afterLabel:s=>{var d,_,f;const e=((_=(d=n.value)==null?void 0:d.consumer_type_distribution)==null?void 0:_.groups)||{},l=s.dataIndex===0?"pro":"property_hunter";return((f=e[l])==null?void 0:f.description)||""}}}}},Ao=S(()=>!b.value||b.value==="all"||b.value==="agent"),zo=S(()=>!b.value||b.value==="all"||b.value==="consumer"||b.value==="anonymous"),mt=S(()=>!b.value||b.value==="all"||b.value==="consumer"||b.value==="anonymous"),pt=[{value:"agent",label:"Agents",icon:$,color:"blue"},{value:"consumer",label:"Consumers",icon:q,color:"green"},{value:"admin",label:"Admins",icon:q,color:"purple"},{value:"anonymous",label:"Anonymous",icon:et,color:"amber"}],ot=S(()=>{var s,e,l;return z.value==="agent"?((s=n.value)==null?void 0:s.top_agents)||[]:((l=(e=n.value)==null?void 0:e.top_users_by_type)==null?void 0:l[z.value])||[]}),J=S(()=>{var l;const s=((l=n.value)==null?void 0:l.public_ai_funnel)||[],e=["bg-stone-50","bg-stone-100","bg-stone-200","bg-gradient-to-r from-pink-500 to-orange-500 text-white"];return s.map((d,_)=>({...d,color:e[_]||e[e.length-1]}))}),Ro=s=>{const e=J.value;if(s>=e.length-1)return null;
1const l=e[s].count,d=e[s+1].count;return l===0?0:(d/l*100).toFixed(1)};to([D,b],()=>{N.value=!0,F.value=10,b.value&&b.value!=="all"&&(z.value=b.value),G()}),to(z,()=>{F.value=10});const _t=j(!1),At=j(null),zt=j(null),Rt=j(null),jo=s=>{var e,l;return!!((e=s.metadata)!=null&&e.conversation_id||(l=s.metadata)!=null&&l.session_id&&s.has_conversation!==!1)},So=s=>{var e,l,d;At.value=s.platform==="agent_portal"?"agent":"public",zt.value=((e=s.metadata)==null?void 0:e.conversation_id)||null,Rt.value=(l=s.metadata)!=null&&l.conversation_id?null:((d=s.metadata)==null?void 0:d.session_id)||null,_t.value=!0};return Wo(G),(s,e)=>(a(),A(Io,{title:"Activity Dashboard"},{default:R(()=>{var l,d,_,f,w,x,k,g,it,nt,y,jt,St,Wt,Tt,Lt,Ut,It,$t,Dt,Ft,Mt,Pt,Vt,Ot,Bt,Nt,Ht,Et,qt,Zt,Gt,Kt,Jt,Yt,Qt,Xt,te,ee,se,oe,ie,ne,ae,re,le,de,ce,ue,me,pe,_e,xe,ve,be,he,ge,fe,ye,we,ke,Ce,Ae,ze,Re,je,Se,We,Te,Le,Ue,Ie,$e,De,Fe,Me,Pe,Ve,Oe,Be,Ne,He,Ee,qe,Ze,Ge,Ke,Je,Ye,Qe,Xe,ts,es,ss,os,is,ns,as,rs,ls,ds,cs,us,ms,ps,_s,xs,vs,bs,hs,gs,fs,ys,ws,ks,Cs,As,zs,Rs,js,Ss,Ws,Ts,Ls,Us,Is,$s,Ds,Fs,Ms,Ps,Vs,Os,Bs,Ns;return[t("div",_i,[t("div",xi,[e[7]||(e[7]=t("div",{class:"absolute inset-y-0 right-0 w-1/2 hidden md:block pointer-events-none"},[t("div",{class:"absolute inset-0 bg-gradient-to-l from-pink-50/70 via-orange-50/30 to-transparent"})],-1)),t("div",vi,[t("div",bi,[t("div",hi,[u(c(bt),{class:"size-6 sm:size-7 text-white","stroke-width":"2"})]),e[3]||(e[3]=t("div",{class:"min-w-0"},[t("h1",{class:"text-2xl sm:text-3xl font-bold text-stone-900 truncate"},"Activity Dashboard"),t("p",{class:"mt-1 text-sm text-stone-600"}," Platform-wide engagement across agents, consumers, and public AI ")],-1))]),t("div",gi,[t("div",fi,[To(t("select",{"onUpdate:modelValue":e[0]||(e[0]=o=>D.value=o),class:"w-full sm:w-auto appearance-none rounded-xl border border-stone-200 bg-white h-11 py-2.5 pl-3 pr-10 text-sm font-semibold text-stone-700 focus:border-pink-400 focus:outline-none focus:ring-1 focus:ring-pink-400"},[(a(),r(W,null,U(T,o=>t("option",{key:o.value,value:o.value},i(o.label),9,yi)),64))],512),[[Lo,D.value]]),u(c(Ko),{class:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-stone-400"})]),t("button",{onClick:uo,disabled:N.value||H.value,class:"min-h-[44px] inline-flex items-center justify-center gap-2 rounded-xl border border-stone-200 bg-white px-4 py-2.5 text-sm font-semibold text-stone-700 transition hover:border-pink-200 disabled:cursor-not-allowed disabled:opacity-50 touch-element"},[u(c(oo),{class:v(["size-4",{"animate-spin":H.value}])},null,8,["class"]),e[4]||(e[4]=t("span",{class:"hidden sm:inline"},"Refresh",-1))],8,wi),u(c(I),{href:"/admin/activity-dashboard/feed",class:"min-h-[44px] inline-flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-pink-500 via-rose-500 to-orange-500 px-4 py-2.5 text-sm font-semibold text-white shadow-sm shadow-pink-500/20 transition hover:shadow-md hover:shadow-pink-500/30 touch-element"},{default:R(()=>[e[5]||(e[5]=t("span",{class:"hidden sm:inline"},"View",-1)),e[6]||(e[6]=X(" Activity Feed ",-1)),u(c(at),{class:"size-4"})]),_:1})])])]),u(pi,{modelValue:b.value,"onUpdate:modelValue":e[1]||(e[1]=o=>b.value=o)},null,8,["modelValue"])]),N.value?(a(),r("div",ki,[...e[8]||(e[8]=[t("div",{class:"flex flex-col items-center gap-3"},[t("div",{class:"size-6 animate-spin rounded-full border-2 border-stone-200 border-t-pink-500"}),t("span",{class:"text-sm text-stone-500"},"Loading dashboard...")],-1)])])):B.value?(a(),r("div",Ci,[t("p",Ai,i(B.value),1),t("button",{onClick:G,class:"mt-2 text-sm text-stone-900 underline"},"Retry")])):(a(),r("div",zi,[Ao.value?(a(),r("div",Ri,[t("div",ji,[t("div",Si,[t("div",null,[e[9]||(e[9]=t("p",{class:"text-sm font-medium text-stone-500"},"Active Agents",-1)),t("p",Wi,i(h((_=(d=(l=n.value)==null?void 0:l.metrics)==null?void 0:d.active_agents)==null?void 0:_.total)),1)]),u(c($),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",Ti,[t("span",null,"DAU: "+i(h((x=(w=(f=n.value)==null?void 0:f.metrics)==null?void 0:w.active_agents)==null?void 0:x.dau)),1),e[10]||(e[10]=t("span",{class:"text-stone-300"},"|",-1)),t("span",null,"WAU: "+i(h((it=(g=(k=n.value)==null?void 0:k.metrics)==null?void 0:g.active_agents)==null?void 0:it.wau)),1),e[11]||(e[11]=t("span",{class:"text-stone-300"},"|",-1)),t("span",null,"MAU: "+i(h((jt=(y=(nt=n.value)==null?void 0:nt.metrics)==null?void 0:y.active_agents)==null?void 0:jt.mau)),1)]),e[12]||(e[12]=t("div",{class:"pointer-events-none absolute -top-2 left-1/2 z-10 -translate-x-1/2 -translate-y-full rounded-lg bg-gray-900 px-3 py-2 text-xs text-white opacity-0 transition-opacity group-hover:opacity-100"},[t("div",{class:"space-y-1"},[t("p",null,"DAU: Daily Active Users"),t("p",null,"WAU: Weekly Active Users"),t("p",null,"MAU: Monthly Active Users")]),t("div",{class:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 rotate-45 size-2 bg-gray-900"})],-1))]),t("div",Li,[t("div",Ui,[t("div",null,[e[13]||(e[13]=t("p",{class:"text-sm font-medium text-stone-500"},"AI Adoption Rate",-1)),t("p",Ii,i(V((Wt=(St=n.value)==null?void 0:St.metrics)==null?void 0:Wt.ai_adoption_rate)),1)]),u(c(rt),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",$i,[(a(),A(E(((Lt=(Tt=n.value)==null?void 0:Tt.metrics)==null?void 0:Lt.ai_adoption_trend)>=0?c(lt):c(io)),{class:v(["size-3.5",((It=(Ut=n.value)==null?void 0:Ut.metrics)==null?void 0:It.ai_adoption_trend)>=0?"text-green-500":"text-red-500"])},null,8,["class"])),t("span",{class:v(((Dt=($t=n.value)==null?void 0:$t.metrics)==null?void 0:Dt.ai_adoption_trend)>=0?"text-green-600":"text-red-600")},i(((Mt=(Ft=n.value)==null?void 0:Ft.metrics)==null?void 0:Mt.ai_adoption_trend)>=0?"+":"")+i(((Ot=(Vt=(Pt=n.value)==null?void 0:Pt.metrics)==null?void 0:Vt.ai_adoption_trend)==null?void 0:Ot.toFixed(1))||0)+"% ",3),e[14]||(e[14]=t("span",{class:"text-stone-400"},"vs last period",-1))])]),t("div",Di,[t("div",Fi,[t("div",null,[e[15]||(e[15]=t("p",{class:"text-sm font-medium text-stone-500"},"AI Chats Today",-1)),t("p",Mi,i(h((Nt=(Bt=n.value)==null?void 0:Bt.metrics)==null?void 0:Nt.ai_chats_today)),1)]),u(c(ht),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",Pi,[t("span",Vi," Yesterday: "+i(h((Et=(Ht=n.value)==null?void 0:Ht.metrics)==null?void 0:Et.ai_chats_yesterday)),1),((Zt=(qt=n.value)==null?void 0:qt.metrics)==null?void 0:Zt.ai_chats_change)!==0?(a(),r("span",{key:0,class:v(((Kt=(Gt=n.value)==null?void 0:Gt.metrics)==null?void 0:Kt.ai_chats_change)>=0?"text-green-600":"text-red-600")}," ("+i(((Yt=(Jt=n.value)==null?void 0:Jt.metrics)==null?void 0:Yt.ai_chats_change)>=0?"+":"")+i(((Xt=(Qt=n.value)==null?void 0:Qt.metrics)==null?void 0:Xt.ai_chats_change)||0)+"%) ",3)):p("",!0)])]),t("div",Oi,[t("div",Bi,[t("div",null,[e[16]||(e[16]=t("p",{class:"text-sm font-medium text-stone-500"},"Avg Session",-1)),t("p",Ni,i(mo((ee=(te=n.value)==null?void 0:te.metrics)==null?void 0:ee.avg_session_duration)),1)]),u(c(Xo),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",Hi,[t("span",null,"Avg pages: "+i(((ie=(oe=(se=n.value)==null?void 0:se.metrics)==null?void 0:oe.avg_pages_per_session)==null?void 0:ie.toFixed(1))||0),1)])]),t("div",Ei,[t("div",qi,[t("div",null,[e[17]||(e[17]=t("p",{class:"text-sm font-medium text-stone-500"},"30-Day Retention",-1)),t("p",Zi,i(V((ae=(ne=n.value)==null?void 0:ne.metrics)==null?void 0:ae.retention_30d)),1)]),u(c(lt),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",Gi,[t("span",null,"7-day: "+i(V((le=(re=n.value)==null?void 0:re.metrics)==null?void 0:le.retention_7d)),1)])])])):p("",!0),t("div",Ki,[u(c(I),{href:"/admin/subscriptions",class:"block rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md hover:border-stone-200 cursor-pointer"},{default:R(()=>{var o,m,L,O,Y,Q,Hs,Es,qs,Zs,Gs,Ks,Js,Ys,Qs,Xs;return[t("div",Ji,[t("div",null,[e[18]||(e[18]=t("p",{class:"text-sm font-medium text-stone-500"},"Monthly Recurring Revenue",-1)),t("p",Yi,i(ct((m=(o=n.value)==null?void 0:o.revenue)==null?void 0:m.mrr)),1)]),u(c(ti),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",Qi,[(a(),A(E(((O=(L=n.value)==null?void 0:L.revenue)==null?void 0:O.mrr_growth)>=0?c(lt):c(io)),{class:v(["size-3.5",((Q=(Y=n.value)==null?void 0:Y.revenue)==null?void 0:Q.mrr_growth)>=0?"text-green-500":"text-red-500"])},null,8,["class"])),t("span",{class:v(((Es=(Hs=n.value)==null?void 0:Hs.revenue)==null?void 0:Es.mrr_growth)>=0?"text-green-600":"text-red-600")},i(((Zs=(qs=n.value)==null?void 0:qs.revenue)==null?void 0:Zs.mrr_growth)>=0?"+":"")+i(ct((Ks=(Gs=n.value)==null?void 0:Gs.revenue)==null?void 0:Ks.mrr_growth)),3),t("span",Xi,"("+i(((Ys=(Js=n.value)==null?void 0:Js.revenue)==null?void 0:Ys.mrr_growth_percent)>=0?"+":"")+i((Xs=(Qs=n.value)==null?void 0:Qs.revenue)==null?void 0:Xs.mrr_growth_percent)+"%)",1)])]}),_:1}),u(c(I),{href:"/admin/subscriptions",class:"block rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md hover:border-stone-200 cursor-pointer"},{default:R(()=>{var o,m;return[t("div",tn,[t("div",null,[e[19]||(e[19]=t("p",{class:"text-sm font-medium text-stone-500"},"Annual Run Rate",-1)),t("p",en,i(ct((m=(o=n.value)==null?void 0:o.revenue)==null?void 0:m.arr)),1)]),u(c(no),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),e[20]||(e[20]=t("div",{class:"mt-3 flex items-center gap-1.5 text-xs text-stone-500"},[t("span",null,"Based on current MRR Ã 12")],-1))]}),_:1}),u(c(I),{href:"/admin/subscriptions",class:"block rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md hover:border-stone-200 cursor-pointer"},{default:R(()=>{var o,m,L,O,Y,Q;return[t("div",sn,[t("div",null,[e[21]||(e[21]=t("p",{class:"text-sm font-medium text-stone-500"},"Active Subscriptions",-1)),t("p",on,i(h((m=(o=n.value)==null?void 0:o.revenue)==null?void 0:m.active_subscriptions)),1)]),u(c(ao),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",nn,[t("span",null,i(((O=(L=n.value)==null?void 0:L.revenue)==null?void 0:O.trialing_subscriptions)||0)+" on trial",1),e[22]||(e[22]=t("span",{class:"text-stone-300"},"|",-1)),t("span",an,"+"+i(((Q=(Y=n.value)==null?void 0:Y.revenue)==null?void 0:Q.new_subscriptions)||0)+" new",1)])]}),_:1}),u(c(I),{href:"/admin/subscriptions",class:"block rounded-2xl bg-white p-5 border border-stone-100 shadow-sm transition-shadow hover:shadow-md hover:border-stone-200 cursor-pointer"},{default:R(()=>{var o,m,L,O;return[t("div",rn,[t("div",null,[e[23]||(e[23]=t("p",{class:"text-sm font-medium text-stone-500"},"Churn Rate",-1)),t("p",ln,i(V((m=(o=n.value)==null?void 0:o.revenue)==null?void 0:m.churn_rate)),1)]),u(c(ei),{class:"size-6 shrink-0 text-stone-400","stroke-width":"1.75"})]),t("div",dn,[t("span",null,i(((O=(L=n.value)==null?void 0:L.revenue)==null?void 0:O.churned_this_month)||0)+" churned this period",1)])]}),_:1})]),u(vt,{title:"Revenue Trend","height-class":"h-64 sm:h-72 lg:h-64"},{"header-actions":R(()=>[u(c(I),{href:"/admin/subscriptions",class:"flex items-center gap-1 text-sm text-stone-500 hover:text-stone-900 transition-colors"},{default:R(()=>[e[24]||(e[24]=t("span",{class:"hidden sm:inline"},"View Subscriptions",-1)),e[25]||(e[25]=t("span",{class:"sm:hidden"},"View",-1)),u(c(at),{class:"size-4"})]),_:1})]),default:R(()=>{var o;return[Object.keys(((o=n.value)==null?void 0:o.mrr_trend)||{}).length>0?(a(),A(c(xt),{key:0,data:_o.value,options:xo},null,8,["data"])):(a(),r("div",cn," No revenue data available for this period "))]}),_:1}),zo.value?(a(),r("div",un,[t("div",mn,[t("div",pn,[u(c(rt),{class:"size-5 text-white"})]),e[26]||(e[26]=t("div",null,[t("h2",{class:"text-lg font-semibold text-stone-900"},"Public AI (Inigo)"),t("p",{class:"text-sm text-stone-500 mt-0.5"},"Consumer AI chat engagement metrics")],-1))]),t("div",_n,[t("div",xn,[t("div",vn,[u(c(et),{class:"size-4 text-stone-400"}
1),e[27]||(e[27]=t("p",{class:"text-xs font-medium text-stone-500"},"Sessions",-1))]),t("p",bn,i(h((ce=(de=n.value)==null?void 0:de.public_ai)==null?void 0:ce.total_sessions)),1)]),t("div",hn,[t("div",gn,[u(c($),{class:"size-4 text-stone-400"}),e[28]||(e[28]=t("p",{class:"text-xs font-medium text-stone-500"},"Unique Visitors",-1))]),t("p",fn,i(h((me=(ue=n.value)==null?void 0:ue.public_ai)==null?void 0:me.unique_visitors)),1)]),t("div",yn,[t("div",wn,[u(c(ht),{class:"size-4 text-stone-400"}),e[29]||(e[29]=t("p",{class:"text-xs font-medium text-stone-500"},"Messages",-1))]),t("p",kn,i(h((_e=(pe=n.value)==null?void 0:pe.public_ai)==null?void 0:_e.total_messages)),1),t("p",Cn," ~"+i(((be=(ve=(xe=n.value)==null?void 0:xe.public_ai)==null?void 0:ve.avg_messages_per_session)==null?void 0:be.toFixed(1))||0)+" per session ",1)]),t("div",An,[t("div",zn,[u(c(lt),{class:"size-4 text-stone-400"}),e[30]||(e[30]=t("p",{class:"text-xs font-medium text-stone-500"},"Conversion Rate",-1))]),t("p",Rn,i(V((ge=(he=n.value)==null?void 0:he.public_ai)==null?void 0:ge.conversion_rate)),1),t("p",jn,i(h((ye=(fe=n.value)==null?void 0:fe.public_ai)==null?void 0:ye.converted_sessions))+" converted ",1)]),t("div",Sn,[t("div",Wn,[u(c(no),{class:"size-4 text-stone-400"}),e[31]||(e[31]=t("p",{class:"text-xs font-medium text-stone-500"},"Tokens Used",-1))]),t("p",Tn,i(h((ke=(we=n.value)==null?void 0:we.public_ai)==null?void 0:ke.total_tokens)),1)])]),J.value.length>0?(a(),r("div",Ln,[e[32]||(e[32]=t("h3",{class:"mb-3 sm:mb-4 text-sm font-semibold text-stone-700"},"Conversion Funnel",-1)),t("div",Un,[(a(!0),r(W,null,U(J.value,(o,m)=>{var L;return a(),r(W,{key:o.step},[t("div",In,[t("div",{class:v(["relative overflow-hidden rounded-xl p-4",o.color])},[t("p",{class:v(["text-xs sm:text-sm font-medium truncate",o.color.includes("gradient")?"text-white/80":"text-stone-600"])},i(o.label),3),t("p",{class:v(["mt-1 text-xl sm:text-2xl font-bold",o.color.includes("gradient")?"text-white":"text-stone-900"])},i(h(o.count)),3),((L=J.value[0])==null?void 0:L.count)>0?(a(),r("div",{key:0,class:v(["mt-2 text-xs",o.color.includes("gradient")?"text-white/70":"text-stone-500"])},i(o.percentage)+"% of total ",3)):p("",!0)],2)]),m<J.value.length-1?(a(),r("div",$n,[u(c(gt),{class:"size-5 text-stone-400 sm:hidden"}),u(c(at),{class:"size-5 text-stone-400 hidden sm:block"}),t("span",Dn,i(Ro(m))+"% ",1)])):p("",!0)],64)}),128))])])):p("",!0)])):p("",!0),t("div",{class:v(["grid grid-cols-1 gap-4 sm:gap-6",mt.value?"lg:grid-cols-3":""])},[t("div",{class:v(["rounded-2xl bg-white p-4 sm:p-6 border border-stone-100 shadow-sm",mt.value?"lg:col-span-2":""])},[t("div",Fn,[e[35]||(e[35]=t("div",null,[t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"Chats Started"),t("p",{class:"text-xs text-stone-500 mt-0.5"},"Public AI vs Agent AI conversations")],-1)),t("div",Mn,[t("div",Pn,[e[33]||(e[33]=t("span",{class:"relative flex size-2"},[t("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),t("span",{class:"relative inline-flex rounded-full size-2 bg-green-500"})],-1)),e[34]||(e[34]=t("span",{class:"text-stone-500"},"Live (1h):",-1)),t("span",Vn,i(((ze=(Ae=(Ce=n.value)==null?void 0:Ce.chat_trends)==null?void 0:Ae.live)==null?void 0:ze.total)||0),1)])])]),t("div",On,[Object.keys(((je=(Re=n.value)==null?void 0:Re.chat_trends)==null?void 0:je.by_date)||{}).length>0?(a(),A(c(xt),{key:0,data:yo.value,options:wo},null,8,["data"])):(a(),r("div",Bn," No chat data available for this period "))]),t("div",Nn,[(Te=(We=(Se=n.value)==null?void 0:Se.chat_trends)==null?void 0:We.showing)!=null&&Te.public?(a(),r("div",Hn,[e[36]||(e[36]=t("div",{class:"size-3 rounded-full bg-cyan-500"},null,-1)),e[37]||(e[37]=t("span",{class:"text-stone-600"},"Public:",-1)),t("span",En,i(h((Ie=(Ue=(Le=n.value)==null?void 0:Le.chat_trends)==null?void 0:Ue.totals)==null?void 0:Ie.public)),1)])):p("",!0),(Fe=(De=($e=n.value)==null?void 0:$e.chat_trends)==null?void 0:De.showing)!=null&&Fe.agent?(a(),r("div",qn,[e[38]||(e[38]=t("div",{class:"size-3 rounded-full bg-violet-500"},null,-1)),e[39]||(e[39]=t("span",{class:"text-stone-600"},"Agent:",-1)),t("span",Zn,i(h((Ve=(Pe=(Me=n.value)==null?void 0:Me.chat_trends)==null?void 0:Pe.totals)==null?void 0:Ve.agent)),1)])):p("",!0),t("div",{class:v(["flex items-center gap-2",{"border-l pl-6 border-stone-200":((Ne=(Be=(Oe=n.value)==null?void 0:Oe.chat_trends)==null?void 0:Be.showing)==null?void 0:Ne.public)&&((qe=(Ee=(He=n.value)==null?void 0:He.chat_trends)==null?void 0:Ee.showing)==null?void 0:qe.agent)}])},[e[40]||(e[40]=t("span",{class:"text-stone-600"},"Total:",-1)),t("span",Gn,i(h((Ke=(Ge=(Ze=n.value)==null?void 0:Ze.chat_trends)==null?void 0:Ge.totals)==null?void 0:Ke.total)),1)],2)])],2),mt.value?(a(),r("div",Kn,[e[44]||(e[44]=t("div",{class:"mb-4"},[t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"User Types"),t("p",{class:"text-xs text-stone-500 mt-0.5"},"Pro vs Property Hunter")],-1)),t("div",Jn,[((Ye=(Je=n.value)==null?void 0:Je.consumer_type_distribution)==null?void 0:Ye.total)>0?(a(),A(c(eo),{key:0,data:ko.value,options:Co},null,8,["data"])):(a(),r("div",Yn," No user type data available "))]),((Xe=(Qe=n.value)==null?void 0:Qe.consumer_type_distribution)==null?void 0:Xe.total)>0?(a(),r("div",Qn,[t("div",Xn,[e[41]||(e[41]=t("div",{class:"flex items-center gap-2"},[t("div",{class:"size-3 rounded-full bg-amber-500"}),t("span",{class:"text-stone-600"},"Pro")],-1)),t("div",ta,[t("span",ea,i(h((os=(ss=(es=(ts=n.value)==null?void 0:ts.consumer_type_distribution)==null?void 0:es.groups)==null?void 0:ss.pro)==null?void 0:os.count)),1),t("span",sa,"("+i((rs=(as=(ns=(is=n.value)==null?void 0:is.consumer_type_distribution)==null?void 0:ns.groups)==null?void 0:as.pro)==null?void 0:rs.percentage)+"%)",1)])]),t("div",oa,[e[42]||(e[42]=t("div",{class:"flex items-center gap-2"},[t("div",{class:"size-3 rounded-full bg-blue-500"}),t("span",{class:"text-stone-600"},"Property Hunter")],-1)),t("div",ia,[t("span",na,i(h((us=(cs=(ds=(ls=n.value)==null?void 0:ls.consumer_type_distribution)==null?void 0:ds.groups)==null?void 0:cs.property_hunter)==null?void 0:us.count)),1),t("span",aa,"("+i((xs=(_s=(ps=(ms=n.value)==null?void 0:ms.consumer_type_distribution)==null?void 0:ps.groups)==null?void 0:_s.property_hunter)==null?void 0:xs.percentage)+"%)",1)])]),t("div",ra,[e[43]||(e[43]=t("p",{class:"text-xs text-stone-400 mb-2"},"Breakdown:",-1)),t("div",la,[(a(!0),r(W,null,U((bs=(vs=n.value)==null?void 0:vs.consumer_type_distribution)==null?void 0:bs.breakdown,(o,m)=>(a(),r("span",{key:m,class:"inline-flex items-center gap-1 rounded-full bg-stone-100 px-2 py-0.5 text-xs text-stone-600"},i(m)+": "+i(o),1))),128))])])])):p("",!0)])):p("",!0)],2),!b.value||b.value==="all"?(a(),r("div",da,[t("div",ca,[t("div",ua,[e[45]||(e[45]=t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"User Distribution",-1)),u(so,{text:"Active users by type in the selected period",width:"w-56"})]),t("div",ma,[Ct.value.labels.length>0?(a(),A(c(eo),{key:0,data:Ct.value,options:fo},null,8,["data"])):(a(),r("div",pa," No user data available "))]),t("div",_a," Total: "+i(h((gs=(hs=n.value)==null?void 0:hs.user_type_distribution)==null?void 0:gs.total))+" active users ",1)]),t("div",xa,[t("div",va,[t("div",ba,[u(c($),{class:"size-4 text-stone-400","stroke-width":"1.75"}),e[46]||(e[46]=t("p",{class:"text-sm font-semibold text-stone-700"},"Agents",-1)),e[47]||(e[47]=t("span",{class:"ml-auto size-2 roun
1ded-full bg-blue-500"},null,-1))]),t("p",ha,i(h((ws=(ys=(fs=n.value)==null?void 0:fs.user_type_distribution)==null?void 0:ys.agent)==null?void 0:ws.count)),1),t("p",ga,i(V((As=(Cs=(ks=n.value)==null?void 0:ks.user_type_distribution)==null?void 0:Cs.agent)==null?void 0:As.percentage))+" of activity ",1)]),t("div",fa,[t("div",ya,[u(c(q),{class:"size-4 text-stone-400","stroke-width":"1.75"}),e[48]||(e[48]=t("p",{class:"text-sm font-semibold text-stone-700"},"Consumers",-1)),e[49]||(e[49]=t("span",{class:"ml-auto size-2 rounded-full bg-emerald-500"},null,-1))]),t("p",wa,i(h((js=(Rs=(zs=n.value)==null?void 0:zs.user_type_distribution)==null?void 0:Rs.consumer)==null?void 0:js.count)),1),t("p",ka,i(V((Ts=(Ws=(Ss=n.value)==null?void 0:Ss.user_type_distribution)==null?void 0:Ws.consumer)==null?void 0:Ts.percentage))+" of activity ",1)]),t("div",Ca,[t("div",Aa,[u(c(et),{class:"size-4 text-stone-400","stroke-width":"1.75"}),e[50]||(e[50]=t("p",{class:"text-sm font-semibold text-stone-700"},"Anonymous",-1)),e[51]||(e[51]=t("span",{class:"ml-auto size-2 rounded-full bg-amber-500"},null,-1))]),t("p",za,i(h((Is=(Us=(Ls=n.value)==null?void 0:Ls.user_type_distribution)==null?void 0:Us.anonymous)==null?void 0:Is.count)),1),t("p",Ra,i(V((Fs=(Ds=($s=n.value)==null?void 0:$s.user_type_distribution)==null?void 0:Ds.anonymous)==null?void 0:Fs.percentage))+" of activity ",1)])])])):p("",!0),t("div",ja,[t("div",Sa,[e[52]||(e[52]=t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"Adoption Funnel",-1)),u(so,{text:"Agent progression from signup to power user",width:"w-56"})]),t("div",Wa,[(a(!0),r(W,null,U(K.value,(o,m)=>(a(),r(W,{key:o.label},[t("div",Ta,[t("div",{class:v(["relative overflow-hidden rounded-xl p-4",o.color])},[t("p",{class:v(["text-xs sm:text-sm font-medium truncate",o.color.includes("gradient")?"text-white/80":"text-stone-600"])},i(o.label),3),t("p",{class:v(["mt-1 text-xl sm:text-2xl font-bold",o.color.includes("gradient")?"text-white":"text-stone-900"])},i(h(o.value)),3),K.value[0].value>0?(a(),r("div",{key:0,class:v(["mt-2 text-xs",o.color.includes("gradient")?"text-white/70":"text-stone-500"])},i((o.value/K.value[0].value*100).toFixed(1))+"% of total ",3)):p("",!0)],2)]),m<K.value.length-1?(a(),r("div",La,[u(c(gt),{class:"size-5 text-stone-400 sm:hidden"}),u(c(at),{class:"size-5 text-stone-400 hidden sm:block"}),t("span",Ua,i(bo(m))+"% ",1)])):p("",!0)],64))),128))])]),t("div",Ia,[u(vt,{class:"lg:col-span-2",title:"Activity by Category","height-class":"h-72 sm:h-80 lg:h-72"},{default:R(()=>[wt.value.labels.length?(a(),A(c(xt),{key:0,data:wt.value,options:po},null,8,["data"])):(a(),r("div",$a," No activity data available "))]),_:1}),u(vt,{title:"Top AI Tools","height-class":"h-72 sm:h-80 lg:h-72"},{default:R(()=>[kt.value.labels.length?(a(),A(c(qo),{key:0,data:kt.value,options:vo},null,8,["data"])):(a(),r("div",Da," No AI tool usage data "))]),_:1})]),t("div",Fa,[t("div",Ma,[t("div",Pa,[t("div",Va,[e[54]||(e[54]=t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"Top Users",-1)),u(c(I),{href:"/admin/activity-dashboard/feed",class:"text-sm font-medium text-pink-600 hover:text-pink-700 touch-element shrink-0"},{default:R(()=>[...e[53]||(e[53]=[X(" View all ",-1)])]),_:1})]),t("div",Oa,[t("div",Ba,[(a(),r(W,null,U(pt,o=>t("button",{key:o.value,onClick:m=>z.value=o.value,class:v(["flex items-center gap-1.5 rounded-md min-h-[44px] px-3 sm:px-4 py-2 sm:py-2.5 text-xs sm:text-sm font-medium transition-all touch-element whitespace-nowrap",z.value===o.value?"bg-white text-stone-900 shadow-sm":"text-stone-500 hover:text-stone-700"])},[(a(),A(E(o.icon),{class:"size-3.5 shrink-0"})),t("span",null,i(o.label),1)],10,Na)),64))])])]),t("div",Ha,[z.value==="agent"?(a(!0),r(W,{key:0},U(((Ms=n.value)==null?void 0:Ms.top_agents)||[],(o,m)=>(a(),r("div",{key:o.id,class:"flex items-center gap-3 sm:gap-4 px-4 sm:px-6 py-3 sm:py-4 transition-colors hover:bg-stone-50"},[t("span",{class:v(["flex size-6 sm:size-7 items-center justify-center rounded-full text-xs sm:text-sm font-semibold shrink-0",{"bg-stone-900 text-white":m===0,"bg-stone-100 text-stone-600":m===1,"bg-stone-200 text-stone-600":m===2,"bg-stone-50 text-stone-500":m>2}])},i(m+1),3),t("div",Ea,[o.avatar?(a(),r("img",{key:0,src:o.avatar,alt:o.name,class:"size-full object-cover"},null,8,qa)):(a(),r("div",Za,i(yt(o.name)),1))]),t("div",Ga,[u(c(I),{href:`/admin/activity-dashboard/agents/${o.id}`,class:"font-medium text-sm sm:text-base text-stone-900 hover:text-pink-600 line-clamp-1"},{default:R(()=>[X(i(o.name),1)]),_:2},1032,["href"]),t("p",Ka,i(o.company_name),1)]),t("div",Ja,[t("p",Ya,i(h(o.total_activities)),1),e[55]||(e[55]=t("p",{class:"text-[10px] sm:text-xs text-stone-500"},"activities",-1))]),t("div",Qa,[t("p",Xa,i(h(o.ai_chats))+" chats",1),t("p",tr,[o.ai_valuations?(a(),r("span",er,i(o.ai_valuations)+" vals",1)):p("",!0),o.ai_valuations&&(o.widgets||o.articles)?(a(),r("span",sr,", ")):p("",!0),o.widgets?(a(),r("span",or,i(o.widgets)+" widgets",1)):p("",!0),o.widgets&&o.articles?(a(),r("span",ir,", ")):p("",!0),o.articles?(a(),r("span",nr,i(o.articles)+" articles",1)):p("",!0),!o.ai_valuations&&!o.widgets&&!o.articles?(a(),r("span",ar,"only")):p("",!0)])]),t("div",rr,[t("p",lr,i(st(o.last_active_at)),1
1)])]))),128)):z.value==="consumer"||z.value==="admin"?(a(!0),r(W,{key:1},U(ot.value,(o,m)=>(a(),r("div",{key:o.id,class:"flex items-center gap-3 sm:gap-4 px-4 sm:px-6 py-3 sm:py-4 transition-colors hover:bg-stone-50"},[t("span",{class:v(["flex size-6 sm:size-7 items-center justify-center rounded-full text-xs sm:text-sm font-semibold shrink-0",{"bg-stone-900 text-white":m===0,"bg-stone-100 text-stone-600":m===1,"bg-stone-200 text-stone-600":m===2,"bg-stone-50 text-stone-500":m>2}])},i(m+1),3),t("div",{class:v(["size-9 sm:size-10 overflow-hidden rounded-full shrink-0","bg-stone-100"])},[o.avatar?(a(),r("img",{key:0,src:o.avatar,alt:o.name,class:"size-full object-cover"},null,8,dr)):(a(),r("div",{key:1,class:v(["flex size-full items-center justify-center text-xs sm:text-sm font-medium","text-stone-500"])},i(yt(o.name)),1))]),t("div",cr,[t("p",ur,i(o.name),1),t("p",mr,i(o.email),1)]),t("div",pr,[t("p",_r,i(h(o.activity_count)),1),e[56]||(e[56]=t("p",{class:"text-[10px] sm:text-xs text-stone-500"},"activities",-1))]),t("div",xr,[t("p",{class:v(["text-sm font-medium","text-stone-600"])},i(o.ai_activities||0)+" AI chats ",1),t("p",vr,[o.valuation_activities?(a(),r("span",br,i(o.valuation_activities)+" vals",1)):p("",!0),o.valuation_activities&&o.property_views?(a(),r("span",hr,", ")):p("",!0),o.property_views?(a(),r("span",gr,i(o.property_views)+" views",1)):p("",!0),!o.valuation_activities&&!o.property_views?(a(),r("span",fr,i(o.categories_used)+" categories",1)):p("",!0)])]),t("div",yr,[t("p",wr,i(st(o.last_active_at)),1)])]))),128)):z.value==="anonymous"?(a(!0),r(W,{key:2},U(ot.value,(o,m)=>(a(),r("div",{key:o.id,class:"flex items-center gap-3 sm:gap-4 px-4 sm:px-6 py-3 sm:py-4 transition-colors hover:bg-stone-50"},[t("span",{class:v(["flex size-6 sm:size-7 items-center justify-center rounded-full text-xs sm:text-sm font-semibold shrink-0",{"bg-stone-900 text-white":m===0,"bg-stone-100 text-stone-600":m===1,"bg-stone-200 text-stone-600":m===2,"bg-stone-50 text-stone-500":m>2}])},i(m+1),3),t("div",kr,[u(c(et),{class:"size-4 sm:size-5 text-stone-500"})]),t("div",Cr,[t("p",Ar,i(o.name),1),t("p",zr,i(o.location),1)]),t("div",Rr,[t("p",jr,i(h(o.activity_count)),1),e[57]||(e[57]=t("p",{class:"text-[10px] sm:text-xs text-stone-500"},"activities",-1))]),t("div",Sr,[t("p",Wr,i(o.ai_activities||0)+" AI chats ",1),t("p",Tr,[o.valuation_activities?(a(),r("span",Lr,i(o.valuation_activities)+" vals",1)):p("",!0),o.valuation_activities&&o.property_views?(a(),r("span",Ur,", ")):p("",!0),o.property_views?(a(),r("span",Ir,i(o.property_views)+" views",1)):p("",!0),!o.valuation_activities&&!o.property_views?(a(),r("span",$r,i(o.categories_used)+" categories",1)):p("",!0)])]),t("div",Dr,[t("p",Fr,i(st(o.last_active_at)),1)])]))),128)):p("",!0),ot.value.length===0?(a(),r("div",Mr,[(a(),A(E(((Ps=pt.find(o=>o.value===z.value))==null?void 0:Ps.icon)||c($)),{class:"size-10 text-stone-300"})),t("p",Pr," No "+i((Vs=pt.find(o=>o.value===z.value))==null?void 0:Vs.label.toLowerCase())+" activity yet ",1)])):p("",!0),ot.value.length>=F.value?(a(),r("div",Vr,[t("button",{onClick:C,disabled:M.value,class:"flex items-center gap-2 rounded-lg border border-stone-200 bg-white px-4 py-2 text-sm font-medium text-stone-700 transition-colors hover:bg-stone-50 disabled:cursor-not-allowed disabled:opacity-50"},[M.value?(a(),A(c(oo),{key:0,class:"size-4 animate-spin"})):(a(),A(c(gt),{key:1,class:"size-4"})),X(" "+i(M.value?"Loading...":"Load more"),1)],8,Or)])):p("",!0)])]),t("div",Br,[t("div",Nr,[e[59]||(e[59]=t("h2",{class:"text-base sm:text-lg font-semibold text-stone-900"},"Recent Activity",-1)),u(c(I),{href:"/admin/activity-dashboard/feed",class:"text-sm font-medium text-pink-600 hover:text-pink-700"},{default:R(()=>[...e[58]||(e[58]=[X(" View all ",-1)])]),_:1})]),t("div",Hr,[(a(!0),r(W,null,U((((Os=n.value)==null?void 0:Os.recent_activities)||[]).slice(0,10),o=>{var m;return a(),r("div",{key:o.id,class:"px-3 sm:px-4 py-3 transition-colors hover:bg-stone-50"},[t("div",Er,[t("div",{class:v([go(o.category),"flex size-7 sm:size-8 flex-shrink-0 items-center justify-center rounded-lg"])},[(a(),A(E(ho(o.category)),{class:"size-3.5 sm:size-4"}))],2),t("div",qr,[t("div",Zr,[t("p",Gr,i(o.activity_label||o.activity_type),1),o.user_type?(a(),r("span",{key:0,class:v(["shrink-0 rounded px-1.5 py-0.5 text-[9px] sm:text-[10px] font-medium",{"bg-stone-100 text-stone-600":!0}])}
1,i(o.user_type_label||o.user_type),1)):p("",!0)]),t("div",Kr,[(m=o.user)!=null&&m.name?(a(),r("span",Jr,i(o.user.name),1)):o.user_type==="anonymous"?(a(),r("span",Yr,"Anonymous visitor")):p("",!0),e[61]||(e[61]=t("span",{class:"text-stone-300"},"|",-1)),t("span",Qr,i(st(o.created_at)),1),jo(o)?(a(),r(W,{key:2},[e[60]||(e[60]=t("span",{class:"text-stone-300 hidden sm:inline"},"|",-1)),t("button",{onClick:L=>So(o),class:"text-pink-600 hover:text-pink-700 font-medium whitespace-nowrap min-h-[24px]"}," View Chat ",8,Xr)],64)):p("",!0)])])])])}),128)),(Ns=(Bs=n.value)==null?void 0:Bs.recent_activities)!=null&&Ns.length?p("",!0):(a(),r("div",tl,[...e[62]||(e[62]=[t("div",{class:"flex size-16 items-center justify-center overflow-hidden rounded-2xl bg-white ring-1 ring-stone-100"},[t("img",{src:"/images/icons/moments/no-activity.webp",alt:"",class:"h-full w-full object-cover",loading:"lazy"})],-1),t("p",{class:"mt-3 text-sm text-stone-500"},"No recent activity",-1)])]))])])])])),u(Go,{modelValue:_t.value,"onUpdate:modelValue":e[2]||(e[2]=o=>_t.value=o),"conversation-type":At.value,"conversation-id":zt.value,"session-id":Rt.value},null,8,["modelValue","conversation-type","conversation-id","session-id"])]}),_:1}))}},y0=co(el,[["__scopeId","data-v-d4da57fa"]]);export{y0 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.