import{r as c,j as s,a as i,b as l,d as g}from"./index-afzoW-A2.js";import{t as h}from"./runtime-omRR9KF1.js";import{P as j}from"./PageHeading-CTrjuZmQ.js";const m=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("rounded-xl border bg-card text-card-foreground shadow-sm",e),...a}));m.displayName="Card";const p=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("flex flex-col space-y-1.5 p-6",e),...a}));p.displayName="CardHeader";const N=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("font-semibold leading-none tracking-tight",e),...a}));N.displayName="CardTitle";const u=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("text-sm text-muted-foreground",e),...a}));u.displayName="CardDescription";const v=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("p-6 pt-0",e),...a}));v.displayName="CardContent";const C=c.forwardRef(({className:e,...a},r)=>s.jsx("div",{ref:r,className:i("flex items-center p-6 pt-0",e),...a}));C.displayName="CardFooter";const n=({ad:e,eager:a,inset:r})=>{const o=l.useRef(null);return l.useEffect(()=>h(o.current,e.tok??""),[e.tok]),s.jsx(m,{className:i("site-offer-card overflow-hidden border-0",r&&"max-sm:mx-auto max-sm:w-[var(--offer-inset)]"),style:r?{"--offer-inset":r}:void 0,children:s.jsxs("a",{ref:o,href:e.href,target:"_blank",rel:"noopener noreferrer",className:"block",children:[s.jsx("img",{src:e.img,width:e.w||void 0,height:e.h||void 0,alt:e.text??"",className:"w-full h-auto object-contain",loading:a?"eager":"lazy",decoding:"async"}),s.jsx("div",{className:"p-3",children:s.jsx("div",{className:"text-sm text-center text-foreground font-medium",children:e.text})})]})})};function R(){const e=g.useLoaderData(),a=t=>e.slots?.[t]?.ads??[],r=a("offersApps"),o=a("offersJsGames"),x=a("offersJgGames"),f=a("offersHGames");return s.jsxs("div",{className:"site-offers px-4",children:[s.jsx(j,{title:"福利",eyebrow:"PARTNER COLLECTION",children:s.jsx("span",{className:"site-chip",children:"合作推廣"})}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("section",{children:[s.jsxs("div",{className:"site-section-heading",children:[s.jsx("h2",{children:"在線視頻"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"合作內容"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 md:grid-cols-6 gap-6",children:r.map((t,d)=>s.jsx(n,{ad:t,eager:d<6,inset:"85.3%"},`vApps-${d}`))})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"site-section-heading",children:[s.jsx("h2",{children:"遊戲 · JS Game"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"合作內容"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-6",children:o.map((t,d)=>s.jsx(n,{ad:t,eager:d<6},`jsGame-${d}`))})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"site-section-heading",children:[s.jsx("h2",{children:"遊戲 · H Game"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"合作內容"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-6",children:f.map((t,d)=>s.jsx(n,{ad:t,eager:d<6},`hGame-${d}`))})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"site-section-heading",children:[s.jsx("h2",{children:"遊戲 · JG Game"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"合作內容"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-6",children:x.map((t,d)=>s.jsx(n,{ad:t,eager:d<6},`jg-${d}`))})]})]})]})}export{R as component};
