{"version":3,"file":"useCanGoBack.cjs","names":["useRouter","isServer","useSelector"],"sources":["../../src/useCanGoBack.ts"],"sourcesContent":["import { useSelector } from '@tanstack/react-store'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function useCanGoBack() {\n  const router = useRouter()\n\n  if (isServer ?? router.isServer) {\n    return router.stores.location.get().state.__TSR_index !== 0\n  }\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static\n  return useSelector(\n    router.stores.location,\n    (location) => location.state.__TSR_index !== 0,\n  )\n}\n"],"mappings":";;;;AAIA,SAAgB,eAAe;CAC7B,MAAM,SAASA,kBAAAA,UAAU;CAEzB,IAAIC,+BAAAA,YAAY,OAAO,UACrB,OAAO,OAAO,OAAO,SAAS,IAAI,CAAC,CAAC,MAAM,gBAAgB;CAI5D,QAAA,GAAOC,sBAAAA,YAAAA,CACL,OAAO,OAAO,WACb,aAAa,SAAS,MAAM,gBAAgB,CAC/C;AACF"}