From de57ae1d96285094a56a8c86a363b0c7f57776fa Mon Sep 17 00:00:00 2001 From: Jalay Movaliya Date: Tue, 8 Oct 2024 20:58:51 +0530 Subject: [PATCH] Updates --- assets/{index-BImSo9pN.js => index-Qy9Wgr8q.js} | 2 +- index.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename assets/{index-BImSo9pN.js => index-Qy9Wgr8q.js} (95%) diff --git a/assets/index-BImSo9pN.js b/assets/index-Qy9Wgr8q.js similarity index 95% rename from assets/index-BImSo9pN.js rename to assets/index-Qy9Wgr8q.js index 25a0cc6..b5a9b08 100644 --- a/assets/index-BImSo9pN.js +++ b/assets/index-Qy9Wgr8q.js @@ -216,4 +216,4 @@ o.goToAndStop(nt-o.firstFrame-1,!0)}it.type==="loop"&&(j===null||j!==it.frames|| If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return reactExports.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning=({contentRef:e,descriptionId:i})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return reactExports.useEffect(()=>{var c;const a=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");i&&a&&(document.getElementById(i)||console.warn(o))},[o,e,i]),null},Root$3=Dialog,Trigger$1=DialogTrigger,Portal$1=DialogPortal,Overlay=DialogOverlay,Content=DialogContent,Title=DialogTitle,Description=DialogDescription,Close=DialogClose;const Sheet=Root$3,SheetTrigger=Trigger$1,SheetPortal=Portal$1,SheetOverlay=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Overlay,{className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...i,ref:s}));SheetOverlay.displayName=Overlay.displayName;const sheetVariants=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),SheetContent=reactExports.forwardRef(({side:e="right",className:i,children:s,...o},a)=>jsxRuntimeExports.jsxs(SheetPortal,{children:[jsxRuntimeExports.jsx(SheetOverlay,{}),jsxRuntimeExports.jsxs(Content,{ref:a,className:cn(sheetVariants({side:e}),i),...o,children:[jsxRuntimeExports.jsxs(Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntimeExports.jsx(Cross2Icon,{className:"h-4 w-4"}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]}),s]})]}));SheetContent.displayName=Content.displayName;const SheetHeader=({className:e,...i})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col space-y-2 text-center sm:text-left",e),...i});SheetHeader.displayName="SheetHeader";const SheetTitle=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Title,{ref:s,className:cn("text-lg font-semibold text-foreground",e),...i}));SheetTitle.displayName=Title.displayName;const SheetDescription=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Description,{ref:s,className:cn("text-sm text-muted-foreground",e),...i}));SheetDescription.displayName=Description.displayName;var PAGE_KEYS=["PageUp","PageDown"],ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BACK_KEYS={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},SLIDER_NAME="Slider",[Collection$2,useCollection$2,createCollectionScope$2]=createCollection(SLIDER_NAME),[createSliderContext,createSliderScope]=createContextScope$2(SLIDER_NAME,[createCollectionScope$2]),[SliderProvider,useSliderContext]=createSliderContext(SLIDER_NAME),Slider$1=reactExports.forwardRef((e,i)=>{const{name:s,min:o=0,max:a=100,step:c=1,orientation:d="horizontal",disabled:g=!1,minStepsBetweenThumbs:b=0,defaultValue:_=[o],value:j,onValueChange:_e=()=>{},onValueCommit:$=()=>{},inverted:st=!1,form:it,...nt}=e,at=reactExports.useRef(new Set),et=reactExports.useRef(0),tt=d==="horizontal"?SliderHorizontal:SliderVertical,[ot=[],ct]=useControllableState({prop:j,defaultProp:_,onChange:St=>{var kt;(kt=[...at.current][et.current])==null||kt.focus(),_e(St)}}),ft=reactExports.useRef(ot);function dt(St){const xt=getClosestValueIndex(ot,St);Et(St,xt)}function ht(St){Et(St,et.current)}function yt(){const St=ft.current[et.current];ot[et.current]!==St&&$(ot)}function Et(St,xt,{commit:kt}={commit:!1}){const wt=getDecimalCount(c),bt=roundValue(Math.round((St-o)/c)*c+o,wt),pt=clamp$1(bt,[o,a]);ct((mt=[])=>{const lt=getNextSortedValues(mt,pt,xt);if(hasMinStepsBetweenValues(lt,b*c)){et.current=lt.indexOf(pt);const ut=String(lt)!==String(mt);return ut&&kt&&$(lt),ut?lt:mt}else return mt})}return jsxRuntimeExports.jsx(SliderProvider,{scope:e.__scopeSlider,name:s,disabled:g,min:o,max:a,valueIndexToChangeRef:et,thumbs:at.current,values:ot,orientation:d,form:it,children:jsxRuntimeExports.jsx(Collection$2.Provider,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(Collection$2.Slot,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(tt,{"aria-disabled":g,"data-disabled":g?"":void 0,...nt,ref:i,onPointerDown:composeEventHandlers(nt.onPointerDown,()=>{g||(ft.current=ot)}),min:o,max:a,inverted:st,onSlideStart:g?void 0:dt,onSlideMove:g?void 0:ht,onSlideEnd:g?void 0:yt,onHomeKeyDown:()=>!g&&Et(o,0,{commit:!0}),onEndKeyDown:()=>!g&&Et(a,ot.length-1,{commit:!0}),onStepKeyDown:({event:St,direction:xt})=>{if(!g){const bt=PAGE_KEYS.includes(St.key)||St.shiftKey&&ARROW_KEYS.includes(St.key)?10:1,pt=et.current,mt=ot[pt],lt=c*bt*xt;Et(mt+lt,pt,{commit:!0})}}})})})})});Slider$1.displayName=SLIDER_NAME;var[SliderOrientationProvider,useSliderOrientationContext]=createSliderContext(SLIDER_NAME,{startEdge:"left",endEdge:"right",size:"width",direction:1}),SliderHorizontal=reactExports.forwardRef((e,i)=>{const{min:s,max:o,dir:a,inverted:c,onSlideStart:d,onSlideMove:g,onSlideEnd:b,onStepKeyDown:_,...j}=e,[_e,$]=reactExports.useState(null),st=useComposedRefs(i,tt=>$(tt)),it=reactExports.useRef(),nt=useDirection(a),at=nt==="ltr",et=at&&!c||!at&&c;function rt(tt){const ot=it.current||_e.getBoundingClientRect(),ct=[0,ot.width],dt=linearScale(ct,et?[s,o]:[o,s]);return it.current=ot,dt(tt-ot.left)}return jsxRuntimeExports.jsx(SliderOrientationProvider,{scope:e.__scopeSlider,startEdge:et?"left":"right",endEdge:et?"right":"left",direction:et?1:-1,size:"width",children:jsxRuntimeExports.jsx(SliderImpl,{dir:nt,"data-orientation":"horizontal",...j,ref:st,style:{...j.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:tt=>{const ot=rt(tt.clientX);d==null||d(ot)},onSlideMove:tt=>{const ot=rt(tt.clientX);g==null||g(ot)},onSlideEnd:()=>{it.current=void 0,b==null||b()},onStepKeyDown:tt=>{const ct=BACK_KEYS[et?"from-left":"from-right"].includes(tt.key);_==null||_({event:tt,direction:ct?-1:1})}})})}),SliderVertical=reactExports.forwardRef((e,i)=>{const{min:s,max:o,inverted:a,onSlideStart:c,onSlideMove:d,onSlideEnd:g,onStepKeyDown:b,..._}=e,j=reactExports.useRef(null),_e=useComposedRefs(i,j),$=reactExports.useRef(),st=!a;function it(nt){const at=$.current||j.current.getBoundingClientRect(),et=[0,at.height],tt=linearScale(et,st?[o,s]:[s,o]);return $.current=at,tt(nt-at.top)}return jsxRuntimeExports.jsx(SliderOrientationProvider,{scope:e.__scopeSlider,startEdge:st?"bottom":"top",endEdge:st?"top":"bottom",size:"height",direction:st?1:-1,children:jsxRuntimeExports.jsx(SliderImpl,{"data-orientation":"vertical",..._,ref:_e,style:{..._.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:nt=>{const at=it(nt.clientY);c==null||c(at)},onSlideMove:nt=>{const at=it(nt.clientY);d==null||d(at)},onSlideEnd:()=>{$.current=void 0,g==null||g()},onStepKeyDown:nt=>{const et=BACK_KEYS[st?"from-bottom":"from-top"].includes(nt.key);b==null||b({event:nt,direction:et?-1:1})}})})}),SliderImpl=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:g,onStepKeyDown:b,..._}=e,j=useSliderContext(SLIDER_NAME,s);return jsxRuntimeExports.jsx(Primitive.span,{..._,ref:i,onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{_e.key==="Home"?(d(_e),_e.preventDefault()):_e.key==="End"?(g(_e),_e.preventDefault()):PAGE_KEYS.concat(ARROW_KEYS).includes(_e.key)&&(b(_e),_e.preventDefault())}),onPointerDown:composeEventHandlers(e.onPointerDown,_e=>{const $=_e.target;$.setPointerCapture(_e.pointerId),_e.preventDefault(),j.thumbs.has($)?$.focus():o(_e)}),onPointerMove:composeEventHandlers(e.onPointerMove,_e=>{_e.target.hasPointerCapture(_e.pointerId)&&a(_e)}),onPointerUp:composeEventHandlers(e.onPointerUp,_e=>{const $=_e.target;$.hasPointerCapture(_e.pointerId)&&($.releasePointerCapture(_e.pointerId),c(_e))})})}),TRACK_NAME="SliderTrack",SliderTrack=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,...o}=e,a=useSliderContext(TRACK_NAME,s);return jsxRuntimeExports.jsx(Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...o,ref:i})});SliderTrack.displayName=TRACK_NAME;var RANGE_NAME="SliderRange",SliderRange=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,...o}=e,a=useSliderContext(RANGE_NAME,s),c=useSliderOrientationContext(RANGE_NAME,s),d=reactExports.useRef(null),g=useComposedRefs(i,d),b=a.values.length,_=a.values.map($=>convertValueToPercentage($,a.min,a.max)),j=b>1?Math.min(..._):0,_e=100-Math.max(..._);return jsxRuntimeExports.jsx(Primitive.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...o,ref:g,style:{...e.style,[c.startEdge]:j+"%",[c.endEdge]:_e+"%"}})});SliderRange.displayName=RANGE_NAME;var THUMB_NAME="SliderThumb",SliderThumb=reactExports.forwardRef((e,i)=>{const s=useCollection$2(e.__scopeSlider),[o,a]=reactExports.useState(null),c=useComposedRefs(i,g=>a(g)),d=reactExports.useMemo(()=>o?s().findIndex(g=>g.ref.current===o):-1,[s,o]);return jsxRuntimeExports.jsx(SliderThumbImpl,{...e,ref:c,index:d})}),SliderThumbImpl=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,index:o,name:a,...c}=e,d=useSliderContext(THUMB_NAME,s),g=useSliderOrientationContext(THUMB_NAME,s),[b,_]=reactExports.useState(null),j=useComposedRefs(i,rt=>_(rt)),_e=b?d.form||!!b.closest("form"):!0,$=useSize(b),st=d.values[o],it=st===void 0?0:convertValueToPercentage(st,d.min,d.max),nt=getLabel(o,d.values.length),at=$==null?void 0:$[g.size],et=at?getThumbInBoundsOffset(at,it,g.direction):0;return reactExports.useEffect(()=>{if(b)return d.thumbs.add(b),()=>{d.thumbs.delete(b)}},[b,d.thumbs]),jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${it}% + ${et}px)`},children:[jsxRuntimeExports.jsx(Collection$2.ItemSlot,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(Primitive.span,{role:"slider","aria-label":e["aria-label"]||nt,"aria-valuemin":d.min,"aria-valuenow":st,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...c,ref:j,style:st===void 0?{display:"none"}:e.style,onFocus:composeEventHandlers(e.onFocus,()=>{d.valueIndexToChangeRef.current=o})})}),_e&&jsxRuntimeExports.jsx(BubbleInput,{name:a??(d.name?d.name+(d.values.length>1?"[]":""):void 0),form:d.form,value:st},o)]})});SliderThumb.displayName=THUMB_NAME;var BubbleInput=e=>{const{value:i,...s}=e,o=reactExports.useRef(null),a=usePrevious(i);return reactExports.useEffect(()=>{const c=o.current,d=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==i&&b){const _=new Event("input",{bubbles:!0});b.call(c,i),c.dispatchEvent(_)}},[a,i]),jsxRuntimeExports.jsx("input",{style:{display:"none"},...s,ref:o,defaultValue:i})};function getNextSortedValues(e=[],i,s){const o=[...e];return o[s]=i,o.sort((a,c)=>a-c)}function convertValueToPercentage(e,i,s){const c=100/(s-i)*(e-i);return clamp$1(c,[0,100])}function getLabel(e,i){return i>2?`Value ${e+1} of ${i}`:i===2?["Minimum","Maximum"][e]:void 0}function getClosestValueIndex(e,i){if(e.length===1)return 0;const s=e.map(a=>Math.abs(a-i)),o=Math.min(...s);return s.indexOf(o)}function getThumbInBoundsOffset(e,i,s){const o=e/2,c=linearScale([0,50],[0,o]);return(o-c(i)*s)*s}function getStepsBetweenValues(e){return e.slice(0,-1).map((i,s)=>e[s+1]-i)}function hasMinStepsBetweenValues(e,i){if(i>0){const s=getStepsBetweenValues(e);return Math.min(...s)>=i}return!0}function linearScale(e,i){return s=>{if(e[0]===e[1]||i[0]===i[1])return i[0];const o=(i[1]-i[0])/(e[1]-e[0]);return i[0]+o*(s-e[0])}}function getDecimalCount(e){return(String(e).split(".")[1]||"").length}function roundValue(e,i){const s=Math.pow(10,i);return Math.round(e*s)/s}var Root$2=Slider$1,Track=SliderTrack,Range=SliderRange,Thumb=SliderThumb;const Slider=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsxs(Root$2,{ref:s,className:cn("relative flex w-full touch-none select-none items-center",e),...i,children:[jsxRuntimeExports.jsx(Track,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:jsxRuntimeExports.jsx(Range,{className:"absolute h-full bg-primary"})}),jsxRuntimeExports.jsx(Thumb,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Slider.displayName=Root$2.displayName;const LeaderBoard=()=>{const[e,i]=reactExports.useState([]),[s,o]=reactExports.useState(!0),[a,c]=reactExports.useState(1),[d,g]=reactExports.useState({minPoints:0,maxPoints:100,minPrs:0}),[b,_]=reactExports.useState(1),[j,_e]=reactExports.useState(10),[$,st]=reactExports.useState(""),[it,nt]=reactExports.useState(null),at=reactExports.useCallback(ft(dt=>{st(dt),_(1)},300),[]);reactExports.useEffect(()=>{et(),rt()},[b,j,$,d]);const et=async()=>{try{if(Global.user){const dt=await Global.httpGet(`/users/stats/${Global.user.githubId}`);console.log(dt.user),nt({...dt.stats,...dt.user})}}catch(dt){console.error("Error fetching user:",dt)}},rt=async()=>{o(!0);try{let dt=`/leaderboard?page=${b}&limit=${j}`;$&&(dt=`/leaderboard/search?name=${$}&page=${b}&limit=${j}`),(d.minPoints>0||d.maxPoints<100||d.minPrs>0)&&(dt=`/leaderboard/filter?minPoints=${d.minPoints}&maxPoints=${d.maxPoints}&minPrs=${d.minPrs}&page=${b}&limit=${j}`);const ht=await Global.httpGet(dt);i(ht.contributors),c(ht.meta.totalPages)}catch(dt){console.error("Error fetching contributors:",dt)}finally{o(!1)}},tt=dt=>{at(dt)},ot=dt=>{_(dt)},ct=dt=>{_e(parseInt(dt)),_(1)};function ft(dt,ht){let yt;return function(...St){const xt=()=>{clearTimeout(yt),dt(...St)};clearTimeout(yt),yt=setTimeout(xt,ht)}}return jsxRuntimeExports.jsx("div",{className:"min-h-screen font-dm-sans bg-[#1C1C1C] text-white",children:jsxRuntimeExports.jsxs("main",{className:"container mx-auto px-4 py-8 pt-32",children:[it&&jsxRuntimeExports.jsx("div",{className:"bg-[#2A2A2A] rounded-xl shadow-lg p-6 border border-[#3A3A3A] mb-8",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntimeExports.jsx("img",{src:it.avatarUrl||"https://github.com/identicons/jasonlong.png",alt:it.username,className:"w-20 h-20 rounded-full border-4 border-[#FF4545]"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h2",{className:"text-3xl font-bold text-white",children:it.username}),jsxRuntimeExports.jsxs("p",{className:"text-[#FF4545] text-lg",children:["Rank #",it.rank]})]})]}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-3xl font-bold text-[#FF4545]",children:it.points}),jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-300",children:"Points"})]}),jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-3xl font-bold text-[#FFA500]",children:it.totalPRs}),jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-300",children:"Total PRs"})]}),jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-sm font-medium text-gray-300",children:"PRs Status"}),jsxRuntimeExports.jsxs("div",{className:"text-xs mt-1",children:[jsxRuntimeExports.jsxs("span",{className:"text-green-400",children:[it.openPRs," Open"]})," |",jsxRuntimeExports.jsxs("span",{className:"text-blue-400",children:[" ",it.mergedPRs," Merged"]})," |",jsxRuntimeExports.jsxs("span",{className:"text-red-400",children:[" ",it.closedPRs," Closed"]})]})]})]})]})}),jsxRuntimeExports.jsxs("div",{className:"bg-[#2A2A2A] rounded-xl shadow-lg border border-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"p-6 border-b border-[#3A3A3A]",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsx("h2",{className:"text-3xl font-bold text-white",children:"Leaderboard"}),jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsxs("div",{className:"relative w-72 md:w-64 ml-auto pr-3",children:[jsxRuntimeExports.jsx(Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),jsxRuntimeExports.jsx(Input,{placeholder:"Search contributors...",className:"pl-10 bg-[#3A3A3A] border-[#4A4A4A] text-white placeholder-gray-400 w-full",onChange:dt=>tt(dt.target.value)})]}),jsxRuntimeExports.jsxs(Sheet,{children:[jsxRuntimeExports.jsx(SheetTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{variant:"outline",size:"icon",className:"bg-[#3A3A3A] border-[#4A4A4A] hover:bg-[#4A4A4A]",children:jsxRuntimeExports.jsx(SlidersHorizontal,{className:"h-5 w-5"})})}),jsxRuntimeExports.jsxs(SheetContent,{className:"bg-[#2A2A2A] text-white",children:[jsxRuntimeExports.jsxs(SheetHeader,{children:[jsxRuntimeExports.jsx(SheetTitle,{className:"text-white",children:"Filters"}),jsxRuntimeExports.jsx(SheetDescription,{className:"text-gray-400",children:"Adjust the filters to refine the leaderboard"})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-6 py-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Points Range"}),jsxRuntimeExports.jsx(Slider,{defaultValue:[d.minPoints,d.maxPoints],max:100,step:1,onValueChange:([dt,ht])=>g(yt=>({...yt,minPoints:dt,maxPoints:ht})),className:"bg-[#3A3A3A]"}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between text-sm text-gray-400",children:[jsxRuntimeExports.jsx("span",{children:d.minPoints}),jsxRuntimeExports.jsx("span",{children:d.maxPoints})]})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Minimum PRs"}),jsxRuntimeExports.jsx(Slider,{defaultValue:[d.minPrs],max:50,step:1,onValueChange:([dt])=>g(ht=>({...ht,minPrs:dt})),className:"bg-[#3A3A3A]"}),jsxRuntimeExports.jsxs("div",{className:"text-sm text-gray-400",children:[d.minPrs," PRs"]})]})]})]})]})]})]})}),jsxRuntimeExports.jsx("div",{className:"overflow-x-auto",children:jsxRuntimeExports.jsxs("table",{className:"w-full",children:[jsxRuntimeExports.jsx("thead",{className:"bg-[#3A3A3A]",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Rank"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"User"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Points"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-300 uppercase tracking-wider",children:"PRs"})]})}),jsxRuntimeExports.jsx("tbody",{className:"divide-y divide-[#3A3A3A]",children:s?jsxRuntimeExports.jsx("tr",{children:jsxRuntimeExports.jsx("td",{colSpan:"4",className:"px-6 py-4 text-center text-gray-400",children:jsxRuntimeExports.jsx("l-infinity",{size:"55",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"white"})})}):e.map((dt,ht)=>jsxRuntimeExports.jsxs("tr",{className:`hover:bg-[#3A3A3A] transition-colors ${ht%2===0?"bg-[#2A2A2A]":"bg-[#333333]"}`,children:[jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:jsxRuntimeExports.jsx("div",{className:"flex items-center",children:dt.rank<=3?jsxRuntimeExports.jsx(Trophy,{className:`h-6 w-6 ${dt.rank===1?"text-[#FFD700]":dt.rank===2?"text-[#C0C0C0]":"text-[#CD7F32]"}`}):jsxRuntimeExports.jsxs("span",{className:"text-gray-400 font-medium",children:["#",dt.rank]})})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{className:"h-10 w-10 rounded-full border-2 border-[#FF4545]",src:dt.avatarUrl||"https://github.com/identicons/jasonlong.png",alt:""}),jsxRuntimeExports.jsx("div",{className:"ml-4",children:jsxRuntimeExports.jsx("div",{className:"text-sm font-medium text-white",children:dt.githubId})})]})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm",children:jsxRuntimeExports.jsx("div",{className:"text-[#FF4545] font-bold",children:dt.points})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-5 w-5 text-[#FFA500]"}),jsxRuntimeExports.jsx("span",{className:"text-white font-medium",children:dt.prs.opened+dt.prs.merged+dt.prs.closed})]})})]},dt.githubId))})]})}),jsxRuntimeExports.jsx("div",{className:"p-4 border-t border-[#3A3A3A]",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsxs(Select,{value:j.toString(),onValueChange:ct,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-[180px] bg-[#3A3A3A] border-[#4A4A4A] text-white",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select rows per page"})}),jsxRuntimeExports.jsxs(SelectContent,{className:"bg-[#3A3A3A] border-[#4A4A4A] text-white",children:[jsxRuntimeExports.jsx(SelectItem,{value:"5",children:"5 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"10",children:"10 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"20",children:"20 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"50",children:"50 per page"})]})]}),jsxRuntimeExports.jsx(Pagination,{children:jsxRuntimeExports.jsxs(PaginationContent,{children:[jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationPrevious,{onClick:()=>ot(b-1),disabled:b<=1,className:"bg-[#3A3A3A] border-[#4A4A4A] text-white hover:bg-[#4A4A4A]"})}),[...Array(a)].map((dt,ht)=>jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationLink,{onClick:()=>ot(ht+1),isActive:b===ht+1,className:`${b===ht+1?"bg-[#FF4545] text-white":"bg-[#3A3A3A] text-white"} border-[#4A4A4A] hover:bg-[#4A4A4A]`,children:ht+1})},ht)),jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationNext,{onClick:()=>ot(b+1),disabled:b>=a,className:"bg-[#3A3A3A] border-[#4A4A4A] text-white hover:bg-[#4A4A4A]"})})]})})]})})]})]})})};var AVATAR_NAME="Avatar",[createAvatarContext,createAvatarScope]=createContextScope$2(AVATAR_NAME),[AvatarProvider,useAvatarContext]=createAvatarContext(AVATAR_NAME),Avatar$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,...o}=e,[a,c]=reactExports.useState("idle");return jsxRuntimeExports.jsx(AvatarProvider,{scope:s,imageLoadingStatus:a,onImageLoadingStatusChange:c,children:jsxRuntimeExports.jsx(Primitive.span,{...o,ref:i})})});Avatar$1.displayName=AVATAR_NAME;var IMAGE_NAME="AvatarImage",AvatarImage$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,src:o,onLoadingStatusChange:a=()=>{},...c}=e,d=useAvatarContext(IMAGE_NAME,s),g=useImageLoadingStatus(o,c.referrerPolicy),b=useCallbackRef$1(_=>{a(_),d.onImageLoadingStatusChange(_)});return useLayoutEffect2(()=>{g!=="idle"&&b(g)},[g,b]),g==="loaded"?jsxRuntimeExports.jsx(Primitive.img,{...c,ref:i,src:o}):null});AvatarImage$1.displayName=IMAGE_NAME;var FALLBACK_NAME="AvatarFallback",AvatarFallback$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,delayMs:o,...a}=e,c=useAvatarContext(FALLBACK_NAME,s),[d,g]=reactExports.useState(o===void 0);return reactExports.useEffect(()=>{if(o!==void 0){const b=window.setTimeout(()=>g(!0),o);return()=>window.clearTimeout(b)}},[o]),d&&c.imageLoadingStatus!=="loaded"?jsxRuntimeExports.jsx(Primitive.span,{...a,ref:i}):null});AvatarFallback$1.displayName=FALLBACK_NAME;function useImageLoadingStatus(e,i){const[s,o]=reactExports.useState("idle");return useLayoutEffect2(()=>{if(!e){o("error");return}let a=!0;const c=new window.Image,d=g=>()=>{a&&o(g)};return o("loading"),c.onload=d("loaded"),c.onerror=d("error"),c.src=e,i&&(c.referrerPolicy=i),()=>{a=!1}},[e,i]),s}var Root$1=Avatar$1,Image$1=AvatarImage$1,Fallback=AvatarFallback$1;const Avatar=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Root$1,{ref:s,className:cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...i}));Avatar.displayName=Root$1.displayName;const AvatarImage=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Image$1,{ref:s,className:cn("aspect-square h-full w-full",e),...i}));AvatarImage.displayName=Image$1.displayName;const AvatarFallback=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Fallback,{ref:s,className:cn("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...i}));AvatarFallback.displayName=Fallback.displayName;const StatusBadge=({state:e})=>{const i={merged:"bg-purple-500",open:"bg-green-500",closed:"bg-red-500"};return console.log(e),jsxRuntimeExports.jsx("span",{className:`${i[e]} text-white px-2 py-1 rounded text-sm`,children:e.charAt(0).toUpperCase()+e.slice(1)})};function GitHubProfile(){const[e,i]=React.useState(),{username:s}=useParams();if(reactExports.useEffect(()=>{(async()=>{const{user:o,stats:a}=await Global.httpGet(`/users/stats/${s}`);i({...o,...a}),console.log({...o,...a}),document.title=`Profile | ${o.name}`})()},[s]),e)console.log(e.prs);else return jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center h-screen",children:jsxRuntimeExports.jsx("l-infinity",{size:"55",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"black"})});return jsxRuntimeExports.jsx("div",{className:"min-h-screen bg-black text-white p-8 pt-32",children:jsxRuntimeExports.jsxs("div",{className:"max-w-3xl mx-auto",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[jsxRuntimeExports.jsxs(Avatar,{className:"h-24 w-24",children:[jsxRuntimeExports.jsx(AvatarImage,{src:e.avatar,alt:e.name}),jsxRuntimeExports.jsx(AvatarFallback,{children:e.name.charAt(0)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl font-bold",children:e.name}),jsxRuntimeExports.jsxs("div",{className:"text-zinc-400 flex items-center gap-2",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-4 w-4"}),e.username]}),jsxRuntimeExports.jsx("p",{className:"text-zinc-400 mt-2",children:e.bio})]})]}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-5 gap-4 mb-8",children:[jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.points}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Points"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.mergedPRs}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Merged PRs"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.repositories}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Repositories"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.followers}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Followers"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.following}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Following"})]})]}),jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Recent Pull Requests"}),jsxRuntimeExports.jsx("div",{className:"space-y-2",children:e.prs.map((o,a)=>jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-5 w-5 text-zinc-400"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"font-medium",children:o.title}),jsxRuntimeExports.jsx("div",{className:"text-sm text-zinc-400",children:o.url})]})]}),jsxRuntimeExports.jsx(StatusBadge,{state:o.state})]},a))})]})})}const logo="/hacktoberfest2024/assets/logo-DJb3Nfol.jpeg";function createContextScope(e,i=[]){let s=[];function o(c,d){const g=reactExports.createContext(d),b=s.length;s=[...s,d];function _(_e){const{scope:$,children:st,...it}=_e,nt=($==null?void 0:$[e][b])||g,at=reactExports.useMemo(()=>it,Object.values(it));return jsxRuntimeExports.jsx(nt.Provider,{value:at,children:st})}function j(_e,$){const st=($==null?void 0:$[e][b])||g,it=reactExports.useContext(st);if(it)return it;if(d!==void 0)return d;throw new Error(`\`${_e}\` must be used within \`${c}\``)}return _.displayName=c+"Provider",[_,j]}const a=()=>{const c=s.map(d=>reactExports.createContext(d));return function(g){const b=(g==null?void 0:g[e])||c;return reactExports.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return a.scopeName=e,[o,composeContextScopes(a,...i)]}function composeContextScopes(...e){const i=e[0];if(e.length===1)return i;const s=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const d=o.reduce((g,{useScope:b,scopeName:_})=>{const _e=b(c)[`__scope${_}`];return{...g,..._e}},{});return reactExports.useMemo(()=>({[`__scope${i.scopeName}`]:d}),[d])}};return s.scopeName=i.scopeName,s}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS={bubbles:!1,cancelable:!0},GROUP_NAME$2="RovingFocusGroup",[Collection$1,useCollection$1,createCollectionScope$1]=createCollection(GROUP_NAME$2),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$2,[createCollectionScope$1]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$2),RovingFocusGroup=reactExports.forwardRef((e,i)=>jsxRuntimeExports.jsx(Collection$1.Provider,{scope:e.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(Collection$1.Slot,{scope:e.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(RovingFocusGroupImpl,{...e,ref:i})})}));RovingFocusGroup.displayName=GROUP_NAME$2;var RovingFocusGroupImpl=reactExports.forwardRef((e,i)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:a=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:j=!1,..._e}=e,$=reactExports.useRef(null),st=useComposedRefs(i,$),it=useDirection(c),[nt=null,at]=useControllableState({prop:d,defaultProp:g,onChange:b}),[et,rt]=reactExports.useState(!1),tt=useCallbackRef$1(_),ot=useCollection$1(s),ct=reactExports.useRef(!1),[ft,dt]=reactExports.useState(0);return reactExports.useEffect(()=>{const ht=$.current;if(ht)return ht.addEventListener(ENTRY_FOCUS,tt),()=>ht.removeEventListener(ENTRY_FOCUS,tt)},[tt]),jsxRuntimeExports.jsx(RovingFocusProvider,{scope:s,orientation:o,dir:it,loop:a,currentTabStopId:nt,onItemFocus:reactExports.useCallback(ht=>at(ht),[at]),onItemShiftTab:reactExports.useCallback(()=>rt(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>dt(ht=>ht+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>dt(ht=>ht-1),[]),children:jsxRuntimeExports.jsx(Primitive.div,{tabIndex:et||ft===0?-1:0,"data-orientation":o,..._e,ref:st,style:{outline:"none",...e.style},onMouseDown:composeEventHandlers(e.onMouseDown,()=>{ct.current=!0}),onFocus:composeEventHandlers(e.onFocus,ht=>{const yt=!ct.current;if(ht.target===ht.currentTarget&&yt&&!et){const Et=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS);if(ht.currentTarget.dispatchEvent(Et),!Et.defaultPrevented){const St=ot().filter(pt=>pt.focusable),xt=St.find(pt=>pt.active),kt=St.find(pt=>pt.id===nt),bt=[xt,kt,...St].filter(Boolean).map(pt=>pt.ref.current);focusFirst$1(bt,j)}}ct.current=!1}),onBlur:composeEventHandlers(e.onBlur,()=>rt(!1))})})}),ITEM_NAME$2="RovingFocusGroupItem",RovingFocusGroupItem=reactExports.forwardRef((e,i)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:a=!1,tabStopId:c,...d}=e,g=useId(),b=c||g,_=useRovingFocusContext(ITEM_NAME$2,s),j=_.currentTabStopId===b,_e=useCollection$1(s),{onFocusableItemAdd:$,onFocusableItemRemove:st}=_;return reactExports.useEffect(()=>{if(o)return $(),()=>st()},[o,$,st]),jsxRuntimeExports.jsx(Collection$1.ItemSlot,{scope:s,id:b,focusable:o,active:a,children:jsxRuntimeExports.jsx(Primitive.span,{tabIndex:j?0:-1,"data-orientation":_.orientation,...d,ref:i,onMouseDown:composeEventHandlers(e.onMouseDown,it=>{o?_.onItemFocus(b):it.preventDefault()}),onFocus:composeEventHandlers(e.onFocus,()=>_.onItemFocus(b)),onKeyDown:composeEventHandlers(e.onKeyDown,it=>{if(it.key==="Tab"&&it.shiftKey){_.onItemShiftTab();return}if(it.target!==it.currentTarget)return;const nt=getFocusIntent(it,_.orientation,_.dir);if(nt!==void 0){if(it.metaKey||it.ctrlKey||it.altKey||it.shiftKey)return;it.preventDefault();let et=_e().filter(rt=>rt.focusable).map(rt=>rt.ref.current);if(nt==="last")et.reverse();else if(nt==="prev"||nt==="next"){nt==="prev"&&et.reverse();const rt=et.indexOf(it.currentTarget);et=_.loop?wrapArray$1(et,rt+1):et.slice(rt+1)}setTimeout(()=>focusFirst$1(et))}})})})});RovingFocusGroupItem.displayName=ITEM_NAME$2;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(e,i){return i!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function getFocusIntent(e,i,s){const o=getDirectionAwareKey(e.key,s);if(!(i==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(i==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$1(e,i=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:i}),document.activeElement!==s))return}function wrapArray$1(e,i){return e.map((s,o)=>e[(i+o)%e.length])}var Root=RovingFocusGroup,Item=RovingFocusGroupItem,SELECTION_KEYS=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS,"ArrowRight"],rtl:[...SELECTION_KEYS,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection,useCollection,createCollectionScope]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope,createPopperScope,createRovingFocusGroupScope]),usePopperScope=createPopperScope(),useRovingFocusGroupScope=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:i,open:s=!1,children:o,dir:a,onOpenChange:c,modal:d=!0}=e,g=usePopperScope(i),[b,_]=reactExports.useState(null),j=reactExports.useRef(!1),_e=useCallbackRef$1(c),$=useDirection(a);return reactExports.useEffect(()=>{const st=()=>{j.current=!0,document.addEventListener("pointerdown",it,{capture:!0,once:!0}),document.addEventListener("pointermove",it,{capture:!0,once:!0})},it=()=>j.current=!1;return document.addEventListener("keydown",st,{capture:!0}),()=>{document.removeEventListener("keydown",st,{capture:!0}),document.removeEventListener("pointerdown",it,{capture:!0}),document.removeEventListener("pointermove",it,{capture:!0})}},[]),jsxRuntimeExports.jsx(Root2$2,{...g,children:jsxRuntimeExports.jsx(MenuProvider,{scope:i,open:s,onOpenChange:_e,content:b,onContentChange:_,children:jsxRuntimeExports.jsx(MenuRootProvider,{scope:i,onClose:reactExports.useCallback(()=>_e(!1),[_e]),isUsingKeyboardRef:j,dir:$,modal:d,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME="MenuAnchor",MenuAnchor=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e,a=usePopperScope(s);return jsxRuntimeExports.jsx(Anchor,{...a,...o,ref:i})});MenuAnchor.displayName=ANCHOR_NAME;var PORTAL_NAME$1="MenuPortal",[PortalProvider,usePortalContext]=createMenuContext(PORTAL_NAME$1,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:i,forceMount:s,children:o,container:a}=e,c=useMenuContext(PORTAL_NAME$1,i);return jsxRuntimeExports.jsx(PortalProvider,{scope:i,forceMount:s,children:jsxRuntimeExports.jsx(Presence,{present:s||c.open,children:jsxRuntimeExports.jsx(Portal$3,{asChild:!0,container:a,children:o})})})};MenuPortal.displayName=PORTAL_NAME$1;var CONTENT_NAME$1="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$1),MenuContent=reactExports.forwardRef((e,i)=>{const s=usePortalContext(CONTENT_NAME$1,e.__scopeMenu),{forceMount:o=s.forceMount,...a}=e,c=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),d=useMenuRootContext(CONTENT_NAME$1,e.__scopeMenu);return jsxRuntimeExports.jsx(Collection.Provider,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(Presence,{present:o||c.open,children:jsxRuntimeExports.jsx(Collection.Slot,{scope:e.__scopeMenu,children:d.modal?jsxRuntimeExports.jsx(MenuRootContentModal,{...a,ref:i}):jsxRuntimeExports.jsx(MenuRootContentNonModal,{...a,ref:i})})})})}),MenuRootContentModal=reactExports.forwardRef((e,i)=>{const s=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),o=reactExports.useRef(null),a=useComposedRefs(i,o);return reactExports.useEffect(()=>{const c=o.current;if(c)return hideOthers(c)},[]),jsxRuntimeExports.jsx(MenuContentImpl,{...e,ref:a,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),MenuRootContentNonModal=reactExports.forwardRef((e,i)=>{const s=useMenuContext(CONTENT_NAME$1,e.__scopeMenu);return jsxRuntimeExports.jsx(MenuContentImpl,{...e,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),MenuContentImpl=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:j,onFocusOutside:_e,onInteractOutside:$,onDismiss:st,disableOutsideScroll:it,...nt}=e,at=useMenuContext(CONTENT_NAME$1,s),et=useMenuRootContext(CONTENT_NAME$1,s),rt=usePopperScope(s),tt=useRovingFocusGroupScope(s),ot=useCollection(s),[ct,ft]=reactExports.useState(null),dt=reactExports.useRef(null),ht=useComposedRefs(i,dt,at.onContentChange),yt=reactExports.useRef(0),Et=reactExports.useRef(""),St=reactExports.useRef(0),xt=reactExports.useRef(null),kt=reactExports.useRef("right"),wt=reactExports.useRef(0),bt=it?ReactRemoveScroll:reactExports.Fragment,pt=it?{as:Slot,allowPinchZoom:!0}:void 0,mt=ut=>{var Rt,Nt;const vt=Et.current+ut,gt=ot().filter(Lt=>!Lt.disabled),Ct=document.activeElement,Pt=(Rt=gt.find(Lt=>Lt.ref.current===Ct))==null?void 0:Rt.textValue,At=gt.map(Lt=>Lt.textValue),Mt=getNextMatch(At,vt,Pt),_t=(Nt=gt.find(Lt=>Lt.textValue===Mt))==null?void 0:Nt.ref.current;(function Lt(jt){Et.current=jt,window.clearTimeout(yt.current),jt!==""&&(yt.current=window.setTimeout(()=>Lt(""),1e3))})(vt),_t&&setTimeout(()=>_t.focus())};reactExports.useEffect(()=>()=>window.clearTimeout(yt.current),[]),useFocusGuards();const lt=reactExports.useCallback(ut=>{var gt,Ct;return kt.current===((gt=xt.current)==null?void 0:gt.side)&&isPointerInGraceArea(ut,(Ct=xt.current)==null?void 0:Ct.area)},[]);return jsxRuntimeExports.jsx(MenuContentProvider,{scope:s,searchRef:Et,onItemEnter:reactExports.useCallback(ut=>{lt(ut)&&ut.preventDefault()},[lt]),onItemLeave:reactExports.useCallback(ut=>{var vt;lt(ut)||((vt=dt.current)==null||vt.focus(),ft(null))},[lt]),onTriggerLeave:reactExports.useCallback(ut=>{lt(ut)&&ut.preventDefault()},[lt]),pointerGraceTimerRef:St,onPointerGraceIntentChange:reactExports.useCallback(ut=>{xt.current=ut},[]),children:jsxRuntimeExports.jsx(bt,{...pt,children:jsxRuntimeExports.jsx(FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:composeEventHandlers(c,ut=>{var vt;ut.preventDefault(),(vt=dt.current)==null||vt.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:j,onFocusOutside:_e,onInteractOutside:$,onDismiss:st,children:jsxRuntimeExports.jsx(Root,{asChild:!0,...tt,dir:et.dir,orientation:"vertical",loop:o,currentTabStopId:ct,onCurrentTabStopIdChange:ft,onEntryFocus:composeEventHandlers(b,ut=>{et.isUsingKeyboardRef.current||ut.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntimeExports.jsx(Content$1,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(at.open),"data-radix-menu-content":"",dir:et.dir,...rt,...nt,ref:ht,style:{outline:"none",...nt.style},onKeyDown:composeEventHandlers(nt.onKeyDown,ut=>{const gt=ut.target.closest("[data-radix-menu-content]")===ut.currentTarget,Ct=ut.ctrlKey||ut.altKey||ut.metaKey,Pt=ut.key.length===1;gt&&(ut.key==="Tab"&&ut.preventDefault(),!Ct&&Pt&&mt(ut.key));const At=dt.current;if(ut.target!==At||!FIRST_LAST_KEYS.includes(ut.key))return;ut.preventDefault();const _t=ot().filter(Rt=>!Rt.disabled).map(Rt=>Rt.ref.current);LAST_KEYS.includes(ut.key)&&_t.reverse(),focusFirst(_t)}),onBlur:composeEventHandlers(e.onBlur,ut=>{ut.currentTarget.contains(ut.target)||(window.clearTimeout(yt.current),Et.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(ut=>{const vt=ut.target,gt=wt.current!==ut.clientX;if(ut.currentTarget.contains(vt)&>){const Ct=ut.clientX>wt.current?"right":"left";kt.current=Ct,wt.current=ut.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$1;var GROUP_NAME$1="MenuGroup",MenuGroup=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{role:"group",...o,ref:i})});MenuGroup.displayName=GROUP_NAME$1;var LABEL_NAME$1="MenuLabel",MenuLabel=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{...o,ref:i})});MenuLabel.displayName=LABEL_NAME$1;var ITEM_NAME$1="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=reactExports.forwardRef((e,i)=>{const{disabled:s=!1,onSelect:o,...a}=e,c=reactExports.useRef(null),d=useMenuRootContext(ITEM_NAME$1,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$1,e.__scopeMenu),b=useComposedRefs(i,c),_=reactExports.useRef(!1),j=()=>{const _e=c.current;if(!s&&_e){const $=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});_e.addEventListener(ITEM_SELECT,st=>o==null?void 0:o(st),{once:!0}),dispatchDiscreteCustomEvent(_e,$),$.defaultPrevented?_.current=!1:d.onClose()}};return jsxRuntimeExports.jsx(MenuItemImpl,{...a,ref:b,disabled:s,onClick:composeEventHandlers(e.onClick,j),onPointerDown:_e=>{var $;($=e.onPointerDown)==null||$.call(e,_e),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,_e=>{var $;_.current||($=_e.currentTarget)==null||$.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{const $=g.searchRef.current!=="";s||$&&_e.key===" "||SELECTION_KEYS.includes(_e.key)&&(_e.currentTarget.click(),_e.preventDefault())})})});MenuItem.displayName=ITEM_NAME$1;var MenuItemImpl=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,disabled:o=!1,textValue:a,...c}=e,d=useMenuContentContext(ITEM_NAME$1,s),g=useRovingFocusGroupScope(s),b=reactExports.useRef(null),_=useComposedRefs(i,b),[j,_e]=reactExports.useState(!1),[$,st]=reactExports.useState("");return reactExports.useEffect(()=>{const it=b.current;it&&st((it.textContent??"").trim())},[c.children]),jsxRuntimeExports.jsx(Collection.ItemSlot,{scope:s,disabled:o,textValue:a??$,children:jsxRuntimeExports.jsx(Item,{asChild:!0,...g,focusable:!o,children:jsxRuntimeExports.jsx(Primitive.div,{role:"menuitem","data-highlighted":j?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(it=>{o?d.onItemLeave(it):(d.onItemEnter(it),it.defaultPrevented||it.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(it=>d.onItemLeave(it))),onFocus:composeEventHandlers(e.onFocus,()=>_e(!0)),onBlur:composeEventHandlers(e.onBlur,()=>_e(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=reactExports.forwardRef((e,i)=>{const{checked:s=!1,onCheckedChange:o,...a}=e;return jsxRuntimeExports.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:s,children:jsxRuntimeExports.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate(s)?"mixed":s,...a,ref:i,"data-state":getCheckedState(s),onSelect:composeEventHandlers(a.onSelect,()=>o==null?void 0:o(isIndeterminate(s)?!0:!s),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=reactExports.forwardRef((e,i)=>{const{value:s,onValueChange:o,...a}=e,c=useCallbackRef$1(o);return jsxRuntimeExports.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:s,onValueChange:c,children:jsxRuntimeExports.jsx(MenuGroup,{...a,ref:i})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=reactExports.forwardRef((e,i)=>{const{value:s,...o}=e,a=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),c=s===a.value;return jsxRuntimeExports.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:c,children:jsxRuntimeExports.jsx(MenuItem,{role:"menuitemradio","aria-checked":c,...o,ref:i,"data-state":getCheckedState(c),onSelect:composeEventHandlers(o.onSelect,()=>{var d;return(d=a.onValueChange)==null?void 0:d.call(a,s)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME,{checked:!1}),MenuItemIndicator=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,forceMount:o,...a}=e,c=useItemIndicatorContext(ITEM_INDICATOR_NAME,s);return jsxRuntimeExports.jsx(Presence,{present:o||isIndeterminate(c.checked)||c.checked===!0,children:jsxRuntimeExports.jsx(Primitive.span,{...a,ref:i,"data-state":getCheckedState(c.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME;var SEPARATOR_NAME$1="MenuSeparator",MenuSeparator=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{role:"separator","aria-orientation":"horizontal",...o,ref:i})});MenuSeparator.displayName=SEPARATOR_NAME$1;var ARROW_NAME$1="MenuArrow",MenuArrow=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e,a=usePopperScope(s);return jsxRuntimeExports.jsx(Arrow,{...a,...o,ref:i})});MenuArrow.displayName=ARROW_NAME$1;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=reactExports.forwardRef((e,i)=>{const s=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),a=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),c=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=reactExports.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=c,_={__scopeMenu:e.__scopeMenu},j=reactExports.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return reactExports.useEffect(()=>j,[j]),reactExports.useEffect(()=>{const _e=g.current;return()=>{window.clearTimeout(_e),b(null)}},[g,b]),jsxRuntimeExports.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntimeExports.jsx(MenuItemImpl,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":a.contentId,"data-state":getOpenState(s.open),...e,ref:composeRefs(i,a.onTriggerChange),onClick:_e=>{var $;($=e.onClick)==null||$.call(e,_e),!(e.disabled||_e.defaultPrevented)&&(_e.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(_e=>{c.onItemEnter(_e),!_e.defaultPrevented&&!e.disabled&&!s.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{s.onOpenChange(!0),j()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(_e=>{var st,it;j();const $=(st=s.content)==null?void 0:st.getBoundingClientRect();if($){const nt=(it=s.content)==null?void 0:it.dataset.side,at=nt==="right",et=at?-5:5,rt=$[at?"left":"right"],tt=$[at?"right":"left"];c.onPointerGraceIntentChange({area:[{x:_e.clientX+et,y:_e.clientY},{x:rt,y:$.top},{x:tt,y:$.top},{x:tt,y:$.bottom},{x:rt,y:$.bottom}],side:nt}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(_e),_e.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{var st;const $=c.searchRef.current!=="";e.disabled||$&&_e.key===" "||SUB_OPEN_KEYS[o.dir].includes(_e.key)&&(s.onOpenChange(!0),(st=s.content)==null||st.focus(),_e.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=reactExports.forwardRef((e,i)=>{const s=usePortalContext(CONTENT_NAME$1,e.__scopeMenu),{forceMount:o=s.forceMount,...a}=e,c=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),d=useMenuRootContext(CONTENT_NAME$1,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=reactExports.useRef(null),_=useComposedRefs(i,b);return jsxRuntimeExports.jsx(Collection.Provider,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(Presence,{present:o||c.open,children:jsxRuntimeExports.jsx(Collection.Slot,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...a,ref:_,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:j=>{var _e;d.isUsingKeyboardRef.current&&((_e=b.current)==null||_e.focus()),j.preventDefault()},onCloseAutoFocus:j=>j.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,j=>{j.target!==g.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,j=>{d.onClose(),j.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,j=>{var st;const _e=j.currentTarget.contains(j.target),$=SUB_CLOSE_KEYS[d.dir].includes(j.key);_e&&$&&(c.onOpenChange(!1),(st=g.trigger)==null||st.focus(),j.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst(e){const i=document.activeElement;for(const s of e)if(s===i||(s.focus(),document.activeElement!==i))return}function wrapArray(e,i){return e.map((s,o)=>e[(i+o)%e.length])}function getNextMatch(e,i,s){const a=i.length>1&&Array.from(i).every(_=>_===i[0])?i[0]:i,c=s?e.indexOf(s):-1;let d=wrapArray(e,Math.max(c,0));a.length===1&&(d=d.filter(_=>_!==s));const b=d.find(_=>_.toLowerCase().startsWith(a.toLowerCase()));return b!==s?b:void 0}function isPointInPolygon(e,i){const{x:s,y:o}=e;let a=!1;for(let c=0,d=i.length-1;co!=j>o&&s<(_-g)*(o-b)/(j-b)+g&&(a=!a)}return a}function isPointerInGraceArea(e,i){if(!i)return!1;const s={x:e.clientX,y:e.clientY};return isPointInPolygon(s,i)}function whenMouse(e){return i=>i.pointerType==="mouse"?e(i):void 0}var Root3=Menu,Anchor2=MenuAnchor,Portal=MenuPortal,Content2$1=MenuContent,Group=MenuGroup,Label=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator=MenuItemIndicator,Separator=MenuSeparator,Arrow2=MenuArrow,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext,createDropdownMenuScope]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:i,children:s,dir:o,open:a,defaultOpen:c,onOpenChange:d,modal:g=!0}=e,b=useMenuScope(i),_=reactExports.useRef(null),[j=!1,_e]=useControllableState({prop:a,defaultProp:c,onChange:d});return jsxRuntimeExports.jsx(DropdownMenuProvider,{scope:i,triggerId:useId(),triggerRef:_,contentId:useId(),open:j,onOpenChange:_e,onOpenToggle:reactExports.useCallback(()=>_e($=>!$),[_e]),modal:g,children:jsxRuntimeExports.jsx(Root3,{...b,open:j,onOpenChange:_e,dir:o,modal:g,children:s})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME="DropdownMenuTrigger",DropdownMenuTrigger$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...a}=e,c=useDropdownMenuContext(TRIGGER_NAME,s),d=useMenuScope(s);return jsxRuntimeExports.jsx(Anchor2,{asChild:!0,...d,children:jsxRuntimeExports.jsx(Primitive.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:composeRefs(i,c.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(c.onOpenToggle(),c.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&c.onOpenToggle(),g.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME;var PORTAL_NAME="DropdownMenuPortal",DropdownMenuPortal=e=>{const{__scopeDropdownMenu:i,...s}=e,o=useMenuScope(i);return jsxRuntimeExports.jsx(Portal,{...o,...s})};DropdownMenuPortal.displayName=PORTAL_NAME;var CONTENT_NAME="DropdownMenuContent",DropdownMenuContent$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useDropdownMenuContext(CONTENT_NAME,s),c=useMenuScope(s),d=reactExports.useRef(!1);return jsxRuntimeExports.jsx(Content2$1,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...o,ref:i,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;d.current||(b=a.triggerRef.current)==null||b.focus(),d.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,j=b.button===2||_;(!a.modal||j)&&(d.current=!0)}),style:{...e.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME;var GROUP_NAME="DropdownMenuGroup",DropdownMenuGroup=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Group,{...a,...o,ref:i})});DropdownMenuGroup.displayName=GROUP_NAME;var LABEL_NAME="DropdownMenuLabel",DropdownMenuLabel$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Label,{...a,...o,ref:i})});DropdownMenuLabel$1.displayName=LABEL_NAME;var ITEM_NAME="DropdownMenuItem",DropdownMenuItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Item2$1,{...a,...o,ref:i})});DropdownMenuItem$1.displayName=ITEM_NAME;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(CheckboxItem,{...a,...o,ref:i})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(RadioGroup,{...a,...o,ref:i})});DropdownMenuRadioGroup.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(RadioItem,{...a,...o,ref:i})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME="DropdownMenuItemIndicator",DropdownMenuItemIndicator=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(ItemIndicator,{...a,...o,ref:i})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME;var SEPARATOR_NAME="DropdownMenuSeparator",DropdownMenuSeparator$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Separator,{...a,...o,ref:i})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME="DropdownMenuArrow",DropdownMenuArrow=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Arrow2,{...a,...o,ref:i})});DropdownMenuArrow.displayName=ARROW_NAME;var SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(SubTrigger,{...a,...o,ref:i})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(SubContent,{...a,...o,ref:i,style:{...e.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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2=DropdownMenu$1,Trigger=DropdownMenuTrigger$1,Portal2=DropdownMenuPortal,Content2=DropdownMenuContent$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2,DropdownMenuTrigger=Trigger,DropdownMenuSubTrigger=reactExports.forwardRef(({className:e,inset:i,children:s,...o},a)=>jsxRuntimeExports.jsxs(SubTrigger2,{ref:a,className:cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",i&&"pl-8",e),...o,children:[s,jsxRuntimeExports.jsx(ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(SubContent2,{ref:s,className:cn("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=reactExports.forwardRef(({className:e,sideOffset:i=4,...s},o)=>jsxRuntimeExports.jsx(Portal2,{children:jsxRuntimeExports.jsx(Content2,{ref:o,sideOffset:i,className:cn("z-50 min-w-[8rem] overflow-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",e),...s})}));DropdownMenuContent.displayName=Content2.displayName;const DropdownMenuItem=reactExports.forwardRef(({className:e,inset:i,...s},o)=>jsxRuntimeExports.jsx(Item2,{ref:o,className:cn("relative flex cursor-default select-none items-center 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",i&&"pl-8",e),...s}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=reactExports.forwardRef(({className:e,children:i,checked:s,...o},a)=>jsxRuntimeExports.jsxs(CheckboxItem2,{ref:a,className:cn("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",e),checked:s,...o,children:[jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntimeExports.jsx(ItemIndicator2,{children:jsxRuntimeExports.jsx(CheckIcon,{className:"h-4 w-4"})})}),i]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=reactExports.forwardRef(({className:e,children:i,...s},o)=>jsxRuntimeExports.jsxs(RadioItem2,{ref:o,className:cn("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",e),...s,children:[jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntimeExports.jsx(ItemIndicator2,{children:jsxRuntimeExports.jsx(DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),i]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=reactExports.forwardRef(({className:e,inset:i,...s},o)=>jsxRuntimeExports.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",i&&"pl-8",e),...s}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Separator2,{ref:s,className:cn("-mx-1 my-1 h-px bg-muted",e),...i}));DropdownMenuSeparator.displayName=Separator2.displayName;function RiMenu3Fill(e){return GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM9 11H21V13H9V11ZM3 18H21V20H3V18Z"},child:[]}]})(e)}function IoMdClose(e){return GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"},child:[]}]})(e)}const Navbar=({onContactClick:e,onQandAClick:i,onStatusClick:s,onProjectsClick:o,onLeaderboardClick:a})=>{const[c,d]=reactExports.useState(!1),g=()=>{window.location.href="http://37.27.81.8:3005/api/auth/github"},b=async()=>{try{await Global.httpPost("/auth/logout"),Global.user=null,window.location.reload()}catch(j){console.error(j)}},_=()=>{d(!c)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("nav",{className:"bg-[rgba(30,30,30,0.8)] backdrop-blur-lg p-4 fixed top-0 left-0 right-0 z-50 flex justify-between items-center shadow-lg",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{className:"w-10 h-10 rounded-full mr-4 transition-transform duration-300 ease-in-out hover:scale-110",src:logo,alt:"Logo"}),jsxRuntimeExports.jsx("a",{href:"/",className:"text-red-500 font-dm-sans text-2xl font-bold tracking-wide",children:"Club Gamma"})]}),jsxRuntimeExports.jsxs("div",{className:"hidden lg:flex gap-12 font-montserrat text-lg",children:[jsxRuntimeExports.jsx("a",{href:"/",className:"text-white hover:text-red-500 transition-all duration-300",children:"Home"}),jsxRuntimeExports.jsx("button",{onClick:i,className:"text-white hover:text-red-500 transition-all duration-300",children:"Q&A"}),jsxRuntimeExports.jsx("button",{onClick:s,className:"text-white hover:text-red-500 transition-all duration-300",children:"Stats"}),jsxRuntimeExports.jsx("button",{onClick:o,className:"text-white hover:text-red-500 transition-all duration-300",children:"Projects"}),jsxRuntimeExports.jsx("button",{onClick:e,className:"text-white hover:text-red-500 transition-all duration-300",children:"Contact"}),jsxRuntimeExports.jsx(Link,{to:"/leaderboard",className:"text-white hover:text-red-500 transition-all duration-300",children:"Leaderboard"})," "]}),jsxRuntimeExports.jsx("div",{className:"hidden lg:flex",children:Global.user?jsxRuntimeExports.jsxs(DropdownMenu,{children:[jsxRuntimeExports.jsx(DropdownMenuTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(Button,{variant:"outline",className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx(User,{className:"h-4 w-4"}),Global.user.name.split(" ")[0]]})}),jsxRuntimeExports.jsxs(DropdownMenuContent,{align:"end",children:[jsxRuntimeExports.jsx(Link,{to:`/profile/${Global.user.githubId}`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Profile"})}),jsxRuntimeExports.jsx(DropdownMenuItem,{onClick:b,children:"Logout"})]})]}):jsxRuntimeExports.jsxs("button",{onClick:g,className:"flex font-dm-sans items-center bg-[#181717] text-white py-2 px-5 rounded-md font-bold shadow-lg hover:shadow-none transition-all duration-500",children:[jsxRuntimeExports.jsx("svg",{className:"w-6 h-6 mr-2",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{d:"M12,2A10,10,0,0,0,8.84,21.5c.5.08.66-.23.66-.5V19.31C6.73,19.91,6.14,18,6.14,18A2.69,2.69,0,0,0,5,16.5c-.91-.62.07-.6.07-.6a2.1,2.1,0,0,1,1.53,1,2.15,2.15,0,0,0,2.91.83,2.16,2.16,0,0,1,.63-1.34C8,16.17,5.62,15.31,5.62,11.5a3.87,3.87,0,0,1,1-2.71,3.58,3.58,0,0,1,.1-2.64s.84-.27,2.75,1a9.63,9.63,0,0,1,5,0c1.91-1.29,2.75-1,2.75-1a3.58,3.58,0,0,1,.1,2.64,3.87,3.87,0,0,1,1,2.71c0,3.82-2.34,4.66-4.57,4.91a2.39,2.39,0,0,1,.69,1.85V21c0,.27.16.59.67.5A10,10,0,0,0,12,2Z"})}),"Continue with GitHub"]})}),jsxRuntimeExports.jsx("div",{className:"lg:hidden",children:jsxRuntimeExports.jsx("button",{className:"text-white bg-transparent border-none",onClick:_,children:c?jsxRuntimeExports.jsx(IoMdClose,{size:24}):jsxRuntimeExports.jsx(RiMenu3Fill,{size:24})})})]}),jsxRuntimeExports.jsx("div",{className:`fixed inset-y-0 left-0 font-dm-sans w-64 bg-gray-900 transform ${c?"translate-x-0":"-translate-x-full"} transition-transform duration-300 ease-in-out z-50 lg:hidden`,children:jsxRuntimeExports.jsxs("div",{className:"p-4",children:[jsxRuntimeExports.jsx("img",{className:"w-10 h-10 rounded-full mb-4",src:logo,alt:"Logo"}),jsxRuntimeExports.jsxs("nav",{className:"space-y-6",children:[jsxRuntimeExports.jsx("a",{href:"/",className:"text-white block",children:"Home"}),jsxRuntimeExports.jsx("button",{onClick:i,className:"text-white block",children:"Q&A"}),jsxRuntimeExports.jsx("button",{onClick:s,className:"text-white block",children:"Stats"}),jsxRuntimeExports.jsx("button",{onClick:o,className:"text-white block",children:"Projects"}),jsxRuntimeExports.jsx("button",{onClick:e,className:"text-white block",children:"Contact"}),jsxRuntimeExports.jsx(Link,{to:"/leaderboard",className:"text-white block",children:"Leaderboard"})," ",jsxRuntimeExports.jsx("hr",{className:"border-gray-700"}),Global.user?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Link,{to:`/profile/${Global.user.githubId}`,className:"text-white block",children:"Profile"}),jsxRuntimeExports.jsx("button",{onClick:b,className:"text-white block",children:"Logout"})]}):jsxRuntimeExports.jsx(Button,{onClick:g,className:"text-white bg-red-500 block",children:"Continue with GitHub"})]})]})}),jsxRuntimeExports.jsx(Outlet,{})]})};function App(){const[e,i]=reactExports.useState(!1),s=useNavigate(),o=useLocation(),a=c=>{if(o.pathname!=="/")s("/",{state:{scrollTo:c}});else{const d=document.getElementById(c);d==null||d.scrollIntoView({behavior:"smooth"})}};return reactExports.useEffect(()=>{(async()=>{try{Global.user=await Global.getUser(),i(!0)}catch(c){console.error(c),i(!0)}})()},[]),e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Routes,{children:jsxRuntimeExports.jsxs(Route,{path:"/",element:jsxRuntimeExports.jsx(Navbar,{onContactClick:()=>a("contact"),onQandAClick:()=>a("q&a"),onStatusClick:()=>a("stat"),onProjectsClick:()=>a("project")}),children:[jsxRuntimeExports.jsx(Route,{path:"",element:jsxRuntimeExports.jsx(Home,{})}),jsxRuntimeExports.jsx(Route,{path:"/leaderboard",element:jsxRuntimeExports.jsx(LeaderBoard,{})}),jsxRuntimeExports.jsx(Route,{path:"/profile/:username",element:jsxRuntimeExports.jsx(GitHubProfile,{})})]})})}):jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-gradient-to-br from-[#1e1e1e] to-[#4e3535]",children:jsxRuntimeExports.jsx("l-infinity",{size:"80",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"white"})})}createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(App,{})})})); +For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return reactExports.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning=({contentRef:e,descriptionId:i})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return reactExports.useEffect(()=>{var c;const a=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");i&&a&&(document.getElementById(i)||console.warn(o))},[o,e,i]),null},Root$3=Dialog,Trigger$1=DialogTrigger,Portal$1=DialogPortal,Overlay=DialogOverlay,Content=DialogContent,Title=DialogTitle,Description=DialogDescription,Close=DialogClose;const Sheet=Root$3,SheetTrigger=Trigger$1,SheetPortal=Portal$1,SheetOverlay=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Overlay,{className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...i,ref:s}));SheetOverlay.displayName=Overlay.displayName;const sheetVariants=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),SheetContent=reactExports.forwardRef(({side:e="right",className:i,children:s,...o},a)=>jsxRuntimeExports.jsxs(SheetPortal,{children:[jsxRuntimeExports.jsx(SheetOverlay,{}),jsxRuntimeExports.jsxs(Content,{ref:a,className:cn(sheetVariants({side:e}),i),...o,children:[jsxRuntimeExports.jsxs(Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntimeExports.jsx(Cross2Icon,{className:"h-4 w-4"}),jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]}),s]})]}));SheetContent.displayName=Content.displayName;const SheetHeader=({className:e,...i})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col space-y-2 text-center sm:text-left",e),...i});SheetHeader.displayName="SheetHeader";const SheetTitle=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Title,{ref:s,className:cn("text-lg font-semibold text-foreground",e),...i}));SheetTitle.displayName=Title.displayName;const SheetDescription=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Description,{ref:s,className:cn("text-sm text-muted-foreground",e),...i}));SheetDescription.displayName=Description.displayName;var PAGE_KEYS=["PageUp","PageDown"],ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BACK_KEYS={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},SLIDER_NAME="Slider",[Collection$2,useCollection$2,createCollectionScope$2]=createCollection(SLIDER_NAME),[createSliderContext,createSliderScope]=createContextScope$2(SLIDER_NAME,[createCollectionScope$2]),[SliderProvider,useSliderContext]=createSliderContext(SLIDER_NAME),Slider$1=reactExports.forwardRef((e,i)=>{const{name:s,min:o=0,max:a=100,step:c=1,orientation:d="horizontal",disabled:g=!1,minStepsBetweenThumbs:b=0,defaultValue:_=[o],value:j,onValueChange:_e=()=>{},onValueCommit:$=()=>{},inverted:st=!1,form:it,...nt}=e,at=reactExports.useRef(new Set),et=reactExports.useRef(0),tt=d==="horizontal"?SliderHorizontal:SliderVertical,[ot=[],ct]=useControllableState({prop:j,defaultProp:_,onChange:St=>{var kt;(kt=[...at.current][et.current])==null||kt.focus(),_e(St)}}),ft=reactExports.useRef(ot);function dt(St){const xt=getClosestValueIndex(ot,St);Et(St,xt)}function ht(St){Et(St,et.current)}function yt(){const St=ft.current[et.current];ot[et.current]!==St&&$(ot)}function Et(St,xt,{commit:kt}={commit:!1}){const wt=getDecimalCount(c),bt=roundValue(Math.round((St-o)/c)*c+o,wt),pt=clamp$1(bt,[o,a]);ct((mt=[])=>{const lt=getNextSortedValues(mt,pt,xt);if(hasMinStepsBetweenValues(lt,b*c)){et.current=lt.indexOf(pt);const ut=String(lt)!==String(mt);return ut&&kt&&$(lt),ut?lt:mt}else return mt})}return jsxRuntimeExports.jsx(SliderProvider,{scope:e.__scopeSlider,name:s,disabled:g,min:o,max:a,valueIndexToChangeRef:et,thumbs:at.current,values:ot,orientation:d,form:it,children:jsxRuntimeExports.jsx(Collection$2.Provider,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(Collection$2.Slot,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(tt,{"aria-disabled":g,"data-disabled":g?"":void 0,...nt,ref:i,onPointerDown:composeEventHandlers(nt.onPointerDown,()=>{g||(ft.current=ot)}),min:o,max:a,inverted:st,onSlideStart:g?void 0:dt,onSlideMove:g?void 0:ht,onSlideEnd:g?void 0:yt,onHomeKeyDown:()=>!g&&Et(o,0,{commit:!0}),onEndKeyDown:()=>!g&&Et(a,ot.length-1,{commit:!0}),onStepKeyDown:({event:St,direction:xt})=>{if(!g){const bt=PAGE_KEYS.includes(St.key)||St.shiftKey&&ARROW_KEYS.includes(St.key)?10:1,pt=et.current,mt=ot[pt],lt=c*bt*xt;Et(mt+lt,pt,{commit:!0})}}})})})})});Slider$1.displayName=SLIDER_NAME;var[SliderOrientationProvider,useSliderOrientationContext]=createSliderContext(SLIDER_NAME,{startEdge:"left",endEdge:"right",size:"width",direction:1}),SliderHorizontal=reactExports.forwardRef((e,i)=>{const{min:s,max:o,dir:a,inverted:c,onSlideStart:d,onSlideMove:g,onSlideEnd:b,onStepKeyDown:_,...j}=e,[_e,$]=reactExports.useState(null),st=useComposedRefs(i,tt=>$(tt)),it=reactExports.useRef(),nt=useDirection(a),at=nt==="ltr",et=at&&!c||!at&&c;function rt(tt){const ot=it.current||_e.getBoundingClientRect(),ct=[0,ot.width],dt=linearScale(ct,et?[s,o]:[o,s]);return it.current=ot,dt(tt-ot.left)}return jsxRuntimeExports.jsx(SliderOrientationProvider,{scope:e.__scopeSlider,startEdge:et?"left":"right",endEdge:et?"right":"left",direction:et?1:-1,size:"width",children:jsxRuntimeExports.jsx(SliderImpl,{dir:nt,"data-orientation":"horizontal",...j,ref:st,style:{...j.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:tt=>{const ot=rt(tt.clientX);d==null||d(ot)},onSlideMove:tt=>{const ot=rt(tt.clientX);g==null||g(ot)},onSlideEnd:()=>{it.current=void 0,b==null||b()},onStepKeyDown:tt=>{const ct=BACK_KEYS[et?"from-left":"from-right"].includes(tt.key);_==null||_({event:tt,direction:ct?-1:1})}})})}),SliderVertical=reactExports.forwardRef((e,i)=>{const{min:s,max:o,inverted:a,onSlideStart:c,onSlideMove:d,onSlideEnd:g,onStepKeyDown:b,..._}=e,j=reactExports.useRef(null),_e=useComposedRefs(i,j),$=reactExports.useRef(),st=!a;function it(nt){const at=$.current||j.current.getBoundingClientRect(),et=[0,at.height],tt=linearScale(et,st?[o,s]:[s,o]);return $.current=at,tt(nt-at.top)}return jsxRuntimeExports.jsx(SliderOrientationProvider,{scope:e.__scopeSlider,startEdge:st?"bottom":"top",endEdge:st?"top":"bottom",size:"height",direction:st?1:-1,children:jsxRuntimeExports.jsx(SliderImpl,{"data-orientation":"vertical",..._,ref:_e,style:{..._.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:nt=>{const at=it(nt.clientY);c==null||c(at)},onSlideMove:nt=>{const at=it(nt.clientY);d==null||d(at)},onSlideEnd:()=>{$.current=void 0,g==null||g()},onStepKeyDown:nt=>{const et=BACK_KEYS[st?"from-bottom":"from-top"].includes(nt.key);b==null||b({event:nt,direction:et?-1:1})}})})}),SliderImpl=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:g,onStepKeyDown:b,..._}=e,j=useSliderContext(SLIDER_NAME,s);return jsxRuntimeExports.jsx(Primitive.span,{..._,ref:i,onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{_e.key==="Home"?(d(_e),_e.preventDefault()):_e.key==="End"?(g(_e),_e.preventDefault()):PAGE_KEYS.concat(ARROW_KEYS).includes(_e.key)&&(b(_e),_e.preventDefault())}),onPointerDown:composeEventHandlers(e.onPointerDown,_e=>{const $=_e.target;$.setPointerCapture(_e.pointerId),_e.preventDefault(),j.thumbs.has($)?$.focus():o(_e)}),onPointerMove:composeEventHandlers(e.onPointerMove,_e=>{_e.target.hasPointerCapture(_e.pointerId)&&a(_e)}),onPointerUp:composeEventHandlers(e.onPointerUp,_e=>{const $=_e.target;$.hasPointerCapture(_e.pointerId)&&($.releasePointerCapture(_e.pointerId),c(_e))})})}),TRACK_NAME="SliderTrack",SliderTrack=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,...o}=e,a=useSliderContext(TRACK_NAME,s);return jsxRuntimeExports.jsx(Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...o,ref:i})});SliderTrack.displayName=TRACK_NAME;var RANGE_NAME="SliderRange",SliderRange=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,...o}=e,a=useSliderContext(RANGE_NAME,s),c=useSliderOrientationContext(RANGE_NAME,s),d=reactExports.useRef(null),g=useComposedRefs(i,d),b=a.values.length,_=a.values.map($=>convertValueToPercentage($,a.min,a.max)),j=b>1?Math.min(..._):0,_e=100-Math.max(..._);return jsxRuntimeExports.jsx(Primitive.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...o,ref:g,style:{...e.style,[c.startEdge]:j+"%",[c.endEdge]:_e+"%"}})});SliderRange.displayName=RANGE_NAME;var THUMB_NAME="SliderThumb",SliderThumb=reactExports.forwardRef((e,i)=>{const s=useCollection$2(e.__scopeSlider),[o,a]=reactExports.useState(null),c=useComposedRefs(i,g=>a(g)),d=reactExports.useMemo(()=>o?s().findIndex(g=>g.ref.current===o):-1,[s,o]);return jsxRuntimeExports.jsx(SliderThumbImpl,{...e,ref:c,index:d})}),SliderThumbImpl=reactExports.forwardRef((e,i)=>{const{__scopeSlider:s,index:o,name:a,...c}=e,d=useSliderContext(THUMB_NAME,s),g=useSliderOrientationContext(THUMB_NAME,s),[b,_]=reactExports.useState(null),j=useComposedRefs(i,rt=>_(rt)),_e=b?d.form||!!b.closest("form"):!0,$=useSize(b),st=d.values[o],it=st===void 0?0:convertValueToPercentage(st,d.min,d.max),nt=getLabel(o,d.values.length),at=$==null?void 0:$[g.size],et=at?getThumbInBoundsOffset(at,it,g.direction):0;return reactExports.useEffect(()=>{if(b)return d.thumbs.add(b),()=>{d.thumbs.delete(b)}},[b,d.thumbs]),jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${it}% + ${et}px)`},children:[jsxRuntimeExports.jsx(Collection$2.ItemSlot,{scope:e.__scopeSlider,children:jsxRuntimeExports.jsx(Primitive.span,{role:"slider","aria-label":e["aria-label"]||nt,"aria-valuemin":d.min,"aria-valuenow":st,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...c,ref:j,style:st===void 0?{display:"none"}:e.style,onFocus:composeEventHandlers(e.onFocus,()=>{d.valueIndexToChangeRef.current=o})})}),_e&&jsxRuntimeExports.jsx(BubbleInput,{name:a??(d.name?d.name+(d.values.length>1?"[]":""):void 0),form:d.form,value:st},o)]})});SliderThumb.displayName=THUMB_NAME;var BubbleInput=e=>{const{value:i,...s}=e,o=reactExports.useRef(null),a=usePrevious(i);return reactExports.useEffect(()=>{const c=o.current,d=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==i&&b){const _=new Event("input",{bubbles:!0});b.call(c,i),c.dispatchEvent(_)}},[a,i]),jsxRuntimeExports.jsx("input",{style:{display:"none"},...s,ref:o,defaultValue:i})};function getNextSortedValues(e=[],i,s){const o=[...e];return o[s]=i,o.sort((a,c)=>a-c)}function convertValueToPercentage(e,i,s){const c=100/(s-i)*(e-i);return clamp$1(c,[0,100])}function getLabel(e,i){return i>2?`Value ${e+1} of ${i}`:i===2?["Minimum","Maximum"][e]:void 0}function getClosestValueIndex(e,i){if(e.length===1)return 0;const s=e.map(a=>Math.abs(a-i)),o=Math.min(...s);return s.indexOf(o)}function getThumbInBoundsOffset(e,i,s){const o=e/2,c=linearScale([0,50],[0,o]);return(o-c(i)*s)*s}function getStepsBetweenValues(e){return e.slice(0,-1).map((i,s)=>e[s+1]-i)}function hasMinStepsBetweenValues(e,i){if(i>0){const s=getStepsBetweenValues(e);return Math.min(...s)>=i}return!0}function linearScale(e,i){return s=>{if(e[0]===e[1]||i[0]===i[1])return i[0];const o=(i[1]-i[0])/(e[1]-e[0]);return i[0]+o*(s-e[0])}}function getDecimalCount(e){return(String(e).split(".")[1]||"").length}function roundValue(e,i){const s=Math.pow(10,i);return Math.round(e*s)/s}var Root$2=Slider$1,Track=SliderTrack,Range=SliderRange,Thumb=SliderThumb;const Slider=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsxs(Root$2,{ref:s,className:cn("relative flex w-full touch-none select-none items-center",e),...i,children:[jsxRuntimeExports.jsx(Track,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:jsxRuntimeExports.jsx(Range,{className:"absolute h-full bg-primary"})}),jsxRuntimeExports.jsx(Thumb,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Slider.displayName=Root$2.displayName;const LeaderBoard=()=>{const[e,i]=reactExports.useState([]),[s,o]=reactExports.useState(!0),[a,c]=reactExports.useState(1),[d,g]=reactExports.useState({minPoints:0,maxPoints:100,minPrs:0}),[b,_]=reactExports.useState(1),[j,_e]=reactExports.useState(10),[$,st]=reactExports.useState(""),[it,nt]=reactExports.useState(null),at=reactExports.useCallback(ft(dt=>{st(dt),_(1)},300),[]);reactExports.useEffect(()=>{et(),rt()},[b,j,$,d]);const et=async()=>{try{if(Global.user){const dt=await Global.httpGet(`/users/stats/${Global.user.githubId}`);console.log(dt.user),nt({...dt.stats,...dt.user})}}catch(dt){console.error("Error fetching user:",dt)}},rt=async()=>{o(!0);try{let dt=`/leaderboard?page=${b}&limit=${j}`;$&&(dt=`/leaderboard/search?name=${$}&page=${b}&limit=${j}`),(d.minPoints>0||d.maxPoints<100||d.minPrs>0)&&(dt=`/leaderboard/filter?minPoints=${d.minPoints}&maxPoints=${d.maxPoints}&minPrs=${d.minPrs}&page=${b}&limit=${j}`);const ht=await Global.httpGet(dt);i(ht.contributors),c(ht.meta.totalPages)}catch(dt){console.error("Error fetching contributors:",dt)}finally{o(!1)}},tt=dt=>{at(dt)},ot=dt=>{_(dt)},ct=dt=>{_e(parseInt(dt)),_(1)};function ft(dt,ht){let yt;return function(...St){const xt=()=>{clearTimeout(yt),dt(...St)};clearTimeout(yt),yt=setTimeout(xt,ht)}}return jsxRuntimeExports.jsx("div",{className:"min-h-screen font-dm-sans bg-[#1C1C1C] text-white",children:jsxRuntimeExports.jsxs("main",{className:"container mx-auto px-4 py-8 pt-32",children:[it&&jsxRuntimeExports.jsx("div",{className:"bg-[#2A2A2A] rounded-xl shadow-lg p-6 border border-[#3A3A3A] mb-8",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntimeExports.jsx("img",{src:it.avatarUrl||"https://github.com/identicons/jasonlong.png",alt:it.username,className:"w-20 h-20 rounded-full border-4 border-[#FF4545]"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h2",{className:"text-3xl font-bold text-white",children:it.username}),jsxRuntimeExports.jsxs("p",{className:"text-[#FF4545] text-lg",children:["Rank #",it.rank]})]})]}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-3xl font-bold text-[#FF4545]",children:it.points}),jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-300",children:"Points"})]}),jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-3xl font-bold text-[#FFA500]",children:it.totalPRs}),jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-300",children:"Total PRs"})]}),jsxRuntimeExports.jsxs("div",{className:"p-4 rounded-lg bg-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"text-sm font-medium text-gray-300",children:"PRs Status"}),jsxRuntimeExports.jsxs("div",{className:"text-xs mt-1",children:[jsxRuntimeExports.jsxs("span",{className:"text-green-400",children:[it.openPRs," Open"]})," |",jsxRuntimeExports.jsxs("span",{className:"text-blue-400",children:[" ",it.mergedPRs," Merged"]})," |",jsxRuntimeExports.jsxs("span",{className:"text-red-400",children:[" ",it.closedPRs," Closed"]})]})]})]})]})}),jsxRuntimeExports.jsxs("div",{className:"bg-[#2A2A2A] rounded-xl shadow-lg border border-[#3A3A3A]",children:[jsxRuntimeExports.jsx("div",{className:"p-6 border-b border-[#3A3A3A]",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsx("h2",{className:"text-3xl font-bold text-white",children:"Leaderboard"}),jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsxs("div",{className:"relative w-72 md:w-64 ml-auto pr-3",children:[jsxRuntimeExports.jsx(Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),jsxRuntimeExports.jsx(Input,{placeholder:"Search contributors...",className:"pl-10 bg-[#3A3A3A] border-[#4A4A4A] text-white placeholder-gray-400 w-full",onChange:dt=>tt(dt.target.value)})]}),jsxRuntimeExports.jsxs(Sheet,{children:[jsxRuntimeExports.jsx(SheetTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{variant:"outline",size:"icon",className:"bg-[#3A3A3A] border-[#4A4A4A] hover:bg-[#4A4A4A]",children:jsxRuntimeExports.jsx(SlidersHorizontal,{className:"h-5 w-5"})})}),jsxRuntimeExports.jsxs(SheetContent,{className:"bg-[#2A2A2A] text-white",children:[jsxRuntimeExports.jsxs(SheetHeader,{children:[jsxRuntimeExports.jsx(SheetTitle,{className:"text-white",children:"Filters"}),jsxRuntimeExports.jsx(SheetDescription,{className:"text-gray-400",children:"Adjust the filters to refine the leaderboard"})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-6 py-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Points Range"}),jsxRuntimeExports.jsx(Slider,{defaultValue:[d.minPoints,d.maxPoints],max:100,step:1,onValueChange:([dt,ht])=>g(yt=>({...yt,minPoints:dt,maxPoints:ht})),className:"bg-[#3A3A3A]"}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between text-sm text-gray-400",children:[jsxRuntimeExports.jsx("span",{children:d.minPoints}),jsxRuntimeExports.jsx("span",{children:d.maxPoints})]})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Minimum PRs"}),jsxRuntimeExports.jsx(Slider,{defaultValue:[d.minPrs],max:50,step:1,onValueChange:([dt])=>g(ht=>({...ht,minPrs:dt})),className:"bg-[#3A3A3A]"}),jsxRuntimeExports.jsxs("div",{className:"text-sm text-gray-400",children:[d.minPrs," PRs"]})]})]})]})]})]})]})}),jsxRuntimeExports.jsx("div",{className:"overflow-x-auto",children:jsxRuntimeExports.jsxs("table",{className:"w-full",children:[jsxRuntimeExports.jsx("thead",{className:"bg-[#3A3A3A]",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Rank"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"User"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Points"}),jsxRuntimeExports.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-300 uppercase tracking-wider",children:"PRs"})]})}),jsxRuntimeExports.jsx("tbody",{className:"divide-y divide-[#3A3A3A]",children:s?jsxRuntimeExports.jsx("tr",{children:jsxRuntimeExports.jsx("td",{colSpan:"4",className:"px-6 py-4 text-center text-gray-400",children:jsxRuntimeExports.jsx("l-infinity",{size:"55",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"white"})})}):e.map((dt,ht)=>jsxRuntimeExports.jsxs("tr",{className:`hover:bg-[#3A3A3A] transition-colors ${ht%2===0?"bg-[#2A2A2A]":"bg-[#333333]"}`,children:[jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:jsxRuntimeExports.jsx("div",{className:"flex items-center",children:dt.rank<=3?jsxRuntimeExports.jsx(Trophy,{className:`h-6 w-6 ${dt.rank===1?"text-[#FFD700]":dt.rank===2?"text-[#C0C0C0]":"text-[#CD7F32]"}`}):jsxRuntimeExports.jsxs("span",{className:"text-gray-400 font-medium",children:["#",dt.rank]})})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{className:"h-10 w-10 rounded-full border-2 border-[#FF4545]",src:dt.avatarUrl||"https://github.com/identicons/jasonlong.png",alt:""}),jsxRuntimeExports.jsx("div",{className:"ml-4",children:jsxRuntimeExports.jsx("div",{className:"text-sm font-medium text-white",children:dt.githubId})})]})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm",children:jsxRuntimeExports.jsx("div",{className:"text-[#FF4545] font-bold",children:dt.points})}),jsxRuntimeExports.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-5 w-5 text-[#FFA500]"}),jsxRuntimeExports.jsx("span",{className:"text-white font-medium",children:dt.prs.opened+dt.prs.merged+dt.prs.closed})]})})]},dt.githubId))})]})}),jsxRuntimeExports.jsx("div",{className:"p-4 border-t border-[#3A3A3A]",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-4 md:space-y-0",children:[jsxRuntimeExports.jsxs(Select,{value:j.toString(),onValueChange:ct,children:[jsxRuntimeExports.jsx(SelectTrigger,{className:"w-[180px] bg-[#3A3A3A] border-[#4A4A4A] text-white",children:jsxRuntimeExports.jsx(SelectValue,{placeholder:"Select rows per page"})}),jsxRuntimeExports.jsxs(SelectContent,{className:"bg-[#3A3A3A] border-[#4A4A4A] text-white",children:[jsxRuntimeExports.jsx(SelectItem,{value:"5",children:"5 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"10",children:"10 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"20",children:"20 per page"}),jsxRuntimeExports.jsx(SelectItem,{value:"50",children:"50 per page"})]})]}),jsxRuntimeExports.jsx(Pagination,{children:jsxRuntimeExports.jsxs(PaginationContent,{children:[jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationPrevious,{onClick:()=>ot(b-1),disabled:b<=1,className:"bg-[#3A3A3A] border-[#4A4A4A] text-white hover:bg-[#4A4A4A]"})}),[...Array(a)].map((dt,ht)=>jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationLink,{onClick:()=>ot(ht+1),isActive:b===ht+1,className:`${b===ht+1?"bg-[#FF4545] text-white":"bg-[#3A3A3A] text-white"} border-[#4A4A4A] hover:bg-[#4A4A4A]`,children:ht+1})},ht)),jsxRuntimeExports.jsx(PaginationItem,{children:jsxRuntimeExports.jsx(PaginationNext,{onClick:()=>ot(b+1),disabled:b>=a,className:"bg-[#3A3A3A] border-[#4A4A4A] text-white hover:bg-[#4A4A4A]"})})]})})]})})]})]})})};var AVATAR_NAME="Avatar",[createAvatarContext,createAvatarScope]=createContextScope$2(AVATAR_NAME),[AvatarProvider,useAvatarContext]=createAvatarContext(AVATAR_NAME),Avatar$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,...o}=e,[a,c]=reactExports.useState("idle");return jsxRuntimeExports.jsx(AvatarProvider,{scope:s,imageLoadingStatus:a,onImageLoadingStatusChange:c,children:jsxRuntimeExports.jsx(Primitive.span,{...o,ref:i})})});Avatar$1.displayName=AVATAR_NAME;var IMAGE_NAME="AvatarImage",AvatarImage$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,src:o,onLoadingStatusChange:a=()=>{},...c}=e,d=useAvatarContext(IMAGE_NAME,s),g=useImageLoadingStatus(o,c.referrerPolicy),b=useCallbackRef$1(_=>{a(_),d.onImageLoadingStatusChange(_)});return useLayoutEffect2(()=>{g!=="idle"&&b(g)},[g,b]),g==="loaded"?jsxRuntimeExports.jsx(Primitive.img,{...c,ref:i,src:o}):null});AvatarImage$1.displayName=IMAGE_NAME;var FALLBACK_NAME="AvatarFallback",AvatarFallback$1=reactExports.forwardRef((e,i)=>{const{__scopeAvatar:s,delayMs:o,...a}=e,c=useAvatarContext(FALLBACK_NAME,s),[d,g]=reactExports.useState(o===void 0);return reactExports.useEffect(()=>{if(o!==void 0){const b=window.setTimeout(()=>g(!0),o);return()=>window.clearTimeout(b)}},[o]),d&&c.imageLoadingStatus!=="loaded"?jsxRuntimeExports.jsx(Primitive.span,{...a,ref:i}):null});AvatarFallback$1.displayName=FALLBACK_NAME;function useImageLoadingStatus(e,i){const[s,o]=reactExports.useState("idle");return useLayoutEffect2(()=>{if(!e){o("error");return}let a=!0;const c=new window.Image,d=g=>()=>{a&&o(g)};return o("loading"),c.onload=d("loaded"),c.onerror=d("error"),c.src=e,i&&(c.referrerPolicy=i),()=>{a=!1}},[e,i]),s}var Root$1=Avatar$1,Image$1=AvatarImage$1,Fallback=AvatarFallback$1;const Avatar=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Root$1,{ref:s,className:cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...i}));Avatar.displayName=Root$1.displayName;const AvatarImage=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Image$1,{ref:s,className:cn("aspect-square h-full w-full",e),...i}));AvatarImage.displayName=Image$1.displayName;const AvatarFallback=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Fallback,{ref:s,className:cn("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...i}));AvatarFallback.displayName=Fallback.displayName;const StatusBadge=({state:e})=>{const i={merged:"bg-purple-500",open:"bg-green-500",closed:"bg-red-500"};return console.log(e),jsxRuntimeExports.jsx("span",{className:`${i[e]} text-white px-2 py-1 rounded text-sm`,children:e.charAt(0).toUpperCase()+e.slice(1)})};function GitHubProfile(){const[e,i]=React.useState(),{username:s}=useParams();if(reactExports.useEffect(()=>{(async()=>{const{user:o,stats:a}=await Global.httpGet(`/users/stats/${s}`);i({...o,...a}),console.log({...o,...a}),document.title=`Profile | ${o.name}`})()},[s]),e)console.log(e.prs);else return jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center h-screen",children:jsxRuntimeExports.jsx("l-infinity",{size:"55",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"black"})});return jsxRuntimeExports.jsx("div",{className:"min-h-screen bg-black text-white p-8 pt-32",children:jsxRuntimeExports.jsxs("div",{className:"max-w-3xl mx-auto",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[jsxRuntimeExports.jsxs(Avatar,{className:"h-24 w-24",children:[jsxRuntimeExports.jsx(AvatarImage,{src:e.avatar,alt:e.name}),jsxRuntimeExports.jsx(AvatarFallback,{children:e.name.charAt(0)})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl font-bold",children:e.name}),jsxRuntimeExports.jsxs("div",{className:"text-zinc-400 flex items-center gap-2",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-4 w-4"}),e.username]}),jsxRuntimeExports.jsx("p",{className:"text-zinc-400 mt-2",children:e.bio})]})]}),jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-5 gap-4 mb-8",children:[jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.points}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Points"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.mergedPRs}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Merged PRs"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.repositories}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Repositories"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.followers}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Followers"})]}),jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg",children:[jsxRuntimeExports.jsx("div",{className:"text-2xl font-bold",children:e.following}),jsxRuntimeExports.jsx("div",{className:"text-zinc-400",children:"Following"})]})]}),jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Recent Pull Requests"}),jsxRuntimeExports.jsx("div",{className:"space-y-2",children:e.prs.map((o,a)=>jsxRuntimeExports.jsxs("div",{className:"bg-zinc-900 p-4 rounded-lg flex items-center justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntimeExports.jsx(GitPullRequest,{className:"h-5 w-5 text-zinc-400"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"font-medium",children:o.title}),jsxRuntimeExports.jsx("div",{className:"text-sm text-zinc-400",children:o.url})]})]}),jsxRuntimeExports.jsx(StatusBadge,{state:o.state})]},a))})]})})}const logo="/assets/logo-DJb3Nfol.jpeg";function createContextScope(e,i=[]){let s=[];function o(c,d){const g=reactExports.createContext(d),b=s.length;s=[...s,d];function _(_e){const{scope:$,children:st,...it}=_e,nt=($==null?void 0:$[e][b])||g,at=reactExports.useMemo(()=>it,Object.values(it));return jsxRuntimeExports.jsx(nt.Provider,{value:at,children:st})}function j(_e,$){const st=($==null?void 0:$[e][b])||g,it=reactExports.useContext(st);if(it)return it;if(d!==void 0)return d;throw new Error(`\`${_e}\` must be used within \`${c}\``)}return _.displayName=c+"Provider",[_,j]}const a=()=>{const c=s.map(d=>reactExports.createContext(d));return function(g){const b=(g==null?void 0:g[e])||c;return reactExports.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return a.scopeName=e,[o,composeContextScopes(a,...i)]}function composeContextScopes(...e){const i=e[0];if(e.length===1)return i;const s=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const d=o.reduce((g,{useScope:b,scopeName:_})=>{const _e=b(c)[`__scope${_}`];return{...g,..._e}},{});return reactExports.useMemo(()=>({[`__scope${i.scopeName}`]:d}),[d])}};return s.scopeName=i.scopeName,s}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS={bubbles:!1,cancelable:!0},GROUP_NAME$2="RovingFocusGroup",[Collection$1,useCollection$1,createCollectionScope$1]=createCollection(GROUP_NAME$2),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$2,[createCollectionScope$1]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$2),RovingFocusGroup=reactExports.forwardRef((e,i)=>jsxRuntimeExports.jsx(Collection$1.Provider,{scope:e.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(Collection$1.Slot,{scope:e.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(RovingFocusGroupImpl,{...e,ref:i})})}));RovingFocusGroup.displayName=GROUP_NAME$2;var RovingFocusGroupImpl=reactExports.forwardRef((e,i)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:a=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:j=!1,..._e}=e,$=reactExports.useRef(null),st=useComposedRefs(i,$),it=useDirection(c),[nt=null,at]=useControllableState({prop:d,defaultProp:g,onChange:b}),[et,rt]=reactExports.useState(!1),tt=useCallbackRef$1(_),ot=useCollection$1(s),ct=reactExports.useRef(!1),[ft,dt]=reactExports.useState(0);return reactExports.useEffect(()=>{const ht=$.current;if(ht)return ht.addEventListener(ENTRY_FOCUS,tt),()=>ht.removeEventListener(ENTRY_FOCUS,tt)},[tt]),jsxRuntimeExports.jsx(RovingFocusProvider,{scope:s,orientation:o,dir:it,loop:a,currentTabStopId:nt,onItemFocus:reactExports.useCallback(ht=>at(ht),[at]),onItemShiftTab:reactExports.useCallback(()=>rt(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>dt(ht=>ht+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>dt(ht=>ht-1),[]),children:jsxRuntimeExports.jsx(Primitive.div,{tabIndex:et||ft===0?-1:0,"data-orientation":o,..._e,ref:st,style:{outline:"none",...e.style},onMouseDown:composeEventHandlers(e.onMouseDown,()=>{ct.current=!0}),onFocus:composeEventHandlers(e.onFocus,ht=>{const yt=!ct.current;if(ht.target===ht.currentTarget&&yt&&!et){const Et=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS);if(ht.currentTarget.dispatchEvent(Et),!Et.defaultPrevented){const St=ot().filter(pt=>pt.focusable),xt=St.find(pt=>pt.active),kt=St.find(pt=>pt.id===nt),bt=[xt,kt,...St].filter(Boolean).map(pt=>pt.ref.current);focusFirst$1(bt,j)}}ct.current=!1}),onBlur:composeEventHandlers(e.onBlur,()=>rt(!1))})})}),ITEM_NAME$2="RovingFocusGroupItem",RovingFocusGroupItem=reactExports.forwardRef((e,i)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:a=!1,tabStopId:c,...d}=e,g=useId(),b=c||g,_=useRovingFocusContext(ITEM_NAME$2,s),j=_.currentTabStopId===b,_e=useCollection$1(s),{onFocusableItemAdd:$,onFocusableItemRemove:st}=_;return reactExports.useEffect(()=>{if(o)return $(),()=>st()},[o,$,st]),jsxRuntimeExports.jsx(Collection$1.ItemSlot,{scope:s,id:b,focusable:o,active:a,children:jsxRuntimeExports.jsx(Primitive.span,{tabIndex:j?0:-1,"data-orientation":_.orientation,...d,ref:i,onMouseDown:composeEventHandlers(e.onMouseDown,it=>{o?_.onItemFocus(b):it.preventDefault()}),onFocus:composeEventHandlers(e.onFocus,()=>_.onItemFocus(b)),onKeyDown:composeEventHandlers(e.onKeyDown,it=>{if(it.key==="Tab"&&it.shiftKey){_.onItemShiftTab();return}if(it.target!==it.currentTarget)return;const nt=getFocusIntent(it,_.orientation,_.dir);if(nt!==void 0){if(it.metaKey||it.ctrlKey||it.altKey||it.shiftKey)return;it.preventDefault();let et=_e().filter(rt=>rt.focusable).map(rt=>rt.ref.current);if(nt==="last")et.reverse();else if(nt==="prev"||nt==="next"){nt==="prev"&&et.reverse();const rt=et.indexOf(it.currentTarget);et=_.loop?wrapArray$1(et,rt+1):et.slice(rt+1)}setTimeout(()=>focusFirst$1(et))}})})})});RovingFocusGroupItem.displayName=ITEM_NAME$2;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(e,i){return i!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function getFocusIntent(e,i,s){const o=getDirectionAwareKey(e.key,s);if(!(i==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(i==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$1(e,i=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:i}),document.activeElement!==s))return}function wrapArray$1(e,i){return e.map((s,o)=>e[(i+o)%e.length])}var Root=RovingFocusGroup,Item=RovingFocusGroupItem,SELECTION_KEYS=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS,"ArrowRight"],rtl:[...SELECTION_KEYS,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection,useCollection,createCollectionScope]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope,createPopperScope,createRovingFocusGroupScope]),usePopperScope=createPopperScope(),useRovingFocusGroupScope=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:i,open:s=!1,children:o,dir:a,onOpenChange:c,modal:d=!0}=e,g=usePopperScope(i),[b,_]=reactExports.useState(null),j=reactExports.useRef(!1),_e=useCallbackRef$1(c),$=useDirection(a);return reactExports.useEffect(()=>{const st=()=>{j.current=!0,document.addEventListener("pointerdown",it,{capture:!0,once:!0}),document.addEventListener("pointermove",it,{capture:!0,once:!0})},it=()=>j.current=!1;return document.addEventListener("keydown",st,{capture:!0}),()=>{document.removeEventListener("keydown",st,{capture:!0}),document.removeEventListener("pointerdown",it,{capture:!0}),document.removeEventListener("pointermove",it,{capture:!0})}},[]),jsxRuntimeExports.jsx(Root2$2,{...g,children:jsxRuntimeExports.jsx(MenuProvider,{scope:i,open:s,onOpenChange:_e,content:b,onContentChange:_,children:jsxRuntimeExports.jsx(MenuRootProvider,{scope:i,onClose:reactExports.useCallback(()=>_e(!1),[_e]),isUsingKeyboardRef:j,dir:$,modal:d,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME="MenuAnchor",MenuAnchor=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e,a=usePopperScope(s);return jsxRuntimeExports.jsx(Anchor,{...a,...o,ref:i})});MenuAnchor.displayName=ANCHOR_NAME;var PORTAL_NAME$1="MenuPortal",[PortalProvider,usePortalContext]=createMenuContext(PORTAL_NAME$1,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:i,forceMount:s,children:o,container:a}=e,c=useMenuContext(PORTAL_NAME$1,i);return jsxRuntimeExports.jsx(PortalProvider,{scope:i,forceMount:s,children:jsxRuntimeExports.jsx(Presence,{present:s||c.open,children:jsxRuntimeExports.jsx(Portal$3,{asChild:!0,container:a,children:o})})})};MenuPortal.displayName=PORTAL_NAME$1;var CONTENT_NAME$1="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$1),MenuContent=reactExports.forwardRef((e,i)=>{const s=usePortalContext(CONTENT_NAME$1,e.__scopeMenu),{forceMount:o=s.forceMount,...a}=e,c=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),d=useMenuRootContext(CONTENT_NAME$1,e.__scopeMenu);return jsxRuntimeExports.jsx(Collection.Provider,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(Presence,{present:o||c.open,children:jsxRuntimeExports.jsx(Collection.Slot,{scope:e.__scopeMenu,children:d.modal?jsxRuntimeExports.jsx(MenuRootContentModal,{...a,ref:i}):jsxRuntimeExports.jsx(MenuRootContentNonModal,{...a,ref:i})})})})}),MenuRootContentModal=reactExports.forwardRef((e,i)=>{const s=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),o=reactExports.useRef(null),a=useComposedRefs(i,o);return reactExports.useEffect(()=>{const c=o.current;if(c)return hideOthers(c)},[]),jsxRuntimeExports.jsx(MenuContentImpl,{...e,ref:a,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),MenuRootContentNonModal=reactExports.forwardRef((e,i)=>{const s=useMenuContext(CONTENT_NAME$1,e.__scopeMenu);return jsxRuntimeExports.jsx(MenuContentImpl,{...e,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),MenuContentImpl=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:j,onFocusOutside:_e,onInteractOutside:$,onDismiss:st,disableOutsideScroll:it,...nt}=e,at=useMenuContext(CONTENT_NAME$1,s),et=useMenuRootContext(CONTENT_NAME$1,s),rt=usePopperScope(s),tt=useRovingFocusGroupScope(s),ot=useCollection(s),[ct,ft]=reactExports.useState(null),dt=reactExports.useRef(null),ht=useComposedRefs(i,dt,at.onContentChange),yt=reactExports.useRef(0),Et=reactExports.useRef(""),St=reactExports.useRef(0),xt=reactExports.useRef(null),kt=reactExports.useRef("right"),wt=reactExports.useRef(0),bt=it?ReactRemoveScroll:reactExports.Fragment,pt=it?{as:Slot,allowPinchZoom:!0}:void 0,mt=ut=>{var Rt,Nt;const vt=Et.current+ut,gt=ot().filter(Lt=>!Lt.disabled),Ct=document.activeElement,Pt=(Rt=gt.find(Lt=>Lt.ref.current===Ct))==null?void 0:Rt.textValue,At=gt.map(Lt=>Lt.textValue),Mt=getNextMatch(At,vt,Pt),_t=(Nt=gt.find(Lt=>Lt.textValue===Mt))==null?void 0:Nt.ref.current;(function Lt(jt){Et.current=jt,window.clearTimeout(yt.current),jt!==""&&(yt.current=window.setTimeout(()=>Lt(""),1e3))})(vt),_t&&setTimeout(()=>_t.focus())};reactExports.useEffect(()=>()=>window.clearTimeout(yt.current),[]),useFocusGuards();const lt=reactExports.useCallback(ut=>{var gt,Ct;return kt.current===((gt=xt.current)==null?void 0:gt.side)&&isPointerInGraceArea(ut,(Ct=xt.current)==null?void 0:Ct.area)},[]);return jsxRuntimeExports.jsx(MenuContentProvider,{scope:s,searchRef:Et,onItemEnter:reactExports.useCallback(ut=>{lt(ut)&&ut.preventDefault()},[lt]),onItemLeave:reactExports.useCallback(ut=>{var vt;lt(ut)||((vt=dt.current)==null||vt.focus(),ft(null))},[lt]),onTriggerLeave:reactExports.useCallback(ut=>{lt(ut)&&ut.preventDefault()},[lt]),pointerGraceTimerRef:St,onPointerGraceIntentChange:reactExports.useCallback(ut=>{xt.current=ut},[]),children:jsxRuntimeExports.jsx(bt,{...pt,children:jsxRuntimeExports.jsx(FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:composeEventHandlers(c,ut=>{var vt;ut.preventDefault(),(vt=dt.current)==null||vt.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:j,onFocusOutside:_e,onInteractOutside:$,onDismiss:st,children:jsxRuntimeExports.jsx(Root,{asChild:!0,...tt,dir:et.dir,orientation:"vertical",loop:o,currentTabStopId:ct,onCurrentTabStopIdChange:ft,onEntryFocus:composeEventHandlers(b,ut=>{et.isUsingKeyboardRef.current||ut.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntimeExports.jsx(Content$1,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(at.open),"data-radix-menu-content":"",dir:et.dir,...rt,...nt,ref:ht,style:{outline:"none",...nt.style},onKeyDown:composeEventHandlers(nt.onKeyDown,ut=>{const gt=ut.target.closest("[data-radix-menu-content]")===ut.currentTarget,Ct=ut.ctrlKey||ut.altKey||ut.metaKey,Pt=ut.key.length===1;gt&&(ut.key==="Tab"&&ut.preventDefault(),!Ct&&Pt&&mt(ut.key));const At=dt.current;if(ut.target!==At||!FIRST_LAST_KEYS.includes(ut.key))return;ut.preventDefault();const _t=ot().filter(Rt=>!Rt.disabled).map(Rt=>Rt.ref.current);LAST_KEYS.includes(ut.key)&&_t.reverse(),focusFirst(_t)}),onBlur:composeEventHandlers(e.onBlur,ut=>{ut.currentTarget.contains(ut.target)||(window.clearTimeout(yt.current),Et.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(ut=>{const vt=ut.target,gt=wt.current!==ut.clientX;if(ut.currentTarget.contains(vt)&>){const Ct=ut.clientX>wt.current?"right":"left";kt.current=Ct,wt.current=ut.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$1;var GROUP_NAME$1="MenuGroup",MenuGroup=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{role:"group",...o,ref:i})});MenuGroup.displayName=GROUP_NAME$1;var LABEL_NAME$1="MenuLabel",MenuLabel=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{...o,ref:i})});MenuLabel.displayName=LABEL_NAME$1;var ITEM_NAME$1="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=reactExports.forwardRef((e,i)=>{const{disabled:s=!1,onSelect:o,...a}=e,c=reactExports.useRef(null),d=useMenuRootContext(ITEM_NAME$1,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$1,e.__scopeMenu),b=useComposedRefs(i,c),_=reactExports.useRef(!1),j=()=>{const _e=c.current;if(!s&&_e){const $=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});_e.addEventListener(ITEM_SELECT,st=>o==null?void 0:o(st),{once:!0}),dispatchDiscreteCustomEvent(_e,$),$.defaultPrevented?_.current=!1:d.onClose()}};return jsxRuntimeExports.jsx(MenuItemImpl,{...a,ref:b,disabled:s,onClick:composeEventHandlers(e.onClick,j),onPointerDown:_e=>{var $;($=e.onPointerDown)==null||$.call(e,_e),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,_e=>{var $;_.current||($=_e.currentTarget)==null||$.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{const $=g.searchRef.current!=="";s||$&&_e.key===" "||SELECTION_KEYS.includes(_e.key)&&(_e.currentTarget.click(),_e.preventDefault())})})});MenuItem.displayName=ITEM_NAME$1;var MenuItemImpl=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,disabled:o=!1,textValue:a,...c}=e,d=useMenuContentContext(ITEM_NAME$1,s),g=useRovingFocusGroupScope(s),b=reactExports.useRef(null),_=useComposedRefs(i,b),[j,_e]=reactExports.useState(!1),[$,st]=reactExports.useState("");return reactExports.useEffect(()=>{const it=b.current;it&&st((it.textContent??"").trim())},[c.children]),jsxRuntimeExports.jsx(Collection.ItemSlot,{scope:s,disabled:o,textValue:a??$,children:jsxRuntimeExports.jsx(Item,{asChild:!0,...g,focusable:!o,children:jsxRuntimeExports.jsx(Primitive.div,{role:"menuitem","data-highlighted":j?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(it=>{o?d.onItemLeave(it):(d.onItemEnter(it),it.defaultPrevented||it.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(it=>d.onItemLeave(it))),onFocus:composeEventHandlers(e.onFocus,()=>_e(!0)),onBlur:composeEventHandlers(e.onBlur,()=>_e(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=reactExports.forwardRef((e,i)=>{const{checked:s=!1,onCheckedChange:o,...a}=e;return jsxRuntimeExports.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:s,children:jsxRuntimeExports.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate(s)?"mixed":s,...a,ref:i,"data-state":getCheckedState(s),onSelect:composeEventHandlers(a.onSelect,()=>o==null?void 0:o(isIndeterminate(s)?!0:!s),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=reactExports.forwardRef((e,i)=>{const{value:s,onValueChange:o,...a}=e,c=useCallbackRef$1(o);return jsxRuntimeExports.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:s,onValueChange:c,children:jsxRuntimeExports.jsx(MenuGroup,{...a,ref:i})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=reactExports.forwardRef((e,i)=>{const{value:s,...o}=e,a=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),c=s===a.value;return jsxRuntimeExports.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:c,children:jsxRuntimeExports.jsx(MenuItem,{role:"menuitemradio","aria-checked":c,...o,ref:i,"data-state":getCheckedState(c),onSelect:composeEventHandlers(o.onSelect,()=>{var d;return(d=a.onValueChange)==null?void 0:d.call(a,s)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME,{checked:!1}),MenuItemIndicator=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,forceMount:o,...a}=e,c=useItemIndicatorContext(ITEM_INDICATOR_NAME,s);return jsxRuntimeExports.jsx(Presence,{present:o||isIndeterminate(c.checked)||c.checked===!0,children:jsxRuntimeExports.jsx(Primitive.span,{...a,ref:i,"data-state":getCheckedState(c.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME;var SEPARATOR_NAME$1="MenuSeparator",MenuSeparator=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e;return jsxRuntimeExports.jsx(Primitive.div,{role:"separator","aria-orientation":"horizontal",...o,ref:i})});MenuSeparator.displayName=SEPARATOR_NAME$1;var ARROW_NAME$1="MenuArrow",MenuArrow=reactExports.forwardRef((e,i)=>{const{__scopeMenu:s,...o}=e,a=usePopperScope(s);return jsxRuntimeExports.jsx(Arrow,{...a,...o,ref:i})});MenuArrow.displayName=ARROW_NAME$1;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=reactExports.forwardRef((e,i)=>{const s=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),a=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),c=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=reactExports.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=c,_={__scopeMenu:e.__scopeMenu},j=reactExports.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return reactExports.useEffect(()=>j,[j]),reactExports.useEffect(()=>{const _e=g.current;return()=>{window.clearTimeout(_e),b(null)}},[g,b]),jsxRuntimeExports.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntimeExports.jsx(MenuItemImpl,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":a.contentId,"data-state":getOpenState(s.open),...e,ref:composeRefs(i,a.onTriggerChange),onClick:_e=>{var $;($=e.onClick)==null||$.call(e,_e),!(e.disabled||_e.defaultPrevented)&&(_e.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(_e=>{c.onItemEnter(_e),!_e.defaultPrevented&&!e.disabled&&!s.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{s.onOpenChange(!0),j()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(_e=>{var st,it;j();const $=(st=s.content)==null?void 0:st.getBoundingClientRect();if($){const nt=(it=s.content)==null?void 0:it.dataset.side,at=nt==="right",et=at?-5:5,rt=$[at?"left":"right"],tt=$[at?"right":"left"];c.onPointerGraceIntentChange({area:[{x:_e.clientX+et,y:_e.clientY},{x:rt,y:$.top},{x:tt,y:$.top},{x:tt,y:$.bottom},{x:rt,y:$.bottom}],side:nt}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(_e),_e.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,_e=>{var st;const $=c.searchRef.current!=="";e.disabled||$&&_e.key===" "||SUB_OPEN_KEYS[o.dir].includes(_e.key)&&(s.onOpenChange(!0),(st=s.content)==null||st.focus(),_e.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=reactExports.forwardRef((e,i)=>{const s=usePortalContext(CONTENT_NAME$1,e.__scopeMenu),{forceMount:o=s.forceMount,...a}=e,c=useMenuContext(CONTENT_NAME$1,e.__scopeMenu),d=useMenuRootContext(CONTENT_NAME$1,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=reactExports.useRef(null),_=useComposedRefs(i,b);return jsxRuntimeExports.jsx(Collection.Provider,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(Presence,{present:o||c.open,children:jsxRuntimeExports.jsx(Collection.Slot,{scope:e.__scopeMenu,children:jsxRuntimeExports.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...a,ref:_,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:j=>{var _e;d.isUsingKeyboardRef.current&&((_e=b.current)==null||_e.focus()),j.preventDefault()},onCloseAutoFocus:j=>j.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,j=>{j.target!==g.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,j=>{d.onClose(),j.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,j=>{var st;const _e=j.currentTarget.contains(j.target),$=SUB_CLOSE_KEYS[d.dir].includes(j.key);_e&&$&&(c.onOpenChange(!1),(st=g.trigger)==null||st.focus(),j.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst(e){const i=document.activeElement;for(const s of e)if(s===i||(s.focus(),document.activeElement!==i))return}function wrapArray(e,i){return e.map((s,o)=>e[(i+o)%e.length])}function getNextMatch(e,i,s){const a=i.length>1&&Array.from(i).every(_=>_===i[0])?i[0]:i,c=s?e.indexOf(s):-1;let d=wrapArray(e,Math.max(c,0));a.length===1&&(d=d.filter(_=>_!==s));const b=d.find(_=>_.toLowerCase().startsWith(a.toLowerCase()));return b!==s?b:void 0}function isPointInPolygon(e,i){const{x:s,y:o}=e;let a=!1;for(let c=0,d=i.length-1;co!=j>o&&s<(_-g)*(o-b)/(j-b)+g&&(a=!a)}return a}function isPointerInGraceArea(e,i){if(!i)return!1;const s={x:e.clientX,y:e.clientY};return isPointInPolygon(s,i)}function whenMouse(e){return i=>i.pointerType==="mouse"?e(i):void 0}var Root3=Menu,Anchor2=MenuAnchor,Portal=MenuPortal,Content2$1=MenuContent,Group=MenuGroup,Label=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator=MenuItemIndicator,Separator=MenuSeparator,Arrow2=MenuArrow,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext,createDropdownMenuScope]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:i,children:s,dir:o,open:a,defaultOpen:c,onOpenChange:d,modal:g=!0}=e,b=useMenuScope(i),_=reactExports.useRef(null),[j=!1,_e]=useControllableState({prop:a,defaultProp:c,onChange:d});return jsxRuntimeExports.jsx(DropdownMenuProvider,{scope:i,triggerId:useId(),triggerRef:_,contentId:useId(),open:j,onOpenChange:_e,onOpenToggle:reactExports.useCallback(()=>_e($=>!$),[_e]),modal:g,children:jsxRuntimeExports.jsx(Root3,{...b,open:j,onOpenChange:_e,dir:o,modal:g,children:s})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME="DropdownMenuTrigger",DropdownMenuTrigger$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...a}=e,c=useDropdownMenuContext(TRIGGER_NAME,s),d=useMenuScope(s);return jsxRuntimeExports.jsx(Anchor2,{asChild:!0,...d,children:jsxRuntimeExports.jsx(Primitive.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:composeRefs(i,c.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(c.onOpenToggle(),c.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&c.onOpenToggle(),g.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME;var PORTAL_NAME="DropdownMenuPortal",DropdownMenuPortal=e=>{const{__scopeDropdownMenu:i,...s}=e,o=useMenuScope(i);return jsxRuntimeExports.jsx(Portal,{...o,...s})};DropdownMenuPortal.displayName=PORTAL_NAME;var CONTENT_NAME="DropdownMenuContent",DropdownMenuContent$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useDropdownMenuContext(CONTENT_NAME,s),c=useMenuScope(s),d=reactExports.useRef(!1);return jsxRuntimeExports.jsx(Content2$1,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...o,ref:i,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;d.current||(b=a.triggerRef.current)==null||b.focus(),d.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,j=b.button===2||_;(!a.modal||j)&&(d.current=!0)}),style:{...e.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME;var GROUP_NAME="DropdownMenuGroup",DropdownMenuGroup=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Group,{...a,...o,ref:i})});DropdownMenuGroup.displayName=GROUP_NAME;var LABEL_NAME="DropdownMenuLabel",DropdownMenuLabel$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Label,{...a,...o,ref:i})});DropdownMenuLabel$1.displayName=LABEL_NAME;var ITEM_NAME="DropdownMenuItem",DropdownMenuItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Item2$1,{...a,...o,ref:i})});DropdownMenuItem$1.displayName=ITEM_NAME;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(CheckboxItem,{...a,...o,ref:i})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(RadioGroup,{...a,...o,ref:i})});DropdownMenuRadioGroup.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(RadioItem,{...a,...o,ref:i})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME="DropdownMenuItemIndicator",DropdownMenuItemIndicator=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(ItemIndicator,{...a,...o,ref:i})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME;var SEPARATOR_NAME="DropdownMenuSeparator",DropdownMenuSeparator$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Separator,{...a,...o,ref:i})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME="DropdownMenuArrow",DropdownMenuArrow=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(Arrow2,{...a,...o,ref:i})});DropdownMenuArrow.displayName=ARROW_NAME;var SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(SubTrigger,{...a,...o,ref:i})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=reactExports.forwardRef((e,i)=>{const{__scopeDropdownMenu:s,...o}=e,a=useMenuScope(s);return jsxRuntimeExports.jsx(SubContent,{...a,...o,ref:i,style:{...e.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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2=DropdownMenu$1,Trigger=DropdownMenuTrigger$1,Portal2=DropdownMenuPortal,Content2=DropdownMenuContent$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2,DropdownMenuTrigger=Trigger,DropdownMenuSubTrigger=reactExports.forwardRef(({className:e,inset:i,children:s,...o},a)=>jsxRuntimeExports.jsxs(SubTrigger2,{ref:a,className:cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",i&&"pl-8",e),...o,children:[s,jsxRuntimeExports.jsx(ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(SubContent2,{ref:s,className:cn("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=reactExports.forwardRef(({className:e,sideOffset:i=4,...s},o)=>jsxRuntimeExports.jsx(Portal2,{children:jsxRuntimeExports.jsx(Content2,{ref:o,sideOffset:i,className:cn("z-50 min-w-[8rem] overflow-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",e),...s})}));DropdownMenuContent.displayName=Content2.displayName;const DropdownMenuItem=reactExports.forwardRef(({className:e,inset:i,...s},o)=>jsxRuntimeExports.jsx(Item2,{ref:o,className:cn("relative flex cursor-default select-none items-center 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",i&&"pl-8",e),...s}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=reactExports.forwardRef(({className:e,children:i,checked:s,...o},a)=>jsxRuntimeExports.jsxs(CheckboxItem2,{ref:a,className:cn("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",e),checked:s,...o,children:[jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntimeExports.jsx(ItemIndicator2,{children:jsxRuntimeExports.jsx(CheckIcon,{className:"h-4 w-4"})})}),i]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=reactExports.forwardRef(({className:e,children:i,...s},o)=>jsxRuntimeExports.jsxs(RadioItem2,{ref:o,className:cn("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",e),...s,children:[jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntimeExports.jsx(ItemIndicator2,{children:jsxRuntimeExports.jsx(DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),i]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=reactExports.forwardRef(({className:e,inset:i,...s},o)=>jsxRuntimeExports.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",i&&"pl-8",e),...s}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=reactExports.forwardRef(({className:e,...i},s)=>jsxRuntimeExports.jsx(Separator2,{ref:s,className:cn("-mx-1 my-1 h-px bg-muted",e),...i}));DropdownMenuSeparator.displayName=Separator2.displayName;function RiMenu3Fill(e){return GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3 4H21V6H3V4ZM9 11H21V13H9V11ZM3 18H21V20H3V18Z"},child:[]}]})(e)}function IoMdClose(e){return GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"},child:[]}]})(e)}const Navbar=({onContactClick:e,onQandAClick:i,onStatusClick:s,onProjectsClick:o,onLeaderboardClick:a})=>{const[c,d]=reactExports.useState(!1),g=()=>{window.location.href="http://37.27.81.8:3005/api/auth/github"},b=async()=>{try{await Global.httpPost("/auth/logout"),Global.user=null,window.location.reload()}catch(j){console.error(j)}},_=()=>{d(!c)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("nav",{className:"bg-[rgba(30,30,30,0.8)] backdrop-blur-lg p-4 fixed top-0 left-0 right-0 z-50 flex justify-between items-center shadow-lg",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{className:"w-10 h-10 rounded-full mr-4 transition-transform duration-300 ease-in-out hover:scale-110",src:logo,alt:"Logo"}),jsxRuntimeExports.jsx("a",{href:"/",className:"text-red-500 font-dm-sans text-2xl font-bold tracking-wide",children:"Club Gamma"})]}),jsxRuntimeExports.jsxs("div",{className:"hidden lg:flex gap-12 font-montserrat text-lg",children:[jsxRuntimeExports.jsx("a",{href:"/",className:"text-white hover:text-red-500 transition-all duration-300",children:"Home"}),jsxRuntimeExports.jsx("button",{onClick:i,className:"text-white hover:text-red-500 transition-all duration-300",children:"Q&A"}),jsxRuntimeExports.jsx("button",{onClick:s,className:"text-white hover:text-red-500 transition-all duration-300",children:"Stats"}),jsxRuntimeExports.jsx("button",{onClick:o,className:"text-white hover:text-red-500 transition-all duration-300",children:"Projects"}),jsxRuntimeExports.jsx("button",{onClick:e,className:"text-white hover:text-red-500 transition-all duration-300",children:"Contact"}),jsxRuntimeExports.jsx(Link,{to:"/leaderboard",className:"text-white hover:text-red-500 transition-all duration-300",children:"Leaderboard"})," "]}),jsxRuntimeExports.jsx("div",{className:"hidden lg:flex",children:Global.user?jsxRuntimeExports.jsxs(DropdownMenu,{children:[jsxRuntimeExports.jsx(DropdownMenuTrigger,{asChild:!0,children:jsxRuntimeExports.jsxs(Button,{variant:"outline",className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx(User,{className:"h-4 w-4"}),Global.user.name.split(" ")[0]]})}),jsxRuntimeExports.jsxs(DropdownMenuContent,{align:"end",children:[jsxRuntimeExports.jsx(Link,{to:`/profile/${Global.user.githubId}`,children:jsxRuntimeExports.jsx(DropdownMenuItem,{children:"Profile"})}),jsxRuntimeExports.jsx(DropdownMenuItem,{onClick:b,children:"Logout"})]})]}):jsxRuntimeExports.jsxs("button",{onClick:g,className:"flex font-dm-sans items-center bg-[#181717] text-white py-2 px-5 rounded-md font-bold shadow-lg hover:shadow-none transition-all duration-500",children:[jsxRuntimeExports.jsx("svg",{className:"w-6 h-6 mr-2",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{d:"M12,2A10,10,0,0,0,8.84,21.5c.5.08.66-.23.66-.5V19.31C6.73,19.91,6.14,18,6.14,18A2.69,2.69,0,0,0,5,16.5c-.91-.62.07-.6.07-.6a2.1,2.1,0,0,1,1.53,1,2.15,2.15,0,0,0,2.91.83,2.16,2.16,0,0,1,.63-1.34C8,16.17,5.62,15.31,5.62,11.5a3.87,3.87,0,0,1,1-2.71,3.58,3.58,0,0,1,.1-2.64s.84-.27,2.75,1a9.63,9.63,0,0,1,5,0c1.91-1.29,2.75-1,2.75-1a3.58,3.58,0,0,1,.1,2.64,3.87,3.87,0,0,1,1,2.71c0,3.82-2.34,4.66-4.57,4.91a2.39,2.39,0,0,1,.69,1.85V21c0,.27.16.59.67.5A10,10,0,0,0,12,2Z"})}),"Continue with GitHub"]})}),jsxRuntimeExports.jsx("div",{className:"lg:hidden",children:jsxRuntimeExports.jsx("button",{className:"text-white bg-transparent border-none",onClick:_,children:c?jsxRuntimeExports.jsx(IoMdClose,{size:24}):jsxRuntimeExports.jsx(RiMenu3Fill,{size:24})})})]}),jsxRuntimeExports.jsx("div",{className:`fixed inset-y-0 left-0 font-dm-sans w-64 bg-gray-900 transform ${c?"translate-x-0":"-translate-x-full"} transition-transform duration-300 ease-in-out z-50 lg:hidden`,children:jsxRuntimeExports.jsxs("div",{className:"p-4",children:[jsxRuntimeExports.jsx("img",{className:"w-10 h-10 rounded-full mb-4",src:logo,alt:"Logo"}),jsxRuntimeExports.jsxs("nav",{className:"space-y-6",children:[jsxRuntimeExports.jsx("a",{href:"/",className:"text-white block",children:"Home"}),jsxRuntimeExports.jsx("button",{onClick:i,className:"text-white block",children:"Q&A"}),jsxRuntimeExports.jsx("button",{onClick:s,className:"text-white block",children:"Stats"}),jsxRuntimeExports.jsx("button",{onClick:o,className:"text-white block",children:"Projects"}),jsxRuntimeExports.jsx("button",{onClick:e,className:"text-white block",children:"Contact"}),jsxRuntimeExports.jsx(Link,{to:"/leaderboard",className:"text-white block",children:"Leaderboard"})," ",jsxRuntimeExports.jsx("hr",{className:"border-gray-700"}),Global.user?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Link,{to:`/profile/${Global.user.githubId}`,className:"text-white block",children:"Profile"}),jsxRuntimeExports.jsx("button",{onClick:b,className:"text-white block",children:"Logout"})]}):jsxRuntimeExports.jsx(Button,{onClick:g,className:"text-white bg-red-500 block",children:"Continue with GitHub"})]})]})}),jsxRuntimeExports.jsx(Outlet,{})]})};function App(){const[e,i]=reactExports.useState(!1),s=useNavigate(),o=useLocation(),a=c=>{if(o.pathname!=="/")s("/",{state:{scrollTo:c}});else{const d=document.getElementById(c);d==null||d.scrollIntoView({behavior:"smooth"})}};return reactExports.useEffect(()=>{(async()=>{try{Global.user=await Global.getUser(),i(!0)}catch(c){console.error(c),i(!0)}})()},[]),e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Routes,{children:jsxRuntimeExports.jsxs(Route,{path:"/",element:jsxRuntimeExports.jsx(Navbar,{onContactClick:()=>a("contact"),onQandAClick:()=>a("q&a"),onStatusClick:()=>a("stat"),onProjectsClick:()=>a("project")}),children:[jsxRuntimeExports.jsx(Route,{path:"",element:jsxRuntimeExports.jsx(Home,{})}),jsxRuntimeExports.jsx(Route,{path:"/leaderboard",element:jsxRuntimeExports.jsx(LeaderBoard,{})}),jsxRuntimeExports.jsx(Route,{path:"/profile/:username",element:jsxRuntimeExports.jsx(GitHubProfile,{})})]})})}):jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-gradient-to-br from-[#1e1e1e] to-[#4e3535]",children:jsxRuntimeExports.jsx("l-infinity",{size:"80",stroke:"4","stroke-length":"0.15","bg-opacity":"0.1",speed:"1.3",color:"white"})})}createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(App,{})})})); diff --git a/index.html b/index.html index ea06dbe..e21b355 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,11 @@ - + Club Gamma - - + +