1const __vite__fileDeps=["./C5TZuC_W.js","./Bt1E67ws.js","./CnGHOUf1.js","./swiper-vue.2ZXFEWE-.css","./entry.CWg3YZJR.css","./BB_Ol6Sd.js","./Cq9Fpw4b.js","./-8NnNHIm.js","./D0cf4aYI.js","./CORhKg4v.js","./D500OTS8.js","./vTuk3rco.js","./CqvQKci1.js","./CJVCwZ1E.js","./DDsz6LYN.js","./cJzKwTnv.js","./av-s3G47.js","./BeSgDSyr.js","./DyZ5XCUf.js","./DARS2pox.js","./CZVe7Xiy.js","./Cod6S8-8.js","./BKH2jIrb.js","./BOH-bk_l.js","./xqL3uEpU.js","./mObWgOZU.js","./CAyffnK6.js","./Bg02e69q.js","./D2NfFbPB.js","./BsAZkJ1y.js","./BFa1m1N7.js","./BxyFGKuf.js","./7ctrovUr.js","./CCvOapre.js","./B_Sq3XHf.js","./Cklfe_jN.js","./vw_cW4zd.js","./Cesw2vBv.js","./CFZdXGb2.js","./D4hVyknI.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); 2import{u as A,B as E,b as U,L as T,e as b,m as P}from"./Bt1E67ws.js";import{r as k,a as O,l,u as B,b as D}from"./CnGHOUf1.js";const m=k(new Map);function M(u){return String(u||"").trim().toLowerCase()}function h(u){const a=M(u);return a?(m.has(a)||m.set(a,{isFollowing:!1,loading:!1,initialized:!1}),m.get(a)):null}function V(u,a={}){const{onFollowerCountChange:n=null,showToast:p=!0,autoCheck:_=!0}=a,F=A(),y=E(),$=b(),{t:f}=U(),g=O(!1),w=l(()=>T($.public)),c=l(()=>F.getAuthenticatedUser),s=l(()=>{const e=B(u);return String(e||"").trim()}),v=l(()=>{var o;const e=(o=c.value)==null?void 0:o.username,t=s.value;return!e||!t?!1:String(e).toLowerCase()===String(t).toLowerCase()}),i=l(()=>h(s.value)),C=l({get:()=>{var e;return((e=i.value)==null?void 0:e.isFollowing)??!1},set:e=>{i.value&&(i.value.isFollowing=e)}}),I=l({get:()=>{var e;return((e=i.value)==null?void 0:e.loading)??!1},set:e=>{i.value&&(i.value.loading=e)}}),L=l({get:()=>{var e;return((e=i.value)==null?void 0:e.initialized)??!1},set:e=>{i.value&&(i.value.initialized=e)}});function d(e,t){!p||typeof window>"u"||P(()=>import("./C5TZuC_W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]),import.meta.url).then(({ElMessage:o})=>{o({type:e,message:t,duration:2500})})}async function S(){var o;const e=s.value,t=h(e);if(t){if(!e||v.value||!((o=c.value)!=null&&o._id)){t.isFollowing=!1,t.initialized=!0;return}try{g.value=!0;const r=await $fetch(`${w.value}/${encodeURIComponent(e)}/follow/status`,{credentials:"include"});t.isFollowing=!!(r!=null&&r.isFollowing)}catch{t.isFollowing=!1}finally{g.value=!1,t.initialized=!0}}}async function R(){var r;const e=s.value,t=h(e);if(!e||!t||v.value||t.loading)return;if(!((r=c.value)!=null&&r._id)){y.toggleSignIn(),d("warning",f("profile_public.follow.tooltip_login"));return}const o=t.isFollowing;t.isFollowing=!o,t.loading=!0;try{o?(await $fetch(`${w.value}/${encodeURIComponent(e)}/follow`,{method:"DELETE",credentials:"include"}),n==null||n(-1),d("success",f("ui.follow.toast_unfollowed",{username:e}))):(await $fetch(`${w.value}/${encodeURIComponent(e)}/follow`,{method:"POST",credentials:"include"}),n==null||n(1),d("success",f("ui.follow.toast_followed",{username:e})))}catch(z){t.isFollowing=o,console.error("Creator follow toggle error:",z),d("error",f("ui.follow.toast_error"))}finally{t.loading=!1}}return _&&D([s,()=>{var e;return(e=c.value)==null?void 0:e._id}],()=>{S()},{immediate:!0}),{isFollowing:C,loading:I,statusLoading:g,initialized:L,isSelf:v,authUser:c,targetUsername:s,checkStatus:S,toggle:R}}export{V as u};
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.