PageSourceSearch

https://pharos-mvp.vercel.app/_next/static/chunks/4e6dcf4634413cd0.js

js pharos-mvp.vercel.app collected 2026-10-03 07:29:29 UTC 27,417 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,258885,e=>{e.v("/_next/static/media/logo-p.ce49d995.png")},817909,e=>{e.v("/_next/static/media/pyusd.fe08e429.png")},276664,e=>{"use strict";e.s(["default",()=>b],276664);var r=e.i(843476),t=e.i(271645),a=e.i(657688),s=e.i(522016),l=e.i(654238),o=e.i(395719),n=e.i(546500),i=e.i(984828),d=e.i(677711),c=e.i(313811);let x=()=>(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-8 xl:gap-6 2xl:gap-8",children:[1,2,3,4,5,6].map(e=>(0,r.jsxs)("div",{className:"h-full bg-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl overflow-hidden animate-pulse",children:[(0,r.jsxs)("div",{className:"relative aspect-square overflow-hidden bg-gray-200",children:[(0,r.jsxs)("div",{className:"absolute top-0 left-0 w-full h-8 bg-gray-300 border-b-4 border-black flex items-center px-3 space-x-2 z-10",children:[(0,r.jsx)("span",{className:"w-3 h-3 bg-gray-400 rounded-full border-2 border-gray-600"}),(0,r.jsx)("span",{className:"w-3 h-3 bg-gray-400 rounded-full border-2 border-gray-600"}),(0,r.jsx)("span",{className:"w-3 h-3 bg-gray-400 rounded-full border-2 border-gray-600"})]}),(0,r.jsx)("div",{className:"relative w-full h-full pt-8 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-6xl mb-4 text-gray-400",children:"🎫"}),(0,r.jsx)("p",{className:"text-lg font-rubik font-black text-gray-400",children:"Loading..."})]})}),(0,r.jsx)("div",{className:"absolute top-10 right-3 bg-gray-300 px-3 py-1 border-3 border-black shadow-[3px_3px_0px_rgba(0,0,0,1)] rounded w-16 h-6"})]}),(0,r.jsxs)("div",{className:"p-6",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-8 rounded-lg mb-4 w-3/4"}),(0,r.jsxs)("div",{className:"mb-4 p-2 bg-gray-100 border-2 border-gray-300 rounded",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-32 mb-1"}),(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-full"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-4 rounded w-28 mb-2"}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-gray-300 border-3 border-black rounded-lg py-2 h-12 shadow-[3px_3px_0px_#000]"}),(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-12 mt-1"})]}),(0,r.jsx)("div",{className:"text-xl font-bold text-gray-300",children:":"}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-gray-300 border-3 border-black rounded-lg py-2 h-12 shadow-[3px_3px_0px_#000]"}),(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-14 mt-1"})]}),(0,r.jsx)("div",{className:"text-xl font-bold text-gray-300",children:":"}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-gray-300 border-3 border-black rounded-lg py-2 h-12 shadow-[3px_3px_0px_#000]"}),(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-14 mt-1"})]})]})]}),(0,r.jsxs)("div",{className:"bg-pharos-orange/10 border-l-4 border-pharos-orange px-4 py-3 mb-4 rounded",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-28 mb-1"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"bg-gray-300 w-6 h-6 rounded-full"}),(0,r.jsx)("div",{className:"bg-gray-300 h-6 rounded w-24"})]})]}),(0,r.jsxs)("div",{className:"bg-gray-50 border-2 border-black rounded-lg px-4 py-3 mb-4",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-32 mb-1"}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-8 rounded w-20"}),(0,r.jsx)("div",{className:"bg-gray-300 h-3 rounded w-16"})]}),(0,r.jsx)("div",{className:"w-full h-2 bg-gray-200 border-2 border-black rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-gray-300 w-1/2"})})]}),(0,r.jsx)("div",{className:"mb-4 p-3 bg-blue-50 border-2 border-blue-300 rounded",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"bg-gray-300 h-4 rounded"}),(0,r.jsx)("div",{className:"bg-gray-300 h-4 rounded"})]})}),(0,r.jsx)("div",{className:"bg-gray-300 h-12 rounded-lg w-full"})]})]},e))}),u="0xea82FE34F42bCAa9c74dD63843AAf0e5835aC22b",h="0x72e42BA5Fb6675FEc4f3Ea2E83b9484C6781a0D8,0x0f104E09F8dce4bF2d7ac43B9d22eC39d7f3B124".split(",").map(e=>e.trim()),b=()=>{let[e,b]=(0,t.useState)([]),[m,f]=(0,t.useState)({}),[g,p]=(0,t.useState)(!1),[w,v]=(0,t.useState)(!0),[j,y]=(0,t.useState)(null),[N,k]=(0,t.useState)(!1),[_,S]=(0,t.useState)(new Set),[C,T]=(0,t.useState)(null),[E,P]=(0,t.useState)(null),[A,R]=(0,t.useState)(new Set),[F,U]=(0,t.useState)(null),[L,M]=(0,t.useState)(null),z=()=>
1new l.ethers.JsonRpcProvider("https://sepolia-rollup.arbitrum.io/rpc"),D=async()=>{try{if(!window.ethereum){console.log("MetaMask not found"),k(!1);return}let e=new l.ethers.BrowserProvider(window.ethereum),r=await e.getSigner(),t=await r.getAddress();console.log("Checking admin status for:",t);let a=h.some(e=>e.toLowerCase()===t.toLowerCase());if(console.log("Environment admin check:",a,"ADMIN_ADDRESSES:",h),a){console.log("✅ User is admin (environment check)"),k(!0);return}try{let e=new l.ethers.Contract(u,["function isAdmin(address account) external view returns (bool)"],r),a=await e.isAdmin(t);console.log("Contract admin check:",a),k(a)}catch(e){console.log("Contract admin check not available, using env check only",e),k(!1)}}catch(e){console.log("Error checking admin status:",e),k(!1)}},B=async e=>{try{var r,t,a;if(S(r=>new Set(r).add(e)),T(null),P(null),!window.ethereum)throw Error("Please connect MetaMask to close raffles");let s=new l.ethers.BrowserProvider(window.ethereum),o=await s.getSigner(),n=z(),i=["function closeIfReady() external","function owner() external view returns (address)"],d=new l.ethers.Contract(e,i,n),c=new l.ethers.Contract(e,i,o),x=await d.owner(),u=await o.getAddress();if(x.toLowerCase()!==u.toLowerCase())throw Error("Only the raffle owner can close this raffle");console.log("🔒 Auto-closing raffle...");let h=await c.closeIfReady();console.log("Transaction hash:",h.hash);let b=await h.wait();console.log("Transaction receipt:",{status:null==b?void 0:b.status,logsCount:(null==b||null==(r=b.logs)?void 0:r.length)||0,gasUsed:null==b||null==(t=b.gasUsed)?void 0:t.toString()});let m=null;if((null==b?void 0:b.logs)&&b.logs.length>0){let e=l.ethers.id("RaffleClosed(uint64)"),r=b.logs.find(r=>r.topics[0]===e);if(r){let e=new l.ethers.Interface(["event RaffleClosed(uint64 sequenceNumber)"]);try{let t=e.parseLog({topics:r.topics,data:r.data});m=null==t||null==(a=t.args)?void 0:a[0]}catch(e){console.log("Failed to parse RaffleClosed event:",e),r.topics.length>1&&(m=BigInt(r.topics[1]))}}}if(m)console.log("✅ Raffle closed successfully!"),console.log("📊 Sequence number:",m),P("Raffle closed successfully! Sequence: ".concat(m)),await q(),setTimeout(()=>{P(null)},5e3);else throw Error("Could not find sequence number in transaction logs")}catch(e){console.error("Error closing raffle:",e),T(e instanceof Error?e.message:"Unknown error occurred"),setTimeout(()=>{T(null)},1e4)}finally{S(r=>{let t=new Set(r);return t.delete(e),t})}},I=async e=>{try{if(R(r=>new Set(r).add(e)),U(null),M(null),!window.ethereum)throw Error("Please connect MetaMask to distribute prizes");let r=new l.ethers.BrowserProvider(window.ethereum),t=await r.getSigner(),a=z(),s=["function distributePrize() external","function owner() external view returns (address)","function isClosed() external view returns (bool)","function winner() external view returns (address)"],o=new l.ethers.Contract(e,s,a),n=new l.ethers.Contract(e,s,t),i=await o.owner(),d=await t.getAddress();if(i.toLowerCase()!==d.toLowerCase())throw Error("Only the raffle owner can distribute the prize");let c=await o.isClosed(),x=await o.winner();if(!c)throw Error("Raffle must be closed before distributing the prize");if("0x0000000000000000000000000000000000000000"===x)throw Error("No winner set for this raffle");let u=await n.distributePrize(),h=await u.wait();if((null==h?void 0:h.status)!==1)throw Error("Prize distribution transaction failed");M("✅ Prize distributed successfully"),await q(),setTimeout(()=>M(null),8e3)}catch(e){console.error("Error distributing prize:",e),U(e instanceof Error?e.message:"Unknown error occurred"),setTimeout(()=>U(null),1e4)}finally{R(r=>{let t=new Set(r);return t.delete(e),t})}},q=async()=>{try{v(!0),y(null),console.log("🔄 Fetching raffles from smart contracts...");let e=await O()||[];try{console.log("🖼️ Fetching images from MongoDB...");let r=await fetch("/api/raffles");if(r.ok){let t=await r.json();if(t.success&&t.raffles){console.log("📊 Found MongoDB raffles:",t.raffles.length);let r=new Map;t.raffles.forEach(e=>{e.contractAddress&&e.imageUrl&&(r.set(e.contractAddress.toLowerCase(),e.imageUrl),console.log("🖼️ Found image for ".concat(e.contractAddress,": ").concat(e.imageUrl)))});let a=e.map(e=>({...e,imageUrl:r.get(e.address.toLowerCase())||void 0}));b(a),console.log("✅ Loaded raffles with images:",a.length);return}}}catch(e){console.log("⚠️ Could not fetch images from MongoDB:",e)}b(e),console.log("✅ Loaded raffles from smart contracts only:",e.length)}catch(e){console.error("Error fetching raffles:",e),y(e instanceof Error?e.message:"Failed to fetch raffles")}finally{v(!1)}},O=async()=>{try{let e=z(),r=["function prizeDescription() external view returns (string memory)","function ticketPrice() external view returns (uint256)","function maxTickets() external view returns (uint256)","function totalTicketsSold() external view returns (uint256)","function endTime() external view returns (uint256)","function startTime() external view returns (uint256)","function isClosed() external view returns (bool)","function winner() external view returns (address)","function maxTicketsPerUser() external view returns (uint256)","function houseFeePercentage() external view returns (uint256)","function prizeAmount() external view returns (uint256)"],t=new l.ethers.Contract(u,["function getRaffles() external view returns (address[] memory)"],e),a=[];try{let r=await e.getCode(u);if("0x"===r)throw Error("No contract deployed at address ".concat(u));a=await t.getRaffles(),console.log("Found raffles from smart contract:",a.length)}catch(e){if(console.error("Error calling getRaffles():",e),e instanceof Error&&e.message.includes("could not decode result data")&&e.message.includes('value="
10x"'))console.log("ℹ️ Factory contract returned empty data - this might be a network/RPC issue"),console.log("ℹ️ Try switching MetaMask to Arbitrum Sepolia network or refresh the page"),a=[];else throw e}if(0===a.length){console.log("No raffles found, returning empty raffle list"),b([]),v(!1);return}let s=[];for(let t of a)try{console.log("Fetching data for raffle: ".concat(t));let a=new l.ethers.Contract(t,r,e),o=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(let a=0;a<r;a++)try{return await Promise.race([e(),new Promise((e,r)=>setTimeout(()=>r(Error("Request timeout")),1e4))])}catch(e){if(a===r-1)throw e;console.log("Retry ".concat(a+1,"/").concat(r," for ").concat(t)),await new Promise(e=>setTimeout(e,1e3*(a+1)))}throw Error("Max retries reached")},[n,i,d,c,x,u,h,b,m,f,g]=await Promise.all([o(()=>a.prizeDescription()).catch(()=>"Unknown Prize"),o(()=>a.ticketPrice()).catch(()=>0),o(()=>a.maxTickets()).catch(()=>0),o(()=>a.totalTicketsSold()).catch(()=>0),o(()=>a.endTime()).catch(()=>0),o(()=>a.startTime()).catch(()=>0),o(()=>a.isClosed()).catch(()=>!1),o(()=>a.winner()).catch(()=>"0x0000000000000000000000000000000000000000"),o(()=>a.maxTicketsPerUser()).catch(()=>0),o(()=>a.houseFeePercentage()).catch(()=>0),o(()=>a.prizeAmount()).catch(()=>0)]);console.log("✅ Successfully fetched raffle ".concat(t,":"),{title:n,ticketsSold:Number(c),totalTickets:Number(d),isClosed:h}),s.push({address:t,title:n,description:n,pricePerTicket:l.ethers.formatEther(i),totalTickets:Number(d),ticketsSold:Number(c),endTime:Number(x),startTime:Number(u),isClosed:h,winner:b,maxTicketsPerUser:Number(m),houseFeePercentage:Number(f),prizeAmount:l.ethers.formatEther(g),imageUrl:void 0})}catch(e){console.error("❌ Error fetching raffle ".concat(t," after retries:"),e),s.push({address:t,title:"Loading...",description:"Loading...",pricePerTicket:"0",totalTickets:0,ticketsSold:0,endTime:0,startTime:0,isClosed:!1,winner:"0x0000000000000000000000000000000000000000",maxTicketsPerUser:0,houseFeePercentage:0,prizeAmount:"0",imageUrl:void 0})}return console.log("✅ Loaded raffles from smart contract:",s.length),s}catch(e){throw console.error("Error fetching raffles from smart contract:",e),e}};return((0,t.useEffect)(()=>{if(p(!0),q(),D(),window.ethereum)return window.ethereum.on("accountsChanged",D),window.ethereum.on("chainChanged",D),()=>{window.ethereum.removeListener("accountsChanged",D),window.ethereum.removeListener("chainChanged",D)}},[]),(0,t.useEffect)(()=>{if(e.length>0){let r=setInterval(()=>{let r={};e.forEach(e=>{r[e.address]=((e,r)=>{let t=Math.floor(Date.now()/1e3);if(t<e){let r=e-t,a=Math.floor(r/3600),s=Math.floor(r%3600/60);return{hours:a.toString().padStart(2,"0"),minutes:s.toString().padStart(2,"0"),seconds:(r%60).toString().padStart(2,"0"),expired:!1,notStarted:!0}}if(t>=r)return{hours:"00",minutes:"00",seconds:"00",expired:!0,notStarted:!1};let a=r-t,s=Math.floor(a/3600),l=Math.floor(a%3600/60);return{hours:s.toString().padStart(2,"0"),minutes:l.toString().padStart(2,"0"),seconds:(a%60).toString().padStart(2,"0"),expired:!1,notStarted:!1}})(e.startTime,e.endTime)}),f(r)},1e3);return()=>clearInterval(r)}},[e]),w)?(0,r.jsx)("div",{className:"min-h-screen bg-linear-to-br from-pharos-yellow/20 to-pharos-orange/10 py-12 px-4 md:px-8 lg:px-12",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"text-center mb-12",children:[(0,r.jsx)("h1",{className:"text-5xl md:text-6xl lg:text-7xl font-rubik font-black uppercase text-black mb-4 drop-shadow-[4px_4px_0px_rgba(243,162,15,0.3)]",children:"All Raffles"}),(0,r.jsx)("p",{className:"text-lg md:text-xl font-rubik font-semibold text-gray-700",children:"Browse all available raffles and find your next win!"})]}),(0,r.jsx)(x,{})]})}):j?(0,r.jsx)("div",{className:"min-h-screen bg-linear-to-br from-pharos-yellow/20 to-pharos-orange/10 py-12 px-4 md:px-8 lg:px-12",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,r.jsxs)("div",{className:"bg-white border-4 border-black shadow-[8px_8px_0px_rgba(0,0,0,0.8)] rounded-xl p-8 max-w-md mx-auto text-center",children:[(0,r.jsx)("p",{className:"text-xl font-rubik font-black text-red-600 mb-4",children:"Error Loading Raffles"}),(0,r.jsx)("p",{className:"text-base font-rubik text-gray-600 mb-4",children:j}),(0,r.jsx)("button",{onClick:q,className:"bg-pharos-orange border-4 border-black px-6 py-3 font-black text-white uppercase tracking-tight   shadow-[4px_4px_0px_#000] hover:shadow-[2px_2px_0px_#000]   hover:translate-x-[2px] hover:translate-y-[2px]   active:shadow-none active:translate-x-[4px] active:translate-y-[4px]   transition-all duration-100",children:"Try Again"})]})})})}):(0,r.jsx)("div",{className:"min-h-screen bg-linear-to-br from-pharos-yellow/20 to-pharos-orange/10 py-12 px-4 md:px-8 lg:px-12",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"text-center mb-12 transition-all duration-700 ".concat(g?"opacity-100 translate-y-0":"opacity-0 -translate-y-4"),children:[(0,r.jsx)("h1",{className:"text-5xl md:text-6xl lg:text-7xl font-rubik font-black uppercase text-black mb-4 drop-shadow-[4px_4px_0px_rgba(243,162,15,0.3)]",children:"All Raffles"}),(0,r.jsx)("p",{className:"text-lg md:text-xl font-rubik font-semibold text-gray-700",children:"Browse all available raffles and find your next win!"})]}),E&&(0,r.jsxs)("div",{className:"mb-6 bg-green-500 text-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl p-6",children:[(0,r.jsx)("p",{className:"text-xl font-rubik font-black uppercase mb-2",children:"🎉 Success!"}),(0,r.jsx)("p",{className:"text-base font-rubik font-bold",children:E})]}),L&&(0,r.jsxs)("div",{className:"mb-6 bg-green-500 text-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl p-6",children:[(0,r.jsx)("p",{className:"text-xl font-rubik font-black uppercase mb-2",children:"🎉 Success!"}),(0,r.jsx)("p",{className:"text-base font-rubik font-bold",children:L})]}),C&&(0,r.jsxs)("div",{className:"mb-6 bg-red-500 text-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl p-6",children:[(0,r.jsx)("p",{className:"text-xl font-rubik font-black uppercase mb-2",children:"❌ Error"}),(0,r.jsx)("p",{className:"text-base font-rubik font-bold",children:C})]}),F&&(0,r.jsxs)("div",{className:"mb-6 bg-red-500 text-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl p-6",children:[(0,r.jsx)("p",{className:"text-xl font-rubik font-black uppercase mb-2",children:"❌ Error"}),(0,r.jsx)("p",{className:"text-base font-rubik font-bold",children:F})]}),N&&(0,r.jsx)("div",{className:"mb-6 bg-blue-500 text-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl p-4",children:(0,r.jsx)("p",{className:"text-lg font-rubik font-black uppercase text-center",children:"👑 Admin Mode - You can close raffles that have ended or sold out"})}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-8 xl:gap-6 2xl:gap-8",children:e.map((e,t)=>{let l=e.totalTickets-e.ticketsSold,x=m[e.address],u=e.totalTickets>0?Math.round(e.ticketsSold/e.totalTickets*100):0,h=(null==x?void 0:x.expired)||e.isClosed;return(0,r.jsx)("div",{className:"transition-all duration-700 h-full ".concat(g?"opacity-100 translate-y-0":"opacity-0 translate-y-8"),style:{transitionDelay:"".concat(100*t,"ms")},children:(0,r.jsxs)("div",{className:"h-full bg-white border-4 border-black shadow-[6px_6px_0px_rgba(0,0,0,0.8)] rounded-xl overflow-hidden hover:translate-y-[-4px] hover:shadow-[8px_8px_0px_rgba(0,0,0,0.8)] transition-all duration-300 group",children:[(0,r.jsxs)("div",{className:"relative aspect-square overflow-hidden bg-gray-100",children:[(0,r.jsxs)("div",{className:"absolute top-0 left-0 w-full h-8 bg-gray-200 border-b-4 border-black flex items-center px-3 space-x-2 z-10",children:[(0,r.jsx)("span",{className:"w-3 h-3 bg-red-500 rounded-full border-2 border-gray-700"}),(0,r.jsx)("span",{className:"w-3 h-3 bg-yellow-500 rounded-full border-2 border-gray-700"}),(0,r.jsx)("span",{className:"w-3 h-3 bg-green-500 rounded-full border-2 border-gray-700"})]}),(0,r.jsxs)("div",{className:"relative w-full h-full pt-8",children:[e.imageUrl?(0,r.jsx)(a.default,{src:e.imageUrl,alt:e.title,fill:!0,className:"object-cover",onError:r=>{console.log("Image failed to load:",e.imageUrl),r.currentTarget.style.display="none";let t=r.currentTarget.nextElementSibling;t&&(t.style.display="flex")}}):null,(0,r.jsx)("div",{className:"relative w-full h-full flex items-center justify-center bg-linear-to-br from-pharos-orange/20 to-pharos-yellow/20 ".concat(e.imageUrl?"absolute inset-0 hidden":""),children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-6xl mb-4",children:"🎫"}),(0,r.jsx)("p",{className:"text-lg font-rubik font-black text-gray-700",children:"PYUSD Raffle"})]})})]}),(0,r.jsx)("div",{className:"absolute top-10 right-3 bg-pharos-orange text-black px-3 py-1 border-3 border-black shadow-[3px_3px_0px_rgba(0,0,0,1)] font-rubik font-black text-sm rounded",children:h?"CLOSED":"".concat(u,"%")}),"0x0000000000000000000000000000000000000000"!==e.winner&&(0,r.jsx)("div",{className:"absolute top-10 left-3 bg-green-500 text-white px-3 py-1 border-3 border-black shadow-[3px_3px_0px_rgba(0,0,0,1)] font-rubik font-black text-sm rounded",children:"WINNER!"})]}),(0,r.jsxs)("div",{className:"p-6",children:[(0,r.jsx)("h3",{className:"text-2xl md:text-3xl font-rubik font-black uppercase text-black mb-4 leading-tight",children:e.title}),(0,r.jsxs)("div",{className:"mb-4 p-2 bg-gray-100 border-2 border-gray-300 rounded",children:[(0,r.jsx)("p",{className:"text-xs font-rubik font-bold text-gray-600 uppercase mb-1",children:"Contract Address"}),(0,r.jsx)("p",{className:"text-xs font-mono text-gray-700 break-all",children:e.address})]}),!h&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("p",{className:"text-xs flex gap-2 items-center font-rubik font-bold text-gray-600 uppercase mb-2 tracking-wide",children:[(0,r.jsx)(d.FcAlarmClock,{}),(null==x?void 0:x.notStarted)?"Starts In":(null==x?void 0:x.expired)?"Ended":"Time Remaining"]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-pharos-orange text-white border-3 border-black rounded-lg py-2 text-2xl font-black shadow-[3px_3px_0px_#000] text-center font-rubik bg-[#f3a20f]",children:(null==x?void 0:x.hours)||"00"}),(0,r.jsx)("span",{className:"text-xs font-bold text-black uppercase mt-1 font-rubik",children:"Hours"})]}),(0,r.jsx)("div",{className:"text-xl font-bold text-pharos-orange",children:":"}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-pharos-orange text-white border-3 border-black rounded-lg py-2 text-2xl font-black shadow-[3px_3px_0px_#000] text-center font-rubik bg-[#f3a20f]",children:(null==x?void 0:x.minutes)||"00"}),(0,r.jsx)("span",{className:"text-xs font-bold text-black uppercase mt-1 font-rubik",children:"Minutes"})]}),(0,r.jsx)("div",{className:"text-xl font-bold text-pharos-orange",children:":"}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-full bg-pharos-orange text-white border-3 border-black rounded-lg py-2 text-2xl font-black shadow-[3px_3px_0px_#000] text-center font-rubik bg-[#f3a20f]",children:(null==x?void 0:x.seconds)||"00"}),(0,r.jsx)("span",{className:"text-xs font-bold text-black uppercase mt-1 font-rubik",children:"Seconds"})]})]})]}),h&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-red-100 border-2 border-red-400 rounded",children:(0,r.jsx)("p",{className:"text-red-800 font-rubik font-bold text-center",children:"0x0000000000000000000000000000000000000000"!==e.winner?"🎉 Raffle Completed!":"⏰ Raffle Ended"})}),(0,r.jsxs)("div",{className:"bg-pharos-orange/10 border-l-4 border-pharos-orange px-4 py-3 mb-4 rounded",children:[(0,r.jsx)("p",{className:"text-xs font-rubik font-semibold text-gray-600 uppercase mb-1",children:"Price Per Ticket"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(a.default,{src:n.default,alt:"PYUSD",width:24,height:24,className:"object-contain"}),(0,r.jsx)("p",{className:"text-xl font-rubik font-black text-pharos-orange",children:e.pricePerTicket})]})]}),(0,r.jsxs)("div",{className:"bg-gray-50 border-2 border-black rounded-lg px-4 py-3 mb-4",children:[(0,r.jsx)("p",{className:"text-xs font-rubik font-semibold text-gray-600 uppercase mb-1",children:"Tickets Available"}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("p",{className:"text-2xl font-rubik font-black text-black",children:l.toLocaleStr
1ing()}),(0,r.jsxs)("p",{className:"text-xs font-rubik text-gray-500",children:["of ",e.totalTickets.toLocaleString()]})]}),(0,r.jsx)("div",{className:"mt-2 w-full h-2 bg-gray-200 border-2 border-black rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-[#f97028] transition-all duration-300",style:{width:"".concat(u,"%")}})})]}),(0,r.jsx)("div",{className:"mb-4 p-3 bg-blue-50 border-2 border-blue-300 rounded",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-bold text-gray-600",children:"Max per User:"}),(0,r.jsx)("span",{className:"ml-1 font-bold text-black",children:e.maxTicketsPerUser})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-bold text-gray-600",children:"House Fee:"}),(0,r.jsxs)("span",{className:"ml-1 font-bold text-black",children:[e.houseFeePercentage/100,"%"]})]})]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(s.default,{href:(null==x?void 0:x.notStarted)?"#":"/raffle/".concat(e.address),children:(0,r.jsxs)(o.default,{color:"pharos-orange",shape:"medium-rounded",className:"w-full flex items-center gap-2 justify-center text-lg py-3 px-6 uppercase ".concat((null==x?void 0:x.notStarted)?"opacity-50 cursor-not-allowed":""),disabled:null==x?void 0:x.notStarted,children:[(null==x?void 0:x.notStarted)?"Not Started Yet":h?"View Results":"Buy Tickets"," ",(0,r.jsx)(i.FaArrowRight,{})]})}),N&&!e.isClosed&&(h||e.ticketsSold>=e.totalTickets)&&(0,r.jsx)(o.default,{color:"pharos-orange",shape:"medium-rounded",className:"w-full flex items-center gap-2 justify-center text-lg py-3 px-6 uppercase disabled:opacity-50 disabled:cursor-not-allowed bg-red-500 hover:bg-red-600 text-white border-4 border-black shadow-[4px_4px_0px_#000] hover:shadow-[2px_2px_0px_#000] hover:translate-x-[2px] hover:translate-y-[2px] active:shadow-none active:translate-x-[4px] active:translate-y-[4px] transition-all duration-100",onClick:()=>B(e.address),disabled:_.has(e.address),children:_.has(e.address)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.AiOutlineLoading3Quarters,{className:"animate-spin"}),"Closing..."]}):(0,r.jsx)(r.Fragment,{children:"🔒 Close Raffle"})}),N&&e.isClosed&&"0x0000000000000000000000000000000000000000"!==e.winner&&(0,r.jsx)(o.default,{color:"pharos-orange",shape:"medium-rounded",className:"w-full flex items-center gap-2 justify-center text-lg py-3 px-6 uppercase disabled:opacity-50 disabled:cursor-not-allowed bg-green-600 hover:bg-green-700 text-white border-4 border-black shadow-[4px_4px_0px_#000] hover:shadow-[2px_2px_0px_#000] hover:translate-x-[2px] hover:translate-y-[2px] active:shadow-none active:translate-x-[4px] active:translate-y-[4px] transition-all duration-100",onClick:()=>I(e.address),disabled:A.has(e.address),children:A.has(e.address)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.AiOutlineLoading3Quarters,{className:"animate-spin"}),"Distributing..."]}):(0,r.jsx)(r.Fragment,{children:"💸 Distribute Prize"})}),N&&e.isClosed&&(0,r.jsx)("div",{className:"bg-green-100 border-2 border-green-400 rounded p-2",children:(0,r.jsx)("p",{className:"text-green-800 font-rubik font-bold text-center text-sm",children:"✅ Raffle Closed"})})]})]})]})},e.address)})}),0===e.length&&(0,r.jsx)("div",{className:"text-center py-20",children:(0,r.jsxs)("div",{className:"bg-white border-4 border-black shadow-[8px_8px_0px_rgba(0,0,0,0.8)] rounded-xl p-12 max-w-md mx-auto",children:[(0,r.jsx)("p",{className:"text-2xl font-rubik font-black text-gray-700 mb-4",children:"No raffles available at the moment"}),(0,r.jsx)("p",{className:"text-base font-rubik text-gray-600",children:"Check back soon for new raffles!"})]})})]})})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.