PageSourceSearch

https://curveblock.uk/assets/community-SOopi6yD.js

js curveblock.uk collected 2026-10-09 18:23:51 UTC 52,419 bytes, 1 lines download raw bytes

vendor: 18,654 bytes, line 1
1import{r as i,j as e,b as Vt,u as V,c as R,L as Ue}from"./vendor-BrAeVBUM.js";import{y as ze,z as Yt,w as Be,K as Ge,R as Xt,E as Wt,S as be,H as Ht,A as ue,G as N,P as se,X as Jt,M as Zt,N as en,O as tn,Q as nn,Y as Qe,x as sn,r as X,e as me,f as P,q as w,B as b,g as an,C as ie,I as Ve}from"./index-ofQpgDbb.js";import{u as on}from"./use-page-meta-Ctvx6-D_.js";import{T as Ye}from"./textarea-ChHPOlFP.js";import{B as qe}from"./badge-3a-AXBRa.js";import{c as rn,d as cn,e as dn}from"./index-D8MmAZ4F.js";import{u as ln}from"./index-nUyUk-UQ.js";import{h as un,u as mn,R as pn,F as fn}from"./Combination-C_DehH5h.js";import{c as Xe,I as hn,R as xn}from"./index-CKEpaH6-.js";import{u as Fe}from"./index-BPKH830j.js";import{b8 as gn,aT as ce,b9 as vn,a as Me,X as Y,M as we,$ as yn,ay as ke,m as ge,ba as Oe,bb as bn,bc as wn,bd as We,a7 as jn,g as Nn,U as Cn,be as He,a6 as Mn,ax as kn,af as Sn,ag as Rn,H as Pn,bf as _n,aQ as En,bg as Le,a$ as In,bh as Dn}from"./icons-DDC7D6iB.js";import{I as Se}from"./investor-badge-BKEKV3w5.js";import{D as Tn,a as $n,b as An,c as qn}from"./dialog-Bkrk02OC.js";import{u as ae}from"./i18n-0F8WnNsh.js";var Re=["Enter"," "],Fn=["ArrowDown","PageUp","Home"],Je=["ArrowUp","PageDown","End"],On=[...Fn,...Je],Ln={ltr:[...Re,"ArrowRight"],rtl:[...Re,"ArrowLeft"]},Kn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},pe="Menu",[de,Un,zn]=Yt(pe),[J,Ze]=ze(pe,[zn,Be,Xe]),je=Be(),et=Xe(),[Bn,Z]=J(pe),[Gn,fe]=J(pe),tt=t=>{const{__scopeMenu:s,open:n=!1,children:a,dir:r,onOpenChange:o,modal:c=!0}=t,m=je(s),[h,v]=i.useState(null),p=i.useRef(!1),d=Ge(o),l=ln(r);return i.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),e.jsx(Xt,{...m,children:e.jsx(Bn,{scope:s,open:n,onOpenChange:d,content:h,onContentChange:v,children:e.jsx(Gn,{scope:s,onClose:i.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:p,dir:l,modal:c,children:a})})})};tt.displayName=pe;var Qn="MenuAnchor",Pe=i.forwardRef((t,s)=>{const{__scopeMenu:n,...a}=t,r=je(n);return e.jsx(Wt,{...r,...a,ref:s})});Pe.displayName=Qn;var _e="MenuPortal",[Vn,nt]=J(_e,{forceMount:void 0}),st=t=>{const{__scopeMenu:s,forceMount:n,children:a,container:r}=t,o=Z(_e,s);return e.jsx(Vn,{scope:s,forceMount:n,children:e.jsx(be,{present:n||o.open,children:e.jsx(Ht,{asChild:!0,container:r,children:a})})})};st.displayName=_e;var $="MenuContent",[Yn,Ee]=J($),at=i.forwardRef((t,s)=>{const n=nt($,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,o=Z($,t.__scopeMenu),c=fe($,t.__scopeMenu);return e.jsx(de.Provider,{scope:t.__scopeMenu,children:e.jsx(be,{present:a||o.open,children:e.jsx(de.Slot,{scope:t.__scopeMenu,children:c.modal?e.jsx(Xn,{...r,ref:s}):e.jsx(Wn,{...r,ref:s})})})})}),Xn=i.forwardRef((t,s)=>{const n=Z($,t.__scopeMenu),a=i.useRef(null),r=ue(s,a);return i.useEffect(()=>{const o=a.current;if(o)return un(o)},[]),e.jsx(Ie,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:N(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Wn=i.forwardRef((t,s)=>{const n=Z($,t.__scopeMenu);return e.jsx(Ie,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hn=Zt("MenuContent.ScrollLock"),Ie=i.forwardRef((t,s)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:v,onPointerDownOutside:p,onFocusOutside:d,onInteractOutside:l,onDismiss:g,disableOutsideScroll:y,...k}=t,C=Z($,n),D=fe($,n),u=je(n),I=et(n),U=Un(n),[z,ee]=i.useState(null),F=i.useRef(null),B=ue(s,F,C.onContentChange),O=i.useRef(0),L=i.useRef(""),x=i.useRef(0),S=i.useRef(null),A=i.useRef("right"),T=i.useRef(0),W=y?pn:i.Fragment,he=y?{as:Hn,allowPinchZoom:!0}:void 0,Ce=f=>{const Q=L.current+f,M=U().filter(_=>!_.disabled),K=document.activeElement,H=M.find(_=>_.ref.current===K)?.textValue,te=M.map(_=>_.textValue),j=ds(te,Q,H),q=M.find(_=>_.textValue===j)?.ref.current;(function _(xe){L.current=xe,window.clearTimeout(O.current),xe!==""&&(O.current=window.setTimeout(()=>_(""),1e3))})(Q),q&&setTimeout(()=>q.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),mn();const G=i.useCallback(f=>A.current===S.current?.side&&us(f,S.current?.area),[]);return e.jsx(Yn,{scope:n,searchRef:L,onItemEnter:i.useCallback(f=>{G(f)&&f.preventDefault()},[G]),onItemLeave:i.useCallback(f=>{G(f)||(F.current?.focus(),ee(null))},[G]),onTriggerLeave:i.useCallback(f=>{G(f)&&f.preventDefault()},[G]),pointerGraceTimerRef:x,onPointerGraceIntentChange:i.useCallback(f=>{S.current=f},[]),children:e.jsx(W,{...he,children:e.jsx(fn,{asChild:!0,trapped:r,onMountAutoFocus:N(o,f=>{f.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:e.jsx(en,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:v,onPointerDownOutside:p,onFocusOutside:d,onInteractOutside:l,onDismiss:g,children:e.jsx(xn,{asChild:!0,...I,dir:D.dir,orientation:"vertical",loop:a,currentTabStopId:z,onCurrentTabStopIdChange:ee,onEntryFocus:N(h,f=>{D.isUsingKeyboardRef.current||f.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(tn,{role:"menu","aria-orientation":"vertical","data-state":bt(C.open),"data-radix-menu-content":"",dir:D.dir,...u,...k,ref:B,style:{outline:"none",...k.style},onKeyDown:N(k.onKeyDown,f=>{const M=f.target.closest("[data-radix-menu-content]")===f.currentTarget,K=f.ctrlKey||f.altKey||f.metaKey,H=f.key.length===1;M&&(f.key==="Tab"&&f.preventDefault(),!K&&H&&Ce(f.key));const te=F.current;if(f.target!==te||!On.includes(f.key))return;f.preventDefault();const q=U().filter(_=>!_.disabled).map(_=>_.ref.current);Je.includes(f.key)&&q.reverse(),is(q)}),onBlur:N(t.onBlur,f=>{f.currentTarget.contains(f.target)||(window.clearTimeout(O.current),L.current="")}),onPointerMove:N(t.onPointerMove,le(f=>{const Q=f.target,M=T.current!==f.clientX;if(f.currentTarget.contains(Q)&&M){const K=f.clientX>T.current?"right":"left";A.current=K,T.current=f.clientX}}))})})})})})})});at.displayName=$;var Jn="MenuGroup",De=i.forwardRef((t,s)=>{const{__scopeMenu:n,...a}=t;return e.jsx(se.div,{role:"group",...a,ref:s})});De.displayName=Jn;var Zn="MenuLabel",ot=i.forwardRef((t,s)=>{const{__scopeMenu:n,...a}=t;return e.jsx(se.div,{...a,ref:s})});ot.displayName=Zn;var ve="MenuItem",Ke="menu.itemSelect",Ne=i.forwardRef((t,s)=>{const{disabled:n=!1,onSelect:a,...r}=t,o=i.useRef(null),c=fe(ve,t.__scopeMenu),m=Ee(ve,t.__scopeMenu),h=ue(s,o),v=i.useRef(!1),p=()=>{const d=o.current;if(!n&&d){const l=new CustomEvent(Ke,{bubbles:!0,cancelable:!0});d.addEventListener(Ke,g=>a?.(g),{once:!0}),Jt(d,l),l.defaultPrevented?v.current=!1:c.onClose()}};return e.jsx(rt,{...r,ref:h,disabled:n,onClick:N(t.onClick,p),onPointerDown:d=>{t.onPointerDown?.(d),v.current=!0},onPointerUp:N(t.onPointerUp,d=>{v.current||d.currentTarget?.click()}),onKeyDown:N(t.onKeyDown,d=>{const l=m.searchRef.current!=="";n||l&&d.key===" "||Re.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ne.displayName=ve;var rt=i.forwardRef((t,s)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...o}=t,c=Ee(ve,n),m=et(n),h=i.useRef(null),v=ue(s,h),[p,d]=i.useState(!1),[l,g]=i.useState("");return i.useEffect(()=>{const y=h.current;y&&g((y.textContent??"").trim())},[o.children]),e.jsx(de.ItemSlot,{scope:n,disabled:a,textValue:r??l,children:e.jsx(hn,{asChild:!0,...m,focusable:!a,children:e.jsx(se.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:v,onPointerMove:N(t.onPointerMove,le(y=>{a?c.onItemLeave(y):(c.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:N(t.onPointerLeave,le(y=>c.onItemLeave(y))),onFocus:N(t.onFocus,()=>d(!0)),onBlur:N(t.onBlur,()=>d(!1))})})})}),es="MenuCheckboxItem",it=i.forwardRef((t,s)=>{const{checked:n=!1,onCheckedChange:a,...r}=t;return e.jsx(mt,{scope:t.__scopeMenu,checked:n,children:e.jsx(Ne,{role:"menuitemcheckbox","aria-checked":ye(n)?"mixed":n,...r,ref:s,"data-state":$e(n),onSelect:N(r.onSelect,()=>a?.(ye(n)?!0:!n),{checkForDefaultPrevented:!1})})})});it.displayName=es;var ct="MenuRadioGroup",[ts,ns]=J(ct,{value:void 0,onValueChange:()=>{}}),dt=i.forwardRef((t,s)=>{const{value:n,onValueChange:a,...r}=t,o=Ge(a);return e.jsx(ts,{scope:t.__scopeMenu,value:n,onValueChange:o,children:e.jsx(De,{...r,ref:s})})});dt.displayName=ct;var lt="MenuRadioItem",ut=i.forwardRef((t,s)=>{const{value:n,...a}=t,r=ns(lt,t.__scopeMenu),o=n===r.value;return e.jsx(mt,{scope:t.__scopeMenu,checked:o,children:e.jsx(Ne,{role:"menuitemradio","aria-checked":o,...a,ref:s,"data-state":$e(o),onSelect:N(a.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ut.displayName=lt;var Te="MenuItemIndicator",[mt,ss]=J(Te,{checked:!1}),pt=i.forwardRef((t,s)=>{const{__scopeMenu:n,forceMount:a,...r}=t,o=ss(Te,n);return e.jsx(be,{present:a||ye(o.checked)||o.checked===!0,children:e.jsx(se.span,{...r,ref:s,"data-state":$e(o.checked)})})});pt.displayName=Te;var as="MenuSeparator",ft=i.forwardRef((t,s)=>{const{__scopeMenu:n,...a}=t;return e.jsx(se.div,{role:"separator","aria-orientation":"horizontal",...a,ref:s})});ft.displayName=as;var os="MenuArrow",ht=i.forwardRef((t,s)=>{const{__scopeMenu:n,...a}=t,r=je(n);return e.jsx(nn,{...r,...a,ref:s})});ht.displayName=os;var rs="MenuSub",[wa,xt]=J(rs),oe="MenuSubTrigger",gt=i.forwardRef((t,s)=>{const n=Z(oe,t.__scopeMenu),a=fe(oe,t.__scopeMenu),r=xt(oe,t.__scopeMenu),o=Ee(oe,t.__scopeMenu),c=i.useRef(null),{pointerGraceTimerRef:m,onPointerGraceIntentChange:h}=o,v={__scopeMenu:t.__scopeMenu},p=i.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return i.useEffect(()=>p,[p]),i.useEffect(()=>{const d=m.current;return()=>{window.clearTimeout(d),h(null)}},[m,h]),e.jsx(Pe,{asChild:!0,...v,children:e.jsx(rt,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":bt(n.open),...t,ref:Qe(s,r.onTriggerChange),onClick:d=>{t.onClick?.(d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:N(t.onPointerMove,le(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:N(t.onPointerLeave,le(d=>{p();const l=n.content?.getBoundingClientRect();if(l){const g=n.content?.dataset.side,y=g==="right",k=y?-5:5,C=l[y?"left":"right"],D=l[y?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+k,y:d.clientY},{x:C,y:l.top},{x:D,y:l.top},{x:D,y:l.bottom},{x:C,y:l.bottom}],side:g}),window.clearTimeout(m.current),m.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:N(t.onKeyDown,d=>{const l=o.searchRef.current!=="";t.disabled||l&&d.key===" "||Ln[a.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});gt.displayName=oe;var vt="MenuSubContent",yt=i.forwardRef((t,s)=>{const n=nt($,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,o=Z($,t.__scopeMenu),c=fe($,t.__scopeMenu),m=xt(vt,t.__scopeMenu),h=i.useRef(null),v=ue(s,h);return e.jsx(de.Provider,{scope:t.__scopeMenu,children:e.jsx(be,{present:a||o.open,children:e.jsx(de.Slot,{scope:t.__scopeMenu,children:e.jsx(Ie,{id:m.contentId,"aria-labelledby":m.triggerId,...r,ref:v,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{c.isUsingKeyboardRef.current&&h.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:N(t.onFocusOutside,p=>{p.target!==m.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:N(t.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:N(t.onKeyDown,p=>{const d=p.currentTarget.contains(p.target),l=Kn[c.dir].includes(p.key);d&&l&&(o.onOpenChange(!1),m.trigger?.focus(),p.preventDefault())})})})})})});yt.displayName=vt;function bt(t){return t?"open":"closed"}function ye(t){return t==="indeterminate"}function $e(t){return ye(t)?"indeterminate":t?"checked":"unchecked"}function is(t){const s=document.activeElement;for(const n of t)if(n===s||(n.focus(),document.activeElement!==s))return}function cs(t,s){return t.map((n,a)=>t[(s+a)%t.length])}function ds(t,s,n){const r=s.length>1&&Array.from(s).every(v=>v===s[0])?s[0]:s,o=n?t.indexOf(n):-1;let c=cs(t,Math.max(o,0));r.length===1&&(c=c.filter(v=>v!==n));const h=c.find(v=>v.toLowerCase().startsWith(r.toLowerCase()));return h!==n?h:void 0}function ls(t,s){const{x:n,y:a}=t;let r=!1;for(let o=0,c=s.length-1;o<s.length;c=o++){const m=s[o].x,h=s[o].y,v=s[c].x,p=s[c].y;h>a!=p>a&&n<(v-m)*(a-h)/(p-h)+m&&(r=!r)}return r}function us(t,s){if(!s)return!1;const n={x:t.clientX,y:t.clientY};return ls(n,s)}function le(t){return s=>s.pointerType==="mouse"?t(s):void 0}var ms=tt,ps=Pe,fs=st,hs=at,xs=De,gs=ot,vs=Ne,ys=it,bs=dt,ws=ut,js=pt,Ns=ft,Cs=ht,Ms=gt,ks=yt,Ae="DropdownMenu",[Ss]=ze(Ae,[Ze]),E=Ze(),[Rs,wt]=Ss(Ae),jt=t=>{const{__scopeDropdownMenu:s,children:n,dir:a,open:r,defaultOpen:o,onOpenChange:c,modal:m=!0}=t,h=E(s),v=i.useRef(null),[p=!1,d]=sn({prop:r,defaultProp:o,onChange:c});return e.jsx(Rs,{scope:s,triggerId:Fe(),triggerRef:v,contentId:Fe(),open:p,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(l=>!l),[d]),modal:m,children:e.jsx(ms,{...h,open:p,onOpenChange:d,dir:a,modal:m,children:n})})};jt.displayName=Ae;var Nt="DropdownMenuTrigger",Ct=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=t,o=wt(Nt,n),c=E(n);return e.jsx(ps,{asChild:!0,...c,children:e.jsx(se.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:Qe(s,o.triggerRef),onPointerDown:N(t.onPointerDown,m=>{!a&&m.button===0&&m.ctrlKey===!1&&(o.onOpenToggle(),o.open||m.preventDefault())}),onKeyDown:N(t.onKeyDown,m=>{a||(["Enter"," "].includes(m.key)&&o.onOpenToggle(),m.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});Ct.displayName=Nt;var Ps="DropdownMenuPortal",Mt=t=>{const{__scopeDropdownMenu:s,...n}=t,a=E(s);return e.jsx(fs,{...a,...n})};Mt.displayName=Ps;var kt="DropdownMenuContent",St=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=wt(kt,n),o=E(n),c=i.useRef(!1);return e.jsx(hs,{id:r.contentId,"aria-labelledby":r.triggerId,...o,...a,ref:s,onCloseAutoFocus:N(t.onCloseAutoFocus,m=>{c.current||r.triggerRef.current?.focus(),c.current=!1,m.preventDefault()}),onInteractOutside:N(t.onInteractOutside,m=>{const h=m.detail.originalEvent,v=h.button===0&&h.ctrlKey===!0,p=h.button===2||v;(!r.modal||p)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});St.displayName=kt;var _s="DropdownMenuGroup",Es=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(xs,{...r,...a,ref:s})});Es.displayName=_s;var Is="DropdownMenuLabel",Rt=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(gs,{...r,...a,ref:s})});Rt.displayName=Is;var Ds="DropdownMenuItem",Pt=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(vs,{...r,...a,ref:s})});Pt.displayName=Ds;var Ts="DropdownMenuCheckboxItem",_t=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(ys,{...r,...a,ref:s})});_t.displayName=Ts;var $s="DropdownMenuRadioGroup",As=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(bs,{...r,...a,ref:s})});As.displayName=$s;var qs="DropdownMenuRadioItem",Et=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(ws,{...r,...a,ref:s})});Et.displayName=qs;var Fs="DropdownMenuItemIndicator",It=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(js,{...r,...a,ref:s})});It.displayName=Fs;var Os="DropdownMenuSeparator",Dt=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(Ns,{...r,...a,ref:s})});Dt.displayName=Os;var Ls="DropdownMenuArrow",Ks=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(Cs,{...r,...a,ref:s})});Ks.displayName=Ls;var Us="DropdownMenuSubTrigger",Tt=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(Ms,{...r,...a,ref:s})});Tt.displayName=Us;var zs="DropdownMenuSubContent",$t=i.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...a}=t,r=E(n);return e.jsx(ks,{...r,...a,ref:s,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$t.displayName=zs;var Bs=jt,Gs=Ct,Qs=Mt,At=St,qt=Rt,Ft=Pt,Ot=_t,Lt=Et,Kt=It,Ut=Dt,zt=Tt,Bt=$t;const Vs=Bs,Ys=Gs,Xs=i.forwardRef(({className:t,inset:s,children:n,...a},r)=>e.jsxs(zt,{ref:r,className:X("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",t),...a,children:[n,e.jsx(gn,{className:"ml-auto"})]}));Xs.displayName=zt.displayName;const Ws=i.forwardRef(({className:t,...s},n)=>e.jsx(Bt,{ref:n,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...s}));Ws.displayName=Bt.displayName;const Gt=i.forwardRef(({className:t,sideOffset:s=4,...n},a)=>e.jsx(Qs,{children:e.jsx(At,{ref:a,sideOffset:s,className:X("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...n})}));Gt.displayName=At.displayName;const re=i.forwardRef(({className:t,inset:s,...n},a)=>e.jsx(Ft,{ref:a,className:X("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",t),...n}));re.displayName=Ft.displayName;const Hs=i.forwardRef(({className:t,children:s,checked:n,...a},r)=>e.jsxs(Ot,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Kt,{children:e.jsx(ce,{className:"h-4 w-4"})})}),s]}));Hs.displayName=Ot.displayName;const Js=i.forwardRef(({className:t,children:s,...n},a)=>e.jsxs(Lt,{ref:a,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Kt,{children:e.jsx(vn,{className:"h-2 w-2 fill-current"})})}),s]}));Js.displayName=Lt.displayName;const Zs=i.forwardRef(({className:t,inset:s,...n},a)=>e.jsx(qt,{ref:a,className:X("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",t),...n}));Zs.displayName=qt.displayName;const ea=i.forwardRef(({className:t,...s},n)=>e.jsx(Ut,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",t),...s}));ea.displayName=Ut.displayName;function ta({userId:t,onClose:s}){const{toast:n}=me(),{t:a}=ae(),[,r]=Vt(),{data:o,isLoading:c}=V({queryKey:["/api/user",t,"profile-card"],queryFn:()=>fetch(`/api/user/${t}/profile-card`).then(C=>C.json()),enabled:!!t}),m=R({mutationFn:()=>P("POST",`/api/friends/request/${t}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/friends/requests/sent"]}),n({title:a("community.requestSent","Friend request sent")})},onError:C=>{n({title:C.message||"Failed to send request",variant:"destructive"})}}),h=R({mutationFn:()=>P("POST",`/api/friends/accept/${o?.requestId}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/friends/requests"]}),n({title:a("community.requestAccepted","Friend request accepted")})}}),v=R({mutationFn:()=>P("POST",`/api/friends/reject/${o?.requestId}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/friends/requests"]}),n({title:a("community.requestRejected","Request declined")})}}),p=R({mutationFn:()=>P("DELETE",`/api/friends/request/${t}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/friends/requests/sent"]}),n({title:a("community.requestCancelled","Friend request cancelled")})},onError:C=>{n({title:C.message||"Failed to cancel request",variant:"destructive"})}}),d=R({mutationFn:()=>P("DELETE",`/api/friends/${t}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/friends"]}),n({title:a("community.unfriended","Friend removed")})}}),l=R({mutationFn:()=>P("POST",`/api/user/block/${t}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/community/posts"]}),w.invalidateQueries({queryKey:["/api/user/blocked"]}),n({title:a("community.userBlocked")}),s()}}),g=R({mutationFn:()=>P("DELETE",`/api/user/block/${t}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user",t,"profile-card"]}),w.invalidateQueries({queryKey:["/api/user/blocked"]}),n({title:a("community.userUnblocked","User unblocked")})}}),y=o?`${o.firstName} ${o.lastName}`.trim():"",k=o?`${o.firstName?.[0]||""}${o.lastName?.[0]||""}`.toUpperCase():"";return e.jsx(Tn,{open:!!t,onOpenChange:()=>s(),children:e.jsxs($n,{className:"sm:max-w-md","data-testid":"dialog-user-profile",children:[e.jsx(An,{children:e.jsx(qn,{
1children:a("community.userProfile","User Profile")})}),c?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"animate-pulse text-muted-foreground",children:a("common.loading","Loading...")})}):o?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[o.profileImageUrl?e.jsx("img",{src:o.profileImageUrl,alt:y,className:"w-16 h-16 rounded-full object-cover","data-testid":"img-profile-card"}):e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center text-lg font-semibold text-primary","data-testid":"img-profile-card-placeholder",children:k}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg","data-testid":"text-profile-name",children:y}),e.jsx(Se,{totalShares:o.totalShares,specialBadge:o.specialBadge,size:"sm"})]})]}),o.bio&&e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"text-profile-bio",children:o.bio}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t",children:[o.connectionStatus==="none"&&!o.isBlocked&&e.jsxs(b,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,"data-testid":"button-connect",children:[e.jsx(Me,{className:"w-4 h-4 mr-1.5"}),a("community.connect","Connect")]}),o.connectionStatus==="request_sent"&&e.jsxs(b,{size:"sm",variant:"outline",onClick:()=>p.mutate(),disabled:p.isPending,"data-testid":"button-cancel-request",children:[e.jsx(Y,{className:"w-4 h-4 mr-1.5"}),a("community.cancelRequest","Cancel Request")]}),o.connectionStatus==="request_received"&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,"data-testid":"button-accept-request",children:[e.jsx(ce,{className:"w-4 h-4 mr-1.5"}),a("community.accept","Accept")]}),e.jsxs(b,{size:"sm",variant:"outline",onClick:()=>v.mutate(),disabled:v.isPending,"data-testid":"button-reject-request",children:[e.jsx(Y,{className:"w-4 h-4 mr-1.5"}),a("community.decline","Decline")]})]}),o.connectionStatus==="friends"&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{size:"sm",onClick:()=>{s(),r(`/messages/${o.id}`)},"data-testid":"button-message",children:[e.jsx(we,{className:"w-4 h-4 mr-1.5"}),a("community.message","Message")]}),e.jsxs(b,{size:"sm",variant:"outline",onClick:()=>{confirm(a("community.confirmUnfriend","Remove this friend?"))&&d.mutate()},disabled:d.isPending,"data-testid":"button-unfriend",children:[e.jsx(yn,{className:"w-4 h-4 mr-1.5"}),a("community.unfriend","Unfriend")]})]}),o.isBlocked?e.jsxs(b,{size:"sm",variant:"outline",onClick:()=>g.mutate(),disabled:g.isPending,"data-testid":"button-unblock-profile",children:[e.jsx(ke,{className:"w-4 h-4 mr-1.5"}),a("community.unblock","Unblock")]}):e.jsxs(b,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>{confirm(a("community.confirmBlock"))&&l.mutate()},disabled:l.isPending,"data-testid":"button-block-profile",children:[e.jsx(ke,{className:"w-4 h-4 mr-1.5"}),a("community.blockUser","Block")]})]})]}):null]})})}function ne({src:t,name:s,size:n="md"}){const a=n==="sm"?"w-8 h-8 text-xs":n==="lg"?"w-16 h-16 text-xl":"w-10 h-10 text-sm",r=s.split(" ").map(o=>o[0]).join("").toUpperCase().slice(0,2);return t?e.jsx("img",{src:t,alt:s,className:`${a} rounded-full object-cover border-2 border-primary/20`}):e.jsx("div",{className:`${a} rounded-full bg-primary/10 flex items-center justify-center font-bold text-primary border-2 border-primary/20`,children:r||"?"})}function na(){const{t}=ae();return s=>{const n=new Date,a=new Date(s),r=Math.floor((n.getTime()-a.getTime())/1e3);if(r<60)return t("community.justNow");const o=Math.floor(r/60);if(o<60)return t("community.minutesAgo",{count:o});const c=Math.floor(o/60);if(c<24)return t("community.hoursAgo",{count:c});const m=Math.floor(c/24);return m<7?t("community.daysAgo",{count:m}):a.toLocaleDateString("en-GB",{day:"numeric",month:"short"})}}function sa(t){const s=t.split(/(@everyone\b)/gi);return s.length===1?t:s.map((n,a)=>/^@everyone$/i.test(n)?e.jsx("span",{className:"font-semibold text-primary bg-primary/10 rounded px-1","data-testid":"tag-everyone",children:n},a):n)}function aa({post:t,currentUserId:s,isAdmin:n=!1}){const[a,r]=i.useState(!1),[o,c]=i.useState(""),[m,h]=i.useState(null),[v,p]=i.useState(null),{toast:d}=me(),{t:l}=ae(),g=na(),y=`${t.author.firstName} ${t.author.lastName}`.trim()||l("common.anonymous"),k=R({mutationFn:()=>P("POST",`/api/community/posts/${t.id}/like`),onSuccess:()=>w.invalidateQueries({queryKey:["/api/community/posts"]})}),C=R({mutationFn:({content:M,parentId:K})=>P("POST",`/api/community/posts/${t.id}/comment`,{content:M,parentId:K||null}),onSuccess:()=>{c(""),h(null),w.invalidateQueries({queryKey:["/api/community/posts"]})}}),D=R({mutationFn:()=>P("DELETE",`/api/community/posts/${t.id}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/posts"]}),d({title:l("community.postDeleted","Post deleted")})}}),u=R({mutationFn:()=>P("POST",`/api/user/block/${t.userId}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/posts"]}),w.invalidateQueries({queryKey:["/api/user/blocked"]}),d({title:l("community.userBlocked")})}}),I=R({mutationFn:()=>P("POST",`/api/community/posts/${t.id}/tag-everyone`),onSuccess:()=>d({title:l("community.everyoneNotified","Everyone has been notified about this post")}),onError:M=>d({title:M?.message||l("community.notifyFailed","Failed to notify everyone"),variant:"destructive"})}),[U,z]=i.useState(!1),[ee,F]=i.useState(!1),[B,O]=i.useState(t.content),L=()=>{o.trim()&&C.mutate({content:o.trim(),parentId:m?.id})},x=R({mutationFn:M=>P("PATCH",`/api/community/posts/${t.id}`,{content:M}),onSuccess:()=>{F(!1),w.invalidateQueries({queryKey:["/api/community/posts"]}),d({title:l("community.postEdited","Post updated")})}}),S=()=>{B.trim()&&x.mutate(B.trim())},A=()=>{O(t.content),F(!1)},T=`${window.location.origin}/community/post/${t.id}`,he=`${t.content.length>100?t.content.slice(0,100)+"...":t.content}. Join CurveBlock, the shared economy for real estate investment.`,Ce=()=>{window.open(`https://x.com/intent/tweet?text=${encodeURIComponent(he)}&url=${encodeURIComponent(T)}`,"_blank")},G=()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(T)}&quote=${encodeURIComponent(he)}`,"_blank")},f=()=>{window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(T)}`,"_blank")},Q=()=>{navigator.clipboard.writeText(T),z(!0),d({title:l("community.linkCopied","Link copied to clipboard")}),setTimeout(()=>z(!1),2e3)};return e.jsxs(ie,{className:"p-6","data-testid":`card-post-${t.id}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ne,{src:t.author.profileImageUrl,name:y}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("button",{className:"font-semibold text-sm hover:underline cursor-pointer",onClick:()=>t.userId!==s&&p(t.userId),"data-testid":`text-post-author-${t.id}`,children:y}),e.jsx(Se,{totalShares:t.author.totalShares||0,specialBadge:t.author.specialBadge,badgesBlocked:t.author.badgesBlocked,size:"sm",showLabel:!1})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:g(t.createdAt)})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",disabled:I.isPending,onClick:()=>{confirm(l("community.confirmTagEveryone","Send a notification to every member pointing them to this post?"))&&I.mutate()},title:l("community.tagEveryoneTitle","Notify everyone about this post"),"data-testid":`button-tag-everyone-${t.id}`,children:e.jsx(We,{className:"w-4 h-4"})}),t.userId!==s&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>{confirm(l("community.confirmBlock"))&&u.mutate()},title:l("community.blockUser"),"data-testid":`button-block-${t.id}`,children:e.jsx(ke,{className:"w-4 h-4"})}),t.userId===s&&e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",onClick:()=>F(!0),"data-testid":`button-edit-post-${t.id}`,children:e.jsx(Sn,{className:"w-4 h-4"})}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>D.mutate(),"data-testid":`button-delete-post-${t.id}`,children:e.jsx(Rn,{className:"w-4 h-4"})})]})]})]}),ee?e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsx(Ye,{value:B,onChange:M=>O(M.target.value),className:"text-sm min-h-[80px]",maxLength:5e3,"data-testid":`input-edit-post-${t.id}`}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{size:"sm",onClick:S,disabled:x.isPending||!B.trim(),"data-testid":`button-save-edit-${t.id}`,children:l("community.save","Save")}),e.jsx(b,{size:"sm",variant:"outline",onClick:A,"data-testid":`button-cancel-edit-${t.id}`,children:l("community.cancel","Cancel")})]})]}):e.jsx("p",{className:"mt-3 text-sm leading-relaxed whitespace-pre-wrap","data-testid":`text-post-content-${t.id}`,children:sa(t.content)}),t.imageUrl&&e.jsx("img",{src:t.imageUrl,alt:"Post image",className:"mt-3 rounded-lg max-h-96 object-cover w-full"}),t.videoUrl&&t.videoUrl.startsWith("https://www.youtube.com/embed/")&&e.jsx("div",{className:"mt-3 rounded-lg overflow-hidden aspect-video","data-testid":`video-youtube-${t.id}`,children:e.jsx("iframe",{src:t.videoUrl,title:"YouTube video",className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope;
1 picture-in-picture",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})}),t.videoUrl&&t.videoUrl.startsWith("data:video/")&&e.jsx("video",{src:t.videoUrl,controls:!0,playsInline:!0,preload:"metadata",className:"mt-3 rounded-lg max-h-96 w-full bg-black","data-testid":`video-file-${t.id}`}),e.jsxs("div",{className:"flex items-center gap-4 mt-4 pt-3 border-t",children:[e.jsxs(b,{variant:"ghost",size:"sm",className:`gap-1.5 ${t.likedByMe?"text-red-500":"text-muted-foreground"}`,onClick:()=>k.mutate(),disabled:k.isPending,"data-testid":`button-like-${t.id}`,children:[e.jsx(Pn,{className:`w-4 h-4 ${t.likedByMe?"fill-current":""}`}),t.likeCount>0&&e.jsx("span",{children:t.likeCount})]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground",onClick:()=>r(!a),"data-testid":`button-comments-${t.id}`,children:[e.jsx(we,{className:"w-4 h-4"}),t.comments.length>0&&e.jsx("span",{children:t.comments.length})]}),e.jsxs(Vs,{children:[e.jsx(Ys,{asChild:!0,children:e.jsx(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground","data-testid":`button-share-${t.id}`,children:e.jsx(_n,{className:"w-4 h-4"})})}),e.jsxs(Gt,{align:"start",children:[e.jsxs(re,{onClick:Ce,"data-testid":`share-x-${t.id}`,children:[e.jsx(rn,{className:"w-4 h-4 mr-2"}),l("community.shareOnX","Share on X")]}),e.jsxs(re,{onClick:G,"data-testid":`share-facebook-${t.id}`,children:[e.jsx(cn,{className:"w-4 h-4 mr-2"}),l("community.shareOnFacebook","Share on Facebook")]}),e.jsxs(re,{onClick:f,"data-testid":`share-linkedin-${t.id}`,children:[e.jsx(dn,{className:"w-4 h-4 mr-2"}),l("community.shareOnLinkedIn","Share on LinkedIn")]}),e.jsxs(re,{onClick:Q,"data-testid":`share-copy-link-${t.id}`,children:[U?e.jsx(ce,{className:"w-4 h-4 mr-2 text-green-500"}):e.jsx(En,{className:"w-4 h-4 mr-2"}),l("community.copyLink","Copy Link")]})]})]})]}),a&&e.jsxs("div",{className:"mt-3 space-y-3",children:[(()=>{const M=t.comments.filter(j=>!j.parentId),K=t.comments.filter(j=>j.parentId),H=new Map;K.forEach(j=>{const q=H.get(j.parentId)||[];q.push(j),H.set(j.parentId,q)});const te=(j,q)=>{const _=`${j.author.firstName} ${j.author.lastName}`.trim()||l("common.anonymous"),xe=H.get(j.id)||[];return e.jsxs("div",{children:[e.jsxs("div",{className:`flex gap-2 ${q?"ml-8":""}`,"data-testid":`comment-${j.id}`,children:[q&&e.jsx(Dn,{className:"w-4 h-4 text-muted-foreground mt-2 shrink-0"}),e.jsx(ne,{src:j.author.profileImageUrl,name:_,size:"sm"}),e.jsxs("div",{className:"flex-1 bg-muted rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("button",{className:"text-xs font-semibold hover:underline cursor-pointer",onClick:()=>j.userId!==s&&p(j.userId),children:_}),e.jsx(Se,{totalShares:j.author.totalShares||0,specialBadge:j.author.specialBadge,badgesBlocked:j.author.badgesBlocked,size:"sm",showLabel:!1}),e.jsx("p",{className:"text-xs text-muted-foreground",children:g(j.createdAt)})]}),e.jsx("p",{className:"text-sm mt-1",children:j.content}),e.jsxs("button",{className:"text-xs text-muted-foreground hover:text-primary mt-1 flex items-center gap-1",onClick:()=>{h({id:j.id,name:_}),r(!0)},"data-testid":`button-reply-${j.id}`,children:[e.jsx(Le,{className:"w-3 h-3"}),l("community.reply","Reply")]})]})]}),xe.map(Qt=>te(Qt,!0))]},j.id)};return M.map(j=>te(j,!1))})(),m&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5",children:[e.jsx(Le,{className:"w-3 h-3"}),e.jsxs("span",{children:[l("community.replyingTo","Replying to")," ",e.jsx("strong",{children:m.name})]}),e.jsx("button",{onClick:()=>h(null),className:"ml-auto hover:text-foreground","data-testid":"button-cancel-reply",children:e.jsx(Y,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:o,onChange:M=>c(M.target.value),onKeyDown:M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),L())},placeholder:m?l("community.writeReply","Write a reply..."):l("community.writeComment"),className:"flex-1 bg-muted rounded-full px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/50","data-testid":`input-comment-${t.id}`}),e.jsx(b,{size:"icon",className:"rounded-full",onClick:L,disabled:!o.trim()||C.isPending,"data-testid":`button-send-comment-${t.id}`,children:e.jsx(In,{className:"w-4 h-4"})})]})]})]})]}),e.jsx(ta,{userId:v,onClose:()=>p(null)})]})}function oa(){const{t}=ae(),{toast:s}=me(),[n,a]=i.useState(!1),{data:r}=V({queryKey:["/api/user/blocked"]}),o=R({mutationFn:c=>P("DELETE",`/api/user/block/${c}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/user/blocked"]}),w.invalidateQueries({queryKey:["/api/community/posts"]}),s({title:t("community.userUnblocked")})}});return!r||r.length===0?null:e.jsxs("div",{className:"mb-6",children:[e.jsxs(b,{variant:"outline",size:"sm",className:"gap-2 text-muted-foreground",onClick:()=>a(!n),"data-testid":"button-toggle-blocked",children:[e.jsx(He,{className:"w-4 h-4"}),t("community.blockedUsers")," (",r.length,")"]}),n&&e.jsx(ie,{className:"mt-3 p-4",children:e.jsx("div",{className:"space-y-3",children:r.map(c=>{const m=`${c.firstName} ${c.lastName}`.trim()||t("common.anonymous");return e.jsxs("div",{className:"flex items-center justify-between","data-testid":`blocked-user-${c.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ne,{src:c.profileImageUrl,name:m,size:"sm"}),e.jsx("span",{className:"text-sm font-medium",children:m})]}),e.jsxs(b,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>o.mutate(c.id),disabled:o.isPending,"data-testid":`button-unblock-${c.id}`,children:[e.jsx(kn,{className:"w-3 h-3"}),t("community.unblock")]})]},c.id)})})})]})}function ra(){const[t,s]=i.useState(""),[n,a]=i.useState(""),[r,o]=i.useState(!1),{toast:c}=me(),{t:m}=ae(),h=i.useRef(),v=u=>{s(u),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>a(u),300)},{data:p=[],isLoading:d}=V({queryKey:["/api/community/members",n],queryFn:async()=>{const u=await fetch(`/api/community/members?search=${encodeURIComponent(n)}`,{credentials:"include"});if(!u.ok)throw new Error("Failed");return u.json()},enabled:r}),{data:l=[]}=V({queryKey:["/api/friends/requests"],enabled:r}),g=R({mutationFn:u=>P("POST",`/api/friends/request/${u}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/members"]}),w.invalidateQueries({queryKey:["/api/friends/requests/sent"]}),c({title:"Friend request sent"})},onError:u=>c({title:"Error",description:u.message,variant:"destructive"})}),y=R({mutationFn:u=>P("DELETE",`/api/friends/request/${u}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/members"]}),w.invalidateQueries({queryKey:["/api/friends/requests/sent"]}),c({title:"Request cancelled"})}}),k=R({mutationFn:u=>P("POST",`/api/friends/accept/${u}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/members"]}),w.invalidateQueries({queryKey:["/api/friends"]}),w.invalidateQueries({queryKey:["/api/friends/requests"]}),c({title:"Friend request accepted!"})}}),C=R({mutationFn:u=>P("POST",`/api/friends/reject/${u}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/members"]}),w.invalidateQueries({queryKey:["/api/friends/requests"]}),c({title:"Request declined"})}}),D=R({mutationFn:u=>P("DELETE",`/api/friends/${u}`),onSuccess:()=>{w.invalidateQueries({queryKey:["/api/community/members"]}),w.invalidateQueries({queryKey:["/api/friends"]}),c({title:"Friend removed"})}});return e.jsxs(ie,{className:"p-4 mb-6","data-testid":"card-members-section",children:[e.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>o(!r),"data-testid":"button-toggle-members",children:[e.jsx(ge,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"font-semibold",children:"Find Members"}),l.length>0&&r&&e.jsxs(qe,{variant:"destructive",className:"ml-auto text-xs",children:[l.length," pending"]}),e.jsx("span",{className:`ml-auto transition-transform ${r?"rotate-180":""}`,children:"▾"})]}),r&&e.jsxs("div",{className:"mt-4 space-y-4",children:[l.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-sm font-semibold text-primary flex items-center gap-1.5",children:[e.jsx(Me,{className:"w-4 h-4"}),"Friend Requests (",l.length,")"]}),l.map(u=>{const I=`${u.firstName} ${u.lastName}`.trim();return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-primary/5 border border-primary/10","data-testid":`incoming-request-${u.id}`,children:[e.jsx(ne,{src:u.profileImageUrl,name:I,size:"sm"}),e.jsx("span",{className:"text-sm font-medium flex-1",children:I}),e.jsxs(b,{size:"sm",className:"gap-1 h-7 text-xs",onClick:()=>k.mutate(u.id),disabled:k.isPending,"data-testid":`button-accept-${u.id}`,children:[e.jsx(ce,{className:"w-3 h-3"})," Accept"]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1 h-7 text-xs text-muted-foreground",onClick:()=>C.mutate(u.id),disabled:C.isPending,"data-testid":`button-reject-${u.id}`,children:[e.jsx(Y,{className:"w-3 h-3"})," Decline"]})]},u.id)})]}),e.jsxs("div",{className:"relative",children:[e.jsx(jn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Ve,{placeholder:"Search members by name...",value:t,onChange:u=>v(u.target.value),className:"pl-10","data-testid":"input-search-members"})]}),d?e.jsxs("div",{className:"text-center py-6 text-muted-foreground",children:[e.jsx(Nn,{className:"w-5 h-5 animate-spin mx-auto mb-2"}),"Loading members..."]}):p.length===0?e.jsx("p",{className:"text-center py-4 text-sm text-muted-foreground",children:t?"No members found":"No community members yet"}):e.jsx("div",{className:"space-y-1 max-h-[400px] overflow-y-auto",children:p.map(u=>{const I=`${u.firstName} ${u.lastName}`.trim();return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted/50 transition-colors","data-testid":`member-row-${u.id}`,children:[e.jsx(ne,{src:u.profileImageUrl,name:I,size:"sm"}),e.jsx("span",{className:"text-sm font-medium flex-1 min-w-0 truncate",children:I}),u.status==="friends"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(qe,{variant:"secondary",className:"text-xs gap-1",children:[e.jsx(Cn,{className:"w-3 h-3"})," Friends"]}),e.jsx(Ue,{href:`/messages/${u.id}`,children:e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0","data-testid":`button-message-${u.id}`,children:e.jsx(we,{className:"w-3.5 h-3.5"})})}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{confirm(`Remove ${I} as a friend?`)&&D.mutate(u.id)},"data-testid":`button-unfriend-${u.id}`,children:e.jsx(He,{className:"w-3.5 h-3.5"})})]}),u.status==="request_sent"&&e.jsxs(b,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>y.mutate(u.id),disabled:y.isPending,"data-testid":`button-cancel-request-${u.id}`,children:[e.jsx(Mn,{className:"w-3 h-3"})," Pending"]}),u.status==="request_received"&&u.requestId&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(b,{size:"sm",className:"h-7 text-xs gap-1",onClick:()=>k.mutate(u.requestId),disabled:k.isPending,"data-testid":`button-accept-member-${u.id}`,children:[e.jsx(ce,{className:"w-3 h-3"})," Accept"]}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>C.mutate(u.requestId),disabled:C.isPending,"data-testid":`button-reject-member-${u.id}`,children:e.jsx(Y,{className:"w-3 h-3"})})]}),u.status==="none"&&e.jsxs(b,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>g.mutate(u.id),disabled:g.isPending,"data-testid":`button-add-friend-${u.id}`,children:[e.jsx(Me,{className:"w-3 h-3"})," Add Friend"]})]},u.id)})})]})]})}function ja(){on("Community","Connect with fellow CurveBlock investors. Share updates, discuss opportunities, and grow your network.");const[t,s]=i.useState(""),[n,a]=i.useState(null),[r,o]=i.useState(null),[c,m]=i.useState(""),[h,v]=i.useState(!1),p=i.useRef(null),d=i.useRef(null),{toast:l}=me(),{t:g}=ae(),{user:y}=an(),{data:k}=V({queryKey:["/api/user/profile"],enabled:!!y}),{data:C,isLoading:D}=V({queryKey:["/api/community/posts"],enabled:!!y}),{data:u}=V({queryKey:["/api/admin/check"],enabled:!!y,retry:!1}),I=u?.isAdmin===!0,U=R({mutationFn:x=>P("POST","/api/community/posts",x),onSuccess:()=>{s(""),a(null),o(null),m(""),v(!1),w.invalidateQueries({queryKey:["/api/community/posts"]})},onError:x=>l({title:x?.message||g("community.failedToCreatePost","Failed to create post"),variant:"destructive"})}),{data:z=[]}=V({queryKey:["/api/friends"],enabled:!!y}),ee=x=>{const S=x.target.files?.[0];if(!S||!S.type.startsWith("image/"))return;if(S.size>10*1024*1024){l({title:g("community.imageTooLarge","Image must be under 10MB"),variant:"destructive"});return}const A=new FileReader;A.onload=()=>
1a(A.result),A.readAsDataURL(S)},F=x=>{const S=x.target.files?.[0];if(!S)return;if(!(S.type.startsWith("video/")||/\.(mov|mp4|webm)$/i.test(S.name))){l({title:g("community.selectVideoFile","Please select a video file"),variant:"destructive"});return}if(S.size>20*1024*1024){l({title:g("community.videoTooLarge","Video must be under 20MB"),variant:"destructive"});return}const T=new FileReader;T.onload=()=>{let W=T.result;W.startsWith("data:application/octet-stream")&&/\.mov$/i.test(S.name)&&(W=W.replace("data:application/octet-stream","data:video/quicktime")),o(W),m(""),v(!1)},T.readAsDataURL(S)},B=()=>{if(!t.trim())return;const x=c.trim();if(x&&!/^https?:\/\/(www\.|m\.)?(youtube\.com|youtu\.be)\//i.test(x)){l({title:g("community.invalidYoutubeLink","That does not look like a YouTube link"),variant:"destructive"});return}U.mutate({content:t.trim(),imageData:n,videoData:x?null:r,youtubeUrl:x||null})},O=k?`${k.firstName} ${k.lastName}`.trim():"",L=y?.id||"";return e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[e.jsx(ge,{className:"w-8 h-8 text-primary"}),e.jsx("h1",{className:"text-3xl font-display font-bold","data-testid":"text-community-title",children:g("community.title")})]}),e.jsx(ra,{}),e.jsx(oa,{}),z.length>0&&e.jsxs(ie,{className:"p-4 mb-6","data-testid":"card-friends-list",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ge,{className:"w-4 h-4 text-primary"}),e.jsxs("h3",{className:"font-semibold text-sm",children:[g("community.myFriends","My Friends")," (",z.length,")"]})]}),e.jsx("div",{className:"flex flex-wrap gap-3",children:z.map(x=>{const S=`${x.firstName} ${x.lastName}`.trim(),A=`${x.firstName?.[0]||""}${x.lastName?.[0]||""}`.toUpperCase();return e.jsxs(Ue,{href:`/messages/${x.id}`,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors","data-testid":`community-friend-${x.id}`,children:[x.profileImageUrl?e.jsx("img",{src:x.profileImageUrl,alt:S,className:"w-7 h-7 rounded-full object-cover"}):e.jsx("div",{className:"w-7 h-7 rounded-full bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:A}),e.jsx("span",{className:"text-sm font-medium",children:S}),e.jsx(we,{className:"w-3.5 h-3.5 text-muted-foreground"})]},x.id)})})]}),e.jsx(ie,{className:"p-4 mb-6","data-testid":"card-create-post",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ne,{src:k?.profileImageUrl||null,name:O}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ye,{value:t,onChange:x=>s(x.target.value),placeholder:g("community.whatOnYourMind"),className:"min-h-[80px] resize-none border-0 focus-visible:ring-0 p-0 text-sm","data-testid":"input-new-post"}),n&&e.jsxs("div",{className:"relative mt-2 inline-block",children:[e.jsx("img",{src:n,alt:"Post attachment",className:"max-h-48 rounded-lg object-cover"}),e.jsx(b,{variant:"destructive",size:"icon",className:"absolute top-1 right-1 h-6 w-6 rounded-full",onClick:()=>a(null),children:e.jsx(Y,{className:"w-3 h-3"})})]}),r&&e.jsxs("div",{className:"relative mt-2 inline-block","data-testid":"preview-post-video",children:[e.jsx("video",{src:r,controls:!0,playsInline:!0,className:"max-h-48 rounded-lg bg-black"}),e.jsx(b,{variant:"destructive",size:"icon",className:"absolute top-1 right-1 h-6 w-6 rounded-full",onClick:()=>o(null),"data-testid":"button-remove-video",children:e.jsx(Y,{className:"w-3 h-3"})})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(Oe,{className:"w-4 h-4 text-red-500 shrink-0"}),e.jsx(Ve,{value:c,onChange:x=>m(x.target.value),placeholder:g("community.youtubePlaceholder","Paste a YouTube link"),className:"h-8 text-sm","data-testid":"input-youtube-link"}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>{v(!1),m("")},"data-testid":"button-cancel-youtube",children:e.jsx(Y,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground",onClick:()=>p.current?.click(),"data-testid":"button-add-image",children:[e.jsx(bn,{className:"w-4 h-4"}),g("community.photo")]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground",onClick:()=>d.current?.click(),"data-testid":"button-add-video",children:[e.jsx(wn,{className:"w-4 h-4"}),g("community.video","Video")]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground",onClick:()=>{v(x=>!x),r&&o(null)},"data-testid":"button-add-youtube",children:[e.jsx(Oe,{className:"w-4 h-4"}),"YouTube"]}),I&&!/@everyone\b/i.test(t)&&e.jsxs(b,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground",onClick:()=>s(x=>(x?x.replace(/\s*$/," "):"")+"@everyone "),"data-testid":"button-tag-everyone",children:[e.jsx(We,{className:"w-4 h-4"}),g("community.tagEveryone","Everyone")]})]}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:ee}),e.jsx("input",{ref:d,type:"file",accept:"video/mp4,video/quicktime,video/webm,.mov,.mp4,.webm",className:"hidden",onChange:F}),e.jsx(b,{size:"sm",className:"rounded-full px-6",onClick:B,disabled:!t.trim()||U.isPending,"data-testid":"button-post",children:U.isPending?g("community.posting"):g("community.post")})]})]})]})}),e.jsxs("div",{className:"space-y-4",children:[D&&e.jsx("div",{className:"text-center py-12 text-muted-foreground animate-pulse",children:g("community.loadingPosts")}),C&&C.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ge,{className:"w-12 h-12 text-muted-foreground
1/30 mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground font-medium",children:g("community.noPosts")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g("community.noPostsDesc")})]}),C?.map(x=>e.jsx(aa,{post:x,currentUserId:L,isAdmin:I},x.id))]})]})}export{ja 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.