PageSourceSearch

https://anthum.ai/assets/PublicContestList-BxC5d48o.js

js anthum.ai collected 2026-10-05 11:51:09 UTC 8,158 bytes, 1 lines download raw bytes

1import{p as G,r as a,j as e}from"./vendor-CSpQeQFa.js";import{S as Q,B as E,s as C}from"./entry-main-PLc9_a6q.js";import{F as W}from"./Footer-CGWiw4oR.js";import{I as X}from"./ItemListJsonLd-XI2IGsFB.js";import{f as Y}from"./MarketingHeader-DURgYL2j.js";import{L as Z}from"./BonusExpiryCountdown-DZAQV4Wx.js";import{T as ee}from"./bookingIdentityPing-D51nG8yv.js";import{C as te}from"./contestMediaDisplay-WupF8w-m.js";import{C as se}from"./brandOutreachLogo-DX112xbb.js";const L="https://anthum.ai";function oe(n){return Y({cash:n.prize_type==="credits"||n.prize_type==="credit"?0:n.prize_amount,credits:n.prize_type==="credits"||n.prize_type==="credit"?n.credit_prize_amount??n.prize_amount??0:n.credit_prize_amount,studioCash:n.studio_cash_prize_amount},{emptyFallback:""})||null}function g(n){return n.replace(/[-_]+/g," ").replace(/\b\w/g,d=>d.toUpperCase())}const pe=()=>{const[n,d]=G(),s=n.get("category")?.trim()||"",[m,o]=a.useState([]),[l,x]=a.useState([]),[c,h]=a.useState([]),[_,B]=a.useState({}),[M,b]=a.useState(!0),[O,A]=a.useState(!1),[V,K]=a.useState(0);a.useEffect(()=>{let t=!1;return(async()=>{b(!0);const[{data:p,error:z},{data:J,error:q}]=await Promise.all([C.from("challenges_public").select("id, title, description, status, go_live_at, deadline, prize_amount, prize_type, credit_prize_amount, studio_cash_prize_amount, cover_image_url, category, categories, business_id, updated_at").order("updated_at",{ascending:!1}).limit(200),C.from("challenges_upcoming_public").select("id, title, go_live_at, deadline, prize_amount, prize_type, credit_prize_amount, studio_cash_prize_amount, cover_image_url, category, business_id").order("go_live_at",{ascending:!0}).limit(60)]);if(t)return;if(z||q){A(!0),b(!1);return}const R=Date.now(),y=[],j=[];for(const i of p||[]){if(i.status==="completed"){j.push(i);continue}i.status==="active"&&(!i.go_live_at||new Date(i.go_live_at).getTime()<=R)&&y.push(i)}const U=(J||[]).filter(i=>i.go_live_at&&new Date(i.go_live_at).getTime()>R);o(y),x(U),h(j.slice(0,24));const F=Array.from(new Set([...y,...U,...j].map(i=>i.business_id).filter(i=>!!i)));if(F.length>0){const{data:i}=await C.from("brands_public").select("id, company_name, slug").in("id",F);if(!t){const T={};for(const N of i||[])N.id&&(T[N.id]=N);B(T)}}t||b(!1)})().catch(()=>{t||(A(!0),b(!1))}),()=>{t=!0}},[V]);const u=a.useMemo(()=>t=>s?t.filter(r=>!!((r.categories??[]).map(z=>z.toLowerCase()).includes(s.toLowerCase())||(r.category??"").toLowerCase()===s.toLowerCase())):t,[s]),f=a.useMemo(()=>u(m),[u,m]),v=a.useMemo(()=>u(l),[u,l]),w=a.useMemo(()=>u(c),[u,c]),I=a.useMemo(()=>{const t=new Set;for(const r of[...m,...l,...c]){for(const p of r.categories??[])p&&t.add(p.toLowerCase());r.category&&t.add(r.category.toLowerCase())}return Array.from(t).sort()},[m,l,c]),k=`${L}/ai-video-contests/list${s?`?category=${encodeURIComponent(s)}`:""}`,$=s?`${g(s)} AI Video Contests on Anthum`:"All AI Video Ad Contests on Anthum",H=s?`Open AI video ad contests in the ${g(s)} category. Submit your AI-generated ad and compete for the prize pool.`:"Browse every open and upcoming AI video ad contest on Anthum. Submit your AI-generated ad, compete for cash and credit prizes, get paid when you win.",P=f.slice(0,50).map(t=>({name:t.title||"AI Video Ad Contest",url:`${L}/contest/${t.id}`,image:t.cover_image_url||void 0})),D=t=>{const r=new URLSearchParams(n);t?r.set("category",t):r.delete("category"),d(r,{replace:!1})};return e.jsxs("div",{className:"min-h-screen bg-[#0a0a0b] text-white flex flex-col",children:[e.jsx(Q,{title:$,description:H,canonicalUrl:k,ogImageUrl:`${L}/images/og-image-creator.png`}),P.length>0?e.jsx(X,{scriptId:"schema-public-contest-list",name:$,url:k,items:P}):null,e.jsx("main",{className:"flex-1 container mx-auto px-4 py-8 pt-28",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:s?`${g(s)} contests`:"All contests"}),e.jsx("p",{className:"text-zinc-400 mb-8 max-w-2xl",children:"Open AI video ad contests on Anthum. Submit your AI-generated video, compete for the prize pool, get paid when you win."}),I.length>0?e.jsxs("div",{className:"mb-8 flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>D(""),className:`px-3 py-1.5 rounded-full text-sm border transition-colors ${s?"border-zinc-800 text-zinc-300 hover:border-zinc-700":"border-white bg-white text-black"}`,children:"All"}),I.map(t=>e.jsx("button",{type:"button",onClick:()=>D(t),className:`px-3 py-1.5 rounded-full text-sm border transition-colors ${s.toLowerCase()===t?"border-white bg-white text-black":"border-zinc-800 text-zinc-300 hover:border-zinc-700"}`,children:g(t)},t))]}
1):null,M?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(Z,{className:"h-6 w-6 text-zinc-500 animate-spin"})}):O?e.jsxs("div",{className:"rounded-xl border border-zinc-800 bg-zinc-900/30 p-10 text-center",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Contests couldn’t be loaded"}),e.jsx("p",{className:"text-sm text-zinc-400 mb-6",children:"Something went wrong fetching the list. There may well be open contests — this is a problem on our side, not an empty schedule."}),e.jsx(E,{onClick:()=>K(t=>t+1),className:"bg-white text-black hover:bg-zinc-200",children:"Try again"})]}):e.jsx(e.Fragment,{children:f.length===0&&v.length===0&&w.length===0?e.jsxs("div",{className:"rounded-xl border border-zinc-800 bg-zinc-900/30 p-10 text-center",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No contests right now"}),e.jsx("p",{className:"text-sm text-zinc-400 mb-6",children:s?`No open contests in the ${g(s)} category.`:"New contests open every week. Check back soon, or sign up for alerts."}),e.jsx("a",{href:"/auth?type=creator",children:e.jsx(E,{className:"bg-white text-black hover:bg-zinc-200",children:"Sign up"})})]}):e.jsxs(e.Fragment,{children:[f.length>0?e.jsx(S,{title:"Live",icon:e.jsx(ee,{className:"h-4 w-4 text-amber-400"}),contests:f,brands:_}):null,v.length>0?e.jsx(S,{title:"Coming soon",icon:e.jsx(te,{className:"h-4 w-4 text-emerald-400"}),contests:v,brands:_}):null,w.length>0?e.jsx(S,{title:"Past contests",icon:e.jsx(se,{className:"h-4 w-4 text-zinc-400"}),contests:w,brands:_}):null]})})]})}),e.jsx(W,{})]})};function S({title:n,icon:d,contests:s,brands:m}){return e.jsxs("section",{className:"mb-12",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2 text-xs uppercase tracking-wider text-zinc-500",children:[d,n,e.jsxs("span",{className:"text-zinc-600",children:["· ",s.length]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:s.map(o=>{const l=o.business_id?m[o.business_id]:void 0,x=oe(o),c=o.deadline?new Date(o.deadline):null,h=o.go_live_at?new Date(o.go_live_at):null;return e.jsxs("a",{href:`/contest/${o.id}`,className:"block rounded-xl border border-zinc-800 bg-zinc-900/40 overflow-hidden transition-colors hover:border-zinc-700",children:[o.cover_image_url?e.jsx("div",{className:"aspect-[16/9] bg-zinc-900 overflow-hidden",children:e.jsx("img",{src:o.cover_image_url,alt:o.title||"Contest cover",loading:"lazy",className:"w-full h-full object-cover"})}):e.jsx("div",{className:"aspect-[16/9] bg-gradient-to-br from-zinc-800 to-zinc-900"}),e.jsxs("div",{className:"p-4",children:[l?.company_name?e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-zinc-500 mb-1",children:l.company_name}):null,e.jsx("h3",{className:"font-semibold text-white mb-1.5 line-clamp-2",children:o.title||"Untitled contest"}),o.description?e.jsx("p",{className:"text-xs text-zinc-400 mb-3 line-clamp-2",children:o.description}):null,e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[x?e.jsx("span",{className:"font-medium text-amber-400",children:x}):null,c&&o.status==="active"?e.jsxs("span",{className:"text-zinc-500",children:["Ends"," ",c.toLocaleDateString(void 0,{month:"short",day:"numeric"})]}):h&&o.status==="active"?e.jsxs("span",{className:"text-zinc-500",children:["Opens"," ",h.toLocaleDateString(void 0,{month:"short",day:"numeric"})]}):null]})]})]},o.id)})})]})}export{pe as default};

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