PageSourceSearch

https://criticdb.com/_nuxt/AfgWbS5X.js

js criticdb.com collected 2026-09-25 06:10:53 UTC 17,159 bytes, 1 lines download raw bytes

1import{G as ee,aX as te,s as a,h as D,d as h,a as e,b as n,e as l,c as d,g as p,A as se,j as oe,t as c,f as b,F as B,r as M,P as le,aY as ae,m as f,p as q,_ as K,v as Y,K as re,y as ie,Q as ne,o as de,i as I,aT as T,S as ce,q as z,z as R,l as G}from"./DVPCUeIP.js";import{_ as ue}from"./WgvKiWRj.js";import{_ as me}from"./BdaOO-yF.js";import{_ as Q}from"./_dk6PrHP.js";import{_ as pe}from"./Cx_oi8VI.js";import{getFullImageUrl as A,getScoreColor as ge}from"./BllLcC3l.js";import"./DNd9cadU.js";import"./eyC4mF6J.js";import"./Cme3_O54.js";import"./CKn5O6Ku.js";import"./BQhWxLM2.js";import"./WlG_yBXe.js";const he={class:"p-6"},ve={class:"flex items-start justify-between mb-6"},fe={key:0,class:"space-y-4"},_e={class:"p-3 rounded-lg bg-amber-500/10 border border-amber-500/20 text-xs text-amber-300 flex gap-2"},be={key:0,class:"text-sm text-red-400 text-center"},ye={key:1,class:"space-y-4"},xe={class:"flex items-start justify-between gap-4"},we={class:"text-sm font-medium text-white"},ke={key:0,class:"text-xs text-gray-500 mt-0.5"},$e={key:0,class:"max-h-64 overflow-y-auto space-y-1.5 rounded-lg border border-gray-700/30 p-2"},Ce={class:"w-8 h-10 rounded overflow-hidden bg-gray-800 flex-shrink-0"},Se={class:"text-sm text-white flex-1 min-w-0 truncate"},Ie={key:1,class:"space-y-2"},Ve={class:"flex items-center gap-2"},De={class:"text-xs font-medium text-amber-300"},Ue={class:"max-h-36 overflow-y-auto rounded-lg border border-amber-500/10 bg-amber-500/5 divide-y divide-gray-700/30"},je=["href"],We=["src","alt"],Be={class:"text-xs text-gray-400 group-hover:text-gray-200 flex-1 truncate transition-colors"},Me={key:2,class:"text-xs text-gray-500 text-center"},Ne={class:"flex gap-2 pt-1"},Pe={key:2,class:"text-center py-4 space-y-3"},ze={class:"w-12 h-12 rounded-full bg-teal-500/10 border border-teal-500/20 flex items-center justify-center mx-auto"},Ee={class:"text-sm text-gray-400 mt-1"},Le={class:"text-teal-300"},Te=ee({__name:"ImportWishlistModal",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:ae(["imported"],["update:modelValue"]),setup(F,{emit:U}){const j=te(F,"modelValue"),y=U,_=f("input"),g=f(""),m=f(!1),x=f(""),u=f({matched:[],total_wishlist:0,total_matched:0}),w=f(0),W=()=>{j.value=!1,setTimeout($,300)},$=()=>{_.value="input",g.value="",x.value="",u.value={matched:[],missing:[],total_wishlist:0,total_matched:0,total_missing:0},w.value=0},V=async()=>{if(g.value.trim()){m.value=!0,x.value="";try{const v=await $fetch("/api/steam/import-wishlist",{method:"POST",body:{steamProfile:g.value,confirm:!1}});u.value=v,_.value="preview"}catch(v){x.value=v?.data?.message||v?.message||"Something went wrong. Check the profile URL and try again."}finally{m.value=!1}}},N=async()=>{m.value=!0;try{const v=await $fetch("/api/steam/import-wishlist",{method:"POST",body:{steamProfile:g.value,confirm:!0}});w.value=v.imported,_.value="done",y("imported",v.imported)}catch(v){x.value=v?.data?.message||"Import failed. Please try again.",_.value="preview"}finally{m.value=!1}};return(v,r)=>{const C=Y,E=q,S=K,i=Q,t=pe;return a(),D(t,{modelValue:j.value,"onUpdate:modelValue":r[2]||(r[2]=s=>j.value=s),ui:{width:"max-w-lg"}},{default:h(()=>[e("div",he,[e("div",ve,[r[3]||(r[3]=e("div",null,[e("div",{class:"flex items-center gap-2 mb-1"},[e("img",{src:"https://store.steampowered.com/favicon.ico",class:"w-4 h-4 rounded-sm",alt:"Steam"}),e("h2",{class:"text-lg font-bold text-white"},"Import Steam Wishlist")]),e("p",{class:"text-sm text-gray-400"}," Transfer games from your Steam wishlist to CriticDB. ")],-1)),e("button",{class:"text-gray-500 hover:text-gray-300 transition-colors",onClick:W},[n(C,{name:"i-heroicons-x-mark",class:"w-5 h-5"}
1)])]),l(_)==="input"?(a(),d("div",fe,[e("div",_e,[n(C,{name:"i-heroicons-information-circle",class:"w-4 h-4 flex-shrink-0 mt-0.5"}),r[4]||(r[4]=e("span",null,[p("Your Steam wishlist must be "),e("strong",null,"public"),p(". On Steam go to "),e("em",null,"Edit Profile → Privacy Settings → Game Details → Public"),p(".")],-1))]),e("div",null,[r[5]||(r[5]=e("label",{class:"text-xs text-gray-400 uppercase tracking-wider font-medium mb-1.5 block"},"Steam profile URL or username",-1)),n(E,{modelValue:l(g),"onUpdate:modelValue":r[0]||(r[0]=s=>oe(g)?g.value=s:null),placeholder:"steamcommunity.com/id/username or Steam ID",size:"md",color:"gray",disabled:l(m),onKeydown:se(V,["enter"])},null,8,["modelValue","disabled"]),r[6]||(r[6]=e("p",{class:"text-xs text-gray-600 mt-1.5"},'e.g. https://steamcommunity.com/id/gaben or just "gaben"',-1))]),n(S,{block:"",color:"teal",loading:l(m),disabled:!l(g).trim(),onClick:V},{default:h(()=>[...r[7]||(r[7]=[p(" Preview wishlist ",-1)])]),_:1},8,["loading","disabled"]),l(x)?(a(),d("p",be,c(l(x)),1)):b("",!0)])):l(_)==="preview"?(a(),d("div",ye,[e("div",xe,[e("div",null,[e("p",we,c(l(u).total_matched)+" of "+c(l(u).total_wishlist)+" games found on CriticDB ",1),l(u).total_missing>0?(a(),d("p",ke,c(l(u).total_missing)+" not in our database yet ",1)):b("",!0)]),e("button",{class:"text-xs text-gray-500 hover:text-gray-300 transition-colors flex-shrink-0 mt-0.5",onClick:$}," ← Back ")]),l(u).matched.length?(a(),d("div",$e,[(a(!0),d(B,null,M(l(u).matched,s=>(a(),d("div",{key:s.id,class:"flex items-center gap-3 p-2 rounded-lg bg-gray-800/40"},[e("div",Ce,[s.cover_image?(a(),D(i,{key:0,src:l(A)(s.cover_image),alt:s.name,width:"32",height:"40",class:"w-full h-full object-cover",format:"webp"},null,8,["src","alt"])):b("",!0)]),e("span",Se,c(s.name),1),s.avg_score?(a(),d("span",{key:0,class:"text-xs font-bold flex-shrink-0 tabular-nums",style:le({color:l(ge)(s.avg_score)})},c(Math.round(s.avg_score)),5)):b("",!0)]))),128))])):b("",!0),l(u).missing?.length?(a(),d("div",Ie,[e("div",Ve,[n(C,{name:"i-heroicons-exclamation-triangle",class:"w-3.5 h-3.5 text-amber-400 flex-shrink-0"}),e("p",De,c(l(u).total_missing)+" game"+c(l(u).total_missing===1?"":"s")+" from your wishlist aren't on CriticDB yet ",1)]),e("div",Ue,[(a(!0),d(B,null,M(l(u).missing,s=>(a(),d("a",{key:s.steam_app_id,href:s.store_url,target:"_blank",rel:"noopener noreferrer",class:"flex items-center gap-2 px-3 py-2 hover:bg-amber-500/10 transition-colors group"},[e("img",{src:`https://cdn.cloudflare.steamstatic.com/steam/apps/${s.steam_app_id}/capsule_sm_120.jpg`,class:"w-10 h-7 rounded object-cover flex-shrink-0 opacity-80",alt:s.name,onError:r[1]||(r[1]=P=>P.target.style.display="none")},null,40,We),e("span",Be,c(s.name),1),n(C,{name:"i-heroicons-arrow-top-right-on-square",class:"w-3 h-3 text-gray-600 flex-shrink-0"})],8,je))),128))]),r[8]||(r[8]=e("p",{class:"text-meta text-gray-600 text-center"}," We've noted your interest — these games will be prioritised for addition. ",-1))])):l(u).total_missing>0?(a(),d("div",Me,c(l(u).total_missing)+" games from your wishlist aren't in our database yet. We've noted your interest. ",1)):b("",!0),e("div",Ne,[n(S,{variant:"ghost",color:"gray",class:"flex-1 justify-center",onClick:$},{default:h(()=>[...r[9]||(r[9]=[p("Cancel",-1)])]),_:1}),n(S,{color:"teal",class:"flex-1 justify-center",loading:l(m),disabled:!l(u).matched.length,onClick:N},{default:h(()=>[p(" Add "+c(l(u).matched.length)+" game"+c(l(u).matched.length===1?"":"s")+" to wishlist ",1)]),_:1},8,["loading","disabled"])])])):l(_)==="done"?(a(),d("div",Pe,[e("div",ze,[n(C,{name:"i-heroicons-check",class:"w-6 h-6 text-teal-400"})]),e("div",null,[r[11]||(r[11]=e("p",{class:"text-white font-semibold"},"Wishlist imported!",-1)),e("p",Ee,[r[10]||(r[10]=p(" Added ",-1)),e("strong",Le,c(l(w)),1),p(" game"+c(l(w)===1?"":"s")+" to your CriticDB wishlist. ",1)])]),n(S,{block:"",color:"teal",variant:"soft",onClick:W},{default:h(()=>[...r[12]||(r[12]=[p("Done",-1)])]),_:1})])):b("",!0)])]),_:1},8,["modelValue"])}}}),Ae=Object.assign(Te,{__name:"SteamImportWishlistModal"}),Fe={class:"space-y-6"},Oe={class:"flex items-center gap-2 border-b border-gray-700/30 pb-2 mb-6"},Re={class:"flex flex-col sm:flex-row gap-4 justify-between items-start sm:items-center"},Ge={class:"text-gray-400 mt-1"},qe={class:"flex items-center gap-3"},Ke={class:"flex bg-gray-800/50 rounded-lg p-1"},Ye={class:"bg-gray-800/50 backdrop-blur-sm rounded-xl p-6 border border-gray-700/30"}
1,Qe={class:"flex flex-col lg:flex-row gap-4"},Ze={class:"flex-1"},He={class:"flex gap-3"},Xe={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"},Je={key:2,class:"text-center py-12"},et={class:"text-gray-400 mb-6"},tt={key:3,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"},st={key:1,class:"w-full h-full bg-gray-700 flex items-center justify-center"},ot={class:"absolute top-2 right-2"},lt=["onClick"],at={class:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center"},rt={class:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3"},it={class:"text-white font-medium text-sm line-clamp-2"},nt={key:4,class:"relative"},dt={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"},ct=["onClick"],ut={class:"absolute top-2 right-2"},mt=["onClick"],pt={class:"bg-gray-800 p-4 rounded-lg h-full overflow-y-auto"},gt={class:"text-sm text-gray-300 mb-2"},ht={class:"text-xs text-gray-400"},vt={__name:"my-wishlist",setup(F){const U=f(!1),j=i=>{i>0&&$()};ie({title:"My Wishlist - Dashboard",meta:[{name:"description",content:"Your game wishlist on CriticDB"}]});const y=f(""),_=f("newest"),g=f("grid"),m=f(null),x=f(!1),u=[{label:"Newest First",value:"newest"},{label:"Oldest First",value:"oldest"},{label:"Name A-Z",value:"name_asc"},{label:"Name Z-A",value:"name_desc"}],{data:w,error:W,refresh:$}=ne("userWishlist",()=>$fetch("/api/wishlist",{method:"GET"}),{server:!1,immediate:!1}),V=z(()=>w.value||[]),N=z(()=>!x.value),v=z(()=>V.value.length),r=z(()=>{let i=[...V.value];if(y.value){const t=y.value.toLowerCase();i=i.filter(s=>s.name?.toLowerCase().includes(t)||s.summary?.toLowerCase().includes(t))}return i.sort((t,s)=>{switch(_.value){case"newest":return new Date(s.added_at||s.created_at)-new Date(t.added_at||t.created_at);case"oldest":return new Date(t.added_at||t.created_at)-new Date(s.added_at||s.created_at);case"name_asc":return(t.name||"").localeCompare(s.name||"");case"name_desc":return(s.name||"").localeCompare(t.name||"");default:return 0}}),i}),C=i=>new Date(i).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),E=(i,t)=>i.length<=t?i:i.slice(0,t)+"...",S=async i=>{if(confirm(`Remove "${i.name}" from your wishlist?`))try{w.value=w.value.filter(t=>t.id!==i.id),m.value?.id===i.id&&(m.value=null),await $fetch("/api/wishlist",{method:"DELETE",body:{gameId:i.id}}),G().add({title:"Removed from wishlist",description:`${i.name} has been removed from your wishlist`,icon:"i-heroicons-bookmark",color:"gray",timeout:2e3})}catch{$(),G().add({title:"Error",description:"Failed to remove from wishlist. Please try again.",color:"red",timeout:2e3})}};return de(async()=>{try{await $()}catch{}finally{x.value=!0}}),(i,t)=>{const s=ce,P=K,k=Y,Z=q,H=ue,X=me,O=Q,J=Ae;return a(),d("div",Fe,[e("div",Oe,[n(s,{to:"/dashboard/games",class:I(["px-4 py-2 font-medium transition-colors relative",(i._.provides[T]||i.$route).path==="/dashboard/games"?"text-teal-400 border-b-2 border-teal-400 -mb-[2px]":"text-gray-400 hover:text-gray-300"])},{default:h(()=>[...t[10]||(t[10]=[p(" Collection ",-1)])]),_:1},8,["class"]),n(s,{to:"/dashboard/my-wishlist",class:I(["px-4 py-2 font-medium transition-colors relative",(i._.provides[T]||i.$route).path==="/dashboard/my-wishlist"?"text-teal-400 border-b-2 border-teal-400 -mb-[2px]":"text-gray-400 hover:text-gray-300"])},{default:h(()=>[...t[11]||(t[11]=[p(" Wishlist ",-1)])]),_:1},8,["class"]),n(s,{to:"/dashboard/my-favorites",class:I(["px-4 py-2 font-medium transition-colors relative",(i._.provides[T]||i.$route).path==="/dashboard/my-favorites"?"text-teal-400 border-b-2 border-teal-400 -mb-[2px]":"text-gray-400 hover:text-gray-300"])},{default:h(()=>[...t[12]||(t[12]=[p(" Favorites ",-1)])]),_:1},8,["class"])]),e("div",Re,[e("div",null,[t[13]||(t[13]=e("h1",{class:"text-2xl font-bold text-white"},"Wishlist",-1)),e("p",Ge,c(v.value)+" games in your wishlist",1)]),e("div",qe,[n(P,{size:"sm",variant:"outline",color:"gray","leading-icon":"i-heroicons-arrow-down-tray",onClick:t[0]||(t[0]=o=>U.value=!0)},{default:h(()=>[...t[14]||(t[14]=[p(" Import from Steam ",-1)])]),_:1}),e("div",Ke,[e("button",{onClick:t[1]||(t[1]=o=>g.value="grid"),class:I([g.value==="grid"?"bg-blue-500 text-white":"text-gray-400 hover:text-white","p-2 rounded transition-colors"])},[n(k,{name:"i-heroicons-squares-2x2",class:"w-4 h-4"})],2),e("button",{onClick:t[2]||(t[2]=o=>g.value="cards"),class:I([g.value==="cards"?"bg-blue-500 text-white":"text-gray-400 hover:text-white","p-2 rounded transition-colors"])},[n(k,{name:"i-heroicons-rectangle-stack",class:"w-4 h-4"})],2)])])]),e("div",Ye,[e("div",Qe,[e("div",Ze,[n(Z,{modelValue:y.value,"onUpdate:modelValue":t[3]||(t[3]=o=>y.value=o),placeholder:"Search your wishlist...",icon:"i-heroicons-magnifying-glass",size:"lg",class:"w-full",ui:{icon:{leading:{base:"text-blue-400"}},base:"relative block w-full",rounded:"rounded-lg",placeholder:"placeholder-gray-400",color:{white:{outline:"shadow-sm bg-gray-900/70 border-blue-500/30 text-white placeholder-gray-400 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 hover:border-blue-500/50"}}}},null,8,["modelValue"])]),e("div",He,[n(H,{modelValue:_.value,"onUpdate:modelValue":t[4]||(t[4]=o=>_.value=o),options:u,placeholder:"Sort by",class:"min-w-[140px]",ui:{ring:"focus:ring-2 focus:ring-blue-400",color:{white:{outline:"bg-gray-900/70 border-blue-500/30 text-white focus:border-blue-400 hover:border-blue-500/50"}}}},null,8,["modelValue"]),y.value?(a(),D(P,{key:0,onClick:t[5]||(t[5]=o=>y.value=""),variant:"ghost",color:"gray",size:"md"},{default:h(()=>[...t[15]||(t[15]=[p(" Clear ",-1)])]),_:1})):b("",!0)])])]),N.value?(a(),d("div",Xe,[(a(),d(B,null,M(10,o=>e("div",{key:o,class:"aspect-[3/4] bg-gray-800/50 rounded-lg animate-pulse"})),64))])):b("",!0),l(W)?(a(),D(X,{key:1,title:"Error",color:"red"},{default:h(()=>[p(c(l(W)),1)]),_:1})):!N.value&&V.value.length===0?(a(),d("div",Je,[n(k,{name:"i-heroicons-bookmark",class:"w-16 h-16 text-gray-500 mx-auto mb-4"}),t[17]||(t[17]=e("h3",{class:"text-xl font-semibold text-white mb-2"},"No wishlist games",-1)),e("p",et,c(y.value?"No wishlist games match your search":"Start adding games to your wishlist"),1),n(s,{to:"/games",class:"bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg transition-colors inline-flex items-center gap-2"},{default:h(()=>[n(k,{name:"i-heroicons-bookmark",class:"w-4 h-4"}),t[16]||(t[16]=p(" Discover Games ",-1))]),_:1})])):g.value==="grid"?(a(),d("div",tt,[(a(!0),d(B,null,M(r.value,o=>(a(),d("div",{key:o.id,class:"group relative aspect-[3/4] bg-gray-800/50 rounded-lg overflow-hidden hover:bg-gray-800/70 transition-all hover:scale-105"},[o.cover_image?(a(),D(O,{key:0,src:l(A)(o.cover_image),alt:o.name,class:"w-full h-full object-cover",loading:"lazy"},null,8,["src","alt"])):(a(),d("div",st,[n(k,{name:"i-heroicons-photo",class:"w-8 h-8 text-gray-500"})])),e("div",ot,[e("button",{onClick:L=>S(o),class:"bg-blue-500/20 hover:bg-blue-500/40 p-2 rounded-full transition-colors backdrop-blur-sm"},[n(k,{name:"i-heroicons-bookmark-solid",class:"w-4 h-4 text-blue-400"})],8,lt)]),e("div",at,[n(s,{to:`/games/${o.slug}`,class:"bg-white/20 hover:bg-white/30 p-3 rounded-full transition-colors"},{default:h(()=>[n(k,{name:"i-heroicons-eye",class:"w-5 h-5 text-white"})]),_:1}
1,8,["to"])]),e("div",rt,[e("h3",it,c(o.name),1)])]))),128))])):(a(),d("div",nt,[m.value?(a(),d("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity z-20",onClick:t[6]||(t[6]=o=>m.value=null)})):b("",!0),e("div",dt,[(a(!0),d(B,null,M(r.value,o=>(a(),d("div",{key:o.id,class:I(["relative cursor-pointer aspect-[3/4]",{"z-30":m.value?.id===o.id}])},[e("div",{class:I(["card-flip",{"is-flipped":m.value?.id===o.id,"opacity-50":m.value&&m.value.id!==o.id}])},[e("div",{class:"card-face card-front",onClick:L=>m.value=o},[o.cover_image?(a(),D(O,{key:0,src:l(A)(o.cover_image),alt:o.name,class:"w-full h-full object-cover rounded-lg transition-transform duration-200 hover:scale-105",loading:"lazy"},null,8,["src","alt"])):b("",!0),e("div",ut,[e("button",{onClick:R(L=>S(o),["stop"]),class:"text-gray-400 hover:text-blue-500 transition-colors bg-black/50 p-1 rounded-full backdrop-blur-sm"},[n(k,{name:"i-heroicons-bookmark-solid",class:"w-5 h-5"})],8,mt)])],8,ct),e("div",{class:"card-face card-back",onClick:t[8]||(t[8]=L=>m.value=null)},[e("div",pt,[n(s,{to:`/games/${o.slug}`,class:"text-lg font-bold mb-2 hover:text-blue-400 transition-colors block",onClick:t[7]||(t[7]=R(()=>{},["stop"]))},{default:h(()=>[p(c(o.name),1)]),_:2},1032,["to"]),e("p",gt,c(E(o.summary||"No summary available",100)),1),e("div",ht," Added on "+c(C(o.added_at)),1)])])],2)],2))),128))])])),n(J,{modelValue:U.value,"onUpdate:modelValue":t[9]||(t[9]=o=>U.value=o),onImported:j},null,8,["modelValue"])])}}},Dt=re(vt,[["__scopeId","data-v-fcfbc2dd"]]);export{Dt 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.