1import{s as n,h as k,d as p,a as s,t as l,e,c,b as _,P as I,g as $,f as x,q as d,F as E,r as D,u as V,Y as q,w as N,M as P,y as Y,i as R,R as z,n as J}from"./CVAGsPFZ.js";import{_ as K}from"./CiuwH3r_.js";import{c as Q,f as G,d as W}from"./Dg76NElS.js";import{_ as X}from"./DaVnCCBS.js";import{getFullImageUrl as B,buildRankedListItems as Z}from"./BllLcC3l.js";import{_ as ee}from"./DUT4ZRIE.js";import{_ as te}from"./BScvD5mr.js";import"./tGADGMDC.js";import"./MEP3sRgl.js";import"./CjEPmZ5Y.js";const se={class:"text-xs text-gray-500 mb-3"},ae={class:"text-gray-400"},ne={class:"text-3xl sm:text-4xl font-bold text-white drop-shadow-lg"},oe={class:"text-gray-300 mt-4 text-sm leading-relaxed max-w-3xl"},re={key:0,class:"flex flex-wrap gap-x-6 gap-y-2 mt-4 text-sm"},ie={class:"text-teal-400 tabular-nums"},le={key:0},ce={class:"text-gray-400 tabular-nums"},me={class:"block text-white font-medium tabular-nums"},de={__name:"FranchiseHeader",props:{data:{type:Object,required:!0}},setup(y){const o=y,u=d(()=>G(o.data.franchise.name)),m=d(()=>o.data.games[0]),a=d(()=>o.data.games.at(-1)),h=d(()=>W(o.data)),t=d(()=>o.data.hero);return(L,r)=>{const i=I,C=K;return n(),k(C,{image:e(t)?.image,alt:e(t)?`${e(t).name} artwork`:"","plain-class":"mb-8"},{top:p(()=>[s("nav",se,[_(i,{to:"/franchises",class:"hover:text-teal-400"},{default:p(()=>[...r[0]||(r[0]=[$("Franchises",-1)])]),_:1}),r[1]||(r[1]=s("span",{class:"mx-1.5"},"/",-1)),s("span",ae,l(e(u)),1)])]),default:p(()=>[s("h1",ne,"Every "+l(e(u))+" Game Ranked",1),s("p",oe,l(e(h)),1),e(m)?(n(),c("div",re,[s("div",null,[r[2]||(r[2]=s("span",{class:"text-gray-500"},"Highest rated",-1)),_(i,{to:`/games/${e(m).slug}`,class:"block text-white font-medium hover:text-teal-400"},{default:p(()=>[$(l(e(m).name)+" ",1),s("span",ie,l(Math.round(e(m).avg_score)),1)]),_:1},8,["to"])]),e(a)&&e(a).id!==e(m).id?(n(),c("div",le,[r[3]||(r[3]=s("span",{class:"text-gray-500"},"Lowest rated",-1)),_(i,{to:`/games/${e(a).slug}`,class:"block text-white font-medium hover:text-teal-400"},{default:p(()=>[$(l(e(a).name)+" ",1),s("span",ce,l(Math.round(e(a).avg_score)),1)]),_:1},8,["to"])])):x("",!0),s("div",null,[r[4]||(r[4]=s("span",{class:"text-gray-500"},"Series average",-1)),s("span",me,l(e(Q)(y.data.games)),1)])])):x("",!0)]),_:1},8,["image","alt"])}}},ue={class:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-4"},ge=["src","alt"],pe={key:1,class:"w-full aspect-[3/4] rounded-md bg-gray-800"},_e={class:"mt-1.5 text-xs text-gray-300 group-hover:text-teal-400 line-clamp-2"},he={key:2,class:"text-[11px] text-gray-500"},xe={__name:"FranchiseGameGrid",props:{games:{type:Array,required:!0}},setup(y){return(o,u)=>{const m=I;return n(),c("div",ue,[(n(!0),c(E,null,D(y.games,a=>(n(),k(m,{key:a.id,to:`/games/${a.slug}`,class:"group"},{default:p(()=>[a.cover_image?(n(),c("img",{key:0,src:e(B)(a.cover_image),alt:a.name,loading:"lazy",class:"w-full aspect-[3/4] object-cover rounded-md bg-gray-800"},null,8,ge)):(n(),c("div",pe)),s("p",_e,l(a.name),1),a.release_date?(n(),c("p",he,l(a.release_date.slice(0,4)),1)):x("",!0)]),_:2},1032,["to"]))),128))])}}},ye={key:0,class:"animate-pulse"},ve={key:1,class:"text-center py-16"},fe={class:"text-gray-400"},be={key:2,class:"mt-12"},we={key:3,class:"mt-12 max-w-2xl"},$e={class:"text-lg font-semibold text-white mb-3"},Be={__name:"[slug]",async setup(y){let o,u;const m=V(),a=q().public.siteUrl||"https://criticdb.com",h=Array.isArray(m.params.slug)?m.params.slug[0]:String(m.params.slug||""),{data:t,pending:L,error:r}=([o,u]=N(()=>z(`franchise-${h}`,()=>$fetch(`/api/franchises/${h}`))),o=await o,u(),o);if(r.value)throw P({statusCode:r.value.statusCode||404,statusMessage:"Franchise not found",fatal:!0});t.value?.redirect&&([o,u]=N(()=>J(`/franchises/${t.value.redirect}`,{})),await o,u());const i=d(()=>G(t.value?.franchise?.name||"")),C=new Date().toISOString().slice(0,10),b=d(()=>t.value?.hero?.image?B(t.value.hero.image):null),A=new Date().getFullYear(),v=d(()=>`${a}/franchises/${h}`),F=d(()=>`Every ${i.value} Game Ranked by Critics (${A}) - CriticDB`),w=d(()=>{const f=t.value?.games||[];return f.length?`All ${f.length} ${i.value} games ranked from best to worst by aggregated critic score. #1 is ${f[0].name} (${Math.round(f[0].avg_score)}).`:`Every ${i.value} game on CriticDB, with critic review scores.`});return Y(()=>({title:F.value,meta:[{name:"description",content:w.value},{name:"robots",content:t.value?.indexable?"index, follow":"noindex, follow"},{property:"og:title",content:F.value},{property:"og:description",content:w.value},{property:"og:type",content:"website"},{property:"og:url",content:v.value},{property:"og:site_name",content:"CriticDB"},...b.value?[{property:"og:image",content:b.value},{name:"twitter:image",content:b.value}]:[],{name:"twitter:card",content:b.value?"summary_large_image":"summary"},{name:"twitter:site",content:"@CriticDB"},{name:"twitter:title",content:F.value},{name:"twitter:description",content:w.value}],link:[{rel:"canonical",href:v.value}],script:t.value?.games?.length?[{type:"application/ld+json",innerHTML:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage","@id":`${v.value}#collectionpage`,name:`Every ${i.value} Game Ranked`,description:w.value,url:v.value,numberOfItems:t.value.games.length,mainEntity:{"@type":"ItemList",name:`Every ${i.value}
1 Game Ranked`,itemListOrder:"https://schema.org/ItemListOrderDescending",numberOfItems:t.value.games.length,itemListElement:Z(t.value.games,a)}})},{type:"application/ld+json",innerHTML:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:a},{"@type":"ListItem",position:2,name:"Franchises",item:`${a}/franchises`},{"@type":"ListItem",position:3,name:`Every ${i.value} Game Ranked`,item:v.value}]})}]:[]})),(f,g)=>{const H=de,O=X,S=xe,M=ee,U=I,T=te;return n(),k(T,{class:R(["pb-8 max-w-6xl mx-auto",e(t)?.hero&&!e(L)?"pt-0":"pt-8"])},{default:p(()=>[e(L)?(n(),c("div",ye,[g[0]||(g[0]=s("div",{class:"h-10 bg-gray-800 rounded w-80 mb-2"},null,-1)),g[1]||(g[1]=s("div",{class:"h-5 bg-gray-800 rounded w-56 mb-8"},null,-1)),(n(),c(E,null,D(8,j=>s("div",{key:j,class:"h-24 bg-gray-800/60 rounded mb-2"})),64))])):e(t)&&!e(t).redirect?(n(),c(E,{key:1},[_(H,{data:e(t)},null,8,["data"]),e(t).games.length?(n(),k(O,{key:0,games:e(t).games},null,8,["games"])):(n(),c("div",ve,[s("p",fe,"No "+l(e(i))+" games have enough critic reviews to rank yet.",1)])),e(t).extras.length?(n(),c("section",be,[g[2]||(g[2]=s("h2",{class:"text-xl font-semibold text-white mb-1"},"Expansions & DLC",-1)),g[3]||(g[3]=s("p",{class:"text-gray-500 text-sm mb-4"},"Add-ons, expansions and bundles, not included in the ranking.",-1)),_(S,{games:e(t).extras},null,8,["games"])])):x("",!0),e(t).timeline.length>1?(n(),c("section",we,[s("h2",$e,l(e(i))+" games in release order",1),s("div",{class:R(e(t).timeline.length>15?"max-h-96 overflow-y-auto pr-2":"")},[_(M,{entries:e(t).timeline,today:e(C)},null,8,["entries","today"])],2),_(U,{to:`/franchises/in-order/${e(h)}`,class:"inline-block mt-3 text-sm text-teal-400 hover:text-teal-300"},{default:p(()=>[$(" See every "+l(e(i))+" game in release order â ",1)]),_:1},8,["to"])])):x("",!0)],64)):x("",!0)]),_:1},8,["class"])}}};export{Be 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.