try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`7361ee65-95fb-4ce2-8e7c-c7908c89f381`,e._sentryDebugIdIdentifier=`sentry-dbid-7361ee65-95fb-4ce2-8e7c-c7908c89f381`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Dg as n,Dp as r,Ep as i,Fg as a,Ig as o,dn as s,lh as c,lr as l,mr as u,sh as d}from"./entry.client-dr7r6s9a.js";import{o as f}from"./GameTileError-n5mrzlkv.js";import{a as p,c as m,d as h,f as g,i as _,l as v,n as y,o as b,r as x,s as S,u as C}from"./CompactListItem-gv8s0bza.js";import{a as w,i as T,n as E,r as D,t as O}from"./ThirdPartyGameTile-mzymclxi.js";var k=a(),A=e(o(),1),j=t(),M=s(u(({isPending:e,isError:t,nativeItem:n,error:r,rowIndex:i,onPress:a,columnSetId:o=`native`})=>{let{t:s}=c(`PureThirdPartyCompactListItem`),u=l(),d=(0,A.useId)(),f=E(n),O=n?.identifier,k=w({id:O?.id??``,providerId:O?.providerId,enabled:!!n});if(!u||e)return(0,j.jsx)(x,{id:d,rowIndex:i});if(t&&r)return(0,j.jsx)(y,{id:d,error:r,rowIndex:i});if(!n)return(0,j.jsx)(y,{id:d,error:Error(s(`No item data available`,{shortKey:`no_item_data_available`})),rowIndex:i});let M=T(n),{imageSrc:N}=D(n),P={title:()=>(0,j.jsx)(h,{id:`${d}-title`,title:M,imageSrc:N??``,imageWrapperClassName:`flex h-8 w-8 items-center justify-center rounded-component-item-standard-regular`,imageClassName:`h-full w-full`},`title`),publisher:()=>(0,j.jsx)(m,{publisher:f,id:`${d}-publisher`},`publisher`),lastPlayed:()=>(0,j.jsx)(v,{lastPlayedTimeMs:n.lastPlayedDate?.getTime(),id:`${d}-last-played`},`last-played`),source:()=>(0,j.jsx)(b,{sourceIcons:k,id:`${d}-source`},`source`),input:()=>(0,j.jsx)(C,{id:`${d}-input`},`input`),maturityRating:()=>(0,j.jsx)(C,{id:`${d}-maturity-rating`},`maturity-rating`),status:()=>(0,j.jsx)(p,{nativeData:n,accessLost:!1,playableOnCloud:!1,id:`${d}-status`},`status`),timePlayed:()=>(0,j.jsx)(C,{id:`${d}-time-played`,children:`—`},`time-played`),size:()=>(0,j.jsx)(S,{nativeData:n,id:`${d}-size`},`size`)};return(0,j.jsx)(_,{id:d,rowIndex:i,title:M,cells:g(o).map(e=>P[e.key]()),onPress:a})},`CompactListItem`),({libraryEntry:e,itemIndex:t,columnSetId:a=`native`})=>{if(!e.nativeIdentifier)throw new i(`libraryEntry.nativeIdentifier`,r.Missing);let{nativeGameCatalog:o}=d(),{data:s,isPending:c,isError:l,error:u}=n(o.queries.itemData.getOptions({identifier:e.nativeIdentifier})),p=f(s?.identifier);return{isPending:c,isError:l,error:l?u:null,nativeItem:s,rowIndex:t+2,onPress:p,columnSetId:a}}),N=e=>{let t=(0,k.c)(15),{productId:n,libraryEntry:r,viewAs:i,cardType:a,direction:o,className:s,itemIndex:c,imageConstraints:l,enableContextMenu:u,columnSetId:d}=e,f=O.useComponent(),p=M.useComponent();if(i===`table`){let e;return t[0]!==p||t[1]!==n||t[2]!==r||t[3]!==c||t[4]!==d?(e=(0,j.jsx)(p,{libraryEntry:r,itemIndex:c,columnSetId:d},n),t[0]=p,t[1]=n,t[2]=r,t[3]=c,t[4]=d,t[5]=e):e=t[5],e}let m;return t[6]!==f||t[7]!==n||t[8]!==r||t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==l||t[13]!==u?(m=(0,j.jsx)(f,{libraryEntry:r,cardType:a,direction:o,className:s,imageConstraints:l,enableContextMenu:u},n),t[6]=f,t[7]=n,t[8]=r,t[9]=a,t[10]=o,t[11]=s,t[12]=l,t[13]=u,t[14]=m):m=t[14],m};export{N as default};