1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a1dd9581-ecad-4d0a-9d9b-d3aff70bf468",e._sentryDebugIdIdentifier="sentry-dbid-a1dd9581-ecad-4d0a-9d9b-d3aff70bf468")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1426],{41426:function(e,t,s){s.d(t,{yW:function(){return k},xG:function(){return S},Oo:function(){return j},dA:function(){return T},vQ:function(){return P},H5:function(){return _},Zn:function(){return E},zd:function(){return L},fs:function(){return A}});var a=s(68830),n=s(91958),r=s(78749);function i(e){let{difficulty:t,actionType:s,repository:i,tokenSymbol:l,buttonText:o,onViewMission:c}=e,d="Any GitHub Repository"===i||"any"===i||i.toLowerCase().includes("any repository");return(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(r.Ct,{variant:"beginner"===t?"default":"intermediate"===t?"secondary":"destructive",children:t.charAt(0).toUpperCase()+t.slice(1)}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(r.zx,{size:"sm",variant:"outline",className:"px-4 py-2 text-sm font-medium",asChild:!0,children:(0,a.jsx)(n.default,{href:"/how-to-earn?action=".concat(encodeURIComponent(s),"&repo=").concat(encodeURIComponent(i),"&ticker=").concat(encodeURIComponent(l)),children:"How to Earn"})}),!d&&(0,a.jsx)(r.zx,{size:"sm",onClick:c,className:"px-4 py-2 text-sm font-medium","aria-label":"".concat(o," for the mission"),children:o})]})]})}var l=s(23947);let o="h-5 w-5";function c(){return(0,a.jsx)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"})})}function d(){return(0,a.jsx)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"})})}function u(){return(0,a.jsxs)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:[(0,a.jsx)("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),(0,a.jsx)("path",{d:"M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"})]})}function m(){return(0,a.jsx)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0113.25 12H9.06l-2.573 2.573A1.75 1.75 0 014 13.543V12H2.75A1.75 1.75 0 011 10.25V2.75zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25H4a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h4.25a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25H2.75z"})})}function p(){return(0,a.jsx)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M10.5 7.75a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm1.43.75a4.002 4.002 0 01-7.86 0H.75a.75.75 0 110-1.5h3.32a4.001 4.001 0 017.86 0h3.32a.75.75 0 110 1.5h-3.32z"})})}function h(){return(0,a.jsx)("svg",{className:o,fill:"currentColor",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}function x(e){let{className:t="h-4 w-4"}=e;return(0,a.jsx)("div",{className:"animate-spin rounded-full border-2 border-current border-t-transparent ".concat(t)})}function f(e){let{className:t="h-3.5 w-3.5"}=e;return(0,a.jsxs)("svg",{className:t,fill:"currentColor",viewBox:"0 0 16 16",children:[(0,a.jsx)("path",{d:"M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"}),(0,a.jsx)("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"})]})}function g(e){let{actionType:t}=e;return(0,a.jsx)("div",{className:"border-primary/30 bg-primary/20 text-primary flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border",children:(()=>{switch(t){case"OPEN A PR":return(0,a.jsx)(c,{});case"STAR":return(0,a.jsx)(d,{});case"CREATE ISSUE":return(0,a.jsx)(u,{});case"COMMENT IN AN ISSUE":return(0,a.jsx)(m,{});case"MERGE A PR":return(0,a.jsx)(p,{});default:return(0,a.jsx)(h,{})}})()})}function v(e){let{techStack:t,timeAgo:s}=e;return t&&t.length>0?(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[t.map(e=>(0,a.jsx)(r.Ct,{variant:"secondary",children:e},e)),(0,a.jsxs)("div",{className:"text-muted-foreground ml-4 flex items-center gap-1.5 text-sm font-medium",children:[(0,a.jsx)(f,{}),(0,a.jsx)("span",{children:s})]})]}):(0,a.jsx)("div",{className:"mb-4 flex items-center gap-1.5",children:(0,a.jsxs)("div",{className:"text-muted-foreground flex items-center gap-1.5 text-sm font-medium",children:[(0,a.jsx)(f,{}),(0,a.jsx)("span",{children:s})]})})}var b=s(12990);function y(e){let{actionType:t,repository:s,gitUrl:r,reward:i,tokenSymbol:l}=e,o="Any GitHub Repository"===s||"any"===s||s.toLowerCase().includes("any repository");return(0,a.jsx)(n.default,{href:"/how-to-earn?action=".concat(encodeURIComponent(t),"&repo=").concat(encodeURIComponent(s),"&ticker=").concat(encodeURIComponent(l)),className:"block",children:(0,a.jsxs)("div",{className:"text-foreground mb-4 text-base leading-relaxed font-medium transition-colors hover:underline",children:["MERGE A PR"===t?"If someone":"If you"," ",(0,a.jsx)(b.Tu,{actionType:t,className:"align-middle"})," ","MERGE A PR"===t?"you opened into":"in"," ",o?(0,a.jsx)("span",{className:"text-foreground font-semibold",children:"any GitHub repository"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.fV,{gitUrl:r||"https://github.com/".concat(s),fullName:s,className:"align-middle"}),"MERGE A PR"===t&&","]})," ","you earn ",(0,a.jsx)(b.Ox,{reward:i,className:"align-middle"})]})})}function j(e){let{mission:t,onViewMission:s,className:n}=e,o=(()=>{switch(t.actionType){case"OPEN A PR":default:return"pull_request.opened";case"MERGE A PR":return"pull_request.closed";case"CREATE ISSUE":return"issues.opened";case"COMMENT IN AN ISSUE":return"issue_comment.created";case"STAR":return"star.created"}})(),c="issue_comment.created"===o,d=(0,l.Kh)(o,c?t.issueNumber:void 0);return(0,a.jsx)(r.Zb,{className:"bg-card border-border/50 hover:border-primary/50 group border-2 shadow-sm transition-all duration-300 hover:shadow-md ".concat(n||""),role:"article",children:(0,a.jsxs)(r.aY,{className:"p-6",children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(g,{actionType:t.actionType}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)(y,{actionType:t.actionType,repository:t.repository,gitUrl:t.gitUrl,reward:t.reward,tokenSymbol:t.tokenSymbol}),(0,a.jsx)(v,{techStack:t.techStack,timeAgo:t.timeAgo})]})]})}),(0,a.jsx)(i,{difficulty:t.difficulty,actionType:t.actionType,repository:t.repository,tokenSymbol:t.tokenSymbol,buttonText:"Repository"===d?"Go to GitHub":"Go to ".concat(d),onViewMission:()=>{s?s(t):t.url?window.open(t.url,"_blank","noopener,noreferrer"):t.gitUrl?window.open(t.gitUrl,"_blank","noopener,noreferrer"):"Any GitHub Repository"!==t.repository&&window.open("https://github.com/".concat(t.repository),"_blank","noopener,noreferrer")}})]})})}let N=[{value:"beginner",label:"Beginner"},{value:"intermediate",label:"Intermediate"},{value:"advanced",label:"Advanced"}],w=[{value:"pull_request.opened",label:"Pull Request Opened"},{value:"pull_request.closed",label:"Pull Request Merged"},{value:"pull_request_review.submitted",label:"Pull Request Review Submitted"},{value:"pull_request.review_requested",label:"Pull Request Review Requested"},{value:"issues.opened",label:"Issues Opened"},{value:"issue_comment.created",label:"Issue Comment Created"},{value:"star.created",label:"Star Created"}],R=[{value:"JavaScript",label:"JavaScript"},{value:"TypeScript",label:"TypeScript"},{value:"Python",label:"Python"},{value:"Java",label:"Java"},{value:"Go",label:"Go"},{value:"Rust",label:"Rust"},{value:"C++",label:"C++"},{value:"C#",label:"C#"},{value:"PHP",label:"PHP"},{value:"Ruby",label:"Ruby"},{value:"Swift",label:"Swift"},{value:"Kotlin",label:"Kotlin"}],C=[{label:"Relevance",value:"createdAt"},{label:"Date",value:"updatedAt"},{label:"Reward",value:"reward"}];function k(e){let{currentPage:t,limit:s,totalResults:n,displayedResults:i,sortBy:l,onSortChange:o}=e,c=0===n?0:(t-1)*s+1,d=Math.min(t*s,n);return(0,a.jsxs)("div",{className:"mb-8 flex items-center justify-between",children:[(0,a.jsxs)("h2",{className:"text-foreground text-2xl font-semibold",children:["Showing ",i>0?"".concat(c,"-").concat(d):"0"," of ",n," ","missions"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-muted-foreground text-sm font-medium",children:"Sort By"}),(0,a.jsxs)(r.OC,{value:l,onValueChange:e=>{let t=C.find(t=>t.value===e);t&&o(t)},children:[(0,a.jsx)(r.i4,{className:"min-w-32 text-sm font-medium shadow-none",children:(0,a.jsx)(r.ki,{})}),(0,a.jsx)(r.Bw,{children:C.map(e=>(0,a.jsx)(r.Ql,{value:e.value,children:e.label},e.value))})]})]})]})}function S(e){let{tempFilters:t,onTempFiltersChange:s,onApplyFilters:n,onResetFilters:i}=e,l=(e,a)=>{let n=t[e];s({[e]:n.includes(a)?n.filter(e=>e!==a):[...n,a]})};return(0,a.jsxs)("div",{className:"from-card to-card/50 border-border/50 space-y-6 rounded-lg border-2 bg-gradient-to-br p-6 shadow-md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-foreground text-lg font-semibold",children:"Filter Missions"}),(0,a.jsx)(r.zx,{variant:"ghost",size:"sm",onClick:i,className:"text-muted-foreground",children:"Clear all"})]}),(0,a.jsx)(b.G6,{title:"Difficulty Level",items:N,selectedValues:t.classification,onToggle:e=>l("classification",e)}),(0,a.jsx)(b.G6,{title:"Action Type",items:w,selectedValues:t.action,onToggle:e=>l("action",e)}),(0,a.jsx)(b.G6,{title:"Programming Language",items:R,selectedValues:t.language,onToggle:e=>l("language",e)}),(0,a.jsxs)("div",{className:"space-y-2 pt-4",children:[(0,a.jsx)(r.zx,{onClick:n,className:"w-full",children:"Apply Filters"}),(0,a.jsx)(r.zx,{variant:"outline",onClick:i,className:"w-full",children:"Reset Filters"})]})]})}function _(e){let{currentPage:t,totalPages:s,hasNext:n,hasPrev:i,isRefetching:l,onPageChange:o,onPreviousPage:c,onNextPage:d}=e;return(0,a.jsxs)("div",{className:"mt-8 flex items-center justify-center gap-2",children:[(0,a.jsx)(r.zx,{variant:"outline",size:"sm",onClick:c,disabled:!i||l,children:"Previous"}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:Array.from({length:Math.min(5,s)},(e,n)=>{let i=Math.max(1,Math.min(s-4,Math.max(1,t-2)))+n;return i>s?null:(0,a.jsx)(r.zx,{size:"sm",variant:t===i?"default":"outline",onClick:()=>o(i),disabled:l,children:i},i)})}),(0,a.jsx)(r.zx,{variant:"outline",size:"sm",onClick:d,disabled:!n||l,children:"Next"})]})}function A(e){let{message:t="Refreshing missions..."}=e;return(0,a.jsx)("div",{className:"mt-4 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[(0,a.jsx)(x,{}),t]})})}function P(){return(0,a.jsx)("div",{className:"space-y-6",children:Array.from({length:6},(e,t)=>(0,a.jsx)("div",{className:"bg-card animate-pulse rounded-lg border p-6",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"bg-muted h-10 w-10 flex-shrink-0 rounded-full"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"bg-muted h-4 w-3/4 rounded"}),(0,a.jsx)("div",{className:"bg-muted h-4 w-full rounded"}
1),(0,a.jsx)("div",{className:"bg-muted h-4 w-1/2 rounded"})]}),(0,a.jsxs)("div",{className:"ml-13 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"bg-muted h-6 w-16 rounded-full"}),(0,a.jsx)("div",{className:"bg-muted h-6 w-20 rounded-full"}),(0,a.jsx)("div",{className:"bg-muted h-4 w-24 rounded"})]}),(0,a.jsx)("div",{className:"ml-13",children:(0,a.jsx)("div",{className:"bg-muted h-6 w-20 rounded-full"})}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 pt-1",children:[(0,a.jsx)("div",{className:"bg-muted h-8 w-24 rounded"}),(0,a.jsx)("div",{className:"bg-muted h-8 w-28 rounded"})]})]})]})},"skeleton-".concat(t)))})}function E(e){let{appliedSearch:t,hasFilters:s,onClearSearch:n,onClearFilters:i}=e,l="There are no missions available at the moment.";return t?l='No missions found matching "'.concat(t,'". Try a different search term.'):s&&(l="Try adjusting your filters to see more missions."),(0,a.jsxs)("div",{className:"py-12 text-center",children:[(0,a.jsx)("h3",{className:"text-foreground mb-2 text-xl font-semibold",children:"No missions found"}),(0,a.jsx)("p",{className:"text-muted-foreground mb-4",children:l}),(t||s)&&(0,a.jsxs)("div",{className:"flex justify-center gap-3",children:[t&&n&&(0,a.jsx)(r.zx,{onClick:n,children:"Clear Search"}),s&&i&&(0,a.jsx)(r.zx,{onClick:i,children:"Clear Filters"})]})]})}function T(e){let{errorMessage:t,onRetry:s,onResetFilters:n}=e;return(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.bZ,{variant:"destructive",title:"Failed to load missions",className:"mb-4"}),(0,a.jsx)("p",{className:"text-muted-foreground mb-4 text-sm",children:t||"There was an error loading the missions. Please try again."})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(r.zx,{size:"sm",onClick:s,children:"Try Again"}),(0,a.jsx)(r.zx,{size:"sm",variant:"outline",onClick:n,children:"Reset Filters"})]})]})}var M=s(69315);function I(e){let{missions:t,filteredMissions:s,isInitialLoading:n,isRefetching:r,showError:i,errorMessage:l,appliedSearch:o,hasFilters:c,pagination:d,currentPage:u,onMissionClick:m,onPageChange:p,onPreviousPage:h,onNextPage:x,onClearSearch:f,onClearFilters:g,onRetry:v}=e;return n?(0,a.jsx)(P,{}):i?(0,a.jsx)(T,{errorMessage:l,onRetry:v,onResetFilters:g}):0===s.length?(0,a.jsx)(E,{appliedSearch:o,hasFilters:c,onClearSearch:f,onClearFilters:g}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"space-y-4",children:s.map(e=>(0,a.jsx)(j,{mission:(0,M.lj)(e),onViewMission:m},e.id))}),t.length>0&&d&&(0,a.jsx)(_,{currentPage:u,totalPages:d.pages,hasNext:d.hasNext,hasPrev:d.hasPrev,isRefetching:r,onPageChange:p,onPreviousPage:h,onNextPage:x}),r&&(0,a.jsx)(A,{})]})}var z=s(67290);function Z(e){let{totalMissions:t}=e;return(0,a.jsx)(z.r,{breadcrumbs:["Cha-Ching","Missions"],title:(0,a.jsxs)(a.Fragment,{children:[t," ",(0,a.jsx)("span",{className:"text-primary",children:"missions"})," available"]}),subtitle:"Complete missions across epochs to earn ERC-1155 tokens. Star repos, submit PRs, and contribute to projects to get rewarded."})}var q=s(36624);function U(e){let{searchQuery:t,onSearchChange:s,onSearch:n,placeholder:i="Epoch name, ID, $CHING token, GitHub organization, etc"}=e;return(0,a.jsx)("div",{className:"relative z-20 -mt-10",children:(0,a.jsx)(r.W2,{className:"max-w-5xl",children:(0,a.jsx)("div",{className:"dark:bg-card/95 dark:border-border/50 rounded-lg border border-gray-200 bg-white shadow-2xl",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 px-6 py-4",children:[(0,a.jsx)(q.Z,{className:"text-muted-foreground h-5 w-5 flex-shrink-0"}),(0,a.jsx)(r.II,{type:"text",placeholder:i,value:t,onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"===e.key&&n()},className:"border-0 bg-transparent p-0 text-base shadow-none focus-visible:ring-0 focus-visible:ring-offset-0"}),(0,a.jsx)(r.zx,{onClick:n,size:"lg",children:"Search"})]})})})})}var F=s(45085),O=s(79618);function L(e){let{className:t="",showHero:s=!0}=e,{filters:n,tempFilters:i,sortBy:l,currentPage:o,apiFilters:c,handleSortChange:d,handlePageChange:u,handlePreviousPage:m,handleNextPage:p,handleTempFiltersChange:h,handleResetFilters:x,handleApplyFilters:f}=(0,O.Xu)(),{missions:g,pagination:v,isInitialLoading:b,isRefetching:y,error:j,errorMessage:N,refetch:w}=(0,O.aw)(c),{statistics:R}=(0,O._R)(),[C,_]=(0,F.useState)(""),[A,P]=(0,F.useState)(""),E=(0,F.useCallback)(()=>{P(C),u(1)},[C,u]),T=(0,F.useCallback)(()=>{_(""),P("")},[]),M=(0,F.useMemo)(()=>A?g.filter(e=>e.epochName.toLowerCase().includes(A.toLowerCase())):g,[g,A]),z=j&&!y,q=n.classification.length>0||n.action.length>0;return(0,a.jsxs)(a.Fragment,{children:[s&&(0,a.jsx)(Z,{totalMissions:(null==R?void 0:R.missionCount)||0}),s&&(0,a.jsx)("div",{className:"pb-12",children:(0,a.jsx)(U,{searchQuery:C,onSearchChange:_,onSearch:E})}),(0,a.jsx)("section",{className:"py-16 ".concat(t),children:(0,a.jsxs)(r.W2,{className:"max-w-7xl",children:[!s&&(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-foreground mb-2 text-3xl font-bold tracking-tight",children:"Available Missions"}),(0,a.jsx)("p",{className:"text-muted-foreground text-lg",children:"Complete missions across epochs to earn ERC-1155 tokens"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-4",children:[(0,a.jsx)("div",{className:"lg:col-span-1",children:(0,a.jsx)(S,{tempFilters:i,onTempFiltersChange:h,onApplyFilters:f,onResetFilters:x})}),(0,a.jsxs)("div",{className:"lg:col-span-3",children:[!b&&(0,a.jsx)(k,{currentPage:o,limit:c.limit,totalResults:(null==v?void 0:v.total)||0,displayedResults:M.length,sortBy:l,onSortChange:d}),(0,a.jsx)(I,{missions:g,filteredMissions:M,isInitialLoading:b,isRefetching:y,showError:!!z,errorMessage:N,appliedSearch:A,hasFilters:q,pagination:v?{total:v.total,pages:v.pages,current:v.page,hasNext:v.hasNext,hasPrev:v.hasPrev}:void 0,currentPage:o,onMissionClick:e=>{e.url&&window.open(e.url,"_blank","noopener,noreferrer")},onPageChange:u,onPreviousPage:()=>m((null==v?void 0:v.hasPrev)||!1),onNextPage:()=>p((null==v?void 0:v.hasNext)||!1),onClearSearch:T,onClearFilters:x,onRetry:()=>w()})]})]})]})})]})}},79618:function(e,t,s){s.d(t,{aw:function(){return y},_R:function(){return j},Xu:function(){return R}});var a=s(861),n=s(38976),r=s(67912),i=s(46575),l=s(23947),o=s(95178);let c=o.Km(["beginner","intermediate","advanced"]),d=o.Km(["pull_request.opened","pull_request.closed","pull_request_review.submitted","pull_request.review_requested","issues.opened","issue_comment.created","star.created","star.create"]),u=o.Ry({id:o.Z_(),epochId:o.Z_(),epochName:o.Z_(),ruleId:o.Z_(),description:o.Z_(),classification:c,isActive:o.O7(),createdAt:o.Z_().datetime(),updatedAt:o.Z_().datetime(),endDate:o.Z_().datetime(),reward:o.Rx(),action:d,repository:o.Z_(),tokenSymbol:o.Z_(),languages:o.IX(o.Z_()).optional()}),m=o.Ry({page:o.Rx(),limit:o.Rx(),total:o.Rx(),totalPages:o.Rx(),hasNext:o.O7(),hasPrev:o.O7()}),p=o.Ry({missions:o.IX(u),meta:m});o.Km(["React","CSS","Python","Testing","JavaScript","TypeScript","Node.js","SQL","PostgreSQL","Markdown","Technical Writing"]);let h=o.Km(["MERGE A PR","STAR","OPEN A PR","COMMENT IN AN ISSUE","FORK","FOLLOW","REVIEW PR","CREATE ISSUE"]),x=o.Km(["beginner","intermediate","advanced"]);o.Ry({id:o.Z_(),title:o.Z_(),description:o.Z_(),repository:o.Z_(),reward:o.Z_(),difficulty:x,techStack:o.IX(o.Z_()),issueNumber:o.Rx(),timeAgo:o.Z_(),url:o.Z_().url().optional(),actionType:h,gitUrl:o.Z_().url().optional(),epochName:o.Z_(),tokenSymbol:o.Z_()}),o.Ry({page:o.Rx().min(1).default(1),limit:o.Rx().min(1).max(100).default(20),search:o.Z_().optional(),actionTypes:o.Z_().optional(),languages:o.Z_().optional(),difficulties:o.Z_().optional()}),o.Ry({page:o.Rx().min(1).default(1),limit:o.Rx().min(1).max(100).default(20),search:o.Z_().optional(),classification:o.IX(c).optional(),isActive:o.O7().optional(),actionTypes:o.Z_().optional(),languages:o.Z_().optional(),difficulties:o.Z_().optional(),sortBy:o.Km(["reward","createdAt","updatedAt"]).default("
1createdAt"),sortOrder:o.Km(["asc","desc"]).default("desc")});let f=o.Ry({missionCount:o.Rx(),totalTokenAllocation:o.Z_(),distinctContributors:o.Rx()}),g=e=>{let t=new Date,s=Math.ceil((e.getTime()-t.getTime())/864e5);return s<=0?"expired":1===s?"1 day to go":"".concat(s," days to go")},v=e=>{let t=e.repository.split("#")[0],s=e.description.split(" rewards you with")[0],a=g(new Date(e.endDate)),n=(0,l.Zk)(e.repository),r="issue_comment.created"===e.action,i=n||1,{gitUrl:o,url:c}=(0,l.KJ)({action:e.action,repository:e.repository,issueOrPrNumber:r?n:void 0});return{id:e.id,title:s,description:e.description,repository:"any"===t?"Any GitHub Repository":t,reward:"".concat(e.reward," ").concat(e.tokenSymbol),difficulty:({beginner:"beginner",intermediate:"intermediate",advanced:"advanced"})[e.classification]||"beginner",techStack:e.languages||[],issueNumber:i,timeAgo:a,url:c,actionType:({"pull_request.opened":"OPEN A PR","pull_request.closed":"MERGE A PR","pull_request_review.submitted":"REVIEW PR","pull_request.review_requested":"REVIEW PR","issues.opened":"CREATE ISSUE","issue_comment.created":"COMMENT IN AN ISSUE","star.created":"STAR","star.create":"STAR"})[e.action]||"OPEN A PR",gitUrl:o,epochName:e.epochName,tokenSymbol:e.tokenSymbol}},b=e=>({missions:e.missions.map(v),pagination:{page:e.meta.page,limit:e.meta.limit,total:e.meta.total,pages:e.meta.totalPages,hasNext:e.meta.hasNext,hasPrev:e.meta.hasPrev}});function y(){var e,t,s;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{page:o=1,limit:c=20,search:d,classification:u,isActive:m=!0,actionType:h,language:x,sortBy:f="createdAt",sortOrder:g="desc",enabled:v=!0,query:y}=l,{NEXT_PUBLIC_API_URL:j}=(0,n.k)(),N=(0,a.a)({queryKey:["missions",{page:o,limit:c,search:d,classification:u,isActive:m,actionType:h,language:x,sortBy:f,sortOrder:g,query:y}],queryFn:async()=>{let e=new URLSearchParams;e.append("page",o.toString()),e.append("limit",c.toString()),d&&e.append("search",d),u&&u.length>0&&e.append("difficulties",u.join(",")),h&&h.length>0&&e.append("actionTypes",h.join(",")),x&&x.length>0&&e.append("languages",x.join(",")),y&&e.append("query",y);let t="".concat(j).concat(r.q.missions.all,"?").concat(e.toString()),s=b(await (0,i._)(t,p,{credentials:"include"})),a=s.missions;return void 0!==m&&(a=a.filter(()=>!0===m)),a.sort((e,t)=>{let s,a;return"reward"===f?(s=parseInt(e.reward.split(" ")[0],10)||0,a=parseInt(t.reward.split(" ")[0],10)||0):(s=e.id,a=t.id),"asc"===g?s>a?1:-1:s<a?1:-1}),{...s,missions:a}},enabled:v,staleTime:12e4,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!0});return{...N,missions:(null===(e=N.data)||void 0===e?void 0:e.missions)||[],pagination:null===(t=N.data)||void 0===t?void 0:t.pagination,errorMessage:null===(s=N.error)||void 0===s?void 0:s.message,isInitialLoading:N.isLoading&&!N.data,isRefetching:N.isFetching&&!!N.data,isSuccess:N.isSuccess&&!!N.data}}function j(){var e;let{NEXT_PUBLIC_API_URL:t}=(0,n.k)(),s=(0,a.a)({queryKey:["statistics"],queryFn:async()=>{let e="".concat(t).concat(r.q.statistics);return(0,i._)(e,f,{credentials:"include"})},staleTime:6e5,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!0});return{...s,statistics:s.data,errorMessage:null===(e=s.error)||void 0===e?void 0:e.message,isInitialLoading:s.isLoading&&!s.data,isRefetching:s.isFetching&&!!s.data,isSuccess:s.isSuccess&&!!s.data}}var N=s(45085),w=s(69315);function R(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{initialSortBy:t="createdAt",limit:s=10,query:a}=e,[n,r]=(0,N.useState)((0,w.iS)()),[i,l]=(0,N.useState)(n),[o,c]=(0,N.useState)(t),[d,u]=(0,N.useState)(1),m="desc",p=(0,N.useCallback)(e=>{l(t=>({...t,...e}))},[]),h=(0,N.useCallback)(()=>{r(i),u(1)},[i]),x=(0,N.useCallback)(()=>{let e=(0,w.iS)();l(e),r(e),u(1)},[]),f=(0,N.useCallback)(e=>{let t=String(e.value);(t.includes("reward")||t.includes("created")||t.includes("updated"))&&(c("date"===t?"createdAt":t),u(1))},[]),g=(0,N.useCallback)(e=>{u(e)},[]),v=(0,N.useCallback)(e=>{e&&u(e=>e-1)},[]),b=(0,N.useCallback)(e=>{e&&u(e=>e+1)},[]),y=(0,N.useMemo)(()=>({page:d,limit:s,classification:n.classification,isActive:n.isActive,actionType:n.action,language:n.language,sortBy:o,sortOrder:m,...a&&{query:a}}),[d,s,n,o,m,a]);return{filters:n,tempFilters:i,sortBy:o,currentPage:d,apiFilters:y,handleTempFiltersChange:p,handleApplyFilters:h,handleResetFilters:x,handleSortChange:f,handlePageChange:g,handlePreviousPage:v,handleNextPage:b,handleMissionClick:(0,N.useCallback)(e=>{let t=(0,w.lj)(e);t.url&&window.open(t.url,"_blank","noopener,noreferrer")},[])}}},23947:function(e,t,s){function a(e){let{action:t,repository:s,issueOrPrNumber:a}=e;if(!s||"any"===s||s.toLowerCase().includes("any repository"))return{gitUrl:void 0,url:void 0};let n=s.split("#")[0],r="https://github.com/".concat(n);switch(t){case"pull_request.opened":case"pull_request.closed":return{gitUrl:r,url:"".concat(r,"/pulls")};case"issues.opened":return{gitUrl:r,url:"".concat(r,"/issues")};case"issue_comment.created":return{gitUrl:r,url:a?"".concat(r,"/issues/").concat(a):"".concat(r,"/issues")};case"star.created":case"star.create":default:return{gitUrl:r,url:r};case"fork.created":case"fork.create":return{gitUrl:r,url:"".concat(r,"/network/members")};case"watch.started":case"watch.create":return{gitUrl:r,url:"".concat(r,"/watchers")}}}function n(e){let t=e.match(/#(\d+)$/);return t?parseInt(t[1],10):void 0}function r(e,t){switch(e){case"pull_request.opened":case"pull_request.closed":return"Pull Requests";case"issues.opened":return"Issues";case"issue_comment.created":return t?"Issue #".concat(t):"Issues";case"star.created":case"star.create":default:return"Repository";case"fork.created":case"fork.create":return"Forks";case"watch.started":case"watch.create":return"Watchers"}}s.d(t,{KJ:function(){return a},Kh:function(){return r},Zk:function(){return n}})},69315:function(e,t,s){function a(e){return{id:e.id,title:e.title,de
1scription:e.description,repository:e.repository,reward:e.reward,difficulty:e.difficulty,techStack:e.techStack,issueNumber:e.issueNumber,timeAgo:e.timeAgo,url:e.url,actionType:e.actionType,gitUrl:e.gitUrl,tokenSymbol:e.tokenSymbol}}function n(){return{classification:[],isActive:!0,action:[],language:[],techStack:[],rewardRange:[0,1e5],difficulty:[],actionType:[]}}s.d(t,{iS:function(){return n},lj:function(){return a}})},36624:function(e,t,s){var a=s(45085);let n=a.forwardRef(function(e,t){let{title:s,titleId:n,...r}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},r),s?a.createElement("title",{id:n},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))});t.Z=n}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.