super-time-tracker-ui 0.1.39 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/README.md +88 -88
  2. package/bin/stt-ui.js +220 -220
  3. package/dist/standalone/next-output/BUILD_ID +1 -1
  4. package/dist/standalone/next-output/build-manifest.json +5 -5
  5. package/dist/standalone/next-output/server/app/_global-error/page/build-manifest.json +2 -2
  6. package/dist/standalone/next-output/server/app/_global-error/page.js +1 -1
  7. package/dist/standalone/next-output/server/app/_global-error/page.js.nft.json +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
  10. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/dist/standalone/next-output/server/app/_not-found/page/build-manifest.json +2 -2
  16. package/dist/standalone/next-output/server/app/_not-found/page.js +1 -1
  17. package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
  18. package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/standalone/next-output/server/app/api/auth/signout/route.js +1 -1
  20. package/dist/standalone/next-output/server/app/api/auth/signout/route.js.nft.json +1 -1
  21. package/dist/standalone/next-output/server/app/api/sync/import/route.js +1 -1
  22. package/dist/standalone/next-output/server/app/api/sync/import/route.js.nft.json +1 -1
  23. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js +1 -1
  24. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js.nft.json +1 -1
  25. package/dist/standalone/next-output/server/app/api/sync/pull/route.js +1 -1
  26. package/dist/standalone/next-output/server/app/api/sync/pull/route.js.nft.json +1 -1
  27. package/dist/standalone/next-output/server/app/api/sync/push/route.js +1 -1
  28. package/dist/standalone/next-output/server/app/api/sync/push/route.js.nft.json +1 -1
  29. package/dist/standalone/next-output/server/app/auth/callback/route.js +1 -1
  30. package/dist/standalone/next-output/server/app/auth/callback/route.js.nft.json +1 -1
  31. package/dist/standalone/next-output/server/app/favicon.ico/route.js +1 -1
  32. package/dist/standalone/next-output/server/app/favicon.ico/route.js.nft.json +1 -1
  33. package/dist/standalone/next-output/server/app/login/page/build-manifest.json +2 -2
  34. package/dist/standalone/next-output/server/app/login/page.js +1 -1
  35. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  36. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  37. package/dist/standalone/next-output/server/app/offline/page/build-manifest.json +2 -2
  38. package/dist/standalone/next-output/server/app/offline/page.js +1 -1
  39. package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
  40. package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
  41. package/dist/standalone/next-output/server/app/page/build-manifest.json +2 -2
  42. package/dist/standalone/next-output/server/app/page/react-loadable-manifest.json +1 -1
  43. package/dist/standalone/next-output/server/app/page.js +1 -1
  44. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  45. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  46. package/dist/standalone/next-output/server/app/pomodoro/page/build-manifest.json +2 -2
  47. package/dist/standalone/next-output/server/app/pomodoro/page.js +1 -1
  48. package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
  49. package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
  50. package/dist/standalone/next-output/server/app/register/page/build-manifest.json +2 -2
  51. package/dist/standalone/next-output/server/app/register/page.js +1 -1
  52. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
  53. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
  54. package/dist/standalone/next-output/server/app/reporting/page/build-manifest.json +2 -2
  55. package/dist/standalone/next-output/server/app/reporting/page.js +1 -1
  56. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  57. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  58. package/dist/standalone/next-output/server/app/search/page/build-manifest.json +2 -2
  59. package/dist/standalone/next-output/server/app/search/page.js +1 -1
  60. package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
  61. package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
  62. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page/build-manifest.json +2 -2
  63. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js +1 -1
  64. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
  65. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
  66. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/build-manifest.json +2 -2
  67. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js +1 -1
  68. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
  69. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
  70. package/dist/standalone/next-output/server/app/settings/data/page/build-manifest.json +2 -2
  71. package/dist/standalone/next-output/server/app/settings/data/page.js +1 -1
  72. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  73. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  74. package/dist/standalone/next-output/server/app/settings/display/page/build-manifest.json +2 -2
  75. package/dist/standalone/next-output/server/app/settings/display/page.js +1 -1
  76. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  77. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  78. package/dist/standalone/next-output/server/app/settings/goals/page/build-manifest.json +2 -2
  79. package/dist/standalone/next-output/server/app/settings/goals/page.js +1 -1
  80. package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
  81. package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
  82. package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +2 -2
  83. package/dist/standalone/next-output/server/app/settings/notifications/page.js +1 -1
  84. package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
  85. package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
  86. package/dist/standalone/next-output/server/app/settings/page/build-manifest.json +2 -2
  87. package/dist/standalone/next-output/server/app/settings/page.js +1 -1
  88. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  89. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  90. package/dist/standalone/next-output/server/app/settings/pomodoro/page/build-manifest.json +2 -2
  91. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js +1 -1
  92. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
  93. package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
  94. package/dist/standalone/next-output/server/app/settings/quick-actions/page/build-manifest.json +2 -2
  95. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js +1 -1
  96. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
  97. package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
  98. package/dist/standalone/next-output/server/app/settings/tags/page/build-manifest.json +2 -2
  99. package/dist/standalone/next-output/server/app/settings/tags/page.js +1 -1
  100. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  101. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  102. package/dist/standalone/next-output/server/app/sheets/page/build-manifest.json +2 -2
  103. package/dist/standalone/next-output/server/app/sheets/page.js +1 -1
  104. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
  105. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
  106. package/dist/standalone/next-output/server/app/today/page/build-manifest.json +2 -2
  107. package/dist/standalone/next-output/server/app/today/page.js +1 -1
  108. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
  109. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
  110. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0_l72r2.js +1 -1
  111. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0a439d6.js +1 -1
  112. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0b8a-p3.js +1 -1
  113. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0e-v8-t.js +1 -1
  114. package/dist/standalone/next-output/server/chunks/[externals]__11vad82._.js +3 -0
  115. package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0sqmaqd._.js +3 -0
  116. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0-taz6n._.js +3 -0
  117. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00~g.6x._.js +3 -0
  118. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__057h~1v._.js +1 -1
  119. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06666_b._.js +1 -1
  120. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06h__d_._.js +1 -1
  121. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06r8z50._.js +1 -1
  122. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06wq380._.js +1 -1
  123. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_b50~5._.js +1 -1
  124. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0eruj62._.js +1 -1
  125. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0fc0f.7._.js +1 -1
  126. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g2.yrs._.js +1 -1
  127. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g4.zxh._.js +1 -1
  128. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0hasizg._.js +1 -1
  129. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jlfmb8._.js +1 -1
  130. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m-c-3t._.js +1 -1
  131. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mft_cy._.js +78 -0
  132. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m~u8g4._.js +1 -1
  133. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nx-vwn._.js +1 -1
  134. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0o-u0o6._.js +3 -0
  135. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0pzvh8l._.js +1 -1
  136. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0rl2w7-._.js +1 -1
  137. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wdwx.8._.js +3 -0
  138. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wj1pxh._.js +1 -1
  139. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0y.-jfw._.js +3 -0
  140. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0yqw7pu._.js +1 -1
  141. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0~22xdv._.js +3 -0
  142. package/dist/standalone/next-output/server/chunks/_00h8h72._.js +1 -1
  143. package/dist/standalone/next-output/server/chunks/_01k5l~6._.js +1 -1
  144. package/dist/standalone/next-output/server/chunks/_01m8bky._.js +1 -1
  145. package/dist/standalone/next-output/server/chunks/_08yfru9._.js +1 -1
  146. package/dist/standalone/next-output/server/chunks/_0a9455x._.js +1 -1
  147. package/dist/standalone/next-output/server/chunks/_0glc6qw._.js +1 -1
  148. package/dist/standalone/next-output/server/chunks/_0k9xfs_._.js +1 -1
  149. package/dist/standalone/next-output/server/chunks/_0qc0j~f._.js +1 -1
  150. package/dist/standalone/next-output/server/chunks/_0s9bykd._.js +1 -1
  151. package/dist/standalone/next-output/server/chunks/_0ykasjm._.js +1 -1
  152. package/dist/standalone/next-output/server/chunks/ssr/0prs_next_dist_0gm.sou._.js +1 -1
  153. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0xgtqus._.js → [root-of-the-server]__03~l7zo._.js} +2 -2
  154. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__07dg5mm._.js +1 -1
  155. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__08n6l..._.js +1 -1
  156. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0f0-17f._.js +1 -1
  157. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0i8nvpz._.js +1 -1
  158. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0kp4i1o._.js +1 -1
  159. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0kehl40._.js → [root-of-the-server]__0mvoac~._.js} +2 -2
  160. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0q5n4_f._.js +1 -1
  161. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0s2z7s7._.js +1 -1
  162. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0t9jvpg._.js +1 -1
  163. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ta228.._.js +1 -1
  164. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__11yff~n._.js +1 -1
  165. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__13lfzik._.js +1 -1
  166. package/dist/standalone/next-output/server/chunks/ssr/_09_de1y._.js +3 -0
  167. package/dist/standalone/next-output/server/chunks/ssr/{_0j8zmg6._.js → _0mb-jfk._.js} +1 -1
  168. package/dist/standalone/next-output/server/chunks/ssr/_0n~tafj._.js +1 -1
  169. package/dist/standalone/next-output/server/chunks/ssr/_10n.q--._.js +1 -1
  170. package/dist/standalone/next-output/server/chunks/ssr/_118t3.z._.js +3 -0
  171. package/dist/standalone/next-output/server/chunks/ssr/_119e_ui._.js +3 -0
  172. package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +3 -0
  173. package/dist/standalone/next-output/server/chunks/ssr/components_entry-list_tsx_02.v.ur._.js +1 -1
  174. package/dist/standalone/next-output/server/functions-config-manifest.json +11 -1
  175. package/dist/standalone/next-output/server/middleware-build-manifest.js +5 -5
  176. package/dist/standalone/next-output/server/middleware-manifest.json +2 -30
  177. package/dist/standalone/next-output/server/middleware.js +5 -0
  178. package/dist/standalone/next-output/server/pages/500.html +1 -1
  179. package/dist/standalone/next-output/static/chunks/01.p8x7rwa_da.js +1 -0
  180. package/dist/standalone/next-output/static/chunks/0352pgxbvl-fv.css +3 -0
  181. package/dist/standalone/next-output/static/chunks/05q3gfx1e8sea.js +2 -0
  182. package/dist/standalone/next-output/static/chunks/{0tunlsiqaj8k7.js → 0_ofg6_dn.8-1.js} +1 -1
  183. package/dist/standalone/next-output/static/chunks/0fa.o-_asg9n7.js +1 -0
  184. package/dist/standalone/next-output/static/chunks/{0d1bw0ondgg09.js → 0fxgcr1q998_k.js} +1 -1
  185. package/dist/standalone/next-output/static/chunks/0j2e~637-6iat.js +1 -0
  186. package/dist/standalone/next-output/static/chunks/0oqkatex7m1ci.js +1 -0
  187. package/dist/standalone/next-output/static/chunks/11om1fvdw0yt4.js +1 -0
  188. package/dist/standalone/next-output/static/chunks/{turbopack-0f5lhej4rg9kr.js → turbopack-0qr4v3fex9a4_.js} +1 -1
  189. package/dist/standalone/package.json +1 -1
  190. package/dist/standalone/public/icons/site.webmanifest +19 -1
  191. package/dist/standalone/public/manifest.webmanifest +30 -30
  192. package/dist/standalone/public/sw.js +74 -73
  193. package/package.json +1 -1
  194. package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0arv.vj._.js +0 -3
  195. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0.8v_6p._.js +0 -3
  196. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__07wrb8~._.js +0 -3
  197. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_ar6en._.js +0 -3
  198. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jvridy._.js +0 -3
  199. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mp257.._.js +0 -3
  200. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nhm~x6._.js +0 -3
  201. package/dist/standalone/next-output/server/chunks/ssr/_0y1l.fp._.js +0 -3
  202. package/dist/standalone/next-output/server/chunks/ssr/_11_k_h_._.js +0 -3
  203. package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +0 -3
  204. package/dist/standalone/next-output/server/edge/chunks/0iv-_next_dist_esm_build_templates_edge-wrapper_0tu5gg3.js +0 -3
  205. package/dist/standalone/next-output/server/edge/chunks/0prs_next_dist_esm_build_templates_edge-wrapper_0qnghjz.js +0 -3
  206. package/dist/standalone/next-output/server/edge/chunks/[root-of-the-server]__0864en3._.js +0 -69
  207. package/dist/standalone/next-output/static/chunks/0bkrh0v8rs7jg.js +0 -1
  208. package/dist/standalone/next-output/static/chunks/0dx.1c1lmm455.css +0 -3
  209. package/dist/standalone/next-output/static/chunks/0lj1_~cxf~l6t.js +0 -1
  210. package/dist/standalone/next-output/static/chunks/0o1-l.q7jp8h9.js +0 -1
  211. package/dist/standalone/next-output/static/chunks/0p4cjapdzyl6k.js +0 -2
  212. package/dist/standalone/next-output/static/chunks/0yhbka048dolq.js +0 -1
  213. package/dist/standalone/next-output/static/chunks/11cm.4cgwu.ci.js +0 -1
  214. /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_buildManifest.js +0 -0
  215. /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_clientMiddlewareManifest.js +0 -0
  216. /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",s=r.default.join(t.default.homedir(),".super-time-tracker"),i=r.default.join(s,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,i,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:s,notes:i,archived:o})=>({id:e,description:n,tags:s,notes:i.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===o?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:s})=>({notes:[],tags:s,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,s=!1,i=void 0===n.version?1:n.version;if(i>t.DB_VERSION||i<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;i<t.DB_VERSION;){let e=i+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${i} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);i=e,s=!0}return{json_db:n,did_migrate:s}}],24507)},20253,e=>{"use strict";function t(e,t){let r=new Set,n=[];for(let s of[...e,...t]){let e=`${s.timestamp.getTime()}:${s.text}`;r.has(e)||(r.add(e),n.push(s))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}e.s(["dedupe_sheet_entries_by_id",0,function(e){let r=new Map;for(let n of e){let e=r.get(n.id);if(void 0===e){r.set(n.id,n);continue}if(null===n.end&&null!==e.end){r.set(n.id,{...n,notes:t(n.notes,e.notes)});continue}if(null===e.end&&null!==n.end){r.set(n.id,{...e,notes:t(e.notes,n.notes)});continue}r.set(n.id,{...e,notes:t(e.notes,n.notes)})}return[...r.values()].sort((e,t)=>e.id-t.id)}],20253)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),s=e.i(72127),i=e.i(30853),o=e.i(93361),a=e.i(24507),c=e.i(47143),l=e.i(62775),u=e.i(16366);async function d(e,t=n.DB_PATH){let s=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,s)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function m(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,i.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,o.gen_db)();return await d(t,e),t}let f=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(f)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let v=(0,a.migrate_json_db)(u);u=v.json_db;let _=(0,s.convert_json_db)(u),h=v.did_migrate,g=(0,l.reconcile_stale_active_entry_ids)(_),y=(0,c.dedupe_tracker_db_sheet_entries)(_);return(h||g||y)&&await d(_,e),_}e.s(["write_local_db",0,d],32806),e.s(["read_local_db",0,m],71786)},27440,e=>{"use strict";var t=e.i(49827),r=e.i(71786);let n=(0,t.cache)(async e=>(0,r.read_local_db)(e));e.s(["read_db",0,n])},12888,14850,27984,e=>{"use strict";e.s(["is_entry_archived",0,function(e){return!0===e.archived}],12888),e.s(["is_sheet_archived",0,function(e){return!0===e.archived}],14850),e.s(["serialize_entry",0,function(e,t,r){return{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:t,durationMs:function(e,t=Date.now()){let{end:r,start:n}=e;return Math.max(0,(null===r?t:+r)-n)}(e),isActive:r,...!0===e.archived?{archived:!0}:{}}}],27984)},72609,52455,13455,45196,58611,e=>{"use strict";let t=Symbol.for("constructDateFrom");function r(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}function n(e,t){return r(t||e,e)}e.s(["constructFromSymbol",0,t,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5],52455),e.s(["constructFrom",0,r],13455),e.s(["toDate",0,n],45196),e.s(["endOfDay",0,function(e,t){let r=n(e,t?.in);return r.setHours(23,59,59,999),r}],72609);let s={};e.s(["getDefaultOptions",0,function(){return s}],58611)},64457,e=>{"use strict";var t=e.i(58611),r=e.i(45196);e.s(["startOfWeek",0,function(e,n){let s=(0,t.getDefaultOptions)(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,o=(0,r.toDate)(e,n?.in),a=o.getDay();return o.setDate(o.getDate()-(7*(a<i)+a-i)),o.setHours(0,0,0,0),o}])},69856,e=>{"use strict";var t=e.i(45196);e.s(["startOfDay",0,function(e,r){let n=(0,t.toDate)(e,r?.in);return n.setHours(0,0,0,0),n}])},81207,e=>{"use strict";e.s(["collect_known_tags",0,function(e){let t=new Set;for(let r of e.sheets)for(let e of r.entries)for(let r of e.tags){let e=r.trim();e.length>0&&t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}])},99264,51299,e=>{"use strict";function t(e){let t=e.trim().replace(/^@+/,"");if(0===t.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(t))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${t}`}e.s(["normalize_stored_tag",0,t],51299),e.s(["tags_are_equal",0,function(e,r){try{return t(e)===t(r)}catch{return!1}}],99264)},99458,e=>{"use strict";e.s(["match_entry_search_query",0,function(e,t){let r=t.trim().toLowerCase();if(0===r.length)return{matches:!0,noteSnippet:null};let n=e.description.toLowerCase().includes(r),s=e.sheetName.toLowerCase().includes(r),i=e.tags.some(e=>e.toLowerCase().includes(r));if(n||s||i)return{matches:!0,noteSnippet:null};for(let t of e.noteTexts)if(t.toLowerCase().includes(r))return{matches:!0,noteSnippet:function(e,t){let r=e.toLowerCase().indexOf(t);if(r<0)return e.slice(0,120);let n=Math.max(0,r-40),s=Math.min(e.length,r+t.length+40),i=n>0?"…":"",o=s<e.length?"…":"";return`${i}${e.slice(n,s)}${o}`}(t,r)};return{matches:!1,noteSnippet:null}}])}];
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",s=r.default.join(t.default.homedir(),".super-time-tracker"),i=r.default.join(s,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,i,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:s,notes:i,archived:o})=>({id:e,description:n,tags:s,notes:i.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===o?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:s})=>({notes:[],tags:s,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,s=!1,i=n.version??1;if(i>t.DB_VERSION||i<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;i<t.DB_VERSION;){let e=i+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${i} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);i=e,s=!0}return{json_db:n,did_migrate:s}}],24507)},20253,e=>{"use strict";function t(e,t){let r=new Set,n=[];for(let s of[...e,...t]){let e=`${s.timestamp.getTime()}:${s.text}`;r.has(e)||(r.add(e),n.push(s))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}e.s(["dedupe_sheet_entries_by_id",0,function(e){let r=new Map;for(let n of e){let e=r.get(n.id);if(void 0===e){r.set(n.id,n);continue}if(null===n.end&&null!==e.end){r.set(n.id,{...n,notes:t(n.notes,e.notes)});continue}if(null===e.end&&null!==n.end){r.set(n.id,{...e,notes:t(e.notes,n.notes)});continue}r.set(n.id,{...e,notes:t(e.notes,n.notes)})}return[...r.values()].sort((e,t)=>e.id-t.id)}],20253)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return t?.end!=null?null:t??null}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),s=e.i(72127),i=e.i(30853),o=e.i(93361),a=e.i(24507),c=e.i(47143),l=e.i(62775),u=e.i(16366);async function d(e,t=n.DB_PATH){let s=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,s)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function m(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,i.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,o.gen_db)();return await d(t,e),t}let f=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(f)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let v=(0,a.migrate_json_db)(u);u=v.json_db;let _=(0,s.convert_json_db)(u),h=v.did_migrate,g=(0,l.reconcile_stale_active_entry_ids)(_),y=(0,c.dedupe_tracker_db_sheet_entries)(_);return(h||g||y)&&await d(_,e),_}e.s(["write_local_db",0,d],32806),e.s(["read_local_db",0,m],71786)},27440,e=>{"use strict";var t=e.i(49827),r=e.i(71786);let n=(0,t.cache)(async e=>(0,r.read_local_db)(e));e.s(["read_db",0,n])},12888,14850,27984,e=>{"use strict";e.s(["is_entry_archived",0,function(e){return!0===e.archived}],12888),e.s(["is_sheet_archived",0,function(e){return!0===e.archived}],14850),e.s(["serialize_entry",0,function(e,t,r){return{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:t,durationMs:function(e,t=Date.now()){let{end:r,start:n}=e;return Math.max(0,(null===r?t:+r)-n)}(e),isActive:r,...!0===e.archived?{archived:!0}:{}}}],27984)},72609,52455,13455,45196,58611,e=>{"use strict";let t=Symbol.for("constructDateFrom");function r(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}function n(e,t){return r(t||e,e)}e.s(["constructFromSymbol",0,t,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5],52455),e.s(["constructFrom",0,r],13455),e.s(["toDate",0,n],45196),e.s(["endOfDay",0,function(e,t){let r=n(e,t?.in);return r.setHours(23,59,59,999),r}],72609);let s={};e.s(["getDefaultOptions",0,function(){return s}],58611)},64457,e=>{"use strict";var t=e.i(58611),r=e.i(45196);e.s(["startOfWeek",0,function(e,n){let s=(0,t.getDefaultOptions)(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,o=(0,r.toDate)(e,n?.in),a=o.getDay();return o.setDate(o.getDate()-(7*(a<i)+a-i)),o.setHours(0,0,0,0),o}])},69856,e=>{"use strict";var t=e.i(45196);e.s(["startOfDay",0,function(e,r){let n=(0,t.toDate)(e,r?.in);return n.setHours(0,0,0,0),n}])},81207,e=>{"use strict";e.s(["collect_known_tags",0,function(e){let t=new Set;for(let r of e.sheets)for(let e of r.entries)for(let r of e.tags){let e=r.trim();e.length>0&&t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}])},99264,51299,e=>{"use strict";function t(e){let t=e.trim().replace(/^@+/,"");if(0===t.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(t))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${t}`}e.s(["normalize_stored_tag",0,t],51299),e.s(["tags_are_equal",0,function(e,r){try{return t(e)===t(r)}catch{return!1}}],99264)},99458,e=>{"use strict";e.s(["match_entry_search_query",0,function(e,t){let r=t.trim().toLowerCase();if(0===r.length)return{matches:!0,noteSnippet:null};let n=e.description.toLowerCase().includes(r),s=e.sheetName.toLowerCase().includes(r),i=e.tags.some(e=>e.toLowerCase().includes(r));if(n||s||i)return{matches:!0,noteSnippet:null};for(let t of e.noteTexts)if(t.toLowerCase().includes(r))return{matches:!0,noteSnippet:function(e,t){let r=e.toLowerCase().indexOf(t);if(r<0)return e.slice(0,120);let n=Math.max(0,r-40),s=Math.min(e.length,r+t.length+40),i=n>0?"…":"",o=s<e.length?"…":"";return`${i}${e.slice(n,s)}${o}`}(t,r)};return{matches:!1,noteSnippet:null}}])}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__0hasizg._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[29207,e=>{"use strict";var t=e.i(5313),n=e.i(36117);async function r(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,n.create_server_supabase_client)(),{data:{user:r}}=await e.auth.getUser();return r?.id??null}e.s(["get_authenticated_user_id",0,r])},18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,n=400){let r=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:r},{status:n})}])},50227,(e,t,n)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,n)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,n)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),n=e.i(50227);let r="db.json",s=n.default.join(t.default.homedir(),".super-time-tracker"),i=n.default.join(s,r);e.s(["DB_FILE_NAME",0,r,"DB_PATH",0,i,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:n,activeSheetName:r}=e;return{version:n,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n,archived:r})=>({name:e,activeEntryID:n,...!0===r?{archived:!0}:{},entries:t.map(({id:e,start:t,end:n,description:r,tags:s,notes:i,archived:a})=>({id:e,description:r,tags:s,notes:i.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===n?null:new Date(n),...!0===a?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function n(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,n],30853)},93361,e=>{"use strict";var t=e.i(72507);function n(e,t=[],r=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==r&&void 0===t.find(({id:e})=>e===r))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:r}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[n(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,n])},24507,e=>{"use strict";var t=e.i(72507);let n={2:function(e){let{sheets:t,version:n,activeSheetName:r}=e;if(1!==n&&void 0!==n)throw Error(`DB is version ${n}, cannot migrate to version 2.`);return{version:2,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n})=>({name:e,activeEntryID:n,entries:t.map(({id:e,start:t,end:n,description:r})=>({tags:[],notes:[],id:e,end:n,start:t,description:r}))}))}},3:function(e){let{sheets:t,version:n,activeSheetName:r}=e;if(2!==n&&void 0!==n)throw Error(`DB is version ${n}, cannot migrate to version 3.`);return{version:3,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n})=>({name:e,activeEntryID:n,entries:t.map(({id:e,start:t,end:n,description:r,tags:s})=>({notes:[],tags:s,id:e,end:n,start:t,description:r}))}))}},4:function(e){let{version:t,activeSheetName:n,sheets:r}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:n,sheets:r}}};e.s(["migrate_json_db",0,function(e){let r=e,s=!1,i=void 0===r.version?1:r.version;if(i>t.DB_VERSION||i<1)throw Error(`Unknown DB version ${r.version}, cannot load.`);for(;i<t.DB_VERSION;){let e=i+1,t=n[e];if(void 0===t)throw Error(`Missing migration from version ${i} to ${e}.`);if((r=t(r)).version!==e)throw Error(`Invalid migration output for version ${e}.`);i=e,s=!0}return{json_db:r,did_migrate:s}}],24507)},20253,e=>{"use strict";function t(e,t){let n=new Set,r=[];for(let s of[...e,...t]){let e=`${s.timestamp.getTime()}:${s.text}`;n.has(e)||(n.add(e),r.push(s))}return r.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),r}e.s(["dedupe_sheet_entries_by_id",0,function(e){let n=new Map;for(let r of e){let e=n.get(r.id);if(void 0===e){n.set(r.id,r);continue}if(null===r.end&&null!==e.end){n.set(r.id,{...r,notes:t(r.notes,e.notes)});continue}if(null===e.end&&null!==r.end){n.set(r.id,{...e,notes:t(e.notes,r.notes)});continue}n.set(r.id,{...e,notes:t(e.notes,r.notes)})}return[...n.values()].sort((e,t)=>e.id-t.id)}],20253)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let n=!1;for(let r of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(r.entries);e.length!==r.entries.length&&(n=!0,r.entries=e)}return n}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let n=!1;for(let r of e.sheets)null!==r.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(r)&&(r.activeEntryID=null,n=!0);return n}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),n=e.i(2157),r=e.i(72507),s=e.i(72127),i=e.i(30853),a=e.i(93361),o=e.i(24507),l=e.i(47143),u=e.i(62775),c=e.i(16366);async function d(e,t=r.DB_PATH){let s=JSON.stringify((0,c.convert_db_to_json)(e));try{await n.promises.writeFile(t,s)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=r.DB_PATH){let c,v=t.default.dirname(e);await (0,i.ensure_dir_exists)(v);try{await n.promises.access(e)}catch{let t=(0,a.gen_db)();return await d(t,e),t}let h=await n.promises.readFile(e,"utf-8");try{c=JSON.parse(h)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let f=(0,o.migrate_json_db)(c);c=f.json_db;let m=(0,s.convert_json_db)(c),p=f.did_migrate,g=(0,u.reconcile_stale_active_entry_ids)(m),y=(0,l.dedupe_tracker_db_sheet_entries)(m);return(p||g||y)&&await d(m,e),m}e.s(["write_local_db",0,d],32806),e.s(["read_local_db",0,_],71786)},27440,e=>{"use strict";var t=e.i(49827),n=e.i(71786);let r=(0,t.cache)(async e=>(0,n.read_local_db)(e));e.s(["read_db",0,r])},18212,e=>{"use strict";var t=e.i(47143),n=e.i(62775),r=e.i(32806);async function s(e,s){(0,n.reconcile_stale_active_entry_ids)(e),(0,t.dedupe_tracker_db_sheet_entries)(e),await (0,r.write_local_db)(e,s)}e.s(["write_db",0,s])},72609,52455,13455,45196,58611,e=>{"use strict";let t=Symbol.for("constructDateFrom");function n(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&t in e?e[t](n):e instanceof Date?new e.constructor(n):new Date(n)}function r(e,t){return n(t||e,e)}e.s(["constructFromSymbol",0,t,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5],52455),e.s(["constructFrom",0,n],13455),e.s(["toDate",0,r],45196),e.s(["endOfDay",0,function(e,t){let n=r(e,t?.in);return n.setHours(23,59,59,999),n}],72609);let s={};e.s(["getDefaultOptions",0,function(){return s}],58611)},69856,e=>{"use strict";var t=e.i(45196);e.s(["startOfDay",0,function(e,n){let r=(0,t.toDate)(e,n?.in);return r.setHours(0,0,0,0),r}])},64457,e=>{"use strict";var t=e.i(58611),n=e.i(45196);e.s(["startOfWeek",0,function(e,r){let s=(0,t.getDefaultOptions)(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,a=(0,n.toDate)(e,r?.in),o=a.getDay();return a.setDate(a.getDate()-(7*(o<i)+o-i)),a.setHours(0,0,0,0),a}])},12888,14850,27984,e=>{"use strict";e.s(["is_entry_archived",0,function(e){return!0===e.archived}],12888),e.s(["is_sheet_archived",0,function(e){return!0===e.archived}],14850),e.s(["serialize_entry",0,function(e,t,n){return{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:t,durationMs:function(e,t=Date.now()){let{end:n,start:r}=e;return Math.max(0,(null===n?t:+n)-r)}(e),isActive:n,...!0===e.archived?{archived:!0}:{}}}],27984)},81207,e=>{"use strict";e.s(["collect_known_tags",0,function(e){let t=new Set;for(let n of e.sheets)for(let e of n.entries)for(let n of e.tags){let e=n.trim();e.length>0&&t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}])},77052,e=>{"use strict";function t(e,n,r,s=Date.now()){let i=+e.start;return Math.max(0,Math.min(null===e.end?s:+e.end,r)-Math.max(i,n))}var n=e.i(72609),r=e.i(45196),s=e.i(58611),i=e.i(69856),a=e.i(64457);function o(e,t=new Date,l=1){var u;switch(e){case"week":let c,d,_,v;return{startMs:+(0,a.startOfWeek)(t,{weekStartsOn:l}),endMs:+(u={weekStartsOn:l},c=(0,s.getDefaultOptions)(),d=u?.weekStartsOn??u?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,v=(_=(0,r.toDate)(t,u?.in)).getDay(),_.setDate(_.getDate()+((v<d?-7:0)+6-(v-d))),_.setHours(23,59,59,999),_)};case"month":let h,f,m;return{startMs:+((h=(0,r.toDate)(t,void 0)).setDate(1),h.setHours(0,0,0,0),h),endMs:+(m=(f=(0,r.toDate)(t,void 0)).getMonth(),f.setFullYear(f.getFullYear(),m+1,0),f.setHours(23,59,59,999),f)};default:return{startMs:+(0,i.startOfDay)(t),endMs:+(0,n.endOfDay)(t)}}}var l=e.i(27440);async function u({scope:e="global",sheet_name:n,tag_name:r,db:s}={}){let i=s??await (0,l.read_db)(),a=Date.now(),c=new Date(a),d=o("today",c),_=o("week",c),v=0,h=0,f=null,m=null;for(let s of i.sheets)for(let i of s.entries){("global"===e||"sheet"===e&&void 0!==n&&s.name===n||"tag"===e&&void 0!==r&&i.tags.some(e=>e===r))&&(v+=t(i,d.startMs,d.endMs,a),h+=t(i,_.startMs,_.endMs,a));let o=+i.start,l=null===i.end?null:+i.end,u=null===l?o:Math.max(o,l);if((null===m||u>m)&&(m=u),null===i.end){let e=Math.max(0,a-o);(null===f||e>f)&&(f=e)}}let p=null!==f||null===m?null:Math.floor((a-m)/6e4);return{todayTrackedMs:v,weekTrackedMs:h,activeTimerDurationMs:f,minutesSinceLastLog:p}}e.s(["get_focus_nudges_status",0,u],77052)},93204,e=>{"use strict";e.s(["get_sheet",0,function(e,t){let n=e.sheets.find(({name:e})=>e===t);if(void 0===n)throw Error(`Sheet ${t} not found`);return n}])},87255,76249,e=>{"use strict";var t=e.i(12888);e.s(["filter_visible_entries",0,function(e){return e.filter(e=>!(0,t.is_entry_archived)(e))}],87255);var n=e.i(72507),r=e.i(29207),s=e.i(5313);async function i(){return!!(0,s.is_supabase_configured)()&&null!==await (0,r.get_authenticated_user_id)()}async function a(){return await i()?`Cloud sync (${"https://ctruizaqyeyidujmtxhc.supabase.co".trim()??"Supabase"})`:n.DB_PATH}e.s(["resolve_db_path_label",0,a],76249)},4760,95634,e=>{"use strict";var t=e.i(81207),n=e.i(87255),r=e.i(14850),s=e.i(76249),i=e.i(77052),a=e.i(93204),o=e.i(27440),l=e.i(72507),u=e.i(13690),c=e.i(27984),d=e.i(20253),_=e.i(93361),v=e.i(18212);async function h(e){let t=await (0,o.read_db)();t.sheets.some(({name:t})=>t===e)||t.sheets.push((0,_.gen_sheet)(e)),t.activeSheetName=e,await (0,v.write_db)(t)}async function f(e,_={}){let v=_.persist_active_sheet??!0,m=_.include_sheet_entries??!0,p=_.include_focus_nudges??!1,g=_.db??await (0,o.read_db)(),y=function(e,t){let n=t?.trim()??"";if(n.length>0&&e.sheets.some(e=>e.name===n&&!(0,r.is_sheet_archived)(e)))return n;if(null!==e.activeSheetName&&e.sheets.some(t=>t.name===e.activeSheetName&&!(0,r.is_sheet_archived)(t)))return e.activeSheetName;let s=e.sheets.find(e=>!(0,r.is_sheet_archived)(e)&&null!==(0,u.find_running_entry_on_sheet)(e));if(void 0!==s)return s.name;let i=e.sheets.find(e=>!(0,r.is_sheet_archived)(e));return i?.name??l.DEFAULT_SHEET_NAME}(g,e);v&&g.activeSheetName!==y&&(await h(y),g.activeSheetName=y);let{sheets:w}=g,D=[];m&&(D=function(e,t){let n=[...e];switch(t){case"oldest":return n.sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());case"duration":return n.sort((e,t)=>t.durationMs-e.durationMs);case"description":return n.sort((e,t)=>{let n=e.description.trim()||"Untitled entry",r=t.description.trim()||"Untitled entry";return n.localeCompare(r)});default:return n.sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime())}}(function(e){let{activeEntryID:t,entries:n,name:r}=e;return(0,d.dedupe_sheet_entries_by_id)(n).map(e=>(0,c.serialize_entry)(e,r,t===e.id&&null===e.end))}((0,a.get_sheet)(g,y)),"newest"));let S=function(e,t){let n=e.sheets.find(({name:e})=>e===t);if(void 0===n)return null;let r=(0,u.find_running_entry_on_sheet)(n);return null===r?null:(0,c.serialize_entry)(r,n.name,!0)}(g,y),E=function(e){let t=[];for(let n of e.sheets){let e=(0,u.find_running_entry_on_sheet)(n);null!==e&&t.push((0,c.serialize_entry)(e,n.name,!0))}return t}(g),b=S??E[0]??null,x=p?await (0,i.get_focus_nudges_status)({scope:"global",db:g}):void 0;return{dbPath:await (0,s.resolve_db_path_label)(),activeSheetName:y,knownTags:(0,t.collect_known_tags)(g),sheets:w.map(e=>({name:e.name,activeEntryID:e.activeEntryID,entryCount:(0,n.filter_visible_entries)(e.entries).length,isActive:e.name===y,hasActiveEntry:null!==(0,u.find_running_entry_on_sheet)(e),...(0,r.is_sheet_archived)(e)?{archived:!0}:{}})),activeEntry:S,runningEntry:b,runningEntries:E,activeSheetEntries:D,activeSheetTotalMs:D.reduce((e,t)=>e+t.durationMs,0),activeSheetEntriesLoaded:m,focusNudgesStatusGlobal:x}}e.s(["set_active_sheet",0,h],95634),e.s(["get_tracker_state",0,f],4760)}];
1
+ module.exports=[29207,e=>{"use strict";var t=e.i(5313),n=e.i(36117);async function r(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,n.create_server_supabase_client)(),{data:{user:r}}=await e.auth.getUser();return r?.id??null}e.s(["get_authenticated_user_id",0,r])},18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,n=400){let r=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:r},{status:n})}])},50227,(e,t,n)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,n)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,n)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),n=e.i(50227);let r="db.json",i=n.default.join(t.default.homedir(),".super-time-tracker"),s=n.default.join(i,r);e.s(["DB_FILE_NAME",0,r,"DB_PATH",0,s,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return t?.end!=null?null:t??null}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:n,activeSheetName:r}=e;return{version:n,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n,archived:r})=>({name:e,activeEntryID:n,...!0===r?{archived:!0}:{},entries:t.map(({id:e,start:t,end:n,description:r,tags:i,notes:s,archived:a})=>({id:e,description:r,tags:i,notes:s.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===n?null:new Date(n),...!0===a?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function n(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,n],30853)},93361,e=>{"use strict";var t=e.i(72507);function n(e,t=[],r=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==r&&void 0===t.find(({id:e})=>e===r))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:r}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[n(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,n])},24507,e=>{"use strict";var t=e.i(72507);let n={2:function(e){let{sheets:t,version:n,activeSheetName:r}=e;if(1!==n&&void 0!==n)throw Error(`DB is version ${n}, cannot migrate to version 2.`);return{version:2,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n})=>({name:e,activeEntryID:n,entries:t.map(({id:e,start:t,end:n,description:r})=>({tags:[],notes:[],id:e,end:n,start:t,description:r}))}))}},3:function(e){let{sheets:t,version:n,activeSheetName:r}=e;if(2!==n&&void 0!==n)throw Error(`DB is version ${n}, cannot migrate to version 3.`);return{version:3,activeSheetName:r,sheets:t.map(({name:e,entries:t,activeEntryID:n})=>({name:e,activeEntryID:n,entries:t.map(({id:e,start:t,end:n,description:r,tags:i})=>({notes:[],tags:i,id:e,end:n,start:t,description:r}))}))}},4:function(e){let{version:t,activeSheetName:n,sheets:r}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:n,sheets:r}}};e.s(["migrate_json_db",0,function(e){let r=e,i=!1,s=r.version??1;if(s>t.DB_VERSION||s<1)throw Error(`Unknown DB version ${r.version}, cannot load.`);for(;s<t.DB_VERSION;){let e=s+1,t=n[e];if(void 0===t)throw Error(`Missing migration from version ${s} to ${e}.`);if((r=t(r)).version!==e)throw Error(`Invalid migration output for version ${e}.`);s=e,i=!0}return{json_db:r,did_migrate:i}}],24507)},20253,e=>{"use strict";function t(e,t){let n=new Set,r=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;n.has(e)||(n.add(e),r.push(i))}return r.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),r}e.s(["dedupe_sheet_entries_by_id",0,function(e){let n=new Map;for(let r of e){let e=n.get(r.id);if(void 0===e){n.set(r.id,r);continue}if(null===r.end&&null!==e.end){n.set(r.id,{...r,notes:t(r.notes,e.notes)});continue}if(null===e.end&&null!==r.end){n.set(r.id,{...e,notes:t(e.notes,r.notes)});continue}n.set(r.id,{...e,notes:t(e.notes,r.notes)})}return[...n.values()].sort((e,t)=>e.id-t.id)}],20253)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let n=!1;for(let r of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(r.entries);e.length!==r.entries.length&&(n=!0,r.entries=e)}return n}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let n=!1;for(let r of e.sheets)null!==r.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(r)&&(r.activeEntryID=null,n=!0);return n}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),n=e.i(2157),r=e.i(72507),i=e.i(72127),s=e.i(30853),a=e.i(93361),o=e.i(24507),l=e.i(47143),u=e.i(62775),c=e.i(16366);async function d(e,t=r.DB_PATH){let i=JSON.stringify((0,c.convert_db_to_json)(e));try{await n.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=r.DB_PATH){let c,m=t.default.dirname(e);await (0,s.ensure_dir_exists)(m);try{await n.promises.access(e)}catch{let t=(0,a.gen_db)();return await d(t,e),t}let v=await n.promises.readFile(e,"utf-8");try{c=JSON.parse(v)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let h=(0,o.migrate_json_db)(c);c=h.json_db;let f=(0,i.convert_json_db)(c),p=h.did_migrate,g=(0,u.reconcile_stale_active_entry_ids)(f),y=(0,l.dedupe_tracker_db_sheet_entries)(f);return(p||g||y)&&await d(f,e),f}e.s(["write_local_db",0,d],32806),e.s(["read_local_db",0,_],71786)},27440,e=>{"use strict";var t=e.i(49827),n=e.i(71786);let r=(0,t.cache)(async e=>(0,n.read_local_db)(e));e.s(["read_db",0,r])},18212,e=>{"use strict";var t=e.i(47143),n=e.i(62775),r=e.i(32806);async function i(e,i){(0,n.reconcile_stale_active_entry_ids)(e),(0,t.dedupe_tracker_db_sheet_entries)(e),await (0,r.write_local_db)(e,i)}e.s(["write_db",0,i])},72609,52455,13455,45196,58611,e=>{"use strict";let t=Symbol.for("constructDateFrom");function n(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&t in e?e[t](n):e instanceof Date?new e.constructor(n):new Date(n)}function r(e,t){return n(t||e,e)}e.s(["constructFromSymbol",0,t,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5],52455),e.s(["constructFrom",0,n],13455),e.s(["toDate",0,r],45196),e.s(["endOfDay",0,function(e,t){let n=r(e,t?.in);return n.setHours(23,59,59,999),n}],72609);let i={};e.s(["getDefaultOptions",0,function(){return i}],58611)},69856,e=>{"use strict";var t=e.i(45196);e.s(["startOfDay",0,function(e,n){let r=(0,t.toDate)(e,n?.in);return r.setHours(0,0,0,0),r}])},64457,e=>{"use strict";var t=e.i(58611),n=e.i(45196);e.s(["startOfWeek",0,function(e,r){let i=(0,t.getDefaultOptions)(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=(0,n.toDate)(e,r?.in),o=a.getDay();return a.setDate(a.getDate()-(7*(o<s)+o-s)),a.setHours(0,0,0,0),a}])},12888,14850,27984,e=>{"use strict";e.s(["is_entry_archived",0,function(e){return!0===e.archived}],12888),e.s(["is_sheet_archived",0,function(e){return!0===e.archived}],14850),e.s(["serialize_entry",0,function(e,t,n){return{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:t,durationMs:function(e,t=Date.now()){let{end:n,start:r}=e;return Math.max(0,(null===n?t:+n)-r)}(e),isActive:n,...!0===e.archived?{archived:!0}:{}}}],27984)},81207,e=>{"use strict";e.s(["collect_known_tags",0,function(e){let t=new Set;for(let n of e.sheets)for(let e of n.entries)for(let n of e.tags){let e=n.trim();e.length>0&&t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}])},77052,e=>{"use strict";function t(e,n,r,i=Date.now()){let s=+e.start;return Math.max(0,Math.min(null===e.end?i:+e.end,r)-Math.max(s,n))}var n=e.i(72609),r=e.i(45196),i=e.i(58611),s=e.i(69856),a=e.i(64457);function o(e,t=new Date,l=1){var u;switch(e){case"week":let c,d,_,m;return{startMs:+(0,a.startOfWeek)(t,{weekStartsOn:l}),endMs:+(u={weekStartsOn:l},c=(0,i.getDefaultOptions)(),d=u?.weekStartsOn??u?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,m=(_=(0,r.toDate)(t,u?.in)).getDay(),_.setDate(_.getDate()+((m<d?-7:0)+6-(m-d))),_.setHours(23,59,59,999),_)};case"month":let v,h,f;return{startMs:+((v=(0,r.toDate)(t,void 0)).setDate(1),v.setHours(0,0,0,0),v),endMs:+(f=(h=(0,r.toDate)(t,void 0)).getMonth(),h.setFullYear(h.getFullYear(),f+1,0),h.setHours(23,59,59,999),h)};default:return{startMs:+(0,s.startOfDay)(t),endMs:+(0,n.endOfDay)(t)}}}var l=e.i(27440);async function u({scope:e="global",sheet_name:n,tag_name:r,db:i}={}){let s=i??await (0,l.read_db)(),a=Date.now(),c=new Date(a),d=o("today",c),_=o("week",c),m=0,v=0,h={last_log_ms:null,active_timer_duration_ms:null};for(let i of s.sheets)for(let s of i.entries)(function(e){let{scope:t,sheet_name:n,tag_name:r,sheet_name_on_entry:i,entry:s}=e;return!!("global"===t||"sheet"===t&&void 0!==n&&i===n||"tag"===t&&void 0!==r&&s.tags.includes(r))})({scope:e,sheet_name:n,tag_name:r,sheet_name_on_entry:i.name,entry:s})&&(m+=t(s,d.startMs,d.endMs,a),v+=t(s,_.startMs,_.endMs,a)),h=function(e,t,n){let r=+e.start,i=null===e.end?null:+e.end,s=null===i?r:Math.max(r,i),a=null===n.last_log_ms||s>n.last_log_ms?s:n.last_log_ms;if(null!==e.end)return{last_log_ms:a,active_timer_duration_ms:n.active_timer_duration_ms};let o=Math.max(0,t-r);return{last_log_ms:a,active_timer_duration_ms:null===n.active_timer_duration_ms||o>n.active_timer_duration_ms?o:n.active_timer_duration_ms}}(s,a,h);let f=null!==h.active_timer_duration_ms||null===h.last_log_ms?null:Math.floor((a-h.last_log_ms)/6e4);return{todayTrackedMs:m,weekTrackedMs:v,activeTimerDurationMs:h.active_timer_duration_ms,minutesSinceLastLog:f}}e.s(["get_focus_nudges_status",0,u],77052)},93204,e=>{"use strict";e.s(["get_sheet",0,function(e,t){let n=e.sheets.find(({name:e})=>e===t);if(void 0===n)throw Error(`Sheet ${t} not found`);return n}])},87255,76249,e=>{"use strict";var t=e.i(12888);e.s(["filter_visible_entries",0,function(e){return e.filter(e=>!(0,t.is_entry_archived)(e))}],87255);var n=e.i(72507),r=e.i(29207),i=e.i(5313);async function s(){return!!(0,i.is_supabase_configured)()&&null!==await (0,r.get_authenticated_user_id)()}async function a(){return await s()?`Cloud sync (${"https://ctruizaqyeyidujmtxhc.supabase.co".trim()??"Supabase"})`:n.DB_PATH}e.s(["resolve_db_path_label",0,a],76249)},4760,95634,e=>{"use strict";var t=e.i(81207),n=e.i(87255),r=e.i(14850),i=e.i(76249),s=e.i(77052),a=e.i(93204),o=e.i(27440),l=e.i(72507),u=e.i(13690),c=e.i(27984),d=e.i(20253),_=e.i(93361),m=e.i(18212);async function v(e){let t=await (0,o.read_db)();t.sheets.some(({name:t})=>t===e)||t.sheets.push((0,_.gen_sheet)(e)),t.activeSheetName=e,await (0,m.write_db)(t)}async function h(e,_={}){let m=_.persist_active_sheet??!0,f=_.include_sheet_entries??!0,p=_.include_focus_nudges??!1,g=_.db??await (0,o.read_db)(),y=function(e,t){let n=t?.trim()??"";if(n.length>0&&e.sheets.some(e=>e.name===n&&!(0,r.is_sheet_archived)(e)))return n;if(null!==e.activeSheetName&&e.sheets.some(t=>t.name===e.activeSheetName&&!(0,r.is_sheet_archived)(t)))return e.activeSheetName;let i=e.sheets.find(e=>!(0,r.is_sheet_archived)(e)&&null!==(0,u.find_running_entry_on_sheet)(e));if(void 0!==i)return i.name;let s=e.sheets.find(e=>!(0,r.is_sheet_archived)(e));return s?.name??l.DEFAULT_SHEET_NAME}(g,e);m&&g.activeSheetName!==y&&(await v(y),g.activeSheetName=y);let{sheets:w}=g,D=[];f&&(D=function(e,t){let n=[...e];switch(t){case"oldest":return n.sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());case"duration":return n.sort((e,t)=>t.durationMs-e.durationMs);case"description":return n.sort((e,t)=>{let n=e.description.trim()||"Untitled entry",r=t.description.trim()||"Untitled entry";return n.localeCompare(r)});default:return n.sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime())}}(function(e){let{activeEntryID:t,entries:n,name:r}=e;return(0,d.dedupe_sheet_entries_by_id)(n).map(e=>(0,c.serialize_entry)(e,r,t===e.id&&null===e.end))}((0,a.get_sheet)(g,y)),"newest"));let S=function(e,t){let n=e.sheets.find(({name:e})=>e===t);if(void 0===n)return null;let r=(0,u.find_running_entry_on_sheet)(n);return null===r?null:(0,c.serialize_entry)(r,n.name,!0)}(g,y),E=g.sheets.flatMap(e=>{let t=(0,u.find_running_entry_on_sheet)(e);return null==t?[]:[(0,c.serialize_entry)(t,e.name,!0)]}),b=S??E[0]??null,x=p?await (0,s.get_focus_nudges_status)({scope:"global",db:g}):void 0;return{dbPath:await (0,i.resolve_db_path_label)(),activeSheetName:y,knownTags:(0,t.collect_known_tags)(g),sheets:w.map(e=>({name:e.name,activeEntryID:e.activeEntryID,entryCount:(0,n.filter_visible_entries)(e.entries).length,isActive:e.name===y,hasActiveEntry:null!==(0,u.find_running_entry_on_sheet)(e),...(0,r.is_sheet_archived)(e)?{archived:!0}:{}})),activeEntry:S,runningEntry:b,runningEntries:E,activeSheetEntries:D,activeSheetTotalMs:D.reduce((e,t)=>e+t.durationMs,0),activeSheetEntriesLoaded:f,focusNudgesStatusGlobal:x}}e.s(["set_active_sheet",0,v],95634),e.s(["get_tracker_state",0,h],4760)}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__0jlfmb8._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let a=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:a},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let a="db.json",n=r.default.join(t.default.homedir(),".super-time-tracker"),i=r.default.join(n,a);e.s(["DB_FILE_NAME",0,a,"DB_PATH",0,i,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function a(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:a}}=await e.auth.getUser();return a?.id??null}e.s(["get_authenticated_user_id",0,a])},99712,e=>{"use strict";var t=e.i(4394),r=e.i(45404),a=e.i(60016),n=e.i(33535),i=e.i(46593),s=e.i(10659),o=e.i(19784),l=e.i(31269),u=e.i(13865),d=e.i(65034),p=e.i(81157),c=e.i(82614),h=e.i(24377),x=e.i(57949),v=e.i(9566),R=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),_=e.i(68194),E=e.i(29207),m=e.i(72507),w=e.i(36117);async function y(e,t){let r=await (0,w.create_server_supabase_client)(),{error:a}=await r.from("tracker_accounts").upsert({user_id:e,active_sheet_name:t,db_version:m.DB_VERSION,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(null!==a)throw Error(`Failed to update active sheet: ${a.message}`)}async function C(e){try{let t=await (0,E.get_authenticated_user_id)();if(null===t)return(0,_.api_error_response)(Error("Sign in required"),401);let r=await e.json(),a=r.name?.trim()??"";if(0===a.length)return(0,_.api_error_response)(Error("Sheet name is required"));return await y(t,a),g.NextResponse.json({ok:!0})}catch(e){return(0,_.api_error_response)(e)}}e.s(["POST",0,C],98913);var A=e.i(98913);let b=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sheet/active/route",pathname:"/api/sheet/active",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sheet/active/route.ts",nextConfigOutput:"standalone",userland:A,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:S,serverHooks:T}=b;async function q(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),b.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sheet/active/route";g=g.replace(/\/index$/,"")||"/";let _=await b.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!_)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:m,params:w,nextConfig:y,parsedUrl:C,isDraftMode:A,prerenderManifest:N,routerServerContext:S,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,resolvedPathname:P,clientReferenceManifest:O,serverActionsManifest:k}=_,j=(0,o.normalizeAppPath)(g),I=!!(N.dynamicRoutes[j]||N.routes[P]),D=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,C,!1):t.end("This page could not be found"),null);if(I&&!A){let e=!!N.routes[P],t=N.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await D();throw new R.NoFallbackError}}let H=null;!I||b.isDev||A||(H="/index"===(H=P)?"/":H);let U=!0===b.isDev||!I,M=I&&!U;k&&O&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:O,serverActionsManifest:k});let F=e.method||"GET",B=(0,i.getTracer)(),$=B.getActiveScopeSpan(),K=!!(null==S?void 0:S.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,y,N,L);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let G={params:w,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:V,cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>b.onRequestError(e,t,a,n,S)},sharedContext:{buildId:E,deploymentId:m}},W=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let n,s=async e=>b.handle(z,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${F} ${g}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&T&&q&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!I)return await (0,c.sendResponse)(W,X,i,G.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),t}},u=await b.handleResponse({req:e,nextConfig:y,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!I)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return L&&I||d.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,x.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(W,X,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};K&&$?await o($):(n=B.getActiveScopeSpan(),await B.withPropagatedContext(e.headers,()=>B.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},o),void 0,!K))}catch(t){if(t instanceof R.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),I)throw t;return await (0,c.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,q,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:S})},"routeModule",0,b,"serverHooks",0,T,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,S],99712)}];
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let a=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:a},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let a="db.json",n=r.default.join(t.default.homedir(),".super-time-tracker"),i=r.default.join(n,a);e.s(["DB_FILE_NAME",0,a,"DB_PATH",0,i,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function a(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:a}}=await e.auth.getUser();return a?.id??null}e.s(["get_authenticated_user_id",0,a])},99712,e=>{"use strict";var t=e.i(4394),r=e.i(45404),a=e.i(60016),n=e.i(33535),i=e.i(46593),s=e.i(10659),o=e.i(3644),l=e.i(31269),u=e.i(13865),d=e.i(65034),p=e.i(81157),c=e.i(82614),h=e.i(24377),x=e.i(57949),v=e.i(9566),R=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),_=e.i(68194),E=e.i(29207),m=e.i(72507),w=e.i(36117);async function y(e,t){let r=await (0,w.create_server_supabase_client)(),{error:a}=await r.from("tracker_accounts").upsert({user_id:e,active_sheet_name:t,db_version:m.DB_VERSION,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(null!==a)throw Error(`Failed to update active sheet: ${a.message}`)}async function C(e){try{let t=await (0,E.get_authenticated_user_id)();if(null===t)return(0,_.api_error_response)(Error("Sign in required"),401);let r=await e.json(),a=r.name?.trim()??"";if(0===a.length)return(0,_.api_error_response)(Error("Sheet name is required"));return await y(t,a),g.NextResponse.json({ok:!0})}catch(e){return(0,_.api_error_response)(e)}}e.s(["POST",0,C],98913);var A=e.i(98913);let b=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sheet/active/route",pathname:"/api/sheet/active",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sheet/active/route.ts",nextConfigOutput:"standalone",userland:A,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:S,serverHooks:T}=b;async function q(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),b.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sheet/active/route";g=g.replace(/\/index$/,"")||"/";let _=await b.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!_)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:m,params:w,nextConfig:y,parsedUrl:C,isDraftMode:A,prerenderManifest:N,routerServerContext:S,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,resolvedPathname:P,clientReferenceManifest:O,serverActionsManifest:k}=_,j=(0,o.normalizeAppPath)(g),I=!!(N.dynamicRoutes[j]||N.routes[P]),D=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,C,!1):t.end("This page could not be found"),null);if(I&&!A){let e=!!N.routes[P],t=N.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await D();throw new R.NoFallbackError}}let H=null;!I||b.isDev||A||(H="/index"===(H=P)?"/":H);let U=!0===b.isDev||!I,M=I&&!U;k&&O&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:O,serverActionsManifest:k});let F=e.method||"GET",B=(0,i.getTracer)(),$=B.getActiveScopeSpan(),K=!!(null==S?void 0:S.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,y,N,L);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let G={params:w,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:V,cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>b.onRequestError(e,t,a,n,S)},sharedContext:{buildId:E,deploymentId:m}},W=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let n,s=async e=>b.handle(z,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${F} ${g}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&T&&q&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!I)return await (0,c.sendResponse)(W,X,i,G.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),t}},u=await b.handleResponse({req:e,nextConfig:y,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!I)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return L&&I||d.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,x.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(W,X,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};K&&$?await o($):(n=B.getActiveScopeSpan(),await B.withPropagatedContext(e.headers,()=>B.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},o),void 0,!K))}catch(t){if(t instanceof R.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),I)throw t;return await (0,c.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,q,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:S})},"routeModule",0,b,"serverHooks",0,T,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,S],99712)}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__0m-c-3t._.js.map