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]=`f75afb3f-3079-4f77-b66d-3629a8a0e09a`,e._sentryDebugIdIdentifier=`sentry-dbid-f75afb3f-3079-4f77-b66d-3629a8a0e09a`)}catch{}import{Ag as e,Dp as t,Ep as n,Fg as r,Op as i,lh as a,md as o,pg as s}from"./entry.client-dr7r6s9a.js";import{n as c}from"./TabContentLayout-ltqqpnab.js";var l=r(),u=e(),d=()=>{let e=(0,l.c)(4),{t}=a(`SettingsStorageTab`),n;e[0]===t?n=e[1]:(n=t(`There was an error fetching your save data, please try again`,{shortKey:`fetching_please_there_7207b4`}),e[0]=t,e[1]=n);let r=n,i;return e[2]===r?i=e[3]:(i=(0,u.jsx)(c,{errorString:r}),e[2]=r,e[3]=i),i};function f(e){switch(e){case o.QuickResume:return`QuickResume`;case o.PersistentLocalStorage:return`ReservedSpace`;case o.ConnectedStorage:return`CloudSave`;case o.SharedLocalStorage:return`CloudSave360`;default:throw new n(`contentType`,t.Unsupported,`Unknown content type, received: ${e}`)}}var p=e=>({...e,expirationTime:new Date(e.expirationTime),lastSavedTime:new Date(e.lastSavedTime),contentType:f(e.contentType)}),m=e=>{if(!e)return[];let t=e.reduce((e,t)=>{if(!e[t.productId])e[t.productId]={productId:t.productId,lastSaved:new Date(t.lastSavedTime)};else{let n=e[t.productId].lastSaved.getTime();new Date(t.lastSavedTime).getTime()>n&&(e[t.productId].lastSaved=new Date(t.lastSavedTime))}try{let n=p(t);switch(n.contentType){case`CloudSave`:case`CloudSave360`:e[n.productId].save=n;break;case`QuickResume`:e[n.productId].quickResumeSave=n;break;case`ReservedSpace`:e[n.productId].reservedSpace=n;break}}catch(e){if(i(e))new s(`StorageTab`).error(`Parameter ${e.parameterName} is invalid: ${e.reason}`);else throw e}return e},{});return Object.values(t).sort((e,t)=>t.lastSaved.getTime()-e.lastSaved.getTime())};export{m as n,d as r,f as t};