1import{R as je,r as m,j as e,u as Oe,e as Pe}from"./query-vendor-DeAjbjY1.js";import{U as qe}from"./UniversalHeader-BAisAFem.js";import{c as I,B as M,u as pe,d as ue,L as Ee,t as J,e as ye,D as Be,h as Ve,s as E,A as ze,f as He}from"./index-oKjeO3om.js";import{I as Ye}from"./input-Bq8-EcpP.js";import{c as $e,d as Ge,u as Ke,R as We,a as Qe,e as Ue,b as Je,C as Ze}from"./ReplyThread-sIIj_19H.js";import{C as we}from"./card-B-ZVzsjo.js";import{B as $}from"./badge-CDSmOy46.js";import{D as Ne,a as _e,b as Ce,c as X}from"./UniversalChatWindow-B8q3WF4k.js";import{e as he,g as ge,h as Xe}from"./forumHtml-2IV2Sklo.js";import{B as De}from"./BookmarkButton-BDaK2hKc.js";import{b1 as et,as as Se,aq as Te,ar as Re,a1 as Le,a0 as tt,y as fe,aa as st,X as rt,aj as at,S as me,bZ as nt,K as ot,cm as it,aJ as lt,ac as dt,al as ct,Z as mt}from"./ui-vendor-CbGmq21X.js";import{a as xe,f as pt,r as ne,c as U,O as ut}from"./date-vendor-B5SO7aoS.js";import{U as xt}from"./UniversalActionsBar-Dpp2107S.js";import{R as ht}from"./ReportContentDialog-CKx9oyTZ.js";import{F as be}from"./ForumHtmlContent-Gb9AOWEf.js";import{R as gt,a as ft}from"./radio-group-CF13V8Yj.js";import{T as bt,a as kt,b as oe,c as ie}from"./tabs-BPlPC6UH.js";import{A as vt,a as jt,b as yt,c as wt,d as Nt,e as _t,f as Ct,g as Dt}from"./alert-dialog-DZJuSujH.js";import{u as St}from"./useHighlightDeepLink-CchR73aq.js";import{I as Tt}from"./InFeedAd-C6dt0Pv6.js";import{A as Rt}from"./adsPolicy-SX6uqcmN.js";import{u as Lt}from"./useLocationReactivity-BKmNJLG8.js";import{S as At,P as Ft}from"./Seo-Ds2rORq-.js";import{J as It}from"./JsonLd-DkF_3kxS.js";import{c as Mt}from"./servicePageSchemas-DhHvw4OZ.js";import"./pdf-vendor-BdCO-AL1.js";import"./react-vendor-BvYE7Gz6.js";import"./select-C5nS1biS.js";import"./index-BdQq_4o_.js";import"./AppForm-DOAjRIyG.js";import"./useGeolocation-CdZEu6tO.js";import"./locationPersistence-BAL_dr-K.js";import"./charts-vendor-DxqBrLyO.js";import"./supabase-vendor-JwDR5Hgr.js";import"./checkbox-DGXzL_lp.js";import"./serverRateLimit-CsUblBNL.js";import"./inputValidation-DOO1ccLH.js";import"./purify.es-CFh60W_8.js";import"./contentLimits-DPB5ue0V.js";import"./character-counter-C9Q6qOfv.js";
1import"./scroll-area-BxRmxQWJ.js";import"./useUniversalBookmarks-D-yTad5_.js";import"./useResponsiveBreakpoint-MPyO5MKS.js";import"./UniversalShareMenu-DWXrBXwG.js";import"./useContentReports-Dcp95LdU.js";import"./usePageVisibility-DV6J4lb5.js";import"./separator-BsO-bYnX.js";import"./listingDeepLinkHash-BbMv5saU.js";import"./jsonld-g7AlethP.js";const ke={Love:{bg:"bg-pink-100 dark:bg-pink-950/50",text:"text-pink-700 dark:text-pink-200",border:"border-pink-200 dark:border-pink-800/60"},Drama:{bg:"bg-purple-100 dark:bg-purple-950/50",text:"text-purple-700 dark:text-purple-200",border:"border-purple-200 dark:border-purple-800/60"},Work:{bg:"bg-blue-100 dark:bg-blue-950/50",text:"text-blue-700 dark:text-blue-200",border:"border-blue-200 dark:border-blue-800/60"},Family:{bg:"bg-amber-100 dark:bg-amber-950/50",text:"text-amber-700 dark:text-amber-200",border:"border-amber-200 dark:border-amber-800/60"},Friendship:{bg:"bg-teal-100 dark:bg-teal-950/50",text:"text-teal-700 dark:text-teal-200",border:"border-teal-200 dark:border-teal-800/60"},default:{bg:"bg-slate-100 dark:bg-muted",text:"text-slate-700 dark:text-foreground/90",border:"border-slate-200 dark:border-border"}},Ot=({confession:t,rank:i,isHallOfFame:f,userVote:c,onVote:p,onClick:n,isOwner:k,onEdit:o,onDelete:x})=>{const l=t.like_count||0,g=t.reply_count||0,D=xe(new Date(t.created_at),{addSuffix:!0}),u=m.useRef(null),[b,O]=m.useState(!1),{preview:h,hardTruncated:N}=(()=>{const d=t.post_type||"text";if(d==="poll"){const v=t.poll_question?.trim()||t.title;return v.length>he?{preview:`${v.slice(0,he)}â¦`,hardTruncated:!0}:{preview:v,hardTruncated:!1}}if(d==="link"&&t.link_url)try{const v=new URL(t.link_url).hostname,{preview:L,hardTruncated:F}=ge(t.content);return{preview:L.trim()?`${v} · ${L}`:v,hardTruncated:F}}catch{return{preview:t.link_url.slice(0,120),hardTruncated:!1}}return ge(t.content)})(),S=b||N;m.useLayoutEffect(()=>{const d=u.current;if(!d)return;const v=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const F=u.current;F&&O(F.scrollHeight>F.clientHeight+1)})})};v();const L=typeof ResizeObserver<"u"?new ResizeObserver(v):null;return L?.observe(d),()=>L?.disconnect()},[t.id,h]);const P=ke[t.category||""]||ke.default,q=(d,v)=>{d.stopPropagation(),p(t.id,"up")};return e.jsxs(we,{className:I("group relative cursor-pointer transition-all duration-300","bg-gradient-to-br from-white to-pink-50/50 hover:to-purple-50/50 border-2 border-border","dark:from-card dark:to-purple-950/25 dark:hover:to-purple-950/40","hover:border-pink-300 hover:shadow-xl hover:shadow-pink-500/10 dark:hover:border-pink-500/40 dark:hover:shadow-lg dark:hover:shadow-purple-950/30","hover:-translate-y-1","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",f&&"ring-2 ring-yellow-400/50 from-yellow-50/50 to-amber-50/50 border-yellow-300 dark:from-card dark:to-amber-950/30 dark:border-amber-700/50 dark:ring-amber-500/40"),onClick:n,tabIndex:0,role:"button",onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())},children:[i&&i<=3&&e.jsx("div",{className:I("absolute -top-3 -left-3 w-10 h-10 rounded-full flex items-center justify-center text-lg font-bold shadow-lg z-10",i===1&&"bg-gradient-to-br from-yellow-400 to-amber-500 text-white",i===2&&"bg-gradient-to-br from-slate-300 to-slate-400 text-slate-700",i===3&&"bg-gradient-to-br from-amber-600 to-orange-600 text-white"),children:i===1?"ð":i===2?"ð¥":"ð¥"}),f&&e.jsx("div",{className:"absolute -top-2 -right-2 z-10",children:e.jsxs($,{className:"bg-gradient-to-r from-yellow-500 to-amber-500 text-white border-0 shadow-lg px-3 py-1",children:[e.jsx(et,{className:"h-3 w-3 mr-1"}),"Legend â¨"]})}),e.jsxs("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[k&&(o||x)&&e.jsx("div",{onClick:d=>d.stopPropagation(),children:e.jsxs(Ne,{children:[e.jsx(_e,{asChild:!0,onClick:d=>d.stopPropagation(),children:e.jsx(M,{variant:"ghost",size:"icon",className:"h-8 w-8 text-slate-500 hover:text-purple-700 dark:text-muted-foreground dark:hover:text-foreground","aria-label":"Post actions",children:e.jsx(Se,{className:"h-4 w-4"})})}),e.jsxs(Ce,{align:"end",onClick:d=>d.stopPropagation(),onCloseAutoFocus:d=>d.preventDefault(),children:[o&&e.jsxs(X,{onClick:d=>{d.preventDefault(),d.stopPropagation(),o()},children:[e.jsx(Te,{className:"h-4 w-4 mr-2"})," Edit"]}),x&&e.jsxs(X,{className:"text-destructive focus:text-destructive",onClick:d=>{d.preventDefault(),d.stopPropagation(),x()},children:[e.jsx(Re,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})}),e.jsx(De,{contentId:t.id,contentType:"confession"})]}),e.jsxs("div",{className:"p-5",children:[e.jsx("div",{className:"text-4xl text-pink-200 dark:text-pink-400/40 font-serif leading-none mb-2",children:'"'}),t.category&&e.jsx($,{variant:"outline",className:I("mb-3 text-xs font-medium",P.bg,P.text,P.border),children:t.category}),(t.post_type||"text")==="link"&&e.jsx($,{variant:"outline",className:"mb-3 ml-2 text-xs",children:"Link"}),(t.post_type||"text")==="poll"&&e.jsx($,{variant:"outline",className:"mb-3 ml-2 text-xs",children:"Poll"}),e.jsx("h3",{className:"font-bold text-purple-900 dark:text-foreground mb-2 line-clamp-2 group-hover:text-pink-600 dark:group-hover:text-pink-400 transition-colors text-base",children:t.title}),e.jsxs("div",{className:"mb-4 min-w-0",children:[e.jsxs("div",{className:"relative min-w-0",children:[e.jsx("p",{ref:u,className:"text-sm text-slate-600 dar
1k:text-muted-foreground line-clamp-3 leading-relaxed italic min-w-0 break-words whitespace-pre-line",children:h}),S&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t from-white to-transparent dark:from-card dark:to-transparent","aria-hidden":!0})]}),S&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),n()},className:"mt-0.5 text-xs font-medium text-pink-600 hover:underline dark:text-pink-400","aria-label":"Open full post",children:"Read full confession"})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsxs("button",{onClick:d=>q(d),className:I("flex items-center gap-1 px-3 py-1.5 rounded-full text-sm transition-all","hover:scale-110 active:scale-95",c==="up"?"bg-gradient-to-r from-orange-400 to-red-400 text-white shadow-md":"bg-orange-50 text-orange-600 hover:bg-orange-100 dark:bg-muted dark:text-orange-300 dark:hover:bg-muted/80"),children:[e.jsx("span",{children:"ð¥"}),e.jsx("span",{className:"font-semibold",children:l})]}),e.jsxs("button",{onClick:d=>{d.stopPropagation(),n()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 dark:bg-muted dark:text-purple-300 dark:hover:bg-muted/80 transition-all hover:scale-110 active:scale-95",children:[e.jsx("span",{children:"ð¬"}),e.jsx("span",{className:"font-semibold",children:g})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400 dark:text-muted-foreground pt-2 border-t border-pink-100 dark:border-border",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{className:"h-3 w-3"}),e.jsx("span",{children:D})]}),!S&&e.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity text-pink-500 dark:text-pink-400 font-medium",children:[e.jsx(tt,{className:"h-3 w-3"}),e.jsx("span",{children:"Open"})]})]})]})]})},Z=je.memo(Ot),Pt=({confessionId:t,pollEndsAt:i,question:f})=>{const{user:c}=pe(),{showLoginPrompt:p}=ue(),{data:n,isLoading:k}=$e(t,!0),o=Ge(),[x,l]=m.useState(""),g=m.useMemo(()=>i?new Date(i).getTime()<=Date.now():!0,[i]),D=n?.options??[],u=n?.user_voted_option_id??null,b=D.reduce((h,N)=>h+N.vote_count,0),O=async()=>{if(!c){p();return}if(!x){J({title:"Choose an option",variant:"destructive"});return}try{await o.mutateAsync({confessionId:t,optionId:x}),J({title:"Vote recorded"})}catch(h){const N=h instanceof Error?h.message:"vote_failed";J({title:N==="already_voted"?"You already voted on this poll":N==="poll_closed"?"This poll has ended":"Could not submit vote",variant:"destructive"})}};return k&&D.length===0?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-4",children:[e.jsx(fe,{className:"h-4 w-4 animate-spin"})," Loading pollâ¦"]}):e.jsxs("div",{className:"rounded-lg border border-pink-200/60 bg-pink-50/40 dark:bg-pink-950/20 p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-purple-900",children:f}),i&&e.jsx("span",{className:"text-xs text-muted-foreground",children:g?"Closed":`Closes ${xe(new Date(i),{addSuffix:!0})}`})]}),u||g?e.jsx("ul",{className:"space-y-2",children:D.map(h=>{const N=b>0?Math.round(h.vote_count/b*100):0,S=u===h.option_id;return e.jsxs("li",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm gap-2",children:[e.jsx("span",{className:I(S&&"font-medium text-pink-600"),children:h.label}),e.jsxs("span",{className:"text-muted-foreground shrink-0",children:[h.vote_count," (",N,"%)"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-pink-500/70 transition-all",style:{width:`${N}%`}})})]},h.option_id)})}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(gt,{value:x,onValueChange:l,className:"gap-2",children:D.map(h=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ft,{value:h.option_id,id:`cpoll-${t}-${h.option_id}`}),e.jsx(Ee,{htmlFor:`cpoll-${t}-${h.option_id}`,className:"font-normal cursor-pointer",children:h.label})]},h.option_id))}),e.jsx(M,{size:"sm",onClick:O,disabled:o.isPending||!x,children:o.isPending?e.jsx(fe,{className:"h-4 w-4 animate-spin"}):"Vote"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b," total ",b===1?"vote":"votes"]})]})},ve={Love:{bg:"bg-pink-100",text:"text-pink-700"},Drama:{bg:"bg-purple-100",text:"text-purple-700"},Work:{bg:"bg-blue-100",text:"text-blue-700"},Family:{bg:"bg-amber-100",text:"text-amber-700"},Friendship:{bg:"bg-teal-100",text:"text-teal-700"},default:{bg:"bg-slate-100",text:"text-slate-700"}},qt=({confession:t,isOpen:i,onClose:f,userVote:c,onVote:p,onReplyCountChange:n,isOwner:k,onEdit:o,onDelete:x})=>{const{user:l}=pe(),{showLoginPrompt:g}=ue(),{toast:D}=ye(),[u,b]=m.useState(!1),[O,h]=m.useState(!1),[N,S]=m.useState(null),{createReply:P,updateReply:q,deleteReply:d,replies:v,loading:L,getReplies:F}=Ke(t?.id||"");if(m.useEffect(()=>{i||(S(null),b(!1))},[i]),!t)return null;const G=t.like_count||0,w=xe(new Date(t.created_at),{addSuffix:!0}),K=pt(new Date(t.created_at),"MMMM d, yyyy h:mm a"),B=ve[t.category||""]||ve.default,W=async(_,ee)=>{if(!l){g();return}
1try{await P({confession_id:t.id,content:_,is_anonymous:ee}),b(!1),S(null),n?.(),D({title:"Reply posted! ð¬",description:"Your thoughts have been added to the thread."})}catch(V){const T=V instanceof Error?V.message:"";D(T==="rate_limit_exceeded"||T==="ip_blocked"||T==="user_banned"?{title:T==="rate_limit_exceeded"?"Slow down":"Cannot post",description:T==="rate_limit_exceeded"?"Too many replies. Try again in a little while.":T==="user_banned"?"Your account cannot post replies right now.":"Something blocked this request. Try again later.",variant:"destructive"}:{title:"Error",description:V instanceof Error?V.message:"Failed to post reply.",variant:"destructive"})}};return e.jsxs(e.Fragment,{children:[e.jsx(Be,{open:i,onOpenChange:_=>!_&&f(),children:e.jsxs(Ve,{className:"max-w-2xl max-h-[90vh] overflow-hidden flex flex-col p-0 bg-gradient-to-br from-white via-pink-50/30 to-purple-50/30 border-pink-200",children:[e.jsxs("div",{className:"sticky top-0 bg-gradient-to-r from-purple-50 to-pink-50 border-b border-pink-200 p-4 flex items-center justify-between z-10",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[t.category&&e.jsx($,{className:I(B.bg,B.text,"border-0"),children:t.category}),e.jsxs("span",{className:"text-sm text-purple-500",title:K,children:[e.jsx(Le,{className:"h-3 w-3 inline mr-1"}),w]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[k&&(o||x)&&e.jsxs(Ne,{children:[e.jsx(_e,{asChild:!0,children:e.jsx(M,{variant:"ghost",size:"icon",className:"text-slate-400 hover:text-purple-600","aria-label":"Post actions",children:e.jsx(Se,{className:"h-4 w-4"})})}),e.jsxs(Ce,{align:"end",onCloseAutoFocus:_=>_.preventDefault(),children:[o&&e.jsxs(X,{onClick:_=>{_.preventDefault(),o()},children:[e.jsx(Te,{className:"h-4 w-4 mr-2"})," Edit"]}),x&&e.jsxs(X,{className:"text-destructive focus:text-destructive",onClick:_=>{_.preventDefault(),x()},children:[e.jsx(Re,{className:"h-4 w-4 mr-2"})," Delete"]})]})]}),e.jsx(De,{contentId:t.id,contentType:"confession"}),e.jsx(M,{variant:"ghost",size:"icon",onClick:()=>h(!0),className:"text-slate-400 hover:text-red-500",children:e.jsx(st,{className:"h-4 w-4"})}),e.jsx(M,{variant:"ghost",size:"icon",onClick:f,className:"text-slate-400 hover:text-slate-600",children:e.jsx(rt,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"text-6xl text-pink-200 font-serif leading-none mb-2",children:'"'}),e.jsx("h2",{className:"text-2xl font-bold text-purple-900 mb-4",children:t.title}),e.jsxs("div",{className:"space-y-4 mb-6",children:[(t.post_type||"text")==="poll"&&e.jsx(Pt,{confessionId:t.id,pollEndsAt:t.poll_ends_at??null,question:t.poll_question?.trim()||t.title}),(t.post_type||"text")==="link"&&t.link_url&&e.jsxs("a",{href:t.link_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-medium text-pink-600 hover:underline break-all",children:[e.jsx(at,{className:"h-4 w-4 shrink-0"}),t.link_url]}),((t.post_type||"text")==="text"||(t.post_type||"text")==="link")&&e.jsx(be,{html:t.content,className:"text-slate-700 text-base leading-relaxed"}),(t.post_type||"text")==="poll"&&t.content?.trim()&&e.jsxs("div",{className:"pt-2 border-t border-pink-100",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Details"}),e.jsx(be,{html:t.content,className:"text-slate-700 text-base leading-relaxed"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-6 pb-6 border-b border-pink-100",children:[e.jsxs("button",{onClick:()=>p(t.id,"up"),className:I("flex items-center gap-2 px-4 py-2 rounded-full text-sm font-semibold transition-all","hover:scale-105 active:scale-95",c==="up"?"bg-gradient-to-r from-orange-400 to-red-400 text-white shadow-lg shadow-orange-500/30":"bg-orange-50 text-orange-600 hover:bg-orange-100"),children:[e.jsx("span",{className:"text-lg",children:"ð¥"}),e.jsxs("span",{children:[G," Hot"]})]}),e.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-full text-sm bg-pink-50 text-pink-600 hover:bg-pink-100 transition-all hover:scale-105",children:[e.jsx("span",{className:"text-lg",children:"â¤ï¸"}),e.jsx("span",{children:"Relatable"})]}),e.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-full text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 transition-all hover:scale-105",children:[e.jsx("span",{className:"text-lg",children:"ð®"}),e.jsx("span",{children:"Wow"})]})]}),e.jsx("div",{className:"mb-6",children:e.jsx(xt,{content:{id:t.
1id,title:t.title,description:Xe({title:t.title,content:t.content,post_type:t.post_type||"text",link_url:t.link_url??null,poll_question:t.poll_question??null}),type:"confession",isAnonymous:t.is_anonymous},showCalendar:!1,placement:"inline"})}),e.jsxs("div",{className:"pt-4 border-t border-pink-100",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-bold text-purple-900 flex items-center gap-2",children:[e.jsx("span",{className:"text-xl",children:"ð¬"}),v.length," ",v.length===1?"Comment":"Comments"]}),l&&e.jsx(M,{onClick:()=>{b(_=>!_),S(null)},className:I("rounded-full",u?"bg-slate-200 text-slate-600 hover:bg-slate-300":"bg-gradient-to-r from-pink-500 to-purple-500 text-white hover:from-pink-600 hover:to-purple-600"),size:"sm",children:u?"Cancel":e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"h-4 w-4 mr-1"}),"Add Your Gossip"]})})]}),u&&e.jsx("div",{className:"mb-6 p-4 bg-gradient-to-r from-pink-50 to-purple-50 rounded-xl border border-pink-200",children:e.jsx(We,{formInstanceId:`dialog-top-${t.id}`,onSubmit:W,onCancel:()=>b(!1)})}),L?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-pink-500"}),e.jsx("span",{className:"ml-2 text-purple-500",children:"Loading comments..."})]}):v.length>0?e.jsx(Qe,{replies:v,confessionId:t.id,createReply:P,activeReplyParentId:N,setActiveReplyParentId:S,onBeginInlineReply:()=>b(!1),confessionAuthorId:t.user_id??null,confessionIsAnonymous:!!t.is_anonymous,updateReply:q,deleteReply:d,onReplyAdded:async()=>{await F(),n?.()}}):e.jsxs("div",{className:"text-center py-10 bg-gradient-to-br from-pink-50 to-purple-50 rounded-xl",children:[e.jsx("div",{className:"text-4xl mb-3",children:"ð¤«"}),e.jsx("p",{className:"text-purple-600 font-medium",children:"No comments yet..."}),e.jsx("p",{className:"text-purple-400 text-sm",children:"Be the first to share your thoughts!"})]})]})]})})]})}),e.jsx(ht,{contentType:"confession",contentId:t.id,contentLabel:"Confession",isOpen:O,onOpenChange:h})]})},Et=[{id:"fresh",label:"Latest Gossip",emoji:"ð£",description:"Latest secrets"},{id:"trending",label:"Hot Gossip",emoji:"ð¥",description:"Buzzing right now"},{id:"top",label:"Spicy",emoji:"ð¶ï¸",description:"Most reactions"},{id:"hall-of-fame",label:"Legends",emoji:"ð",description:"Hall of Fame"},{id:"my-confessions",label:"My Secrets",emoji:"ð",description:"Your confessions"}],Bt=({activeTab:t,onTabChange:i,counts:f})=>e.jsx("div",{className:"bg-gradient-to-r from-purple-50 via-pink-50 to-purple-50 rounded-2xl p-2 mb-6 border border-pink-200/50 dark:border-border dark:from-card/90 dark:via-card/80 dark:to-card/90",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 touch-manipulation",children:Et.map(c=>{const p=t===c.id,n=f?.[c.id];return e.jsxs("button",{type:"button",onClick:()=>i(c.id),className:I("flex items-center gap-2 px-4 py-2.5 rounded-xl text-base font-medium transition-colors duration-200 sm:text-sm","focus:outline-none focus:ring-2 focus:ring-pink-500/50 active:opacity-90 md:transition-transform md:hover:scale-[1.02]",p?"bg-gradient-to-r from-pink-500 to-purple-500 text-white shadow-lg shadow-pink-500/25":"text-purple-700 hover:bg-white/80 dark:text-foreground/85 dark:hover:bg-muted"),title:c.description,children:[e.jsx("span",{className:"text-base",children:c.emoji}),e.jsx("span",{className:"hidden sm:inline",children:c.label}),n!==void 0&&n>0&&e.jsx("span",{className:I("text-xs px-2 py-0.5 rounded-full font-semibold",p?"bg-white/25 text-white":"bg-pink-100 text-pink-700 dark:bg-secondary dark:text-secondary-foreground"),children:n>99?"99+":n})]},c.id)})})}),Vt=({weeklyTop:t,monthlyTop:i,allTimeLegends:f,onVote:c,onConfessionClick:p,getUserVote:n,isConfessionOwner:k,onEditConfession:o,onDeleteConfession:x})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-3 bg-gradient-to-br from-yellow-400 to-amber-500 rounded-xl shadow-lg shadow-amber-500/30",children:e.jsx(nt,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold bg-gradient-to-r from-amber-600 to-yellow-500 bg-clip-text text-transparent",children:"Hall of Legends ð"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The spiciest gossip that had everyone talking"})]})]}),e.jsxs(bt,{defaultValue:"weekly",className:"w-full",children:[e.jsxs(kt,{className:"grid w-full grid-cols-3 mb-6 bg-gradient-to-r from-purple-100 via-pink-100 to-amber-100 dar
1k:bg-muted p-1 rounded-xl",children:[e.jsxs(oe,{value:"weekly",className:"flex items-center gap-2 data-[state=active]:bg-white data-[state=active]:shadow-md dark:data-[state=active]:bg-card dark:data-[state=active]:shadow-md rounded-lg",children:[e.jsx("span",{children:"ðï¸"}),e.jsx("span",{className:"hidden sm:inline",children:"This Week"}),e.jsx("span",{className:"sm:hidden",children:"Week"})]}),e.jsxs(oe,{value:"monthly",className:"flex items-center gap-2 data-[state=active]:bg-white data-[state=active]:shadow-md dark:data-[state=active]:bg-card dark:data-[state=active]:shadow-md rounded-lg",children:[e.jsx("span",{children:"ð
"}),e.jsx("span",{className:"hidden sm:inline",children:"This Month"}),e.jsx("span",{className:"sm:hidden",children:"Month"})]}),e.jsxs(oe,{value:"legends",className:"flex items-center gap-2 data-[state=active]:bg-white data-[state=active]:shadow-md dark:data-[state=active]:bg-card dark:data-[state=active]:shadow-md rounded-lg",children:[e.jsx("span",{children:"ð"}),e.jsx("span",{className:"hidden sm:inline",children:"All-Time Legends"}),e.jsx("span",{className:"sm:hidden",children:"Legends"})]})]}),e.jsx(ie,{value:"weekly",children:t.length===0?e.jsx(le,{message:"No hot gossip this week yet... Be the first to share! â"}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4",children:t.map((l,g)=>e.jsx(Z,{confession:l,rank:g+1,userVote:n(l.id),onVote:c,onClick:()=>p(l),isOwner:k?.(l),onEdit:o?()=>o(l):void 0,onDelete:x?()=>x(l):void 0},l.id))})}),e.jsx(ie,{value:"monthly",children:i.length===0?e.jsx(le,{message:"The monthly spotlight is empty... Fill it up! ð«"}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4",children:i.map((l,g)=>e.jsx(Z,{confession:l,rank:g+1,userVote:n(l.id),onVote:c,onClick:()=>p(l),isOwner:k?.(l),onEdit:o?()=>o(l):void 0,onDelete:x?()=>x(l):void 0},l.id))})}),e.jsx(ie,{value:"legends",children:f.length===0?e.jsx(le,{message:"No legends yet... Your story could be the first! ð"}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4",children:f.map((l,g)=>e.jsx(Z,{confession:l,rank:g+1,isHallOfFame:!0,userVote:n(l.id),onVote:c,onClick:()=>p(l),isOwner:k?.(l),onEdit:o?()=>o(l):void 0,onDelete:x?()=>x(l):void 0},l.id))})})]})]}),le=({message:t})=>e.jsxs(we,{className:"p-12 text-center bg-gradient-to-br from-purple-50 via-pink-50 to-amber-50 border-2 border-dashed border-pink-200 dark:from-card dark:via-muted/30 dark:to-card dark:border-border",children:[e.jsx("div",{className:"text-5xl mb-4",children:"ð"}),e.jsx("p",{className:"text-purple-600 dark:text-muted-foreground font-medium",children:t})]}),zt=({stats:t,onShareGossip:i})=>e.jsxs("div",{className:"relative overflow-hidden rounded-2xl mb-6",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-900 via-pink-900 to-purple-950"}),e.jsxs("div",{className:"absolute inset-0 opacity-20",children:[e.jsx("div",{className:"absolute top-4 left-8 text-2xl motion-safe:animate-pulse motion-reduce:animate-none",children:"â¨"}),e.jsx("div",{className:"absolute top-12 right-16 text-xl motion-safe:animate-pulse motion-reduce:animate-none delay-300",children:"ð«"}),e.jsx("div",{className:"absolute bottom-8 left-24 text-lg motion-safe:animate-pulse motion-reduce:animate-none delay-500",children:"â"}),e.jsx("div",{className:"absolute bottom-16 right-8 text-2xl motion-safe:animate-pulse motion-reduce:animate-none delay-700",children:"â¨"}),e.jsx("div",{className:"absolute top-1/2 left-1/3 text-sm motion-safe:animate-pulse motion-reduce:animate-none delay-200",children:"ð"})]}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-pink-500/10 via-trans
1parent to-purple-500/10"}),e.jsx("div",{className:"relative p-6 md:p-8",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-6",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"p-2.5 bg-pink-500/30 rounded-xl backdrop-blur-sm border border-pink-400/20",children:e.jsx(me,{className:"h-6 w-6 text-pink-300"})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white",children:"NRI Confession Room ð¤«"})]}),e.jsx("p",{className:"text-pink-200/80 text-sm md:text-base max-w-lg leading-relaxed",children:"Spill the gossip, share your secrets... anonymously. Your confessions are safe here. React to stories that hit home, join the buzz! ð¬"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 md:gap-6 mt-5",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-1.5 rounded-full backdrop-blur-sm",children:[e.jsx(ot,{className:"h-4 w-4 text-pink-300"}),e.jsx("span",{className:"text-white font-semibold",children:t.totalConfessions}),e.jsx("span",{className:"text-pink-200/70 text-sm",children:"secrets"})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-1.5 rounded-full backdrop-blur-sm",children:[e.jsx(it,{className:"h-4 w-4 text-orange-400"}),e.jsx("span",{className:"text-white font-semibold",children:t.totalReplies}),e.jsx("span",{className:"text-pink-200/70 text-sm",children:"reactions"})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-1.5 rounded-full backdrop-blur-sm",children:[e.jsx(lt,{className:"h-4 w-4 text-purple-300"}),e.jsx("span",{className:"text-pink-200/70 text-sm",children:"100% Anonymous"})]})]})]}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(M,{className:"bg-gradient-to-r from-pink-500 via-purple-500 to-pink-500 hover:from-pink-600 hover:via-purple-600 hover:to-pink-600 shadow-lg shadow-pink-500/30 text-white font-semibold px-6 py-3 rounded-xl transition-all duration-300 border border-pink-400/30 motion-safe:hover:scale-[1.02] motion-safe:active:scale-[0.98] hover:shadow-xl hover:shadow-pink-500/40",size:"lg",onClick:i,children:[e.jsx(me,{className:"h-5 w-5 mr-2"}),"Share your gossip"]})})]})})]}),Ht=({open:t,onOpenChange:i,title:f,confessionId:c,onDelete:p})=>{const{toast:n}=ye(),[k,o]=m.useState(!1),x=async()=>{if(c)try{o(!0),await p(c),i(!1),n({title:"Deleted",description:"Your gossip was removed."})}catch{n({title:"Error",description:"Could not delete this confession.",variant:"destructive"})}finally{o(!1)}};return e.jsx(vt,{open:t,onOpenChange:i,children:e.jsxs(jt,{children:[e.jsxs(yt,{children:[e.jsx(wt,{children:"Delete this gossip?"}),e.jsxs(Nt,{children:['This will permanently remove "',f||"this post",'" and its replies. This cannot be undone.']})]}),e.jsxs(_t,{children:[e.jsx(Ct,{disabled:k,children:"Cancel"}),e.jsx(Dt,{onClick:l=>{l.preventDefault(),x()},disabled:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k?"Deletingâ¦":"Delete"})]})]})})},Ae="jstconnect-confessions-feed-sort",Yt="Top, Best, and Rising reorder posts within the batch loaded from the server (recent posts). They are not a global all-time ranking. Spicy and Hall of Fame use the same loaded set for their highlights.";function $t(){try{const t=sessionStorage.getItem(Ae);if(t==="new"||t==="top"||t==="rising"||t==="best")return t}catch{}return"new"}function Gt(t){try{sessionStorage.setItem(Ae,t)}catch{}}function Kt(t){return{id:t.id,title:t.title,content:t.content,post_type:t.post_type||"text",link_url:t.link_url,poll_question:t.poll_question,poll_ends_at:t.poll_ends_at,is_anonymous:!!t.is_anonymous}}function de(t,i){return t?i.viewer_is_author===!0?!0:!!(i.user_id&&i.user_id===t):!1}const z=t=>{const i=t.like_count||0,f=t.reply_count||0,c=i+f*2,p=Math.max(1,(Date.now()-new Date(t.created_at).getTime())/(1e3*60*60));return c/Math.pow(p,1.15)},H=t=>{const i=t.like_count||0,f=t.reply_count||0,c=i+f*.75;if(c<=0)return 0;const p=1.96,n=c,k=Math.min(1,Math.max(0,i/n)),o=1+p*p/n,x=k+p*p/(2*n),l=p*Math.sqrt((k*(1-k)+p*p/(4*n))/n),g=(x-l)/o,D=Math.max(1,(Date.now()-new Date(t.created_at).getTime())/(1e3*60*60)),u=1/Math.pow(D/24+1,.1);return g*u},ce=12,Wt=()=>{const{user:t,loading:i}=pe(),{showLoginPrompt:f}=ue(),c=Oe(),p=Ue(),[n,k]=m.useState("fresh"),[o,x]=m.useState(()=>$t()),l=m.useCallback(s=>{x(s),Gt(s)},[]),[g,D]=m.useState(""),[u,b]=m.useState(null),[O,h]=m.useState({}),[N,S]=m.useState(ce),[P,q]=m.useState(!1),[d,v]=m.useState(null),[L,F]=m.useState(null),G=m.useMemo(()=>n==="hall-of-fame"||n==="top"?300:n==="trending"?o==="new"?80:300:n==="fresh"?o==="new"?40:300:20,[n,o]),{data:w=[],isLoading:K,error:B,refetch:W}=Je(void 0,{fetchLimit:G});St({items:w,getItemId:s=>s.id,hasResolvedItems:!K,fetchById:async s=>{const{data:r,error:a}=await E.from("confessions_public").select("*").eq("id",s).maybeSingle();return a||!r?null:{...r,reply_count:0,like_count:0,activity_score:0}},onOpen:s=>b(s),onNotFound:()=>{J({title:"Confession unavailable",description:"This post may have been removed or is no longer public.",variant:"destructive"})}});const{data:_=[],isLoading:ee}=Pe({queryKey:["my-confessions",t?.id],queryFn:async()=>
1{if(!t?.id)return[];const{data:s,error:r}=await E.from("confessions").select("id, title, content, post_type, link_url, poll_ends_at, poll_question, category, location, state, city, is_anonymous, user_id, created_at").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(200);if(r)throw r;const a=(s||[]).map(C=>C.id);if(!a.length)return[];const{data:y}=await E.from("confession_replies").select("confession_id").in("confession_id",a),{data:R}=await E.from("confession_interactions").select("confession_id").eq("interaction_type","like").in("confession_id",a),j=(y||[]).reduce((C,Y)=>(C[Y.confession_id]=(C[Y.confession_id]||0)+1,C),{}),A=(R||[]).reduce((C,Y)=>(C[Y.confession_id]=(C[Y.confession_id]||0)+1,C),{});return(s||[]).map(C=>({...C,reply_count:j[C.id]||0,like_count:A[C.id]||0,activity_score:(j[C.id]||0)*2+(A[C.id]||0)}))},enabled:!!t?.id,staleTime:6e4,refetchOnWindowFocus:!1}),V=m.useMemo(()=>({totalConfessions:w.length,totalReplies:w.reduce((s,r)=>s+(r.reply_count||0),0),activeUsers:new Set(w.map(s=>s.user_id).filter(Boolean)).size}),[w]),T=m.useMemo(()=>{let s=n==="my-confessions"?[..._]:[...w];if(g){const r=g.toLowerCase();s=s.filter(a=>a.title?.toLowerCase().includes(r)||a.content?.toLowerCase().includes(r)||a.category?.toLowerCase().includes(r)||a.link_url&&a.link_url.toLowerCase().includes(r)||a.poll_question&&a.poll_question.toLowerCase().includes(r))}switch(n){case"fresh":o==="new"?s.sort((r,a)=>new Date(a.created_at).getTime()-new Date(r.created_at).getTime()):o==="top"?s.sort((r,a)=>(a.like_count||0)+(a.reply_count||0)-((r.like_count||0)+(r.reply_count||0))):o==="best"?s.sort((r,a)=>H(a)-H(r)):s.sort((r,a)=>z(a)-z(r));break;case"trending":{const r=ne(new Date,7);s=s.filter(a=>U(new Date(a.created_at),r)),o==="new"?s.sort((a,y)=>new Date(y.created_at).getTime()-new Date(a.created_at).getTime()):o==="top"?s.sort((a,y)=>(y.like_count||0)+(y.reply_count||0)*2-((a.like_count||0)+(a.reply_count||0)*2)):o==="best"?s.sort((a,y)=>H(y)-H(a)):s.sort((a,y)=>z(y)-z(a));break}case"top":s.sort((r,a)=>(a.like_count||0)+(a.reply_count||0)-((r.like_count||0)+(r.reply_count||0)));break;case"my-confessions":o==="new"?s.sort((r,a)=>new Date(a.created_at).getTime()-new Date(r.created_at).getTime()):o==="top"?s.sort((r,a)=>(a.like_count||0)+(a.reply_count||0)-((r.like_count||0)+(r.reply_count||0))):o==="best"?s.sort((r,a)=>H(a)-H(r)):s.sort((r,a)=>z(a)-z(r));break}return s},[n,w,_,g,o]);m.useEffect(()=>{if(!u)return;const s=T.find(r=>r.id===u.id);s&&b(r=>!r||r.id!==s.id||r.like_count===s.like_count&&r.reply_count===s.reply_count?r:s)},[T,u?.id]);const Q=m.useMemo(()=>{const s=ne(new Date,7),r=ut(new Date),a=[...w].filter(j=>U(new Date(j.created_at),s)).sort((j,A)=>(A.like_count||0)+(A.reply_count||0)-((j.like_count||0)+(j.reply_count||0))).slice(0,6),y=[...w].filter(j=>U(new Date(j.created_at),r)).sort((j,A)=>(A.like_count||0)+(A.reply_count||0)-((j.like_count||0)+(j.reply_count||0))).slice(0,6),R=[...w].sort((j,A)=>(A.like_count||0)+(A.reply_count||0)-((j.like_count||0)+(j.reply_count||0))).slice(0,9);return{weeklyTop:a,monthlyTop:y,allTimeLegends:R}},[w]);m.useEffect(()=>{S(ce)},[n,o,g,t?.id]);const Fe=m.useMemo(()=>T.slice(0,N),[T,N]),te=async(s,r)=>{if(!t){f();return}const a=O[s];let y=null;a===r?y=null:y=r,h(y?R=>({...R,[s]:y}):R=>{const j={...R};return delete j[s],j});try{if(r==="up"){const{data:R}=await E.from("confession_interactions").select("id").eq("confession_id",s).eq("user_id",t.id).eq("interaction_type","like").maybeSingle();R?await E.from("confession_interactions").delete().eq("id",R.id):await E.from("confession_interactions").insert({confession_id:s,user_id:t.id,interaction_type:"like"}),W()}}catch(R){console.error("Vote error:",R)}},se=s=>O[s]||null,Ie=()=>{c.invalidateQueries({queryKey:["confessions"]}),c.invalidateQueries({queryKey:["my-confessions"]})},re=s=>{b(null),v(Kt(s)),q(!0)},ae=s=>{F(s)},Me=async s=>{await p.mutateAsync(s),b(r=>r?.id===s?null:r)};return i||K||n==="my-confessions"&&ee?e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"animate-pulse bg-gradient-to-r from-purple-200 to-pink-200 dark:from-muted dark:to-muted rounded-2xl h-44"}),e.jsx("div",{className:"animate-pulse bg-pink-100 dark:bg-muted rounded-xl h-14"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4",children:[...Array(6)].map((s,r)=>e.jsx("div",{className:"animate-pulse bg-gradient-to-br from-pink-100 to-purple-100 dar
1k:from-card dark:to-muted rounded-xl h-52"},r))})]}):B?e.jsxs(ze,{variant:"destructive",className:"bg-red-50 border-red-200 dark:bg-destructive/15 dark:border-destructive/40",children:[e.jsx(dt,{className:"h-4 w-4"}),e.jsx(He,{children:B instanceof Error?B.message:"Failed to load confessions"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(zt,{stats:V,onShareGossip:()=>{v(null),q(!0)}}),e.jsx(Bt,{activeTab:n,onTabChange:k,counts:{fresh:w.length,trending:w.filter(s=>U(new Date(s.created_at),ne(new Date,7))).length,top:w.length,hallOfFame:Q.allTimeLegends.length,myConfessions:_.length}}),n!=="hall-of-fame"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ct,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-4 w-4 text-pink-400 dark:text-muted-foreground"}),e.jsx(Ye,{placeholder:"Search the room... ð",value:g,onChange:s=>D(s.target.value),className:"pl-11 bg-white/80 border-pink-200 focus:border-pink-400 focus:ring-pink-400 rounded-xl dark:bg-card/90 dark:border-border dark:focus:border-ring dark:focus:ring-ring"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground dark:text-foreground/75",children:"Sort:"}),[{id:"new",label:"New"},{id:"best",label:"Best"},{id:"top",label:"Top"},{id:"rising",label:"Rising"}].map(s=>e.jsx(M,{type:"button",variant:o===s.id?"default":"outline",size:"sm",onClick:()=>l(s.id),className:o===s.id?"bg-purple-600 hover:bg-purple-700 text-white dark:bg-purple-500 dark:hover:bg-purple-600 dark:ring-2 dark:ring-purple-400/30":"dark:border-border",children:s.label},s.id))]}),e.jsxs("details",{className:"w-full text-sm text-muted-foreground dark:text-foreground/80",children:[e.jsx("summary",{className:"cursor-pointer select-none text-xs font-medium text-foreground/90 hover:underline",children:"How sorting works"}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed",children:Yt})]})]}),n==="hall-of-fame"?e.jsx(Vt,{weeklyTop:Q.weeklyTop,monthlyTop:Q.monthlyTop,allTimeLegends:Q.allTimeLegends,onVote:te,onConfessionClick:b,getUserVote:se,isConfessionOwner:s=>de(t?.id,s),onEditConfession:s=>re(s),onDeleteConfession:s=>ae(s)}):e.jsx(e.Fragment,{children:T.length===0?e.jsxs("div",{className:"text-center py-16 bg-gradient-to-br from-purple-50 via-pink-50 to-amber-50 rounded-2xl border-2 border-dashed border-pink-200 dark:from-card dark:via-muted/40 dark:to-card dark:border-border",children:[e.jsx("div",{className:"text-5xl mb-4",children:n==="my-confessions"?"ð":"â"}),e.jsx("h3",{className:"text-lg font-bold text-purple-900 dark:text-foreground mb-2",children:n==="my-confessions"?"You haven't shared any gossip yet":"No gossip here yet..."}),e.jsx("p",{className:"text-purple-600 dark:text-muted-foreground",children:n==="my-confessions"?"Your secrets are waiting to be shared! ð¤«":g?"Try a different search term":"Be the first to start the gossip! â"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-5",children:Fe.map((s,r)=>e.jsxs(je.Fragment,{children:[e.jsx(Z,{confession:s,rank:n==="top"?r+1:void 0,userVote:se(s.id),onVote:te,onClick:()=>b(s),isOwner:de(t?.id,s),onEdit:()=>re(s),onDelete:()=>ae(s)}),(r+1)%6===0&&r>=3&&e.jsx(Tt,{slot:Rt.confessions_feed.slotId,className:"col-span-1"})]},s.id))}),T.length>N&&e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(M,{variant:"outline",onClick:()=>S(s=>s+ce),children:"Load More"})})]})}),e.jsx(qt,{confession:u,isOpen:!!u,onClose:()=>b(null),userVote:u?se(u.id):null,onVote:te,onReplyCountChange:()=>W(),isOwner:u?de(t?.id,u):!1,onEdit:u?()=>re(u):void 0,onDelete:u?()=>ae(u):void 0}),e.jsx(Ze,{open:P,onOpenChange:s=>{q(s),s||v(null)},editTarget:d,onConfessionCreated:()=>{Ie()}}),e.jsx(Ht,{open:!!L,onOpenChange:s=>{s||F(null)},title:L?.title??null,confessionId:L?.id??null,onDelete:Me})]})},Ys=()=>(Lt({queryKeys:[["confessions"]]}),e.jsxs(e.Fragment,{children:[e.jsx(At,{title:"Desi Confessions - Anonymous Community Stories",description:"Share and read anonymous confessions from the Desi community. A safe space for South Asians to express themselves freely.",url:"/confessions",keywords:Ft["/confessions"]}),e.jsx(It,{data:Mt()}),e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-background to-orange-50/30 text-foreground dark:from-background dark:via-purple-950/20 dark:to-background",children:[e.jsx(qe,{badgeText:"Confessions",badgeIcon:mt,backTo:"/communities",backText:"Back to Communities",showLocation:!0}
1),e.jsx("div",{className:"responsive-container py-6 md:py-8",children:e.jsx(Wt,{})})]})]}));export{Ys 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.