super-time-tracker-ui 0.1.31 → 0.1.32

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 (93) hide show
  1. package/dist/standalone/next-output/BUILD_ID +1 -1
  2. package/dist/standalone/next-output/build-manifest.json +3 -3
  3. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  4. package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
  5. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  11. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  12. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  13. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  14. package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
  15. package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
  16. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
  17. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
  18. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  19. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  20. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
  21. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
  22. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
  23. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
  24. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  25. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  26. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  27. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  28. package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
  29. package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
  30. package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
  31. package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
  32. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  33. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  34. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
  35. package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
  36. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
  37. package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
  38. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  39. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  40. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
  41. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
  42. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
  43. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
  44. package/dist/standalone/next-output/server/chunks/ssr/_07p~0bg._.js +3 -0
  45. package/dist/standalone/next-output/server/chunks/ssr/_0m.iebm._.js +3 -0
  46. package/dist/standalone/next-output/server/chunks/ssr/_0nnp~ae._.js +3 -0
  47. package/dist/standalone/next-output/server/chunks/ssr/_0q~8_bm._.js +3 -0
  48. package/dist/standalone/next-output/server/chunks/ssr/_0v9kigy._.js +3 -0
  49. package/dist/standalone/next-output/server/middleware-build-manifest.js +3 -3
  50. package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
  51. package/dist/standalone/next-output/server/pages/500.html +1 -1
  52. package/dist/standalone/next-output/static/chunks/0.4obx1-sv46-.js +1 -0
  53. package/dist/standalone/next-output/static/chunks/029pvmqxn_t4z.js +1 -0
  54. package/dist/standalone/next-output/static/chunks/04~.lbegcwd41.js +1 -0
  55. package/dist/standalone/next-output/static/chunks/05tg.ske01w0a.js +1 -0
  56. package/dist/standalone/next-output/static/chunks/06xf_oh5oqbs2.js +1 -0
  57. package/dist/standalone/next-output/static/chunks/09acxdggb87~w.js +1 -0
  58. package/dist/standalone/next-output/static/chunks/0crn_fc6.6569.js +1 -0
  59. package/dist/standalone/next-output/static/chunks/0fkr5kz7p1r5l.js +1 -0
  60. package/dist/standalone/next-output/static/chunks/0lhj2p9.4g20~.js +1 -0
  61. package/dist/standalone/next-output/static/chunks/0o4zvrm3q.9k3.js +1 -0
  62. package/dist/standalone/next-output/static/chunks/0vov8ngx9~8m2.js +1 -0
  63. package/dist/standalone/next-output/static/chunks/0watkjb-fw0vn.js +1 -0
  64. package/dist/standalone/next-output/static/chunks/0xj4dodycy1oc.js +1 -0
  65. package/dist/standalone/next-output/static/chunks/12eaief5vtso9.js +1 -0
  66. package/dist/standalone/next-output/static/chunks/13-nw2q_c_9mk.js +1 -0
  67. package/dist/standalone/next-output/static/chunks/14jtaz5s.4ih1.js +1 -0
  68. package/dist/standalone/package.json +1 -1
  69. package/package.json +1 -1
  70. package/dist/standalone/next-output/server/chunks/ssr/_00_8gfw._.js +0 -3
  71. package/dist/standalone/next-output/server/chunks/ssr/_059wg4v._.js +0 -3
  72. package/dist/standalone/next-output/server/chunks/ssr/_0hs4c5u._.js +0 -3
  73. package/dist/standalone/next-output/server/chunks/ssr/_0nz4ym1._.js +0 -3
  74. package/dist/standalone/next-output/server/chunks/ssr/_0wg9~zr._.js +0 -3
  75. package/dist/standalone/next-output/static/chunks/0.04y~4c8a5xc.js +0 -1
  76. package/dist/standalone/next-output/static/chunks/01jy.t2pk-fa6.js +0 -1
  77. package/dist/standalone/next-output/static/chunks/02i4jl0xp426g.js +0 -1
  78. package/dist/standalone/next-output/static/chunks/04_-q9c5inknj.js +0 -1
  79. package/dist/standalone/next-output/static/chunks/06y4x2vr8z2ur.js +0 -1
  80. package/dist/standalone/next-output/static/chunks/075ldqatokyh9.js +0 -1
  81. package/dist/standalone/next-output/static/chunks/090ac~je_jd8e.js +0 -1
  82. package/dist/standalone/next-output/static/chunks/0i41ijcz4sls2.js +0 -1
  83. package/dist/standalone/next-output/static/chunks/0phd4iuqah0hn.js +0 -1
  84. package/dist/standalone/next-output/static/chunks/0r35q73w_j-ra.js +0 -1
  85. package/dist/standalone/next-output/static/chunks/0sywmu6t~l1c8.js +0 -1
  86. package/dist/standalone/next-output/static/chunks/0x91bm-1.c.17.js +0 -1
  87. package/dist/standalone/next-output/static/chunks/10b~ujyr8lius.js +0 -1
  88. package/dist/standalone/next-output/static/chunks/131q78th6a65i.js +0 -1
  89. package/dist/standalone/next-output/static/chunks/132642_08w2fh.js +0 -1
  90. package/dist/standalone/next-output/static/chunks/16u2fvwy8kata.js +0 -1
  91. /package/dist/standalone/next-output/static/{Y1yPgSHwp9h2rIpwS9SZf → gS32e4Tv_70ot1IWBJddE}/_buildManifest.js +0 -0
  92. /package/dist/standalone/next-output/static/{Y1yPgSHwp9h2rIpwS9SZf → gS32e4Tv_70ot1IWBJddE}/_clientMiddlewareManifest.js +0 -0
  93. /package/dist/standalone/next-output/static/{Y1yPgSHwp9h2rIpwS9SZf → gS32e4Tv_70ot1IWBJddE}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),s=s.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${s}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return x}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),o=e.r(54710),i=a._(e.r(29158)),l=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let p=e.r(38520),f=e.r(19947),_=e.r(59246),h=e.r(99046);function b(t){var r,n;let s,a,b,[x,k]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),y=(0,i.useRef)(null),{href:w,as:v,children:j,prefetch:N=null,passHref:S,replace:O,shallow:E,scroll:T,onClick:P,onMouseEnter:C,onTouchStart:D,legacyBehavior:R=!1,onNavigate:L,transitionTypes:A,ref:M,unstable_dynamicOnHover:I,...F}=t;s=j,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let $=i.default.useContext(u.AppRouterContext),U=!1!==N,K=!1!==N?null===(n=N)||"auto"===n?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,B="string"==typeof(r=v||w)?r:(0,l.formatUrl)(r);if(R){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(s)}let q=R?a&&"object"==typeof a&&a.ref:M,G=i.default.useCallback(e=>(null!==$&&(y.current=(0,f.mountLinkInstance)(e,B,$,K,U,k)),()=>{y.current&&((0,f.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,f.unmountPrefetchableInstance)(e)}),[U,B,$,K,k]),W={ref:(0,c.useMergedRef)(G,q),onClick(t){R||"function"!=typeof P||P(t),R&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,a,o,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,_.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,B,y,O,T,L,A)},onMouseEnter(e){R||"function"!=typeof C||C(e),R&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){R||"function"!=typeof D||D(e),R&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,d.isAbsoluteUrl)(B)?W.href=B:R&&!S&&("a"!==a.type||"href"in a.props)||(W.href=(0,m.addBasePath)(B)),b=R?i.default.cloneElement(a,W):(0,o.jsx)("a",{...F,...W,children:s}),(0,o.jsx)(g.Provider,{value:x,children:b})}e.r(10364);let g=(0,i.createContext)(f.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,i]=(0,r.useState)(null),[l,u]=(0,r.useState)(!1),c=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:o,is_pending:l,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var o=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,o.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function o(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return o()}],76003);var i=e.i(17798),l=e.i(46549),u=e.i(10464),c=e.i(35434),d=e.i(61834),m=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===o()?"light":"dark";(0,i.apply_theme)(e),(0,m.write_stored_theme)(e),u.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),u.theme_mode_preference.notify(),(0,c.notify_theme_subscribers)(),(0,l.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),o=e.i(90463),i=e.i(46549),l=e.i(73205),u=e.i(66295),c=e.i(2268),d=e.i(32792),m=e.i(90299),p=e.i(28274),f=e.i(76003),_=e.i(35434),h=e.i(38240),b=e.i(22373),g=e.i(25204),x=e.i(77882);let k="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",y={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),v=(0,n.usePathname)()??"/",j=(0,s.useSyncExternalStore)(_.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),N=(0,s.useSyncExternalStore)(c.cloud_sync_enabled_preference.subscribe,c.cloud_sync_enabled_preference.get_snapshot,c.cloud_sync_enabled_preference.get_server_snapshot),S=(0,s.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),O=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),E=(0,u.parse_tracker_shortcut_map)(S),T=new Set((0,l.parse_topbar_quick_actions)(O)),P=b.topbar_quick_action_ids.filter(e=>!T.has(e)),C=Array.from(new Set([...Array.from(w),...P])),{email:D,is_configured:R,is_pending:L,sign_out:A}=(0,x.use_supabase_auth_session)(),[M,I]=(0,s.useState)(!1),F=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!M)return;let e=e=>{null===F.current||F.current.contains(e.target)||I(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[M]);let $=()=>{I(!1)};return(0,g.use_escape_to_cancel)($,M),(0,t.jsxs)("div",{className:"relative shrink-0",ref:F,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":M,"aria-haspopup":"menu",onClick:()=>I(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),M?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[R&&null!==D?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:D,children:D})}):null,C.map(e=>{let n=y[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:k,role:"menuitem",onClick:$,children:n.label})},e)}),R?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:k,role:"menuitemcheckbox","aria-checked":"true"===N,onClick:()=>{let e="true"===N?"false":"true";c.cloud_sync_enabled_preference.write(e),c.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==D&&(0,p.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===N?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===N?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:k,role:"menuitem",onClick:()=>{$(),(0,h.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===j?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===j?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:k,role:"menuitem",onClick:()=>{let e;$(),e=E.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),R?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===D?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:k,role:"menuitem",onClick:()=>{$(),e.push((0,o.build_auth_page_href)("sign_in",v))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${k} text-danger`,role:"menuitem",disabled:L,onClick:()=>{$(),A()},children:L?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let v=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),o=(0,s.useMemo)(()=>(0,l.parse_topbar_quick_actions)(a),[a]);if(0===o.length)return null;let i=v.filter(e=>o.includes(e.id));return 0===i.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:i.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),o=e.i(45958),i=e.i(71060),l=e.i(29539);function u(){let e=((0,i.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(o.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function c({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(o.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(o.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(c,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(u,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},52405,e=>{"use strict";e.s(["get_input_class_name",0,function(e="default"){let t="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===e?`${t} px-2.5 py-2`:t}])},31113,e=>{"use strict";e.s(["normalize_stored_tag",0,function(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}`}])},18774,e=>{"use strict";e.s(["format_display_tag",0,function(e){return e.startsWith("@")?e:`@${e}`}])},14260,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(18774),s=e.i(52405),a=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:o,known_tags:i,placeholder:l,disabled:u=!1,autoFocus:c=!1,on_change:d}){let m=(0,r.useRef)(null),p=(0,r.useRef)(null),f=(0,r.useRef)(null),[_,h]=(0,r.useState)(0),[b,g]=(0,r.useState)(0),x=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let s=r.slice(n+1);return/\s/.test(s)?null:{query:s,start_index:n,end_index:t}}(o,_),k=null===x?[]:function(e,t,r=10){let n=t.toLowerCase();return e.filter(e=>{let t=e.replace(/^@/,"").toLowerCase();return 0===n.length||t.startsWith(n)}).slice(0,r)}(i,x.query),y=null!==x&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,a.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(x.query,i),w=null!==x&&k.length>0&&!y&&!u;(0,r.useLayoutEffect)(()=>{null!==f.current&&null!==m.current&&(m.current.setSelectionRange(f.current,f.current),h(f.current),f.current=null)},[o]),(0,r.useEffect)(()=>{g(0)},[o,_,k.length]);let v=()=>{h(m.current?.selectionStart??o.length)},j=()=>{g(0)},N=e=>{let t,r,s;if(null===x)return;let{next_text:a,next_cursor:i}=(t=(0,n.format_display_tag)(e),r=o.slice(0,x.start_index),s=o.slice(x.end_index),{next_text:`${r}${t}${s}`,next_cursor:r.length+t.length});f.current=i,d(a),j()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",className:(0,s.get_input_class_name)(),value:o,placeholder:l,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),h(e.target.selectionStart??e.target.value.length)},onClick:v,onKeyUp:v,onKeyDown:e=>{if(w){if("ArrowDown"===e.key){e.preventDefault(),g(e=>(e+1)%k.length);return}if("ArrowUp"===e.key){e.preventDefault(),g(e=>(e-1+k.length)%k.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=k[b];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),j())}},onBlur:()=>{window.setTimeout(j,120)}}),w?(0,t.jsx)("ul",{ref:p,id:`${e}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:k.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===b,children:(0,t.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${r===b?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),N(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},85323,e=>{"use strict";var t=e.i(49087);e.s(["notify_desktop",0,function(e){if((0,t.notify_in_app)({title:e.title,body:e.body}),"u"<typeof Notification||"u">typeof document&&"visible"===document.visibilityState&&document.hasFocus()||"granted"!==Notification.permission)return;let{body:r,tag:n,title:s}=e,a={body:r,...void 0!==n?{tag:n}:{}};try{new Notification(s,a)}catch{}},"supports_desktop_notifications",0,function(){return"u">typeof Notification}])},15526,e=>{"use strict";let t="super-time-tracker-pomodoro-active-entry";e.s(["clear_pomodoro_task_entry_marker",0,function(){try{window.localStorage.removeItem(t)}catch{}},"is_pomodoro_task_entry",0,function(e){let r=(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return null;try{let t=JSON.parse(e);if("string"==typeof t.sheetName&&t.sheetName.length>0&&"number"==typeof t.entryId&&Number.isInteger(t.entryId))return{sheetName:t.sheetName,entryId:t.entryId}}catch{}return null}catch{return null}})();return null!==r&&r.sheetName===e.sheetName&&r.entryId===e.id},"mark_pomodoro_task_entry",0,function(e){try{let r={sheetName:e.sheetName,entryId:e.id};window.localStorage.setItem(t,JSON.stringify(r))}catch{}}])},7668,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(29158),s=e.i(29539),a=e.i(14260),o=e.i(75404),i=e.i(52663),l=e.i(85323),u=e.i(15526),c=e.i(72550),d=e.i(26740);e.s(["PomodoroView",0,function({known_tags:e}){let[m,p]=(0,n.useState)(d.POMODORO_DEFAULT_SETTINGS),[f,_]=(0,n.useState)(d.POMODORO_DEFAULT_STATE),[h,b]=(0,n.useState)(()=>Date.now()),[g,x]=(0,n.useState)(!1),[k,y]=(0,n.useState)(null),[w,v]=(0,n.useState)(!1),j=(0,n.useRef)(null),N=(0,n.useRef)(d.POMODORO_DEFAULT_SETTINGS),S=(0,n.useRef)(d.POMODORO_DEFAULT_STATE),O=(0,n.useCallback)((e,t)=>{(0,l.notify_desktop)({title:e,body:t,tag:"pomodoro-phase-event"})},[]);(0,n.useEffect)(()=>{let e=window.setTimeout(()=>{try{let e=window.localStorage.getItem(d.POMODORO_STORAGE_KEY);if(null!==e){let t=JSON.parse(e),r=t.settings,n=t.state;if(void 0!==r&&p({work_minutes:"number"==typeof r.work_minutes&&Number.isFinite(r.work_minutes)&&r.work_minutes>0?Math.round(r.work_minutes):d.POMODORO_DEFAULT_SETTINGS.work_minutes,short_break_minutes:"number"==typeof r.short_break_minutes&&Number.isFinite(r.short_break_minutes)&&r.short_break_minutes>0?Math.round(r.short_break_minutes):d.POMODORO_DEFAULT_SETTINGS.short_break_minutes,long_break_minutes:"number"==typeof r.long_break_minutes&&Number.isFinite(r.long_break_minutes)&&r.long_break_minutes>0?Math.round(r.long_break_minutes):d.POMODORO_DEFAULT_SETTINGS.long_break_minutes,rounds_before_long_break:"number"==typeof r.rounds_before_long_break&&Number.isFinite(r.rounds_before_long_break)&&r.rounds_before_long_break>0?Math.round(r.rounds_before_long_break):d.POMODORO_DEFAULT_SETTINGS.rounds_before_long_break,auto_start_next_phase:"boolean"==typeof r.auto_start_next_phase?r.auto_start_next_phase:d.POMODORO_DEFAULT_SETTINGS.auto_start_next_phase,check_in_on_work_start:"boolean"==typeof r.check_in_on_work_start?r.check_in_on_work_start:d.POMODORO_DEFAULT_SETTINGS.check_in_on_work_start,work_entry_description:"string"==typeof r.work_entry_description?r.work_entry_description:d.POMODORO_DEFAULT_SETTINGS.work_entry_description}),void 0!==n){let e=n.phase,t=n.status,r={phase:"short_break"===e||"long_break"===e||"work"===e?e:d.POMODORO_DEFAULT_STATE.phase,status:"idle"===t||"paused"===t||"running"===t?t:d.POMODORO_DEFAULT_STATE.status,completed_work_sessions:"number"==typeof n.completed_work_sessions&&Number.isFinite(n.completed_work_sessions)&&n.completed_work_sessions>=0?Math.round(n.completed_work_sessions):d.POMODORO_DEFAULT_STATE.completed_work_sessions,deadline_at_ms:"number"==typeof n.deadline_at_ms&&Number.isFinite(n.deadline_at_ms)?n.deadline_at_ms:null,paused_remaining_ms:"number"==typeof n.paused_remaining_ms&&Number.isFinite(n.paused_remaining_ms)&&n.paused_remaining_ms>=0?Math.round(n.paused_remaining_ms):null};S.current=r,_(r)}}}catch{}x(!0)},0);return()=>{window.clearTimeout(e)}},[]),(0,n.useEffect)(()=>{N.current=m},[m]),(0,n.useEffect)(()=>{S.current=f},[f]);let E=(0,n.useCallback)((e,t)=>{try{window.localStorage.setItem(d.POMODORO_STORAGE_KEY,JSON.stringify({settings:e,state:t}))}catch{}},[]),T=(0,n.useCallback)(e=>{_(t=>{let r="function"==typeof e?e(t):e;return S.current=r,E(N.current,r),r})},[E]);(0,n.useEffect)(()=>{g&&E(m,f)},[g,E,m,f]),(0,n.useEffect)(()=>{let e=()=>{E(N.current,S.current)};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[E]),(0,n.useEffect)(()=>{if("running"!==f.status)return;let e=window.setInterval(()=>{b(Date.now())},1e3);return()=>{window.clearInterval(e)}},[f.status,f.deadline_at_ms]);let P=(0,n.useCallback)(e=>{switch(e){case"work":return 6e4*m.work_minutes;case"short_break":return 6e4*m.short_break_minutes;case"long_break":return 6e4*m.long_break_minutes}},[m.long_break_minutes,m.short_break_minutes,m.work_minutes]),C=(0,n.useCallback)(async()=>{let e=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!e.ok)throw Error((await e.json().catch(()=>({}))).error??"Failed to read tracker state");let t=await e.json().catch(()=>null);return t?.runningEntry!==null&&t?.runningEntry!==void 0},[]),D=(0,n.useCallback)(async()=>{try{v(await C())}catch{}},[C]),R=async()=>{let e=m.work_entry_description.trim();if(0===e.length)return;if(await C())return void v(!0);let t=await fetch("/api/in",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:e,sheetName:function(){try{let e=window.localStorage.getItem(c.ACTIVE_SHEET_STORAGE_KEY)?.trim()??"";return e.length>0?e:null}catch{return null}}()??void 0})});if(t.ok){let e=await t.json().catch(()=>null),r=e?.activeEntry;null!=r&&(0,u.mark_pomodoro_task_entry)({id:r.id,sheetName:r.sheetName}),v(!0);return}throw Error((await t.json().catch(()=>({}))).error??"Failed to start tracker entry for Pomodoro")},L=async()=>{let e=await fetch("/api/out",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){(0,u.clear_pomodoro_task_entry_marker)(),v(!1);return}let t=(await e.json().catch(()=>({}))).error??"Failed to check out active tracker entry";if(!t.includes("No active entry"))throw Error(t)},A=async()=>{y(null);try{let e=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??"Failed to read tracker state")}let t=await e.json().catch(()=>null),r=t?.runningEntry;if(r?.start===void 0)throw Error("No active task found to start from");let n=Date.parse(r.start);if(!Number.isFinite(n))throw Error("Active task start time is invalid");let s=Math.max(0,Date.now()-n),a=P(f.phase),o=Math.max(0,a-s);T(e=>({...e,status:"running",deadline_at_ms:Date.now()+o,paused_remaining_ms:null}))}catch(e){y(e instanceof Error?e.message:String(e))}},M=(0,n.useCallback)(()=>{let e="work"===f.phase,t=f.completed_work_sessions+1;if(T(e=>{let t="work"===e.phase?e.completed_work_sessions+1:e.completed_work_sessions,r="work"===e.phase?t%m.rounds_before_long_break==0?"long_break":"short_break":"work",n=P(r);return m.auto_start_next_phase?{phase:r,status:"running",completed_work_sessions:t,deadline_at_ms:Date.now()+n,paused_remaining_ms:null}:{phase:r,status:"idle",completed_work_sessions:t,deadline_at_ms:null,paused_remaining_ms:null}}),e&&O("Pomodoro focus session complete",`Completed focus session ${t}.`),m.auto_start_next_phase){let e="work"===f.phase?f.completed_work_sessions%m.rounds_before_long_break==m.rounds_before_long_break-1?"long break":"short break":"focus";O("work"===f.phase?"Pomodoro break started":"Pomodoro focus started",`Auto-started ${e} timer.`)}},[P,O,T,f.completed_work_sessions,f.phase,m.auto_start_next_phase,m.rounds_before_long_break]);(0,n.useEffect)(()=>{let e=window.setTimeout(()=>{D()},0);return()=>{window.clearTimeout(e)}},[D]),(0,n.useEffect)(()=>{let e=window.setInterval(()=>{D()},5e3);return()=>{window.clearInterval(e)}},[D]),(0,n.useEffect)(()=>{if("running"!==f.status||null===f.deadline_at_ms||h<f.deadline_at_ms)return;let e=window.setTimeout(()=>{M()},0);return()=>{window.clearTimeout(e)}},[M,h,f.deadline_at_ms,f.status]);let I=P(f.phase),F="running"===f.status&&null!==f.deadline_at_ms?Math.max(0,f.deadline_at_ms-h):"paused"===f.status?f.paused_remaining_ms??I:I,$=Math.min(100,Math.max(0,(I-F)/I*100)),U=`${Math.floor(F/6e4).toString().padStart(2,"0")}:${Math.floor(F%6e4/1e3).toString().padStart(2,"0")}`,K={work:"Focus",short_break:"Short break",long_break:"Long break"}[f.phase],B="work"===f.phase?f.completed_work_sessions%m.rounds_before_long_break==m.rounds_before_long_break-1?"long_break":"short_break":"work",q="work"===f.phase?`${f.completed_work_sessions+1} / ${m.rounds_before_long_break} focus rounds`:"short_break"===f.phase?"Recover before the next focus block.":"Take the long break before the next round.",G="running"===f.status?"Pause":"paused"===f.status?"Resume":"Start",W=`${U} \xb7 ${K} \xb7 Pomodoro`;return(0,n.useEffect)(()=>{if("u">typeof document)return null===j.current&&(j.current=document.title),()=>{null!==j.current&&(document.title=j.current)}},[]),(0,n.useEffect)(()=>{"u">typeof document&&(document.title=W)},[W]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.TrackerTopbar,{breadcrumb:{current:"Pomodoro"}}),(0,t.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col gap-6 px-5 pb-12 pt-6",children:[(0,t.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Pomodoro"}),(0,t.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:"Keep a simple focus cycle running alongside your time tracker."})]}),(0,t.jsx)(r.default,{href:"/settings/pomodoro",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Pomodoro settings",title:"Pomodoro settings",children:(0,t.jsx)(s.SettingsIcon,{})})]}),(0,t.jsx)("section",{className:"rounded-md border border-panel-border bg-panel p-5 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Current phase"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[1.3rem] font-semibold",children:K}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.88rem] leading-relaxed text-muted",children:q})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Next phase"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.95rem] font-semibold text-accent",children:{work:"Focus",short_break:"Short break",long_break:"Long break"}[B]}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.84rem] text-muted",children:m.auto_start_next_phase?"Auto-start enabled":"Waiting for you"})]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-background px-4 py-5 text-center",children:[(0,t.jsx)("p",{className:"m-0 font-mono text-[3rem] font-semibold tracking-tight text-accent","aria-live":"polite",children:U}),(0,t.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-surface-strong",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-200",style:{width:`${$}%`}})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 text-[0.82rem] text-muted",children:[(0,t.jsxs)("span",{children:[f.completed_work_sessions," focus sessions done"]}),(0,t.jsx)("span",{children:"•"}),(0,t.jsx)("span",{children:"running"===f.status?"Running":"paused"===f.status?"Paused":"Idle"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("primary"),onClick:()=>{let e,t,r;"running"===f.status?(y(null),T(e=>"running"!==e.status||null===e.deadline_at_ms?e:{...e,status:"paused",deadline_at_ms:null,paused_remaining_ms:Math.max(0,e.deadline_at_ms-Date.now())}),L().catch(e=>{y(e instanceof Error?e.message:String(e))})):(y(null),T(e=>{let t="paused"===e.status&&null!==e.paused_remaining_ms?e.paused_remaining_ms:P(e.phase);return{...e,status:"running",deadline_at_ms:Date.now()+t,paused_remaining_ms:null}}),e="paused"===f.status,t="short_break"===f.phase||"long_break"===f.phase,r=e||"running"!==f.status&&"work"===f.phase&&m.check_in_on_work_start,e||"running"===f.status||O(t?"Pomodoro break started":"Pomodoro focus started",t?"Break timer is running.":"Focus timer is running."),r&&R().catch(e=>{y(e instanceof Error?e.message:String(e))}))},children:G}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),onClick:M,children:"Skip phase"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),onClick:()=>{T(d.POMODORO_DEFAULT_STATE),b(Date.now())},children:"Reset"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:"running"===f.status,onClick:()=>{A()},children:"Start from active task start time"})]}),null!==k?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:k}):null,m.check_in_on_work_start&&!w?(0,t.jsx)("div",{className:"grid gap-2 rounded-md border border-panel-border bg-background p-3 md:grid-cols-2",children:(0,t.jsxs)("label",{className:"flex flex-col gap-1.5 md:col-span-2",children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold text-muted",children:"New entry description (supports @tags)"}),(0,t.jsx)(a.TagAutocompleteInput,{id:"pomodoro-work-entry-description",value:m.work_entry_description,known_tags:e,placeholder:"Pomodoro focus @pomodoro @focus",on_change:e=>{p(t=>({...t,work_entry_description:e}))}})]})}):null]})})]})]})}],7668)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),l=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",o=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let u=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${o}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return _}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),l=e.r(54710),o=a._(e.r(29158)),i=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),h=e.r(20321);e.r(90503);let p=e.r(38520),f=e.r(19947),m=e.r(59246),g=e.r(99046);function b(t){var r,n;let s,a,b,[_,y]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:j,as:w,children:k,prefetch:S=null,passHref:N,replace:E,shallow:O,scroll:C,onClick:T,onMouseEnter:R,onTouchStart:L,legacyBehavior:P=!1,onNavigate:$,transitionTypes:D,ref:A,unstable_dynamicOnHover:M,...U}=t;s=k,P&&("string"==typeof s||"number"==typeof s)&&(s=(0,l.jsx)("a",{children:s}));let I=o.default.useContext(c.AppRouterContext),B=!1!==S,W=!1!==S?null===(n=S)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,q="string"==typeof(r=w||j)?r:(0,i.formatUrl)(r);if(P){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(s)}let K=P?a&&"object"==typeof a&&a.ref:A,F=o.default.useCallback(e=>(null!==I&&(v.current=(0,f.mountLinkInstance)(e,q,I,W,B,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[B,q,I,W,y]),z={ref:(0,u.useMergedRef)(F,K),onClick(t){P||"function"!=typeof T||T(t),P&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,s,a,l,i){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);o.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,i)})}}(t,q,v,E,C,$,D)},onMouseEnter(e){P||"function"!=typeof R||R(e),P&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){P||"function"!=typeof L||L(e),P&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,d.isAbsoluteUrl)(q)?z.href=q:P&&!N&&("a"!==a.type||"href"in a.props)||(z.href=(0,h.addBasePath)(q)),b=P?o.default.cloneElement(a,z):(0,l.jsx)("a",{...U,...z,children:s}),(0,l.jsx)(x.Provider,{value:_,children:b})}e.r(10364);let x=(0,o.createContext)(f.IDLE_LINK_STATUS),_=()=>(0,o.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[l,o]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{o(e?.user.email??null)}).catch(()=>{o(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{o(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:l,is_pending:i,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var l=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,l.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function l(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return l()}],76003);var o=e.i(17798),i=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),h=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===l()?"light":"dark";(0,o.apply_theme)(e),(0,h.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),l=e.i(90463),o=e.i(46549),i=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),h=e.i(90299),p=e.i(28274),f=e.i(76003),m=e.i(35434),g=e.i(38240),b=e.i(22373),x=e.i(25204),_=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),w=(0,n.usePathname)()??"/",k=(0,s.useSyncExternalStore)(m.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),S=(0,s.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),N=(0,s.useSyncExternalStore)(h.tracker_shortcut_map_preference.subscribe,h.tracker_shortcut_map_preference.get_snapshot,h.tracker_shortcut_map_preference.get_server_snapshot),E=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),O=(0,c.parse_tracker_shortcut_map)(N),C=new Set((0,i.parse_topbar_quick_actions)(E)),T=b.topbar_quick_action_ids.filter(e=>!C.has(e)),R=Array.from(new Set([...Array.from(j),...T])),{email:L,is_configured:P,is_pending:$,sign_out:D}=(0,_.use_supabase_auth_session)(),[A,M]=(0,s.useState)(!1),U=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!A)return;let e=e=>{null===U.current||U.current.contains(e.target)||M(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[A]);let I=()=>{M(!1)};return(0,x.use_escape_to_cancel)(I,A),(0,t.jsxs)("div",{className:"relative shrink-0",ref:U,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":A,"aria-haspopup":"menu",onClick:()=>M(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),A?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[P&&null!==L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:L,children:L})}):null,R.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:I,children:n.label})},e)}),P?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===S,onClick:()=>{let e="true"===S?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,o.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==L&&(0,p.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===S?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===S?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),(0,g.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===k?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===k?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;I(),e=O.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),e.push((0,l.build_auth_page_href)("sign_in",w))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:$,onClick:()=>{I(),D()},children:$?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let w=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),l=(0,s.useMemo)(()=>(0,i.parse_topbar_quick_actions)(a),[a]);if(0===l.length)return null;let o=w.filter(e=>l.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),l=e.i(45958),o=e.i(71060),i=e.i(29539);function c(){let e=((0,o.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(l.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(i.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(l.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(l.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":s?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},39474,20993,e=>{"use strict";var t=e.i(13349),r=e.i(32417),n=e.i(44171),s=e.i(28274);let a=null,l=Promise.resolve();function o(){(0,r.is_supabase_configured)()&&(0,n.is_cloud_sync_enabled)()&&(null!==a&&clearTimeout(a),a=setTimeout(()=>{a=null,l=l.then(()=>(0,s.run_tracker_db_cloud_sync)()).catch(()=>{})},400))}function i(){(0,t.is_greedy_cloud_sync_enabled)()&&o()}e.s(["schedule_tracker_db_cloud_sync",0,i],20993),e.s(["push_tracker_db_cloud_after_change",0,function(){(0,t.is_greedy_cloud_sync_enabled)()?i():o()}],39474)},6216,e=>{"use strict";var t=e.i(54710),r=e.i(71060),n=e.i(29158),s=e.i(39474),a=e.i(14974),l=e.i(52663);e.s(["BackupRestoreSetting",0,function({db_path:e}){let o=(0,r.useRouter)(),{confirm:i}=(0,a.use_confirm_dialog)(),c=(0,n.useRef)(null),[u,d]=(0,n.useState)(null),[h,p]=(0,n.useState)(null),[f,m]=(0,n.useState)(!1),[g,b]=(0,n.useState)(!1),x=async()=>{m(!0),d(null),p(null);try{let e=await fetch("/api/backup");if(!e.ok){let t=await e.json();throw Error(t.error??"Download failed")}let t=await e.blob(),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="db.json",n.click(),URL.revokeObjectURL(r),p("Backup downloaded.")}catch(e){d(e instanceof Error?e.message:String(e))}finally{m(!1)}},_=async e=>{let t=e.target.files?.[0];if((e.target.value="",void 0!==t)&&await i({title:"Restore backup?",message:"This will replace your current time tracker data with the uploaded backup file. This cannot be undone.",confirmLabel:"Restore",variant:"danger"})){b(!0),d(null),p(null);try{let e,r=await t.text();try{e=JSON.parse(r)}catch{throw Error("Invalid backup file: file is not valid JSON.")}let n=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){let e=await n.json();throw Error(e.error??"Restore failed")}p("Backup restored. Opening tracker…"),(0,s.push_tracker_db_cloud_after_change)(),o.push("/"),o.refresh()}catch(e){d(e instanceof Error?e.message:String(e))}finally{b(!1)}}},y=f||g;return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Backup and restore"}),(0,t.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"Download a copy of your database or replace it with a previously saved backup file."})]}),(0,t.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-mono text-[0.65rem] leading-snug text-muted",title:e,children:e}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:y,onClick:()=>void x(),children:f?"Downloading…":"Download backup"}),(0,t.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("danger","small"),disabled:y,onClick:()=>{c.current?.click()},children:g?"Restoring…":"Restore from file"}),(0,t.jsx)("input",{ref:c,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>void _(e)})]}),null!==h?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:h}):null,null!==u?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:u}):null]})}],6216)},66764,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(52663);function s(e){let t=e.replaceAll('"','""');return`"${t}"`}function a(e){return e.replaceAll("|","\\|").replaceAll("\n"," ")}e.s(["DbExportSetting",0,function({db:e}){let[l,o]=(0,r.useState)(null),[i,c]=(0,r.useState)(null),u=(0,r.useMemo)(()=>e.sheets.reduce((e,t)=>e+t.entries.length,0),[e.sheets]),d=t=>{c(null),o(null);try{var r,n,l,i,u,d;let c,h,p,f,m="json"===t?(r=e,JSON.stringify(r,null,2)):"csv"===t?(c=e.sheets.flatMap(e=>e.entries.map(t=>{let r=new Date(t.start).toISOString(),n=null===t.end?"":new Date(t.end).toISOString(),a=null===t.end?"":String(Math.max(0,t.end-t.start)/6e4),l=t.notes.map(e=>e.text).join(" | ");return[e.name,String(t.id),t.description,t.tags.join(" "),r,n,a,String(t.notes.length),l].map(s).join(",")})),["sheet_name,entry_id,description,tags,start_iso,end_iso,duration_minutes,note_count,notes",...c].join("\n")):function(e){let t=[],r=new Date().toISOString(),n=e.sheets.reduce((e,t)=>e+t.entries.length,0);for(let s of(t.push("# super-time-tracker export"),t.push(""),t.push(`- Exported at: ${r}`),t.push(`- Active sheet: ${e.activeSheetName??"none"}`),t.push(`- Sheets: ${e.sheets.length}`),t.push(`- Entries: ${n}`),t.push(""),e.sheets)){if(t.push(`## ${s.name}`),t.push(""),t.push(`- Active entry ID: ${s.activeEntryID??"none"}`),t.push(`- Entries: ${s.entries.length}`),t.push(""),0===s.entries.length){t.push("_No entries_"),t.push("");continue}for(let e of(t.push("| ID | Description | Tags | Start | End | Duration | Notes |"),t.push("| --- | --- | --- | --- | --- | --- | --- |"),s.entries)){let r=new Date(e.start).toISOString(),n=null===e.end?"running":new Date(e.end).toISOString(),s=null===e.end?"running":`${Math.max(0,e.end-e.start)/6e4} min`,l=0===e.tags.length?"-":e.tags.map(e=>`@${e}`).join(" "),o=0===e.notes.length?"-":e.notes.map(e=>e.text).join(" / ");t.push(`| ${e.id} | ${a(e.description)} | ${a(l)} | ${r} | ${n} | ${s} | ${a(o)} |`)}t.push("")}return t.join("\n")}(e),g=`super-time-tracker-export.${(n=t,"json"===n?"json":"csv"===n?"csv":"md")}`,b=(l=t,"json"===l?"application/json":"csv"===l?"text/csv;charset=utf-8":"text/markdown;charset=utf-8");i=g,u=m,d=b,h=new Blob([u],{type:d}),p=URL.createObjectURL(h),(f=document.createElement("a")).href=p,f.download=i,f.click(),URL.revokeObjectURL(p),o(`Downloaded ${g}`)}catch(e){c(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Database export"}),(0,t.jsxs)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:[e.sheets.length," sheets and ",u," entries ready to export."]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,n.get_button_class_name)("ghost","small"),onClick:()=>d("json"),children:"Export JSON"}),(0,t.jsx)("button",{type:"button",className:(0,n.get_button_class_name)("ghost","small"),onClick:()=>d("csv"),children:"Export CSV"}),(0,t.jsx)("button",{type:"button",className:(0,n.get_button_class_name)("ghost","small"),onClick:()=>d("markdown"),children:"Export Markdown"})]}),null!==l?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:l}):null,null!==i?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:i}):null]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":s?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),i=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",o=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return _}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),i=e.r(54710),o=a._(e.r(29158)),l=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),p=e.r(20321);e.r(90503);let h=e.r(38520),f=e.r(19947),m=e.r(59246),b=e.r(99046);function g(t){var r,n;let s,a,g,[_,y]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:k,as:j,children:w,prefetch:N=null,passHref:S,replace:C,shallow:E,scroll:T,onClick:P,onMouseEnter:O,onTouchStart:L,legacyBehavior:R=!1,onNavigate:A,transitionTypes:M,ref:q,unstable_dynamicOnHover:$,...D}=t;s=w,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,i.jsx)("a",{children:s}));let U=o.default.useContext(c.AppRouterContext),I=!1!==N,W=!1!==N?null===(n=N)||"auto"===n?b.FetchStrategy.PPR:b.FetchStrategy.Full:b.FetchStrategy.PPR,K="string"==typeof(r=j||k)?r:(0,l.formatUrl)(r);if(R){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(s)}let B=R?a&&"object"==typeof a&&a.ref:q,F=o.default.useCallback(e=>(null!==U&&(v.current=(0,f.mountLinkInstance)(e,K,U,W,I,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[I,K,U,W,y]),z={ref:(0,u.useMergedRef)(F,B),onClick(t){R||"function"!=typeof P||P(t),R&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,s,a,i,l){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);o.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,l)})}}(t,K,v,C,T,A,M)},onMouseEnter(e){R||"function"!=typeof O||O(e),R&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(K)?z.href=K:R&&!S&&("a"!==a.type||"href"in a.props)||(z.href=(0,p.addBasePath)(K)),g=R?o.default.cloneElement(a,z):(0,i.jsx)("a",{...D,...z,children:s}),(0,i.jsx)(x.Provider,{value:_,children:g})}e.r(10364);let x=(0,o.createContext)(f.IDLE_LINK_STATUS),_=()=>(0,o.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[i,o]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),u=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{o(e?.user.email??null)}).catch(()=>{o(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{o(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:i,is_pending:l,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var i=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,i.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function i(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return i()}],76003);var o=e.i(17798),l=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),p=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===i()?"light":"dark";(0,o.apply_theme)(e),(0,p.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,l.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),i=e.i(90463),o=e.i(46549),l=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),p=e.i(90299),h=e.i(28274),f=e.i(76003),m=e.i(35434),b=e.i(38240),g=e.i(22373),x=e.i(25204),_=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},k=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),j=(0,n.usePathname)()??"/",w=(0,s.useSyncExternalStore)(m.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),N=(0,s.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),S=(0,s.useSyncExternalStore)(p.tracker_shortcut_map_preference.subscribe,p.tracker_shortcut_map_preference.get_snapshot,p.tracker_shortcut_map_preference.get_server_snapshot),C=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),E=(0,c.parse_tracker_shortcut_map)(S),T=new Set((0,l.parse_topbar_quick_actions)(C)),P=g.topbar_quick_action_ids.filter(e=>!T.has(e)),O=Array.from(new Set([...Array.from(k),...P])),{email:L,is_configured:R,is_pending:A,sign_out:M}=(0,_.use_supabase_auth_session)(),[q,$]=(0,s.useState)(!1),D=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!q)return;let e=e=>{null===D.current||D.current.contains(e.target)||$(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[q]);let U=()=>{$(!1)};return(0,x.use_escape_to_cancel)(U,q),(0,t.jsxs)("div",{className:"relative shrink-0",ref:D,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":q,"aria-haspopup":"menu",onClick:()=>$(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),q?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[R&&null!==L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:L,children:L})}):null,O.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:U,children:n.label})},e)}),R?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===N,onClick:()=>{let e="true"===N?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,o.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==L&&(0,h.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===N?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===N?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{U(),(0,b.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===w?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===w?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;U(),e=E.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),R?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{U(),e.push((0,i.build_auth_page_href)("sign_in",j))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:A,onClick:()=>{U(),M()},children:A?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let j=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),i=(0,s.useMemo)(()=>(0,l.parse_topbar_quick_actions)(a),[a]);if(0===i.length)return null;let o=j.filter(e=>i.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),i=e.i(45958),o=e.i(71060),l=e.i(29539);function c(){let e=((0,o.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(i.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(i.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(i.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},52405,e=>{"use strict";e.s(["get_input_class_name",0,function(e="default"){let t="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===e?`${t} px-2.5 py-2`:t}])},77352,e=>{"use strict";var t=e.i(54710),r=e.i(42800),n=e.i(75404);e.s(["SettingsPageLayout",0,function({breadcrumb:e,title:s,description:a,children:i}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.TrackerTopbar,{breadcrumb:e}),(0,t.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,t.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,t.jsx)(r.SettingsNav,{})]}),(0,t.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:s}),void 0!==a?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:a}):null]}),i]})]})]})}])},90873,e=>{"use strict";var t=e.i(54710),r=e.i(29158);let n="inline-flex shrink-0 cursor-pointer items-center gap-1.5";e.s(["Checkbox",0,function({checked:e,disabled:s=!1,indeterminate:a=!1,nested:i=!1,on_change:o,label:l,aria_label:c,className:u}){let d=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==d.current&&(d.current.indeterminate=a)},[a]);let p=void 0===u?n:`${n} ${u}`,h=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:d,type:"checkbox",className:"peer absolute m-0 h-px w-px overflow-hidden opacity-0",checked:e,disabled:s,"aria-label":i&&void 0===l?c:void 0,onChange:o}),(0,t.jsx)("span",{className:'relative block h-[0.85rem] w-[0.85rem] shrink-0 rounded-[0.2rem] border border-panel-border bg-input-bg box-border transition-[background-color,border-color] duration-150 peer-checked:border-accent peer-checked:bg-accent peer-indeterminate:border-accent peer-indeterminate:bg-accent peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-input-focus-border peer-focus-visible:outline-offset-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-55 after:absolute after:left-1/2 after:top-[44%] after:hidden after:h-[0.28rem] after:w-[0.45rem] after:-translate-x-1/2 after:-translate-y-[60%] after:rotate-[-45deg] after:border-b-[1.5px] after:border-l-[1.5px] after:border-accent-text-on after:content-[""] peer-checked:after:block peer-indeterminate:after:top-1/2 peer-indeterminate:after:block peer-indeterminate:after:h-[1.5px] peer-indeterminate:after:w-[0.45rem] peer-indeterminate:after:-translate-x-1/2 peer-indeterminate:after:-translate-y-1/2 peer-indeterminate:after:rotate-0 peer-indeterminate:after:border-0 peer-indeterminate:after:bg-accent-text-on',"aria-hidden":"true"})]});return i?(0,t.jsx)("span",{className:p,children:h}):(0,t.jsxs)("label",{className:p,children:[h,void 0!==l?(0,t.jsx)("span",{className:"select-none text-[0.8rem] leading-tight text-muted",children:l}):null]})}])},49996,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(90873),s=e.i(77352),a=e.i(52405),i=e.i(46549),o=e.i(73205),l=e.i(66295),c=e.i(32792),u=e.i(90299),d=e.i(22373);let p={help:"Show keyboard shortcuts","check-in":"Check in","check-out":"Check out","edit-entry":"Edit active entry","add-note":"Add note",pomodoro:"Open Pomodoro","previous-sheet":"Previous sheet","next-sheet":"Next sheet"},h={today:"Today",sheets:"Sheets",reporting:"Reporting",pomodoro:"Pomodoro","manage-tags":"Tag management","sync-settings":"Sync settings"};e.s(["QuickActionsSettingsView",0,function(){let[e,f]=(0,r.useState)(!1),m=(0,r.useSyncExternalStore)(u.tracker_shortcut_map_preference.subscribe,u.tracker_shortcut_map_preference.get_snapshot,u.tracker_shortcut_map_preference.get_server_snapshot),b=(0,r.useSyncExternalStore)(c.topbar_quick_actions_preference.subscribe,c.topbar_quick_actions_preference.get_snapshot,c.topbar_quick_actions_preference.get_server_snapshot),g=(0,r.useMemo)(()=>(0,l.parse_tracker_shortcut_map)(m),[m]),x=(0,r.useMemo)(()=>(0,o.parse_topbar_quick_actions)(b),[b]),[_,y]=(0,r.useState)(g);(0,r.useEffect)(()=>{f(!0)},[]),(0,r.useEffect)(()=>{y(g)},[g]);let v=(0,r.useMemo)(()=>{let e=new Map;for(let t of d.tracker_shortcut_action_ids){let r=g[t];e.set(r,(e.get(r)??0)+1)}return new Set(Array.from(e.entries()).filter(([,e])=>e>1).map(([e])=>e))},[g]);return e?(0,t.jsx)(s.SettingsPageLayout,{breadcrumb:{current:"Quick actions",parent:{label:"Settings",href:"/settings"}},title:"Quick actions config",description:"Customize keyboard shortcuts and topbar shortcuts.",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("section",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Keyboard shortcuts"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.8rem] leading-snug text-muted",children:"Choose one key per action. If a key is reused, only the first matching action will trigger."}),(0,t.jsx)("div",{className:"mt-3 grid grid-cols-1 gap-2 md:grid-cols-2",children:d.tracker_shortcut_action_ids.map(e=>{let r=g[e],n=_[e]??r,s=v.has(r),o=n!==r;return(0,t.jsxs)("div",{className:"grid min-h-20 content-center grid-cols-[minmax(0,1fr)_3.5rem] items-center gap-2 rounded-md border border-panel-border px-2.5 py-2",children:[(0,t.jsx)("span",{className:"text-[0.86rem]",children:p[e]}),(0,t.jsx)("input",{type:"text",className:`${(0,a.get_input_class_name)("compact")} h-8 w-14 justify-self-end px-2 text-center`,value:"?"===n?"?":n.toUpperCase(),readOnly:!0,onKeyDown:t=>((e,t)=>{if("Enter"===t.key){let r;t.preventDefault();let n=_[e];1===n.length&&(r={...g,[e]:n},u.tracker_shortcut_map_preference.write(JSON.stringify(r)),u.tracker_shortcut_map_preference.notify(),(0,i.notify_settings_saved)("Quick actions updated"));return}if("Escape"===t.key){t.preventDefault(),y(t=>({...t,[e]:g[e]}));return}if(1!==t.key.length)return;let r=t.key.toLowerCase();/^[a-z\[\]\?]$/.test(r)&&(t.preventDefault(),y(t=>({...t,[e]:r})))})(e,t),onFocus:e=>e.currentTarget.select(),"aria-label":`${p[e]} shortcut`}),(0,t.jsx)("span",{className:`col-span-2 text-[0.72rem] ${s?"text-danger":o?"text-muted":"text-transparent"}`,children:s?"Duplicate":o?"Press Enter to save":"Ready"})]},e)})})]}),(0,t.jsxs)("section",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Topbar shortcuts"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.8rem] leading-snug text-muted",children:"Show quick links in the topbar on larger screens."}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-3",children:d.topbar_quick_action_ids.map(e=>(0,t.jsx)(n.Checkbox,{checked:x.includes(e),on_change:()=>{let t;return t=x.includes(e)?x.filter(t=>t!==e):[...x,e],void(c.topbar_quick_actions_preference.write(JSON.stringify(t)),c.topbar_quick_actions_preference.notify(),(0,i.notify_settings_saved)("Topbar shortcuts updated"))},label:h[e]},e))})]})]})}):(0,t.jsx)(s.SettingsPageLayout,{breadcrumb:{current:"Quick actions",parent:{label:"Settings",href:"/settings"}},title:"Quick actions config",description:"Customize keyboard shortcuts and topbar shortcuts.",children:(0,t.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:"Loading quick action settings…"})})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":a?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},39474,20993,e=>{"use strict";var t=e.i(13349),r=e.i(32417),n=e.i(44171),a=e.i(28274);let s=null,l=Promise.resolve();function i(){(0,r.is_supabase_configured)()&&(0,n.is_cloud_sync_enabled)()&&(null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,l=l.then(()=>(0,a.run_tracker_db_cloud_sync)()).catch(()=>{})},400))}function o(){(0,t.is_greedy_cloud_sync_enabled)()&&i()}e.s(["schedule_tracker_db_cloud_sync",0,o],20993),e.s(["push_tracker_db_cloud_after_change",0,function(){(0,t.is_greedy_cloud_sync_enabled)()?o():i()}],39474)},77352,e=>{"use strict";var t=e.i(54710),r=e.i(42800),n=e.i(75404);e.s(["SettingsPageLayout",0,function({breadcrumb:e,title:a,description:s,children:l}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.TrackerTopbar,{breadcrumb:e}),(0,t.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,t.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,t.jsx)(r.SettingsNav,{})]}),(0,t.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:a}),void 0!==s?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:s}):null]}),l]})]})]})}])},42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return o}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(44066)._(e.r(78677)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",o=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),o&&"object"==typeof o&&(o=String(s.urlQueryToSearchParams(o)));let c=e.search||o&&`?${o}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(29158);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=s(e,n)),t&&(a.current=s(t,n))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let n=e.r(31047),a=e.r(63334);function s(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return _}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(44066),l=e.r(54710),i=s._(e.r(29158)),o=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let f=e.r(38520),h=e.r(19947),p=e.r(59246),g=e.r(99046);function b(t){var r,n;let a,s,b,[_,y]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:j,as:w,children:k,prefetch:N=null,passHref:S,replace:T,shallow:C,scroll:E,onClick:L,onMouseEnter:P,onTouchStart:O,legacyBehavior:$=!1,onNavigate:R,transitionTypes:A,ref:M,unstable_dynamicOnHover:D,...U}=t;a=k,$&&("string"==typeof a||"number"==typeof a)&&(a=(0,l.jsx)("a",{children:a}));let I=i.default.useContext(u.AppRouterContext),W=!1!==N,q=!1!==N?null===(n=N)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(r=w||j)?r:(0,o.formatUrl)(r);if($){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=i.default.Children.only(a)}let K=$?s&&"object"==typeof s&&s.ref:M,z=i.default.useCallback(e=>(null!==I&&(v.current=(0,h.mountLinkInstance)(e,B,I,q,W,y)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[W,B,I,q,y]),F={ref:(0,c.useMergedRef)(z,K),onClick(t){$||"function"!=typeof L||L(t),$&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,a,s,l,o){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,a?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,o)})}}(t,B,v,T,E,R,A)},onMouseEnter(e){$||"function"!=typeof P||P(e),$&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),I&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){$||"function"!=typeof O||O(e),$&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),I&&W&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(B)?F.href=B:$&&!S&&("a"!==s.type||"href"in s.props)||(F.href=(0,m.addBasePath)(B)),b=$?i.default.cloneElement(s,F):(0,l.jsx)("a",{...U,...F,children:a}),(0,l.jsx)(x.Provider,{value:_,children:b})}e.r(10364);let x=(0,i.createContext)(h.IDLE_LINK_STATUS),_=()=>(0,i.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),a=e.i(32417),s=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[l,i]=(0,r.useState)(null),[o,u]=(0,r.useState)(!1),c=(0,a.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:l,is_pending:o,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,s.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/",label:"Tracker",match:e=>"/"===e}];function s(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":a?"page":void 0,children:n.label},n.href)})})}],45200);var l=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,l.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(s,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let a=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(a))}catch{return r}}],73205);var n=e.i(34869),a=e.i(92629);let s=(0,n.create_ui_preference_store)({storage_key:a.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:a.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function l(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,s],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return l()}],76003);var i=e.i(17798),o=e.i(46549),u=e.i(10464),c=e.i(35434),d=e.i(61834),m=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===l()?"light":"dark";(0,i.apply_theme)(e),(0,m.write_stored_theme)(e),u.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),u.theme_mode_preference.notify(),(0,c.notify_theme_subscribers)(),(0,o.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),a.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),a=e.i(29158),s=e.i(37399),l=e.i(90463),i=e.i(46549),o=e.i(73205),u=e.i(66295),c=e.i(2268),d=e.i(32792),m=e.i(90299),f=e.i(28274),h=e.i(76003),p=e.i(35434),g=e.i(38240),b=e.i(22373),x=e.i(25204),_=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),w=(0,n.usePathname)()??"/",k=(0,a.useSyncExternalStore)(p.subscribe_theme,h.get_theme_snapshot,h.get_theme_server_snapshot),N=(0,a.useSyncExternalStore)(c.cloud_sync_enabled_preference.subscribe,c.cloud_sync_enabled_preference.get_snapshot,c.cloud_sync_enabled_preference.get_server_snapshot),S=(0,a.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),T=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),C=(0,u.parse_tracker_shortcut_map)(S),E=new Set((0,o.parse_topbar_quick_actions)(T)),L=b.topbar_quick_action_ids.filter(e=>!E.has(e)),P=Array.from(new Set([...Array.from(j),...L])),{email:O,is_configured:$,is_pending:R,sign_out:A}=(0,_.use_supabase_auth_session)(),[M,D]=(0,a.useState)(!1),U=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!M)return;let e=e=>{null===U.current||U.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[M]);let I=()=>{D(!1)};return(0,x.use_escape_to_cancel)(I,M),(0,t.jsxs)("div",{className:"relative shrink-0",ref:U,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":M,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(s.HamburgerIcon,{})}),M?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[$&&null!==O?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:O,children:O})}):null,P.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:I,children:n.label})},e)}),$?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===N,onClick:()=>{let e="true"===N?"false":"true";c.cloud_sync_enabled_preference.write(e),c.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==O&&(0,f.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===N?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===N?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),(0,g.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===k?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===k?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;I(),e=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),$?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===O?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),e.push((0,l.build_auth_page_href)("sign_in",w))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:R,onClick:()=>{I(),A()},children:R?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let w=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",s=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),l=(0,a.useMemo)(()=>(0,o.parse_topbar_quick_actions)(s),[s]);if(0===l.length)return null;let i=w.filter(e=>l.includes(e.id));return 0===i.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:i.map(n=>{let a=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":a?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),a=e.i(1976),s=e.i(76080),l=e.i(45958),i=e.i(71060),o=e.i(29539);function u(){let e=((0,i.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(l.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(o.SettingsIcon,{})})}function c({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(l.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(l.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(c,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(s.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(u,{}),(0,t.jsx)(a.TopbarOverflowMenu,{})]})]})]})})}],75404)},52405,e=>{"use strict";e.s(["get_input_class_name",0,function(e="default"){let t="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===e?`${t} px-2.5 py-2`:t}])},31113,e=>{"use strict";e.s(["normalize_stored_tag",0,function(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}`}])},18774,e=>{"use strict";e.s(["format_display_tag",0,function(e){return e.startsWith("@")?e:`@${e}`}])},14260,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(18774),a=e.i(52405),s=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:l,known_tags:i,placeholder:o,disabled:u=!1,autoFocus:c=!1,on_change:d}){let m=(0,r.useRef)(null),f=(0,r.useRef)(null),h=(0,r.useRef)(null),[p,g]=(0,r.useState)(0),[b,x]=(0,r.useState)(0),_=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let a=r.slice(n+1);return/\s/.test(a)?null:{query:a,start_index:n,end_index:t}}(l,p),y=null===_?[]:function(e,t,r=10){let n=t.toLowerCase();return e.filter(e=>{let t=e.replace(/^@/,"").toLowerCase();return 0===n.length||t.startsWith(n)}).slice(0,r)}(i,_.query),v=null!==_&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,s.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(_.query,i),j=null!==_&&y.length>0&&!v&&!u;(0,r.useLayoutEffect)(()=>{null!==h.current&&null!==m.current&&(m.current.setSelectionRange(h.current,h.current),g(h.current),h.current=null)},[l]),(0,r.useEffect)(()=>{x(0)},[l,p,y.length]);let w=()=>{g(m.current?.selectionStart??l.length)},k=()=>{x(0)},N=e=>{let t,r,a;if(null===_)return;let{next_text:s,next_cursor:i}=(t=(0,n.format_display_tag)(e),r=l.slice(0,_.start_index),a=l.slice(_.end_index),{next_text:`${r}${t}${a}`,next_cursor:r.length+t.length});h.current=i,d(s),k()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",className:(0,a.get_input_class_name)(),value:l,placeholder:o,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":j,"aria-controls":j?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),g(e.target.selectionStart??e.target.value.length)},onClick:w,onKeyUp:w,onKeyDown:e=>{if(j){if("ArrowDown"===e.key){e.preventDefault(),x(e=>(e+1)%y.length);return}if("ArrowUp"===e.key){e.preventDefault(),x(e=>(e-1+y.length)%y.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=y[b];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),k())}},onBlur:()=>{window.setTimeout(k,120)}}),j?(0,t.jsx)("ul",{ref:f,id:`${e}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:y.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===b,children:(0,t.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${r===b?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),N(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},2286,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(14974),a=e.i(77352),s=e.i(14260),l=e.i(18774),i=e.i(52663),o=e.i(52405);function u(e,t,r){let n=e.map(e=>(0,l.format_display_tag)(e)).join(", "),a=(0,l.format_display_tag)(t),s=1===r?"1 entry will be updated.":`${r} entries will be updated.`;return{title:"Merge tags?",message:`Merge ${n} into ${a}? ${s}`,confirmLabel:"Merge tags",variant:"danger"}}var c=e.i(39474);e.s(["TagManagementView",0,function({initial_tags:e}){let{confirm:d}=(0,n.use_confirm_dialog)(),[m,f]=(0,r.useState)(e),[h,p]=(0,r.useState)(()=>new Set),[g,b]=(0,r.useState)({}),[x,_]=(0,r.useState)(""),[y,v]=(0,r.useState)(null),[j,w]=(0,r.useState)(null),[k,N]=(0,r.useState)(!1),S=(0,r.useMemo)(()=>m.map(e=>e.name),[m]),T=m.filter(e=>h.has(e.name)).reduce((e,t)=>e+t.entryCount,0),C=async e=>{let t=await fetch("/api/tags",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error((await t.json()).error??"Tag update failed");let r=await t.json();f(r.tags),p(new Set),w(1===r.entries_updated?"Updated 1 entry.":`Updated ${r.entries_updated} entries.`),(0,c.push_tracker_db_cloud_after_change)()},E=async e=>{let t=g[e]?.trim()??"";if(0===t.length)return void v("Enter a new tag name.");let r=m.find(t=>t.name===e);if(void 0===r)return;let n=m.find(e=>(0,l.format_display_tag)(e.name)===(0,l.format_display_tag)(t)),a=void 0!==n&&n.name!==e?r.entryCount+n.entryCount:r.entryCount;if(await d(u([e],t,a))){N(!0),v(null),w(null);try{await C({action:"rename",fromTag:e,toTag:t}),b(t=>{let r={...t};return delete r[e],r})}catch(e){v(e instanceof Error?e.message:String(e))}finally{N(!1)}}},L=async()=>{let e=[...h];if(e.length<2)return void v("Select at least two tags to merge.");if(0===x.trim().length)return void v("Enter a target tag for the merge.");if(await d(u(e,x,T))){N(!0),v(null),w(null);try{await C({action:"merge",sourceTags:e,targetTag:x}),_("")}catch(e){v(e instanceof Error?e.message:String(e))}finally{N(!1)}}};return(0,t.jsxs)(a.SettingsPageLayout,{breadcrumb:{current:"Tag management",parent:{label:"Settings",href:"/settings"}},title:"Tag management",description:"Rename or merge tags across every entry in your database.",children:[(0,t.jsxs)("section",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Merge tags"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.8rem] leading-snug text-muted",children:"Select two or more tags below, then choose the tag they should become."}),(0,t.jsxs)("label",{className:"mt-3 flex flex-col gap-1 text-[0.82rem] text-muted",children:["Target tag",(0,t.jsx)(s.TagAutocompleteInput,{id:"merge-target-tag",value:x,known_tags:S,placeholder:"e.g. @project",disabled:k,on_change:_})]}),(0,t.jsxs)("button",{type:"button",className:`${(0,i.get_button_class_name)("primary","small")} mt-3`,disabled:k||h.size<2,onClick:()=>void L(),children:["Merge ",h.size," tags"]})]}),0===m.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No tags yet. Add @tags when you check in to an entry."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Tags",children:m.map(e=>(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-2.5 shadow-sm",children:(0,t.jsxs)("form",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",onSubmit:t=>{t.preventDefault(),E(e.name)},children:[(0,t.jsx)("input",{type:"checkbox",className:"shrink-0",checked:h.has(e.name),disabled:k,"aria-label":`Select ${(0,l.format_display_tag)(e.name)}`,onChange:()=>{var t;return t=e.name,void p(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsxs)("div",{className:"flex min-w-0 shrink-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[(0,t.jsx)("span",{className:"font-semibold leading-tight",children:(0,l.format_display_tag)(e.name)}),(0,t.jsxs)("span",{className:"text-[0.82rem] text-muted",children:[e.entryCount," ",1===e.entryCount?"entry":"entries"]})]}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-[min(100%,14rem)] flex-1 basis-56 items-center justify-end gap-2 sm:max-w-xs",children:[(0,t.jsx)("input",{className:(0,o.get_input_class_name)("compact"),value:g[e.name]??"",placeholder:"Rename to…","aria-label":`Rename ${(0,l.format_display_tag)(e.name)}`,disabled:k,onChange:t=>b(r=>({...r,[e.name]:t.target.value}))}),(0,t.jsx)("button",{type:"submit",className:`${(0,i.get_button_class_name)("ghost","small")} shrink-0`,disabled:k||(g[e.name]?.trim().length??0)===0,children:"Rename"})]})]})},e.name))}),null!==j?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-accent",children:j}):null,null!==y?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-danger",children:y}):null]})}],2286)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return i}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});let a=e.r(44066)._(e.r(78677)),l=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,s=e.protocol||"",n=e.pathname||"",o=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let u=e.search||i&&`?${i}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||l.test(s))&&!1!==c?(c="//"+(c||""),n&&"/"!==n[0]&&(n="/"+n)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),n=n.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${s}${c}${n}${u}${o}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let s=e.r(29158);function n(e,t){let r=(0,s.useRef)(null),n=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=a(e,s)),t&&(n.current=a(t,s))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let s=e.r(31047),n=e.r(63334);function a(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return b}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});let a=e.r(44066),l=e.r(54710),o=a._(e.r(29158)),i=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),p=e.r(20321);e.r(90503);let _=e.r(38520),f=e.r(19947),h=e.r(59246),m=e.r(99046);function g(t){var r,s;let n,a,g,[b,y]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:j,as:k,children:w,prefetch:N=null,passHref:S,replace:E,shallow:T,scroll:O,onClick:A,onMouseEnter:C,onTouchStart:L,legacyBehavior:P=!1,onNavigate:R,transitionTypes:U,ref:F,unstable_dynamicOnHover:G,...M}=t;n=w,P&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let D=o.default.useContext(c.AppRouterContext),I=!1!==N,W=!1!==N?null===(s=N)||"auto"===s?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,$="string"==typeof(r=k||j)?r:(0,i.formatUrl)(r);if(P){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(n)}let K=P?a&&"object"==typeof a&&a.ref:F,q=o.default.useCallback(e=>(null!==D&&(v.current=(0,f.mountLinkInstance)(e,$,D,W,I,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[I,$,D,W,y]),B={ref:(0,u.useMergedRef)(q,K),onClick(t){P||"function"!=typeof A||A(t),P&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!D||t.defaultPrevented||function(t,r,s,n,a,l,i){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){n&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);o.default.startTransition(()=>{d(r,n?"replace":"push",!1===a?_.ScrollBehavior.NoScroll:_.ScrollBehavior.Default,s.current,i)})}}(t,$,v,E,O,R,U)},onMouseEnter(e){P||"function"!=typeof C||C(e),P&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),D&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===G)},onTouchStart:function(e){P||"function"!=typeof L||L(e),P&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),D&&I&&(0,f.onNavigationIntent)(e.currentTarget,!0===G)}};return(0,d.isAbsoluteUrl)($)?B.href=$:P&&!S&&("a"!==a.type||"href"in a.props)||(B.href=(0,p.addBasePath)($)),g=P?o.default.cloneElement(a,B):(0,l.jsx)("a",{...M,...B,children:n}),(0,l.jsx)(x.Provider,{value:b,children:g})}e.r(10364);let x=(0,o.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,o.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),s=e.i(83105),n=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[l,o]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,n.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,s.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{o(e?.user.email??null)}).catch(()=>{o(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{o(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:l,is_pending:i,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,s.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),s=e.i(71060);let n=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,s.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:n.map(s=>{let n=s.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${n?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:s.href,"aria-current":n?"page":void 0,children:s.label},s.href)})})}],45200);var l=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,l.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",s=t.trim();return 0===s.length||"/"===s?r:`${r}?next=${encodeURIComponent(s)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let s=JSON.parse(e);if(!Array.isArray(s))return r;let n=s.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(n))}catch{return r}}],73205);var s=e.i(34869),n=e.i(92629);let a=(0,s.create_ui_preference_store)({storage_key:n.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:n.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function l(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return l()}],76003);var o=e.i(17798),i=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),p=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===l()?"light":"dark";(0,o.apply_theme)(e),(0,p.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,s=!0){let n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if(!s)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),n.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[s])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),s=e.i(71060),n=e.i(29158),a=e.i(37399),l=e.i(90463),o=e.i(46549),i=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),p=e.i(90299),_=e.i(28274),f=e.i(76003),h=e.i(35434),m=e.i(38240),g=e.i(22373),x=e.i(25204),b=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,s.useRouter)(),k=(0,s.usePathname)()??"/",w=(0,n.useSyncExternalStore)(h.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),N=(0,n.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),S=(0,n.useSyncExternalStore)(p.tracker_shortcut_map_preference.subscribe,p.tracker_shortcut_map_preference.get_snapshot,p.tracker_shortcut_map_preference.get_server_snapshot),E=(0,n.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),T=(0,c.parse_tracker_shortcut_map)(S),O=new Set((0,i.parse_topbar_quick_actions)(E)),A=g.topbar_quick_action_ids.filter(e=>!O.has(e)),C=Array.from(new Set([...Array.from(j),...A])),{email:L,is_configured:P,is_pending:R,sign_out:U}=(0,b.use_supabase_auth_session)(),[F,G]=(0,n.useState)(!1),M=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!F)return;let e=e=>{null===M.current||M.current.contains(e.target)||G(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[F]);let D=()=>{G(!1)};return(0,x.use_escape_to_cancel)(D,F),(0,t.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":F,"aria-haspopup":"menu",onClick:()=>G(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),F?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[P&&null!==L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:L,children:L})}):null,C.map(e=>{let s=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:s.href,className:y,role:"menuitem",onClick:D,children:s.label})},e)}),P?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===N,onClick:()=>{let e="true"===N?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,o.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==L&&(0,_.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===N?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===N?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{D(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===w?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===w?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;D(),e=T.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{D(),e.push((0,l.build_auth_page_href)("sign_in",k))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:R,onClick:()=>{D(),U()},children:R?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let k=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,s.usePathname)()??"/",a=(0,n.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),l=(0,n.useMemo)(()=>(0,i.parse_topbar_quick_actions)(a),[a]);if(0===l.length)return null;let o=k.filter(e=>l.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(s=>{let n=e.startsWith(s.href);return(0,t.jsx)(r.default,{href:s.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${n?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":n?"page":void 0,children:s.label},s.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),s=e.i(648),n=e.i(1976),a=e.i(76080),l=e.i(45958),o=e.i(71060),i=e.i(29539);function c(){let e=((0,o.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(l.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(i.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(l.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(l.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(s.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(n.TopbarOverflowMenu,{})]})]})]})})}],75404)},42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),s=e.i(71060);let n=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,s.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:n.map(s=>{let n=s.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:s.href,"aria-current":n?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${n?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:s.label})},s.href)})})})}])},7902,e=>{"use strict";var t=e.i(46549);e.s(["persist_ui_preference",0,function(e,r){e.read()!==r&&(e.write(r),e.notify(),(0,t.notify_settings_saved)())}])},83821,60145,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let s=(0,t.create_ui_preference_store)({storage_key:r.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=30&&t<=720}});e.s(["daily_focus_target_minutes_preference",0,s],83821);let n=(0,t.create_ui_preference_store)({storage_key:r.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=60&&t<=4200}});e.s(["weekly_focus_target_minutes_preference",0,n],60145)},1238,51703,74597,77130,56442,73228,e=>{"use strict";e.s(["parse_focus_goals_by_name",0,function(e){if(0===e.length)return{};try{let t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))return{};let r={};for(let[e,s]of Object.entries(t)){if(null===s||"object"!=typeof s)continue;let t={};"string"==typeof s.daily&&s.daily.length>0&&(t.daily=s.daily),"string"==typeof s.weekly&&s.weekly.length>0&&(t.weekly=s.weekly),(void 0!==t.daily||void 0!==t.weekly)&&(r[e]=t)}return r}catch{return{}}}],1238);var t=e.i(34869),r=e.i(92629);let s=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SCOPE_STORAGE_KEY,default_value:r.FOCUS_GOAL_SCOPE_DEFAULT,is_valid:e=>"global"===e||"sheet"===e||"tag"===e});e.s(["focus_goal_scope_preference",0,s],51703);let n=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SHEET_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_SHEET_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_sheet_name_preference",0,n],74597);let a=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_TAG_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_TAG_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_tag_name_preference",0,a],77130);let l=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_SHEET_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_SHEET_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_sheet_preference",0,l],56442);let o=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_TAG_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_TAG_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_tag_preference",0,o],73228)},34032,e=>{"use strict";var t=e.i(54710),r=e.i(29158),s=e.i(1238);function n(e,t,r,n){if(0===t.length)return e;let a=(0,s.parse_focus_goals_by_name)(e),l=a[t]??{};if(0===n.length){let e={...l};delete e[r],void 0===e.daily&&void 0===e.weekly?delete a[t]:a[t]=e}else a[t]={...l,[r]:n};return JSON.stringify(a)}var a=e.i(83821),l=e.i(51703),o=e.i(74597),i=e.i(77130),c=e.i(56442),u=e.i(73228),d=e.i(56996),p=e.i(8654),_=e.i(76900),f=e.i(80808),h=e.i(71122),m=e.i(60145),g=e.i(7902);let x=[120,180,240,300,360,420,480],b=[600,900,1200,1500,1800,2100,2400],y=[15,30,45,60,90,120],v=[6,8,10,12,14],j=[{value:"global",label:"Global"},{value:"sheet",label:"Per-sheet"},{value:"tag",label:"Per-tag"}];function k({disabled:e,daily_target_minutes:r,weekly_target_minutes:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Global targets"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Daily target"}),(0,t.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:r,disabled:e,onChange:e=>(0,g.persist_ui_preference)(a.daily_focus_target_minutes_preference,e.target.value),children:x.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," min"]},e))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Weekly target"}),(0,t.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:s,disabled:e,onChange:e=>(0,g.persist_ui_preference)(m.weekly_focus_target_minutes_preference,e.target.value),children:b.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," min"]},e))})]})]})]})}function w({kind:e,names:r,disabled:s,active_name:a,map:l,json:d}){let p="sheet"===e?"Per-sheet targets":"Per-tag targets";if(0===r.length)return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:p}),(0,t.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:"sheet"===e?"Create a sheet to configure per-sheet goals.":"Add a tag to a time entry to configure per-tag goals."})]});let _=`focus-goal-active-${e}`;return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:p}),(0,t.jsxs)("span",{className:"text-[0.75rem] text-muted",children:["Pick the ",e," shown in the focus banner."]})]}),(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(r=>{let p=l[r]??{},f=p.daily??"",h=p.weekly??"",m=a===r;return(0,t.jsxs)("li",{className:`grid items-center gap-2 rounded-md border bg-panel px-3 py-2.5 transition-colors md:grid-cols-[auto_minmax(0,1fr)_minmax(0,11rem)_minmax(0,11rem)] grid-cols-[auto_minmax(0,1fr)] ${m?"border-accent-border bg-accent-soft":"border-panel-border"}`,children:[(0,t.jsx)("label",{className:"flex shrink-0 cursor-pointer items-center justify-center",children:(0,t.jsx)("input",{type:"radio",name:_,className:"cursor-pointer",checked:m,disabled:s,"aria-label":`Show ${r} in focus banner`,onChange:()=>(0,g.persist_ui_preference)("sheet"===e?o.focus_goal_sheet_name_preference:i.focus_goal_tag_name_preference,r)})}),(0,t.jsx)("span",{className:"truncate text-[0.9rem] font-medium",title:r,children:"tag"!==e||r.startsWith("@")?r:`@${r}`}),(0,t.jsxs)("label",{className:"flex items-center gap-2 md:col-start-3",children:[(0,t.jsx)("span",{className:"text-[0.75rem] text-muted",children:"Daily"}),(0,t.jsxs)("select",{className:"flex-1 rounded-md border border-panel-border bg-panel px-2 py-1.5 text-[0.85rem]",value:f,disabled:s,onChange:t=>(0,g.persist_ui_preference)("sheet"===e?c.focus_goals_per_sheet_preference:u.focus_goals_per_tag_preference,n(d,r,"daily",t.target.value)),children:[(0,t.jsx)("option",{value:"",children:"Not set"}),x.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," min"]},e))]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 md:col-start-4",children:[(0,t.jsx)("span",{className:"text-[0.75rem] text-muted",children:"Weekly"}),(0,t.jsxs)("select",{className:"flex-1 rounded-md border border-panel-border bg-panel px-2 py-1.5 text-[0.85rem]",value:h,disabled:s,onChange:t=>(0,g.persist_ui_preference)("sheet"===e?c.focus_goals_per_sheet_preference:u.focus_goals_per_tag_preference,n(d,r,"weekly",t.target.value)),children:[(0,t.jsx)("option",{value:"",children:"Not set"}),b.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," min"]},e))]})]})]},r)})})]})}e.s(["FocusGoalsNudgesSetting",0,function({sheet_names:e,tag_names:n}){let x=(0,r.useSyncExternalStore)(d.focus_nudges_enabled_preference.subscribe,d.focus_nudges_enabled_preference.get_snapshot,d.focus_nudges_enabled_preference.get_server_snapshot),b=(0,r.useSyncExternalStore)(a.daily_focus_target_minutes_preference.subscribe,a.daily_focus_target_minutes_preference.get_snapshot,a.daily_focus_target_minutes_preference.get_server_snapshot),N=(0,r.useSyncExternalStore)(m.weekly_focus_target_minutes_preference.subscribe,m.weekly_focus_target_minutes_preference.get_snapshot,m.weekly_focus_target_minutes_preference.get_server_snapshot),S=(0,r.useSyncExternalStore)(p.no_log_reminder_minutes_preference.subscribe,p.no_log_reminder_minutes_preference.get_snapshot,p.no_log_reminder_minutes_preference.get_server_snapshot),E=(0,r.useSyncExternalStore)(_.overwork_alert_hours_preference.subscribe,_.overwork_alert_hours_preference.get_snapshot,_.overwork_alert_hours_preference.get_server_snapshot),T=(0,r.useSyncExternalStore)(h.work_hours_start_preference.subscribe,h.work_hours_start_preference.get_snapshot,h.work_hours_start_preference.get_server_snapshot),O=(0,r.useSyncExternalStore)(f.work_hours_end_preference.subscribe,f.work_hours_end_preference.get_snapshot,f.work_hours_end_preference.get_server_snapshot),A=(0,r.useSyncExternalStore)(l.focus_goal_scope_preference.subscribe,l.focus_goal_scope_preference.get_snapshot,l.focus_goal_scope_preference.get_server_snapshot),C=(0,r.useSyncExternalStore)(o.focus_goal_sheet_name_preference.subscribe,o.focus_goal_sheet_name_preference.get_snapshot,o.focus_goal_sheet_name_preference.get_server_snapshot),L=(0,r.useSyncExternalStore)(i.focus_goal_tag_name_preference.subscribe,i.focus_goal_tag_name_preference.get_snapshot,i.focus_goal_tag_name_preference.get_server_snapshot),P=(0,r.useSyncExternalStore)(c.focus_goals_per_sheet_preference.subscribe,c.focus_goals_per_sheet_preference.get_snapshot,c.focus_goals_per_sheet_preference.get_server_snapshot),R=(0,r.useSyncExternalStore)(u.focus_goals_per_tag_preference.subscribe,u.focus_goals_per_tag_preference.get_snapshot,u.focus_goals_per_tag_preference.get_server_snapshot),U=(0,s.parse_focus_goals_by_name)(P),F=(0,s.parse_focus_goals_by_name)(R);(0,r.useEffect)(()=>{"sheet"===A&&0===C.length&&e.length>0&&(0,g.persist_ui_preference)(o.focus_goal_sheet_name_preference,e[0])},[A,C,e]),(0,r.useEffect)(()=>{"tag"===A&&0===L.length&&n.length>0&&(0,g.persist_ui_preference)(i.focus_goal_tag_name_preference,n[0])},[A,L,n]);let G="true"!==x;return(0,t.jsxs)("div",{id:"focus-goals-nudges",className:"flex w-full flex-col gap-4",children:[(0,t.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===x,onChange:e=>(0,g.persist_ui_preference)(d.focus_nudges_enabled_preference,e.target.checked?"true":"false")}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Goals + nudges"}),(0,t.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Track daily/weekly focus goals, overwork alerts, and no-log reminders."})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Focus goal scope"}),(0,t.jsx)("div",{role:"radiogroup","aria-label":"Focus goal scope",className:"inline-flex w-full flex-wrap gap-1 rounded-md border border-panel-border bg-panel p-0.5",children:j.map(e=>{let r=A===e.value;return(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":r,disabled:G,className:`flex-1 min-w-24 cursor-pointer rounded px-3 py-1.5 text-[0.85rem] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-55 ${r?"bg-accent-soft text-foreground":"bg-transparent text-muted hover:bg-surface-hover hover:text-foreground"}`,onClick:()=>(0,g.persist_ui_preference)(l.focus_goal_scope_preference,e.value),children:e.label},e.value)})})]}),"global"===A?(0,t.jsx)(k,{disabled:G,daily_target_minutes:b,weekly_target_minutes:N}):null,"sheet"===A?(0,t.jsx)(w,{kind:"sheet",names:e,disabled:G,active_name:C,map:U,json:P}):null,"tag"===A?(0,t.jsx)(w,{kind:"tag",names:n,disabled:G,active_name:L,map:F,json:R}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Behavior nudges"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Work hours start"}),(0,t.jsx)("input",{type:"time",className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:T,disabled:G,onChange:e=>(0,g.persist_ui_preference)(h.work_hours_start_preference,e.target.value)})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Work hours end"}),(0,t.jsx)("input",{type:"time",className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:O,disabled:G,onChange:e=>(0,g.persist_ui_preference)(f.work_hours_end_preference,e.target.value)})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"No-log reminder"}),(0,t.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:S,disabled:G,onChange:e=>(0,g.persist_ui_preference)(p.no_log_reminder_minutes_preference,e.target.value),children:y.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," min"]},e))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Overwork alert"}),(0,t.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:E,disabled:G,onChange:e=>(0,g.persist_ui_preference)(_.overwork_alert_hours_preference,e.target.value),children:v.map(e=>(0,t.jsxs)("option",{value:String(e),children:[e," hours"]},e))})]})]}),(0,t.jsx)("p",{className:"m-0 text-[0.78rem] leading-snug text-muted",children:"Rule reminders: notify when no active timer during work hours, and alert when an active timer runs longer than the overwork threshold."})]})]})}],34032)}]);