@drewpayment/mink 0.5.1 → 0.6.0

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 (125) hide show
  1. package/README.md +21 -0
  2. package/dashboard/out/404.html +1 -1
  3. package/dashboard/out/_next/static/Dw8C--0lGz5BIGsnG-e5H/_buildManifest.js +1 -0
  4. package/dashboard/out/_next/static/chunks/189-fe789442321eb5eb.js +1 -0
  5. package/dashboard/out/_next/static/chunks/255-6b79f309a27fb98b.js +1 -0
  6. package/dashboard/out/_next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
  7. package/dashboard/out/_next/static/chunks/738-11c31dcbdbb98d77.js +1 -0
  8. package/dashboard/out/_next/static/chunks/926-6421b9e9b03abc7b.js +1 -0
  9. package/dashboard/out/_next/static/chunks/app/(panels)/action-log/page-1f507b433af52d16.js +1 -0
  10. package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-096a97ba539d5323.js +1 -0
  11. package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-449d31c133432458.js +1 -0
  12. package/dashboard/out/_next/static/chunks/app/(panels)/capture/page-c6617aa0a8a7333e.js +1 -0
  13. package/dashboard/out/_next/static/chunks/app/(panels)/config/page-aa0a0623b3fdd0d8.js +1 -0
  14. package/dashboard/out/_next/static/chunks/app/(panels)/daemon/page-7cd3fac2f5d87a0d.js +1 -0
  15. package/dashboard/out/_next/static/chunks/app/(panels)/design/page-5304675c96b6793b.js +1 -0
  16. package/dashboard/out/_next/static/chunks/app/(panels)/discord/page-9940dde80ba2a69e.js +1 -0
  17. package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-ecd8a753614e981e.js +1 -0
  18. package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-7909d8beb8d8ef7a.js +1 -0
  19. package/dashboard/out/_next/static/chunks/app/(panels)/learning/page-b766adc79099adb4.js +1 -0
  20. package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-7a9e86dcde67d6a9.js +1 -0
  21. package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-a88f93204c9742a1.js +1 -0
  22. package/dashboard/out/_next/static/chunks/app/(panels)/sync/page-8a9ad4c36aa6cb65.js +1 -0
  23. package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-8dac7d50d4db2756.js +1 -0
  24. package/dashboard/out/_next/static/chunks/app/(panels)/waste/page-bcf56144faf7d133.js +1 -0
  25. package/dashboard/out/_next/static/chunks/app/(panels)/wiki/page-a32fdbd0bf58b30b.js +1 -0
  26. package/dashboard/out/_next/static/chunks/app/_not-found/page-dc2312ec30d73c4e.js +1 -0
  27. package/dashboard/out/_next/static/chunks/app/layout-782cd26e0ccc4514.js +1 -0
  28. package/dashboard/out/_next/static/chunks/app/page-6aca8457abc5d313.js +1 -0
  29. package/dashboard/out/_next/static/chunks/framework-050c1f32293f7182.js +1 -0
  30. package/dashboard/out/_next/static/chunks/main-app-c2dc0acf542ec1c6.js +1 -0
  31. package/dashboard/out/_next/static/chunks/main-ed79d05490604b83.js +1 -0
  32. package/dashboard/out/_next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
  33. package/dashboard/out/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
  34. package/dashboard/out/_next/static/chunks/webpack-4e3139a490df1cfe.js +1 -0
  35. package/dashboard/out/_next/static/css/5e43917ea49c5b3e.css +1 -0
  36. package/dashboard/out/_next/static/media/0aa834ed78bf6d07-s.woff2 +0 -0
  37. package/dashboard/out/_next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  38. package/dashboard/out/_next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  39. package/dashboard/out/_next/static/media/67957d42bae0796d-s.woff2 +0 -0
  40. package/dashboard/out/_next/static/media/886030b0b59bc5a7-s.woff2 +0 -0
  41. package/dashboard/out/_next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  42. package/dashboard/out/_next/static/media/939c4f875ee75fbb-s.woff2 +0 -0
  43. package/dashboard/out/_next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  44. package/dashboard/out/_next/static/media/bb3ef058b751a6ad-s.p.woff2 +0 -0
  45. package/dashboard/out/_next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  46. package/dashboard/out/_next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  47. package/dashboard/out/_next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  48. package/dashboard/out/_next/static/media/f911b923c6adde36-s.woff2 +0 -0
  49. package/dashboard/out/action-log.html +1 -1
  50. package/dashboard/out/action-log.txt +23 -22
  51. package/dashboard/out/activity.html +1 -1
  52. package/dashboard/out/activity.txt +23 -22
  53. package/dashboard/out/bugs.html +1 -1
  54. package/dashboard/out/bugs.txt +23 -22
  55. package/dashboard/out/capture.html +1 -0
  56. package/dashboard/out/capture.txt +24 -0
  57. package/dashboard/out/config.html +1 -0
  58. package/dashboard/out/config.txt +24 -0
  59. package/dashboard/out/daemon.html +1 -0
  60. package/dashboard/out/daemon.txt +24 -0
  61. package/dashboard/out/design.html +1 -1
  62. package/dashboard/out/design.txt +23 -22
  63. package/dashboard/out/discord.html +1 -0
  64. package/dashboard/out/discord.txt +24 -0
  65. package/dashboard/out/file-index.html +1 -1
  66. package/dashboard/out/file-index.txt +23 -22
  67. package/dashboard/out/index.html +1 -1
  68. package/dashboard/out/index.txt +23 -22
  69. package/dashboard/out/insights.html +1 -1
  70. package/dashboard/out/insights.txt +23 -22
  71. package/dashboard/out/learning.html +1 -1
  72. package/dashboard/out/learning.txt +23 -22
  73. package/dashboard/out/overview.html +1 -1
  74. package/dashboard/out/overview.txt +23 -22
  75. package/dashboard/out/scheduler.html +1 -1
  76. package/dashboard/out/scheduler.txt +23 -22
  77. package/dashboard/out/sync.html +1 -0
  78. package/dashboard/out/sync.txt +24 -0
  79. package/dashboard/out/tokens.html +1 -1
  80. package/dashboard/out/tokens.txt +23 -22
  81. package/dashboard/out/waste.html +1 -0
  82. package/dashboard/out/waste.txt +24 -0
  83. package/dashboard/out/wiki.html +1 -0
  84. package/dashboard/out/wiki.txt +24 -0
  85. package/dist/cli.js +1695 -892
  86. package/package.json +1 -1
  87. package/src/core/daemon.ts +5 -3
  88. package/src/core/dashboard-api.ts +764 -1
  89. package/src/core/dashboard-server.ts +270 -0
  90. package/src/core/runtime.ts +7 -4
  91. package/src/core/vault.ts +4 -4
  92. package/src/types/config.ts +9 -1
  93. package/src/types/dashboard.ts +84 -1
  94. package/dashboard/out/_next/static/1wsj8DdMTS0IF2Rk9fkxV/_buildManifest.js +0 -1
  95. package/dashboard/out/_next/static/chunks/160-3e240a3c66269b3f.js +0 -1
  96. package/dashboard/out/_next/static/chunks/212-0f603e7affd3ee2a.js +0 -4
  97. package/dashboard/out/_next/static/chunks/255-b047925426c4e4ba.js +0 -1
  98. package/dashboard/out/_next/static/chunks/4bd1b696-409494caf8c83275.js +0 -1
  99. package/dashboard/out/_next/static/chunks/55-079130502e972d37.js +0 -1
  100. package/dashboard/out/_next/static/chunks/692-9c8d44014aa1813d.js +0 -1
  101. package/dashboard/out/_next/static/chunks/717-3d920b69f8c31178.js +0 -1
  102. package/dashboard/out/_next/static/chunks/752-8a8e79b1a2a3b489.js +0 -1
  103. package/dashboard/out/_next/static/chunks/83-ddf005b52ec7bd16.js +0 -1
  104. package/dashboard/out/_next/static/chunks/845-bed7bdd2fed7ff76.js +0 -1
  105. package/dashboard/out/_next/static/chunks/app/(panels)/action-log/page-c52cf3851d9d92d5.js +0 -1
  106. package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-25a84ac9ddbbc077.js +0 -1
  107. package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-7de0b71150a91377.js +0 -1
  108. package/dashboard/out/_next/static/chunks/app/(panels)/design/page-a2153b4f18533187.js +0 -1
  109. package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-b37bdd2344d3f81c.js +0 -1
  110. package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-b9cea601167e83d1.js +0 -1
  111. package/dashboard/out/_next/static/chunks/app/(panels)/learning/page-faa4afcf1473c9e5.js +0 -1
  112. package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-354f274bc72789a8.js +0 -1
  113. package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-fc11b7fbbd04a4d7.js +0 -1
  114. package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-c08c102aa883500a.js +0 -1
  115. package/dashboard/out/_next/static/chunks/app/_not-found/page-88217a29323e3700.js +0 -1
  116. package/dashboard/out/_next/static/chunks/app/layout-93083f9f140da937.js +0 -1
  117. package/dashboard/out/_next/static/chunks/app/page-0e7a5cffcfa1d064.js +0 -1
  118. package/dashboard/out/_next/static/chunks/framework-1a308e28e19f1a97.js +0 -1
  119. package/dashboard/out/_next/static/chunks/main-7c6d83fa0f7c5e5b.js +0 -1
  120. package/dashboard/out/_next/static/chunks/main-app-2f83d483d67187ef.js +0 -1
  121. package/dashboard/out/_next/static/chunks/pages/_app-5addca2b3b969fde.js +0 -1
  122. package/dashboard/out/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js +0 -1
  123. package/dashboard/out/_next/static/chunks/webpack-ee71d9ae9be3609d.js +0 -1
  124. package/dashboard/out/_next/static/css/cfd58816f9a2afb9.css +0 -1
  125. /package/dashboard/out/_next/static/{1wsj8DdMTS0IF2Rk9fkxV → Dw8C--0lGz5BIGsnG-e5H}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[926],{2196:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(814).A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},5229:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(814).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6405:(e,t,n)=>{n.d(t,{bm:()=>to,UC:()=>tn,hJ:()=>tt,ZL:()=>te,bL:()=>e7,hE:()=>tr});var r,o,a,i=n(2115),u=n.t(i,2);function l(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}"undefined"!=typeof window&&window.document&&window.document.createElement;var c=n(4446),s=n(5155),d=globalThis?.document?i.useLayoutEffect:()=>{},f=u[" useId ".trim().toString()]||(()=>void 0),p=0;function v(e){let[t,n]=i.useState(f());return d(()=>{e||n(e=>e??String(p++))},[e]),e||(t?`radix-${t}`:"")}var m=u[" useInsertionEffect ".trim().toString()]||d;Symbol("RADIX:SYNC_STATE");var h=n(7650),g=n(2467),y=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=(0,g.TL)(`Primitive.${t}`),r=i.forwardRef((e,r)=>{let{asChild:o,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(o?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function E(e){let t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var b="dismissableLayer.update",w=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),N=i.forwardRef((e,t)=>{var n,r;let{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,...m}=e,h=i.useContext(w),[g,N]=i.useState(null),S=null!=(r=null==g?void 0:g.ownerDocument)?r:null==(n=globalThis)?void 0:n.document,[,x]=i.useState({}),O=(0,c.s)(t,e=>N(e)),D=Array.from(h.layers),[T]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),L=D.indexOf(T),M=g?D.indexOf(g):-1,P=h.layersWithOutsidePointerEventsDisabled.size>0,A=M>=L,k=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,r=E(e),o=i.useRef(!1),a=i.useRef(()=>{});return i.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){R("dismissableLayer.pointerDownOutside",r,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,n=[...h.branches].some(e=>e.contains(t));A&&!n&&(null==d||d(e),null==p||p(e),e.defaultPrevented||null==v||v())},S),I=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,r=E(e),o=i.useRef(!1);return i.useEffect(()=>{let e=e=>{e.target&&!o.current&&R("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;![...h.branches].some(e=>e.contains(t))&&(null==f||f(e),null==p||p(e),e.defaultPrevented||null==v||v())},S);return!function(e,t=globalThis?.document){let n=E(e);i.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{M===h.layers.size-1&&(null==u||u(e),!e.defaultPrevented&&v&&(e.preventDefault(),v()))},S),i.useEffect(()=>{if(g)return a&&(0===h.layersWithOutsidePointerEventsDisabled.size&&(o=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),C(),()=>{a&&1===h.layersWithOutsidePointerEventsDisabled.size&&(S.body.style.pointerEvents=o)}},[g,S,a,h]),i.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),C())},[g,h]),i.useEffect(()=>{let e=()=>x({});return document.addEventListener(b,e),()=>document.removeEventListener(b,e)},[]),(0,s.jsx)(y.div,{...m,ref:O,style:{pointerEvents:P?A?"auto":"none":void 0,...e.style},onFocusCapture:l(e.onFocusCapture,I.onFocusCapture),onBlurCapture:l(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,k.onPointerDownCapture)})});function C(){let e=new CustomEvent(b);document.dispatchEvent(e)}function R(e,t,n,r){let{discrete:o}=r,a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&a.addEventListener(e,t,{once:!0}),o)a&&h.flushSync(()=>a.dispatchEvent(i));else a.dispatchEvent(i)}N.displayName="DismissableLayer",i.forwardRef((e,t)=>{let n=i.useContext(w),r=i.useRef(null),o=(0,c.s)(t,r);return i.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,s.jsx)(y.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var S="focusScope.autoFocusOnMount",x="focusScope.autoFocusOnUnmount",O={bubbles:!1,cancelable:!0},D=i.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...u}=e,[l,d]=i.useState(null),f=E(o),p=E(a),v=i.useRef(null),m=(0,c.s)(t,e=>d(e)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;let t=e.target;l.contains(t)?v.current=t:M(v.current,{select:!0})},t=function(e){if(h.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||M(v.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(l)});return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,l,h.paused]),i.useEffect(()=>{if(l){P.add(h);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(S,O);l.addEventListener(S,f),l.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}(T(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&M(l))}return()=>{l.removeEventListener(S,f),setTimeout(()=>{let t=new CustomEvent(x,O);l.addEventListener(x,p),l.dispatchEvent(t),t.defaultPrevented||M(null!=e?e:document.body,{select:!0}),l.removeEventListener(x,p),P.remove(h)},0)}}},[l,f,p,h]);let g=i.useCallback(e=>{if(!n&&!r||h.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[r,a]=function(e){let t=T(e);return[L(t,e),L(t.reverse(),e)]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&M(a,{select:!0})):(e.preventDefault(),n&&M(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,h.paused]);return(0,s.jsx)(y.div,{tabIndex:-1,...u,ref:m,onKeyDown:g})});function T(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function L(e,t){for(let n of e)if(!function(e,t){let{upTo:n}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===n||e!==n);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function M(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}D.displayName="FocusScope";var P=function(){let e=[];return{add(t){let n=e[0];t!==n&&(null==n||n.pause()),(e=A(e,t)).unshift(t)},remove(t){var n;null==(n=(e=A(e,t))[0])||n.resume()}}}();function A(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var k=i.forwardRef((e,t)=>{var n,r;let{container:o,...a}=e,[u,l]=i.useState(!1);d(()=>l(!0),[]);let c=o||u&&(null==(r=globalThis)||null==(n=r.document)?void 0:n.body);return c?h.createPortal((0,s.jsx)(y.div,{...a,ref:t}),c):null});k.displayName="Portal";var I=e=>{let{present:t,children:n}=e,r=function(e){var t,n;let[r,o]=i.useState(),a=i.useRef(null),u=i.useRef(e),l=i.useRef("none"),[c,s]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},i.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return i.useEffect(()=>{let e=j(a.current);l.current="mounted"===c?e:"none"},[c]),d(()=>{let t=a.current,n=u.current;if(n!==e){let r=l.current,o=j(t);e?s("MOUNT"):"none"===o||(null==t?void 0:t.display)==="none"?s("UNMOUNT"):n&&r!==o?s("ANIMATION_OUT"):s("UNMOUNT"),u.current=e}},[e,s]),d(()=>{if(r){var e;let t,n=null!=(e=r.ownerDocument.defaultView)?e:window,o=e=>{let o=j(a.current).includes(CSS.escape(e.animationName));if(e.target===r&&o&&(s("ANIMATION_END"),!u.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},i=e=>{e.target===r&&(l.current=j(a.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",o),r.addEventListener("animationend",o),()=>{n.clearTimeout(t),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",o),r.removeEventListener("animationend",o)}}s("ANIMATION_END")},[r,s]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(e=>{a.current=e?getComputedStyle(e):null,o(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),a=(0,c.s)(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(o=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:a}):null};function j(e){return(null==e?void 0:e.animationName)||"none"}I.displayName="Presence";var F=0;function _(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var W=function(){return(W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function U(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}Object.create;Object.create;var B=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),$="width-before-scroll-bar";function K(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var X="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,Y=new WeakMap;function z(e){return e}var Z=function(e){void 0===e&&(e={});var t,n,r,o=(void 0===t&&(t=z),n=[],r=!1,{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}});return o.options=W({async:!0,ssr:!1},e),o}(),H=function(){},q=i.forwardRef(function(e,t){var n,r,o,a,u=i.useRef(null),l=i.useState({onScrollCapture:H,onWheelCapture:H,onTouchMoveCapture:H}),c=l[0],s=l[1],d=e.forwardProps,f=e.children,p=e.className,v=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,y=e.noRelative,E=e.noIsolation,b=e.inert,w=e.allowPinchZoom,N=e.as,C=e.gapMode,R=U(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=(n=[u,t],r=function(e){return n.forEach(function(t){return K(t,e)})},(o=(0,i.useState)(function(){return{value:null,callback:r,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=r,a=o.facade,X(function(){var e=Y.get(a);if(e){var t=new Set(e),r=new Set(n),o=a.current;t.forEach(function(e){r.has(e)||K(e,null)}),r.forEach(function(e){t.has(e)||K(e,o)})}Y.set(a,n)},[n]),a),x=W(W({},R),c);return i.createElement(i.Fragment,null,m&&i.createElement(g,{sideCar:Z,removeScrollBar:v,shards:h,noRelative:y,noIsolation:E,inert:b,setCallbacks:s,allowPinchZoom:!!w,lockRef:u,gapMode:C}),d?i.cloneElement(i.Children.only(f),W(W({},x),{ref:S})):i.createElement(void 0===N?"div":N,W({},x,{className:p,ref:S}),f))});q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},q.classNames={fullWidth:$,zeroRight:B};var V=function(e){var t=e.sideCar,n=U(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return i.createElement(r,W({},n))};V.isSideCarExport=!0;var G=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a||n.nc;return t&&e.setAttribute("nonce",t),e}())){var o,i;(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},J=function(){var e=G();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Q=function(){var e=J();return function(t){return e(t.styles,t.dynamic),null}},ee={left:0,top:0,right:0,gap:0},et=function(e){return parseInt(e||"",10)||0},en=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[et(n),et(r),et(o)]},er=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ee;var t=en(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},eo=Q(),ea="data-scroll-locked",ei=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,u=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(u,"px ").concat(r,";\n }\n body[").concat(ea,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(u,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(B," {\n right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat($," {\n margin-right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(B," .").concat(B," {\n right: 0 ").concat(r,";\n }\n \n .").concat($," .").concat($," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ea,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(u,"px;\n }\n")},eu=function(){var e=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(e)?e:0},el=function(){i.useEffect(function(){return document.body.setAttribute(ea,(eu()+1).toString()),function(){var e=eu()-1;e<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,e.toString())}},[])},ec=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;el();var a=i.useMemo(function(){return er(o)},[o]);return i.createElement(eo,{styles:ei(a,!t,o,n?"":"!important")})},es=!1;if("undefined"!=typeof window)try{var ed=Object.defineProperty({},"passive",{get:function(){return es=!0,!0}});window.addEventListener("test",ed,ed),window.removeEventListener("test",ed,ed)}catch(e){es=!1}var ef=!!es&&{passive:!1},ep=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},ev=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),em(e,r)){var o=eh(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},em=function(e,t){return"v"===e?ep(t,"overflowY"):ep(t,"overflowX")},eh=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eg=function(e,t,n,r,o){var a,i=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),u=i*r,l=n.target,c=t.contains(l),s=!1,d=u>0,f=0,p=0;do{if(!l)break;var v=eh(e,l),m=v[0],h=v[1]-v[2]-i*m;(m||h)&&em(e,l)&&(f+=h,p+=m);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return d&&(o&&1>Math.abs(f)||!o&&u>f)?s=!0:!d&&(o&&1>Math.abs(p)||!o&&-u>p)&&(s=!0),s},ey=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eE=function(e){return[e.deltaX,e.deltaY]},eb=function(e){return e&&"current"in e?e.current:e},ew=0,eN=[];let eC=(r=function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(ew++)[0],a=i.useState(Q)[0],u=i.useRef(e);i.useEffect(function(){u.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(eb),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!u.current.allowPinchZoom;var o,a=ey(e),i=n.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],s=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===s.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===s||p.contains(s)))return!1;var v=ev(d,s);if(!v)return!0;if(v?o=d:(o="v"===d?"h":"v",v=ev(d,s)),!v)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var m=r.current||o;return eg(m,t,e,"h"===m?l:c,!0)},[]),c=i.useCallback(function(e){if(eN.length&&eN[eN.length-1]===a){var n="deltaY"in e?eE(e):ey(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var o=(u.current.shards||[]).map(eb).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?l(e,o[0]):!u.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),s=i.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=i.useCallback(function(e){n.current=ey(e),r.current=void 0},[]),f=i.useCallback(function(t){s(t.type,eE(t),t.target,l(t,e.lockRef.current))},[]),p=i.useCallback(function(t){s(t.type,ey(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return eN.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ef),document.addEventListener("touchmove",c,ef),document.addEventListener("touchstart",d,ef),function(){eN=eN.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,ef),document.removeEventListener("touchmove",c,ef),document.removeEventListener("touchstart",d,ef)}},[]);var v=e.removeScrollBar,m=e.inert;return i.createElement(i.Fragment,null,m?i.createElement(a,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,v?i.createElement(ec,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Z.useMedium(r),V);var eR=i.forwardRef(function(e,t){return i.createElement(q,W({},e,{ref:t,sideCar:eC}))});eR.classNames=q.classNames;var eS=new WeakMap,ex=new WeakMap,eO={},eD=0,eT=function(e){return e&&(e.host||eT(e.parentNode))},eL=function(e,t,n,r){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=eT(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eO[n]||(eO[n]=new WeakMap);var a=eO[n],i=[],u=new Set,l=new Set(o),c=function(e){!e||u.has(e)||(u.add(e),c(e.parentNode))};o.forEach(c);var s=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(u.has(e))s(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(eS.get(e)||0)+1,c=(a.get(e)||0)+1;eS.set(e,l),a.set(e,c),i.push(e),1===l&&o&&ex.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return s(t),u.clear(),eD++,function(){i.forEach(function(e){var t=eS.get(e)-1,o=a.get(e)-1;eS.set(e,t),a.set(e,o),t||(ex.has(e)||e.removeAttribute(r),ex.delete(e)),o||e.removeAttribute(n)}),--eD||(eS=new WeakMap,eS=new WeakMap,ex=new WeakMap,eO={})}},eM=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),eL(r,o,n,"aria-hidden")):function(){return null}},eP="Dialog",[eA,ek]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>i.createContext(e));return function(n){let r=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=i.createContext(r),a=n.length;n=[...n,r];let u=t=>{let{scope:n,children:r,...u}=t,l=n?.[e]?.[a]||o,c=i.useMemo(()=>u,Object.values(u));return(0,s.jsx)(l.Provider,{value:c,children:r})};return u.displayName=t+"Provider",[u,function(n,u){let l=u?.[e]?.[a]||o,c=i.useContext(l);if(c)return c;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(eP),[eI,ej]=eA(eP),eF=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:u=!0}=e,l=i.useRef(null),c=i.useRef(null),[d,f]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[o,a,u]=function({defaultProp:e,onChange:t}){let[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return m(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:o;{let t=i.useRef(void 0!==e);i.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}return[c,i.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u.current?.(n)}else a(t)},[l,e,a,u])]}({prop:r,defaultProp:null!=o&&o,onChange:a,caller:eP});return(0,s.jsx)(eI,{scope:t,triggerRef:l,contentRef:c,contentId:v(),titleId:v(),descriptionId:v(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:u,children:n})};eF.displayName=eP;var e_="DialogTrigger";i.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=ej(e_,n),a=(0,c.s)(t,o.triggerRef);return(0,s.jsx)(y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":e6(o.open),...r,ref:a,onClick:l(e.onClick,o.onOpenToggle)})}).displayName=e_;var eW="DialogPortal",[eU,eB]=eA(eW,{forceMount:void 0}),e$=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ej(eW,t);return(0,s.jsx)(eU,{scope:t,forceMount:n,children:i.Children.map(r,e=>(0,s.jsx)(I,{present:n||a.open,children:(0,s.jsx)(k,{asChild:!0,container:o,children:e})}))})};e$.displayName=eW;var eK="DialogOverlay",eX=i.forwardRef((e,t)=>{let n=eB(eK,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ej(eK,e.__scopeDialog);return a.modal?(0,s.jsx)(I,{present:r||a.open,children:(0,s.jsx)(ez,{...o,ref:t})}):null});eX.displayName=eK;var eY=(0,g.TL)("DialogOverlay.RemoveScroll"),ez=i.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=ej(eK,n);return(0,s.jsx)(eR,{as:eY,allowPinchZoom:!0,shards:[o.contentRef],children:(0,s.jsx)(y.div,{"data-state":e6(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),eZ="DialogContent",eH=i.forwardRef((e,t)=>{let n=eB(eZ,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ej(eZ,e.__scopeDialog);return(0,s.jsx)(I,{present:r||a.open,children:a.modal?(0,s.jsx)(eq,{...o,ref:t}):(0,s.jsx)(eV,{...o,ref:t})})});eH.displayName=eZ;var eq=i.forwardRef((e,t)=>{let n=ej(eZ,e.__scopeDialog),r=i.useRef(null),o=(0,c.s)(t,n.contentRef,r);return i.useEffect(()=>{let e=r.current;if(e)return eM(e)},[]),(0,s.jsx)(eG,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault())})}),eV=i.forwardRef((e,t)=>{let n=ej(eZ,e.__scopeDialog),r=i.useRef(!1),o=i.useRef(!1);return(0,s.jsx)(eG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a,i;null==(a=e.onCloseAutoFocus)||a.call(e,t),t.defaultPrevented||(r.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{var a,i;null==(a=e.onInteractOutside)||a.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let u=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(u))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),eG=i.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...u}=e,l=ej(eZ,n),d=i.useRef(null),f=(0,c.s)(t,d);return i.useEffect(()=>{var e,t;let n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!=(e=n[0])?e:_()),document.body.insertAdjacentElement("beforeend",null!=(t=n[1])?t:_()),F++,()=>{1===F&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),F--}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,s.jsx)(N,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":e6(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e3,{titleId:l.titleId}),(0,s.jsx)(e9,{contentRef:d,descriptionId:l.descriptionId})]})]})}),eJ="DialogTitle",eQ=i.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=ej(eJ,n);return(0,s.jsx)(y.h2,{id:o.titleId,...r,ref:t})});eQ.displayName=eJ;var e0="DialogDescription";i.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=ej(e0,n);return(0,s.jsx)(y.p,{id:o.descriptionId,...r,ref:t})}).displayName=e0;var e1="DialogClose",e2=i.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=ej(e1,n);return(0,s.jsx)(y.button,{type:"button",...r,ref:t,onClick:l(e.onClick,()=>o.onOpenChange(!1))})});function e6(e){return e?"open":"closed"}e2.displayName=e1;var e8="DialogTitleWarning",[e5,e4]=function(e,t){let n=i.createContext(t),r=e=>{let{children:t,...r}=e,o=i.useMemo(()=>r,Object.values(r));return(0,s.jsx)(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){let o=i.useContext(n);if(o)return o;if(void 0!==t)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}]}(e8,{contentName:eZ,titleName:eJ,docsSlug:"dialog"}),e3=e=>{let{titleId:t}=e,n=e4(e8),r="`".concat(n.contentName,"` requires a `").concat(n.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(n.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(n.docsSlug);return i.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},e9=e=>{let{contentRef:t,descriptionId:n}=e,r=e4("DialogDescriptionWarning"),o="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(r.contentName,"}.");return i.useEffect(()=>{var e;let r=null==(e=t.current)?void 0:e.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(o))},[o,t,n]),null},e7=eF,te=e$,tt=eX,tn=eH,tr=eQ,to=e2}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[119],{63:(e,u,t)=>{"use strict";var r=t(7260);t.o(r,"usePathname")&&t.d(u,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(u,{useRouter:function(){return r.useRouter}})},163:(e,u,t)=>{"use strict";t.r(u),t.d(u,{default:()=>n});var r=t(2115),s=t(63);function n(){let e=(0,s.useRouter)();return(0,r.useEffect)(()=>{e.replace("/activity")},[e]),null}},366:(e,u,t)=>{Promise.resolve().then(t.bind(t,163))}},e=>{e.O(0,[441,255,358],()=>e(e.s=366)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{1044:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var l=s(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:s=14,stroke:n=1.7,className:i=""}=e,r=a[t];return r?(0,l.jsx)("svg",{className:"icn ".concat(i).trim(),width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("path",{d:r})}):null}},3742:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var l=s(5155);function a(e){let{title:t,sub:s,tools:a,flush:n,className:i="",style:r,children:c}=e,o=null!=t||null!=a;return(0,l.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[o&&(0,l.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,l.jsx)("h3",{children:t}):t),null!=s&&(0,l.jsx)("span",{className:"sub",children:s}),null!=a&&(0,l.jsx)("div",{className:"tools",children:a})]}),(0,l.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,t,s)=>{"use strict";s.d(t,{f:()=>l});let l=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,s)=>e({projects:t,activeProjectId:s}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var s;return e({ledger:t,wasteFlags:null!=(s=t.wasteFlags)?s:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,s,l)=>e({tasks:t,taskDefinitions:s,deadLetters:l}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5530:(e,t,s)=>{Promise.resolve().then(s.bind(s,6893))},5959:(e,t,s)=>{"use strict";s.d(t,{v:()=>i});var l=s(2115);let a=e=>{let t,s=new Set,l=(e,l)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=l?l:"object"!=typeof a||null===a)?a:Object.assign({},t,a),s.forEach(s=>s(t,e))}},a=()=>t,n={setState:l,getState:a,getInitialState:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e))},i=t=e(l,a,n);return n},n=e=>{let t=(e=>e?a(e):a)(e),s=e=>(function(e,t=e=>e){let s=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>t(e.getState()),[e,t]),l.useCallback(()=>t(e.getInitialState()),[e,t]));return l.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},i=e=>e?n(e):n},6845:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var l=s(5155),a=s(1044);function n(e){let{icon:t,variant:s,size:n,className:i="",children:r,...c}=e,o=["btn"];return s&&o.push(s),n&&o.push(n),i&&o.push(i),(0,l.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,l.jsx)(a.I,{name:t}),r]})}},6893:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var l=s(5155),a=s(2115),n=s(3928),i=s(3742),r=s(7125),c=s(6845);let o=["all","read","write","session","other"];function h(e){let t=e.action.toLowerCase();return"read"===t?"read":"create"===t||"edit"===t||"write"===t?"write":t.includes("session")?"session":"other"}function d(){let e=(0,n.f)(e=>e.actionLog),[t,s]=(0,a.useState)("all"),d=(0,a.useMemo)(()=>[...e].reverse(),[e]),u="all"===t?d:d.filter(e=>h(e)===t);return(0,l.jsxs)("div",{className:"page",children:[(0,l.jsxs)("div",{className:"page-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"page-title",children:"Activity log"}),(0,l.jsx)("p",{className:"page-sub",children:"Chronological, human-readable record of every hook event"})]}),(0,l.jsx)("div",{className:"page-actions",children:(0,l.jsx)(c.t,{icon:"download",variant:"ghost",disabled:!0,title:"Export coming soon",children:"Export .md"})})]}),(0,l.jsx)(i.Z,{title:"Recent activity",sub:"".concat(u.length," events"),tools:(0,l.jsx)("div",{className:"row tight",children:o.map(e=>(0,l.jsx)("button",{type:"button",className:"tab ".concat(t===e?"on":""),style:{padding:"3px 8px",fontSize:10.5,marginBottom:0,borderBottom:0,borderRadius:4,background:t===e?"var(--bg-3)":"transparent"},onClick:()=>s(e),children:e},e))}),flush:!0,children:0===u.length?(0,l.jsxs)("div",{className:"empty",children:[(0,l.jsx)("h4",{children:"No activity recorded"}),(0,l.jsx)("span",{children:"start a Claude session with mink hooks enabled to populate this log."})]}):(0,l.jsx)("div",{children:u.map((e,t)=>{let s=h(e);return(0,l.jsxs)("div",{className:"evt ".concat(t<2?"fresh":"").trim(),children:[(0,l.jsx)("span",{className:"t",children:e.time}),(0,l.jsxs)("span",{className:"c",children:[(0,l.jsx)(r.v,{tone:function(e){switch(e){case"read":return"";case"write":return"blue";case"session":return"accent";default:return"amber"}}(s),children:s}),(0,l.jsxs)("span",{children:[" ",e.action," "]}),e.files&&"—"!==e.files&&(0,l.jsx)("code",{children:e.files}),e.outcome&&"—"!==e.outcome&&(0,l.jsx)("span",{className:"muted",style:{marginLeft:8,fontSize:10.5,fontFamily:"var(--font-mono), monospace"},children:e.outcome}),e.tokens&&"—"!==e.tokens&&(0,l.jsxs)("span",{className:"muted",style:{marginLeft:8,fontSize:10.5,fontFamily:"var(--font-mono), monospace"},children:[e.tokens," tok"]})]})]},"".concat(e.time,"-").concat(t))})})})]})}function u(){return(0,l.jsx)(d,{})}},7125:(e,t,s)=>{"use strict";s.d(t,{v:()=>a});var l=s(5155);function a(e){let{tone:t="",children:s,className:a=""}=e;return(0,l.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:s})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=5530)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[273],{1008:(e,t,l)=>{Promise.resolve().then(l.bind(l,8032))},1044:(e,t,l)=>{"use strict";l.d(t,{I:()=>n});var s=l(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:l=14,stroke:n=1.7,className:r=""}=e,i=a[t];return i?(0,s.jsx)("svg",{className:"icn ".concat(r).trim(),width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:i})}):null}},3742:(e,t,l)=>{"use strict";l.d(t,{Z:()=>a});var s=l(5155);function a(e){let{title:t,sub:l,tools:a,flush:n,className:r="",style:i,children:c}=e,o=null!=t||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(r).trim(),style:i,children:[o&&(0,s.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,s.jsx)("h3",{children:t}):t),null!=l&&(0,s.jsx)("span",{className:"sub",children:l}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,t,l)=>{"use strict";l.d(t,{f:()=>s});let s=(0,l(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,l)=>e({projects:t,activeProjectId:l}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var l;return e({ledger:t,wasteFlags:null!=(l=t.wasteFlags)?l:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,l,s)=>e({tasks:t,taskDefinitions:l,deadLetters:s}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,l)=>{"use strict";l.d(t,{v:()=>r});var s=l(2115);let a=e=>{let t,l=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),l.forEach(l=>l(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>r,subscribe:e=>(l.add(e),()=>l.delete(e))},r=t=e(s,a,n);return n},n=e=>{let t=(e=>e?a(e):a)(e),l=e=>(function(e,t=e=>e){let l=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(l),l})(t,e);return Object.assign(l,t),l},r=e=>e?n(e):n},6845:(e,t,l)=>{"use strict";l.d(t,{t:()=>n});var s=l(5155),a=l(1044);function n(e){let{icon:t,variant:l,size:n,className:r="",children:i,...c}=e,o=["btn"];return l&&o.push(l),n&&o.push(n),r&&o.push(r),(0,s.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,s.jsx)(a.I,{name:t}),i]})}},7e3:(e,t,l)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function a(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),l=Math.floor(t/60),s=Math.floor(l/60);return s>0?s+"h "+l%60+"m":l>0?l+"m "+t%60+"s":t+"s"}function n(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}l.d(t,{Y0:()=>a,aT:()=>s,r6:()=>n})},7125:(e,t,l)=>{"use strict";l.d(t,{v:()=>a});var s=l(5155);function a(e){let{tone:t="",children:l,className:a=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:l})}},8032:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>m});var s=l(5155),a=l(2115),n=l(3928),r=l(3742),i=l(7125),c=l(6845),o=l(1044),d=l(7e3);function h(e){return!!e.fixDescription&&e.fixDescription.trim().length>0}function u(){let e=(0,n.f)(e=>e.bugs),[t,l]=(0,a.useState)(""),[u,m]=(0,a.useState)("all"),[v,M]=(0,a.useState)([]),[g,x]=(0,a.useState)(null),f=(0,a.useMemo)(()=>{let t=new Set;return e.forEach(e=>{var l;return null==(l=e.tags)?void 0:l.forEach(e=>t.add(e))}),Array.from(t).sort()},[e]),j=(0,a.useMemo)(()=>e.filter(e=>{var l;return!("open"===u&&h(e))&&("fixed"!==u||!!h(e))&&(!t||!!((null==(l=e.errorMessage)?void 0:l.toLowerCase().includes(t.toLowerCase()))||e.id.toLowerCase().includes(t.toLowerCase())))&&(!v.length||!!v.every(t=>e.tags.includes(t)))}),[e,t,u,v]),p=e.filter(e=>!h(e)).length;return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Bug memory"}),(0,s.jsxs)("p",{className:"page-sub",children:[e.length," bugs \xb7 ",p," open"]})]}),(0,s.jsx)("div",{className:"page-actions",children:(0,s.jsx)(c.t,{icon:"plus",variant:"primary",disabled:!0,title:"Write endpoint coming soon",children:"Log bug"})})]}),(0,s.jsx)(r.Z,{title:(0,s.jsxs)("div",{className:"row",style:{flex:1,gap:10,flexWrap:"wrap"},children:[(0,s.jsxs)("div",{className:"row",style:{maxWidth:280,flex:1},children:[(0,s.jsx)(o.I,{name:"search",size:12,className:"muted"}),(0,s.jsx)("input",{value:t,onChange:e=>l(e.target.value),placeholder:"Search bugs…","aria-label":"Search bugs",style:{flex:1,background:"transparent",border:0,color:"var(--fg-0)",fontSize:11.5,outline:"none",fontFamily:"var(--font-mono), monospace"}})]}),(0,s.jsx)("div",{className:"seg",children:["all","open","fixed"].map(e=>(0,s.jsx)("button",{type:"button",className:u===e?"on":"",onClick:()=>m(e),children:e},e))}),(0,s.jsx)("div",{className:"row tight",style:{flexWrap:"wrap"},children:f.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>{M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},children:(0,s.jsxs)(i.v,{tone:v.includes(e)?"accent":"",children:["#",e]})},e))})]}),flush:!0,children:0===j.length?(0,s.jsx)("div",{className:"empty",children:(0,s.jsx)("h4",{children:"No bugs match"})}):(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{}),(0,s.jsx)("th",{children:"ID"}),(0,s.jsx)("th",{children:"Error"}),(0,s.jsx)("th",{children:"Tags"}),(0,s.jsx)("th",{children:"File"}),(0,s.jsx)("th",{children:"Root cause"}),(0,s.jsx)("th",{className:"right",children:"When"})]})}),(0,s.jsx)("tbody",{children:j.map(e=>{let t=h(e),l=g===e.id;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsxs)("tr",{onClick:()=>x(l?null:e.id),style:{cursor:"pointer"},children:[(0,s.jsx)("td",{children:t?(0,s.jsx)(i.v,{tone:"accent",children:"fixed"}):(0,s.jsx)(i.v,{tone:"red",children:"open"})}),(0,s.jsx)("td",{className:"mono",children:e.id}),(0,s.jsx)("td",{className:"strong",style:{maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.errorMessage}),(0,s.jsx)("td",{children:(0,s.jsx)("div",{className:"row tight",style:{flexWrap:"wrap"},children:e.tags.map(e=>(0,s.jsxs)(i.v,{children:["#",e]},e))})}),(0,s.jsxs)("td",{className:"mono muted",style:{fontSize:10.5},children:[e.filePath,e.lineNumber?":".concat(e.lineNumber):""]}),(0,s.jsx)("td",{className:"muted",style:{maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.rootCause}),(0,s.jsx)("td",{className:"right mono muted",children:(0,d.r6)(e.lastSeenAt)})]}),l&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:7,style:{background:"var(--bg-2)",padding:"12px 14px"},children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"muted",style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:4},children:"Root cause"}),(0,s.jsx)("div",{children:e.rootCause||"—"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"muted",style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:4},children:"Fix"}),(0,s.jsx)("div",{children:e.fixDescription||(0,s.jsx)("span",{className:"muted",children:"not fixed yet"})})]}),(0,s.jsxs)("div",{className:"mono muted",style:{fontSize:11},children:["seen ",e.occurrenceCount,"\xd7 \xb7 created ",(0,d.r6)(e.createdAt)]})]})})})]},e.id)})})]})})]})}function m(){return(0,s.jsx)(u,{})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=1008)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=s[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function l(e){return a("/api/token-ledger",e)}function r(e){return a("/api/file-index",e)}function c(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function u(e){return a("/api/bugs",e)}function h(e){return a("/api/design",e)}async function v(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function m(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function g(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function f(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function M(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function S(){return a("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function C(){return a("/api/channel")}async function z(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function P(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function T(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function L(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function V(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function H(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:L(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>O,Aq:()=>N,D:()=>I,Dz:()=>M,EP:()=>i,FW:()=>w,G1:()=>C,Gs:()=>S,Iw:()=>H,MP:()=>u,On:()=>z,P:()=>p,Vo:()=>l,WH:()=>P,Z4:()=>m,ZN:()=>T,ab:()=>y,co:()=>o,e2:()=>c,fX:()=>f,hD:()=>g,hY:()=>h,jm:()=>b,kH:()=>k,p4:()=>V,pu:()=>d,tf:()=>D,vj:()=>s,vo:()=>j,xl:()=>r,yJ:()=>x,yP:()=>v})},2346:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(5155),s=n(2115),i=n(3742),l=n(7125),r=n(6845),c=n(3928),o=n(2327);let d=[];function u(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"dedup-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}function h(){let[e,t]=(0,s.useState)("quick"),n=(0,c.f)(e=>{var t,n;return null!=(n=null==(t=e.wiki)?void 0:t.tags)?n:d}),[h,v]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[g,f]=(0,s.useState)("inbox"),[j,y]=(0,s.useState)(""),[M,x]=(0,s.useState)(""),[w,S]=(0,s.useState)(""),[b,k]=(0,s.useState)(""),[N,C]=(0,s.useState)("resources"),[z,P]=(0,s.useState)("idle"),[O,I]=(0,s.useState)(null),[T,L]=(0,s.useState)(null);async function V(e){P("saving"),I(null);try{var t,n;let a=await e();a.success?(P("saved"),L(null!=(t=a.filePath)?t:null),setTimeout(()=>P(e=>"saved"===e?"idle":e),2e3)):(P("error"),I(null!=(n=a.error)?n:"Save failed"))}catch(e){P("error"),I(e instanceof Error?e.message:String(e))}}function H(){let e=h.trim();if(!e)return;let t=u();V(()=>(0,o.p4)({mode:"quick",body:e,dedupKey:t})).then(()=>v(""))}function D(){let e=w.trim();if(!e)return;let t=u();V(()=>(0,o.Iw)(e,t)).then(()=>S(""))}function U(){return"saved"===z&&T?(0,a.jsxs)("div",{className:"muted",style:{fontSize:11,color:"var(--accent)"},children:["Saved → ",(0,a.jsx)("span",{className:"mono",children:T})]}):"error"===z&&O?(0,a.jsx)("div",{style:{fontSize:11,color:"var(--danger, #c33)",whiteSpace:"pre-wrap"},children:O}):"saving"===z?(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:"Saving…"}):null}return(0,a.jsxs)("div",{className:"page",style:{maxWidth:900},children:[(0,a.jsx)("div",{className:"page-head",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title row tight",children:(0,a.jsx)("span",{children:"Capture"})}),(0,a.jsx)("p",{className:"page-sub",children:"Quick or structured — captures land in the vault immediately"})]})}),(0,a.jsxs)(i.Z,{children:[(0,a.jsx)("div",{className:"seg",style:{marginBottom:12},children:["quick","structured","daily","file"].map(n=>(0,a.jsx)("button",{type:"button",className:e===n?"on":"",onClick:()=>t(n),children:"file"===n?"Ingest file":"daily"===n?"Daily journal":n[0].toUpperCase()+n.slice(1)},n))}),"quick"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Quick capture"}),(0,a.jsx)("textarea",{rows:4,value:h,onChange:e=>v(e.target.value),placeholder:"What's on your mind? First line becomes the title; lands in inbox/.",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&H()}}),(0,a.jsxs)("div",{className:"hint",children:["Lands in ",(0,a.jsx)("span",{className:"mono",children:"inbox/"}),". Cmd/Ctrl+Enter to save."]})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:H,disabled:"saving"===z||!h.trim(),children:"saving"===z?"Saving…":"Capture"}),(0,a.jsx)(U,{})]})]}),"structured"===e&&(0,a.jsxs)("div",{className:"grid g-2",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Title"}),(0,a.jsx)("input",{value:p,onChange:e=>m(e.target.value),placeholder:"e.g. JWT Cookie Pattern"})]}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Category"}),(0,a.jsxs)("select",{value:g,onChange:e=>f(e.target.value),children:[(0,a.jsx)("option",{value:"inbox",children:"inbox"}),(0,a.jsx)("option",{value:"projects",children:"projects"}),(0,a.jsx)("option",{value:"areas",children:"areas"}),(0,a.jsx)("option",{value:"resources",children:"resources"}),(0,a.jsx)("option",{value:"archives",children:"archives"})]})]}),(0,a.jsxs)("div",{className:"field",style:{gridColumn:"span 2"},children:[(0,a.jsx)("label",{children:"Body (markdown)"}),(0,a.jsx)("textarea",{rows:6,className:"mono",value:j,onChange:e=>y(e.target.value),placeholder:"## Context\n\nUse httpOnly cookies for token storage..."})]}),(0,a.jsxs)("div",{className:"field",style:{gridColumn:"span 2"},children:[(0,a.jsx)("label",{children:"Tags (comma-separated)"}),(0,a.jsx)("input",{value:M,onChange:e=>x(e.target.value),placeholder:"auth, security, pattern"})]}),(0,a.jsxs)("div",{style:{gridColumn:"span 2"},className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:function(){let e=j.trim();if(!e)return;let t=u();V(()=>(0,o.p4)({mode:"structured",title:p.trim(),category:g,body:e,tags:M.split(",").map(e=>e.trim().replace(/^#/,"")).filter(Boolean),dedupKey:t})).then(()=>{m(""),y(""),x("")})},disabled:"saving"===z||!j.trim(),children:"saving"===z?"Saving…":"Create note"}),(0,a.jsx)(U,{})]})]}),"daily"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Today"}),(0,a.jsx)("textarea",{rows:5,value:w,onChange:e=>S(e.target.value),placeholder:"Append to today's daily entry…",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&D()}})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:D,disabled:"saving"===z||!w.trim(),children:"saving"===z?"Saving…":"Append"}),(0,a.jsx)(U,{})]})]}),"file"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Source file"}),(0,a.jsx)("input",{value:b,onChange:e=>k(e.target.value),placeholder:"./scratch-notes.md",className:"mono"})]}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Category"}),(0,a.jsxs)("select",{value:N,onChange:e=>C(e.target.value),children:[(0,a.jsx)("option",{value:"resources",children:"resources"}),(0,a.jsx)("option",{value:"inbox",children:"inbox"}),(0,a.jsx)("option",{value:"projects",children:"projects"}),(0,a.jsx)("option",{value:"archives",children:"archives"})]})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"upload",onClick:function(){let e=b.trim();if(!e)return;let t=u();V(()=>(0,o.tf)({sourcePath:e,category:N,dedupKey:t})).then(()=>k(""))},disabled:"saving"===z||!b.trim(),children:"saving"===z?"Ingesting…":"Ingest"}),(0,a.jsx)(U,{})]})]})]}),(0,a.jsx)("div",{style:{height:14}}),(0,a.jsx)(i.Z,{title:"Tag cloud",sub:"top tags across the vault",children:(0,a.jsx)("div",{className:"row tight",style:{flexWrap:"wrap",gap:6},children:0===n.length?(0,a.jsx)("span",{className:"muted",style:{fontSize:11},children:"No tags yet — capture a note to get started."}):n.slice(0,40).map(e=>{let[t,n]=e;return(0,a.jsxs)(l.v,{children:[(0,a.jsxs)("span",{children:["#",t]}),(0,a.jsx)("span",{className:"muted",children:n})]},t)})})})]})}function v(){return(0,a.jsx)(h,{})}},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,a.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,a.jsx)(s.I,{name:t}),r]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}},9993:(e,t,n)=>{Promise.resolve().then(n.bind(n,2346))}},e=>{e.O(0,[441,255,358],()=>e(e.s=9993)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:r=""}=e,l=s[t];return l?(0,a.jsx)("svg",{className:"icn ".concat(r).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:l})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function r(e){return a("/api/token-ledger",e)}function l(e){return a("/api/file-index",e)}function o(e){return a("/api/scheduler",e)}function c(e){return a("/api/learning-memory",e)}function u(e){return a("/api/action-log",e)}function d(e){return a("/api/bugs",e)}function h(e){return a("/api/design",e)}async function v(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function m(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function j(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function b(){return a("/api/sync")}async function k(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function z(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function N(){return a("/api/channel")}async function O(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function P(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function T(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function I(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function L(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function H(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:L(t),body:JSON.stringify({content:e})})).json()}async function F(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>T,Aq:()=>z,D:()=>C,Dz:()=>j,EP:()=>i,FW:()=>w,G1:()=>N,Gs:()=>b,Iw:()=>V,MP:()=>d,On:()=>O,P:()=>p,Vo:()=>r,WH:()=>P,Z4:()=>f,ZN:()=>I,ab:()=>y,co:()=>c,e2:()=>o,fX:()=>g,hD:()=>m,hY:()=>h,jm:()=>k,kH:()=>S,p4:()=>H,pu:()=>u,tf:()=>F,vj:()=>s,vo:()=>M,xl:()=>l,yJ:()=>x,yP:()=>v})},3067:(e,t,n)=>{Promise.resolve().then(n.bind(n,6411))},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:r="",style:l,children:o}=e,c=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(r).trim(),style:l,children:[c&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:o})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var a=n(5155);function s(e){let{on:t,onChange:n,className:s="",ariaLabel:i}=e;return(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,className:"toggle ".concat(t?"on":""," ").concat(s).trim(),onClick:()=>null==n?void 0:n(!t)})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>r});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>r,subscribe:e=>(n.add(e),()=>n.delete(e))},r=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},r=e=>e?i(e):i},6411:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var a=n(5155),s=n(2115),i=n(3742),r=n(7125),l=n(6845),o=n(1044),c=n(4239),u=n(3928),d=n(2327);let h={default:"",shared:"accent",local:"accent",env:"amber"},v={default:"default",shared:"shared",local:"local",env:"env"};function p(e){let{label:t}=e;return(0,a.jsx)("div",{style:{padding:"8px 14px",background:"var(--bg-2)",borderTop:"1px solid var(--line-1)",borderBottom:"1px solid var(--line-1)",fontSize:10.5,color:"var(--fg-3)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:t})}function f(e){let{entry:t}=e,[n,i]=(0,s.useState)(t.value),[o,u]=(0,s.useState)("idle"),[p,f]=(0,s.useState)(null),[m,g]=(0,s.useState)(!1),M=(0,s.useRef)(null),y=(0,s.useRef)(t.value);function j(e){u("saving"),f(null),(0,d.yJ)(t.key,e).then(e=>{if(e.success)u("saved"),setTimeout(()=>u(e=>"saved"===e?"idle":e),1500);else{var t;u("error"),f(null!=(t=e.error)?t:"Failed to save")}}).catch(e=>{u("error"),f(e instanceof Error?e.message:String(e))})}(0,s.useEffect)(()=>{t.value!==y.current&&(y.current=t.value,"saving"!==o&&i(t.value))},[t.value,o]);let x="boolean"===t.type,w=(t.isSecret,n);return(0,a.jsxs)("div",{className:"row",style:{padding:"8px 14px",borderBottom:"1px solid var(--line-1)",gap:14,alignItems:"center"},children:[(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{className:"row tight",style:{gap:6},children:[(0,a.jsx)("span",{className:"mono strong",style:{fontSize:12},children:t.key}),(0,a.jsx)(r.v,{tone:h[t.source],children:v[t.source]}),t.isSecret&&(0,a.jsx)(r.v,{children:"secret"})]}),t.description&&(0,a.jsx)("div",{className:"muted",style:{fontSize:10.5,marginTop:2},children:t.description}),p&&(0,a.jsx)("div",{style:{fontSize:10.5,color:"var(--danger, #c33)",marginTop:2},children:p})]}),(0,a.jsxs)("div",{style:{width:260,display:"flex",gap:6,alignItems:"center"},children:[x?(0,a.jsx)(c.l,{on:"true"===n,onChange:function(e){let t=e?"true":"false";i(t),j(t)}}):(0,a.jsx)("input",{value:w,onChange:e=>{var t;i(t=e.target.value),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>j(t),500)},type:t.isSecret&&!m?"password":"text",className:"mono","aria-label":t.key,style:{width:"100%",background:"var(--bg-inset)",border:"1px solid var(--line-1)",borderRadius:5,padding:"4px 8px",color:"var(--fg-0)",fontSize:11,outline:"none"}}),t.isSecret&&!x&&(0,a.jsx)(l.t,{size:"sm",variant:"ghost",icon:"eye",onClick:()=>g(e=>!e),title:m?"Hide":"Reveal",children:m?"Hide":"Show"}),(0,a.jsx)(l.t,{size:"sm",variant:"ghost",icon:"refresh",onClick:function(){u("saving"),f(null),(0,d.FW)(t.key).then(e=>{if(e.success)u("saved"),setTimeout(()=>u(e=>"saved"===e?"idle":e),1500);else{var t;u("error"),f(null!=(t=e.error)?t:"Failed to reset")}}).catch(e=>{u("error"),f(e instanceof Error?e.message:String(e))})},disabled:"saving"===o||"default"===t.source,title:"Reset to default",children:"saving"===o?"…":"saved"===o?"✓":"Reset"})]})]})}function m(){var e;let t=(0,u.f)(e=>e.config),[n,r]=(0,s.useState)(""),c=null!=(e=null==t?void 0:t.entries)?e:[],d=(0,s.useMemo)(()=>{let e={};for(let a of c){var t;(!n||a.key.toLowerCase().includes(n.toLowerCase()))&&(e[a.group]=null!=(t=e[a.group])?t:[]).push(a)}return e},[c,n]);return(0,a.jsxs)("div",{className:"page",style:{maxWidth:900},children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title row tight",children:(0,a.jsx)("span",{children:"Configuration"})}),(0,a.jsx)("p",{className:"page-sub",children:"~/.mink/config (shared) \xb7 ~/.mink/config.local (per-machine) \xb7 env vars override"})]}),(0,a.jsxs)("div",{className:"page-actions",children:[(0,a.jsx)(l.t,{icon:"download",variant:"ghost",disabled:!0,children:"Export"}),(0,a.jsx)(l.t,{icon:"upload",disabled:!0,children:"Import"})]})]}),(0,a.jsx)(i.Z,{title:"All settings",tools:(0,a.jsxs)("div",{className:"row",style:{maxWidth:220},children:[(0,a.jsx)(o.I,{name:"search",size:12,className:"muted"}),(0,a.jsx)("input",{value:n,onChange:e=>r(e.target.value),placeholder:"Filter keys…","aria-label":"Filter config keys",style:{background:"transparent",border:0,color:"var(--fg-0)",outline:"none",fontSize:11.5,flex:1,fontFamily:"var(--font-mono), monospace"}})]}),flush:!0,children:0===c.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"Loading configuration…"})}):0===Object.keys(d).length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No settings match"})}):Object.entries(d).map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)(p,{label:t}),n.map(e=>(0,a.jsx)(f,{entry:e},e.key))]},t)})})]})}function g(){return(0,a.jsx)(m,{})}},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:r="",children:l,...o}=e,c=["btn"];return n&&c.push(n),i&&c.push(i),r&&c.push(r),(0,a.jsxs)("button",{className:c.join(" "),...o,children:[t&&(0,a.jsx)(s.I,{name:t}),l]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3067)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[666],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var s=n(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=a[t];return r?(0,s.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function s(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,s=await fetch(n);if(!s.ok)throw Error("API error ".concat(s.status,": ").concat(e));return s.json()}function a(){return s("/api/projects")}function i(e){return s("/api/overview",e)}function l(e){return s("/api/token-ledger",e)}function r(e){return s("/api/file-index",e)}function c(e){return s("/api/scheduler",e)}function o(e){return s("/api/learning-memory",e)}function d(e){return s("/api/action-log",e)}function h(e){return s("/api/bugs",e)}function u(e){return s("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function v(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function p(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function y(){return s("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function k(){return s("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return s("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function T(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return s("/api/wiki".concat(n?"?".concat(n):""))}function L(e){return s("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function I(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function H(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:I(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>T,Aq:()=>S,D:()=>C,Dz:()=>y,EP:()=>i,FW:()=>w,G1:()=>z,Gs:()=>k,Iw:()=>V,MP:()=>h,On:()=>P,P:()=>v,Vo:()=>l,WH:()=>O,Z4:()=>f,ZN:()=>L,ab:()=>M,co:()=>o,e2:()=>c,fX:()=>g,hD:()=>p,hY:()=>u,jm:()=>b,kH:()=>N,p4:()=>H,pu:()=>d,tf:()=>D,vj:()=>a,vo:()=>j,xl:()=>r,yJ:()=>x,yP:()=>m})},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(5155);function a(e){let{title:t,sub:n,tools:a,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,s.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,s.jsx)("h3",{children:t}):t),null!=n&&(0,s.jsx)("span",{className:"sub",children:n}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>s});let s=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,s)=>e({tasks:t,taskDefinitions:n,deadLetters:s}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var s=n(5155);function a(e){let{on:t,onChange:n,className:a="",ariaLabel:i}=e;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,className:"toggle ".concat(t?"on":""," ").concat(a).trim(),onClick:()=>null==n?void 0:n(!t)})}},4940:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var s=n(5155),a=n(2115),i=n(3928),l=n(3742),r=n(7125),c=n(6845),o=n(4239),d=n(7e3),h=n(2327);function u(){var e,t,n;let u=(0,i.f)(e=>e.overview),m=(0,i.f)(e=>e.health),[v,f]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),j=null!=(n=null==u||null==(e=u.daemon)?void 0:e.running)&&n,M=null==u||null==(t=u.daemon)?void 0:t.pid,y=j&&(null==m?void 0:m.uptimeMs)?(0,d.Y0)(m.uptimeMs):"—";async function x(e,t){f(e),g(null);try{let s=await t();if(!s.success){var n;g(null!=(n=s.error)?n:"Failed to ".concat(e," daemon"))}}catch(e){g(e instanceof Error?e.message:String(e))}finally{f(null)}}return(0,s.jsxs)("div",{className:"page",style:{maxWidth:1100},children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title row tight",children:(0,s.jsx)("span",{children:"Daemon"})}),(0,s.jsx)("p",{className:"page-sub",children:"Background process — runs scheduled tasks, listens for hook events, pushes live updates"})]}),(0,s.jsx)("div",{className:"page-actions",children:j?(0,s.jsx)(c.t,{icon:"stop",variant:"danger",disabled:null!==v,onClick:()=>x("stop",h.vo),children:"stop"===v?"Stopping…":"Stop daemon"}):(0,s.jsx)(c.t,{icon:"play",variant:"primary",disabled:null!==v,onClick:()=>x("start",h.fX),children:"start"===v?"Starting…":"Start daemon"})})]}),p&&(0,s.jsxs)("div",{className:"kpi",style:{marginBottom:14,borderColor:"var(--danger, #c33)"},children:[(0,s.jsx)("div",{className:"label",style:{color:"var(--danger, #c33)"},children:"Error"}),(0,s.jsx)("div",{className:"value",style:{fontSize:13},children:p})]}),(0,s.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Status"}),(0,s.jsxs)("div",{className:"value",style:{display:"flex",alignItems:"center",gap:6,fontSize:16},children:[(0,s.jsx)("span",{className:"pulse",style:{width:8,height:8,borderRadius:4,background:j?"var(--accent)":"var(--fg-3)"}}),j?"Online":"Offline"]}),(0,s.jsx)("div",{className:"delta",children:j?M?"pid ".concat(M):"running":"run: mink daemon start"})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Uptime"}),(0,s.jsx)("div",{className:"value mono",children:y})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Heartbeat"}),(0,s.jsx)("div",{className:"value mono",children:j?"5.0s":"—"}),(0,s.jsx)("div",{className:"delta",children:j?"healthy":"paused"})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Hook wiring"}),(0,s.jsx)("div",{className:"value",style:{fontSize:16},children:j?"6 events":"—"}),(0,s.jsx)("div",{className:"delta",children:".claude/settings.json"})]})]}),(0,s.jsxs)("div",{className:"grid g-2",children:[(0,s.jsx)(l.Z,{title:"Controls",children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Auto-restart on failure"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"max 5 attempts, backoff 30s"})]}),(0,s.jsx)(o.l,{on:!0})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Boot on system login"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"launchd / systemd user service"})]}),(0,s.jsx)(o.l,{on:!1})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Verbose logging"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"log level: debug"})]}),(0,s.jsx)(o.l,{on:!1})]}),(0,s.jsx)("div",{className:"divider"}),(0,s.jsxs)("div",{className:"row tight",style:{flexWrap:"wrap"},children:[(0,s.jsx)(c.t,{size:"sm",icon:"refresh",disabled:null!==v||!j,onClick:()=>x("restart",h.ab),children:"restart"===v?"Restarting…":"Restart"}),(0,s.jsx)(c.t,{size:"sm",variant:"ghost",icon:"eye",disabled:!0,children:"Open log file"}),(0,s.jsx)(c.t,{size:"sm",variant:"ghost",icon:"download",disabled:!0,children:"Dump state"})]})]})}),(0,s.jsx)(l.Z,{title:"Hook integration",sub:".claude/settings.json",flush:!0,children:(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Event"}),(0,s.jsx)("th",{children:"Command"}),(0,s.jsx)("th",{children:"Purpose"}),(0,s.jsx)("th",{children:"Status"})]})}),(0,s.jsx)("tbody",{children:[["SessionStart","mink session-start","Create fresh session state"],["Stop","mink session-stop","Finalize session, calculate savings"],["PreToolUse (Read)","mink pre-read","Check file index, warn on repeats"],["PostToolUse (Read)","mink post-read","Track read, estimate tokens"],["PreToolUse (Write)","mink pre-write","Enforce learned rules, surface bugs"],["PostToolUse (Write)","mink post-write","Log write, update file index"]].map(e=>{let[t,n,a]=e;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"mono strong",children:t}),(0,s.jsx)("td",{className:"mono muted",children:n}),(0,s.jsx)("td",{children:a}),(0,s.jsx)("td",{children:(0,s.jsx)(r.v,{tone:j?"accent":"",children:j?"wired":"—"})})]},t)})})]})})]})]})}function m(){return(0,s.jsx)(u,{})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var s=n(2115);let a=e=>{let t,n=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,i={setState:s,getState:a,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(s,a,i);return i},i=e=>{let t=(e=>e?a(e):a)(e),n=e=>(function(e,t=e=>e){let n=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var s=n(5155),a=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,s.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,s.jsx)(a.I,{name:t}),r]})}},7e3:(e,t,n)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function a(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/60),s=Math.floor(n/60);return s>0?s+"h "+n%60+"m":n>0?n+"m "+t%60+"s":t+"s"}function i(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}n.d(t,{Y0:()=>a,aT:()=>s,r6:()=>i})},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var s=n(5155);function a(e){let{tone:t="",children:n,className:a=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:n})}},8105:(e,t,n)=>{Promise.resolve().then(n.bind(n,4940))}},e=>{e.O(0,[441,255,358],()=>e(e.s=8105)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[116],{3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>l,ZB:()=>o,Zp:()=>r,aR:()=>i});var a=s(5155);s(2115);var n=s(5016);function r(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,n.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",t),...s})}function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",t),...s})}},3928:(e,t,s)=>{"use strict";s.d(t,{f:()=>a});let a=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,s)=>e({projects:t,activeProjectId:s}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var s;return e({ledger:t,wasteFlags:null!=(s=t.wasteFlags)?s:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,s,a)=>e({tasks:t,taskDefinitions:s,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4987:(e,t,s)=>{Promise.resolve().then(s.bind(s,6185))},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(2821),n=s(5889);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}},6185:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var a=s(5155),n=s(2115),r=s(3928),i=s(3209),o=s(7812),l=s(5229),d=s(6405),c=s(5016);function u(e){let{...t}=e;return(0,a.jsx)(d.bL,{"data-slot":"dialog",...t})}function g(e){let{...t}=e;return(0,a.jsx)(d.ZL,{"data-slot":"dialog-portal",...t})}function x(e){let{className:t,...s}=e;return(0,a.jsx)(d.hJ,{"data-slot":"dialog-overlay",className:(0,c.cn)("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...s})}function v(e){let{className:t,children:s,showCloseButton:n=!0,...r}=e;return(0,a.jsxs)(g,{"data-slot":"dialog-portal",children:[(0,a.jsx)(x,{}),(0,a.jsxs)(d.UC,{"data-slot":"dialog-content",className:(0,c.cn)("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...r,children:[s,n&&(0,a.jsxs)(d.bm,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(l.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)(d.hE,{"data-slot":"dialog-title",className:(0,c.cn)("text-lg leading-none font-semibold",t),...s})}(0,s(3101).F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var f=s(8122),h=s(7e3),p=s(2196);function b(){let e=(0,r.f)(e=>e.designImages),t=(0,r.f)(e=>e.connected),[s,l]=(0,n.useState)(null);return t||0!==e.length?0===e.length?(0,a.jsx)(i.Zp,{children:(0,a.jsx)(i.Wu,{className:"py-8",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(p.A,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No design captures yet. Run: mink designqc"})]})})}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(p.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsxs)("span",{className:"text-sm text-muted-foreground",children:[e.length," captures"]})]}),(0,a.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map((e,t)=>(0,a.jsxs)(i.Zp,{className:"cursor-pointer overflow-hidden transition-shadow hover:shadow-lg",onClick:()=>l(e),children:[(0,a.jsx)("div",{className:"aspect-video bg-muted relative",children:(0,a.jsx)("img",{src:e.url,alt:"".concat(e.route," - ").concat(e.viewport),className:"h-full w-full object-cover",loading:"lazy"})}),(0,a.jsxs)(i.Wu,{className:"py-2 px-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-mono truncate",children:e.route}),(0,a.jsx)(o.E,{variant:"outline",className:"text-[10px]",children:e.viewport})]}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1",children:(0,h.r6)(e.timestamp)})]})]},t))}),(0,a.jsx)(u,{open:null!==s,onOpenChange:e=>!e&&l(null),children:(0,a.jsxs)(v,{className:"max-w-4xl",children:[(0,a.jsx)(m,{className:"sr-only",children:"Design Capture"}),s&&(0,a.jsxs)("div",{children:[(0,a.jsx)("img",{src:s.url,alt:"".concat(s.route," - ").concat(s.viewport),className:"w-full rounded-md"}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm font-mono",children:s.route}),(0,a.jsx)(o.E,{variant:"outline",className:"ml-2 text-[10px]",children:s.viewport}),(0,a.jsxs)(o.E,{variant:"secondary",className:"ml-1 text-[10px]",children:["Section ",s.section]})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,h.r6)(s.timestamp)})]})]})]})})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(f.E,{className:"h-8 w-48"}),(0,a.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((e,t)=>(0,a.jsx)(f.E,{className:"h-48"},t))})]})}function j(){return(0,a.jsx)(b,{})}},7e3:(e,t,s)=>{"use strict";function a(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function n(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),s=Math.floor(t/60),a=Math.floor(s/60);return a>0?a+"h "+s%60+"m":s>0?s+"m "+t%60+"s":t+"s"}function r(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}s.d(t,{Y0:()=>n,aT:()=>a,r6:()=>r})},7812:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var a=s(5155);s(2115);var n=s(3101),r=s(2467),i=s(5016);let o=(0,n.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:s="default",asChild:n=!1,...l}=e,d=n?r.bL:"span";return(0,a.jsx)(d,{"data-slot":"badge","data-variant":s,className:(0,i.cn)(o({variant:s}),t),...l})}},8122:(e,t,s)=>{"use strict";s.d(t,{E:()=>r});var a=s(5155),n=s(5016);function r(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,n.cn)("animate-pulse rounded-md bg-accent",t),...s})}}},e=>{e.O(0,[738,926,441,255,358],()=>e(e.s=4987)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[670],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>l});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function l(e){let{name:t,size:n=14,stroke:l=1.7,className:i=""}=e,r=s[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(i).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function l(e){return a("/api/overview",e)}function i(e){return a("/api/token-ledger",e)}function r(e){return a("/api/file-index",e)}function c(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function h(e){return a("/api/bugs",e)}function u(e){return a("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function v(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function g(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function f(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function M(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function S(){return a("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return a("/api/channel")}async function O(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function P(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function C(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function L(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function T(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function H(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:T(t),body:JSON.stringify({content:e})})).json()}async function R(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>C,Aq:()=>k,D:()=>I,Dz:()=>M,EP:()=>l,FW:()=>w,G1:()=>z,Gs:()=>S,Iw:()=>V,MP:()=>h,On:()=>O,P:()=>p,Vo:()=>i,WH:()=>P,Z4:()=>v,ZN:()=>L,ab:()=>j,co:()=>o,e2:()=>c,fX:()=>f,hD:()=>g,hY:()=>u,jm:()=>b,kH:()=>N,p4:()=>H,pu:()=>d,tf:()=>R,vj:()=>s,vo:()=>y,xl:()=>r,yJ:()=>x,yP:()=>m})},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:l,className:i="",style:r,children:c}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(l?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var a=n(5155);function s(e){let{on:t,onChange:n,className:s="",ariaLabel:l}=e;return(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":l,className:"toggle ".concat(t?"on":""," ").concat(s).trim(),onClick:()=>null==n?void 0:n(!t)})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>i});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,l={setState:a,getState:s,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(a,s,l);return l},l=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},i=e=>e?l(e):l},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>l});var a=n(5155),s=n(1044);function l(e){let{icon:t,variant:n,size:l,className:i="",children:r,...c}=e,o=["btn"];return n&&o.push(n),l&&o.push(l),i&&o.push(i),(0,a.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,a.jsx)(s.I,{name:t}),r]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}},7957:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var a=n(5155),s=n(2115),l=n(3742),i=n(7125),r=n(6845),c=n(4239),o=n(3928),d=n(2327);function h(){var e;let t=(0,o.f)(e=>e.channel),n=(0,o.f)(e=>e.setChannel),[h,u]=(0,s.useState)(null),[m,p]=(0,s.useState)(null),[v,g]=(0,s.useState)(""),f=(0,s.useRef)(null);if((0,s.useEffect)(()=>{if(!t||"running"!==t.status)return;let e=setInterval(()=>{(0,d.G1)().then(n).catch(()=>{})},4e3);return()=>clearInterval(e)},[null==t?void 0:t.status,n,t]),!t)return(0,a.jsx)("div",{className:"page",children:(0,a.jsx)(l.Z,{title:"Discord channel",children:(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"Loading…"})})})});let y="running"===t.status;async function j(e,t){u(e),p(null);try{var n;let a=await t();a.success||p(null!=(n=a.error)?n:"Failed to ".concat(e))}catch(e){p(e instanceof Error?e.message:String(e))}finally{u(null)}}function M(e){p(null),(0,d.yJ)("channel.discord.allowlist",e.join(",")).then(e=>{var t;e.success||p(null!=(t=e.error)?t:"Failed to save allowlist")}).catch(e=>p(e instanceof Error?e.message:String(e)))}function x(){var e;let n=v.trim();if(n){if(t.allowlist.includes(n))return void g("");M([...t.allowlist,n]),g(""),null==(e=f.current)||e.focus()}}return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title row tight",children:(0,a.jsx)("span",{children:"Discord channel"})}),(0,a.jsx)("p",{className:"page-sub",children:"DM your bot to capture, search, and summarize your wiki from anywhere"})]}),(0,a.jsx)("div",{className:"page-actions",children:y?(0,a.jsx)(r.t,{icon:"stop",variant:"danger",disabled:null!==h,onClick:()=>j("stop",d.WH),children:"stop"===h?"Stopping…":"Stop channel"}):(0,a.jsx)(r.t,{icon:"play",variant:"primary",disabled:null!==h,onClick:()=>j("start",d.On),children:"start"===h?"Starting…":"Start channel"})})]}),m&&(0,a.jsxs)("div",{className:"kpi",style:{marginBottom:14,borderColor:"var(--danger, #c33)"},children:[(0,a.jsx)("div",{className:"label",style:{color:"var(--danger, #c33)"},children:"Error"}),(0,a.jsx)("div",{className:"value",style:{fontSize:12,whiteSpace:"pre-wrap"},children:m})]}),(0,a.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Status"}),(0,a.jsxs)("div",{className:"value",style:{fontSize:14,display:"flex",alignItems:"center",gap:6},children:[(0,a.jsx)("span",{className:"pulse",style:{width:8,height:8,borderRadius:4,background:y?"var(--accent)":"var(--fg-3)"}}),y?"Running":"Stopped"]}),(0,a.jsx)("div",{className:"delta",children:t.session||"—"})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Uptime"}),(0,a.jsx)("div",{className:"value mono",children:function(e){if(!e)return"—";let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),a=Math.floor(e%3600/60);return t>0?"".concat(t,"d ").concat(String(n).padStart(2,"0"),"h"):n>0?"".concat(n,"h ").concat(String(a).padStart(2,"0"),"m"):"".concat(a,"m ").concat(String(e%60).padStart(2,"0"),"s")}(t.uptimeSec)})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Platform"}),(0,a.jsx)("div",{className:"value mono",children:null!=(e=t.platform)?e:"—"})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Allowlist"}),(0,a.jsx)("div",{className:"value mono",children:t.allowlist.length})]})]}),(0,a.jsxs)("div",{className:"grid g-2",children:[(0,a.jsx)(l.Z,{title:"Configuration",children:(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Bot token"}),(0,a.jsx)("input",{value:t.tokenMasked||"(not set)",className:"mono",readOnly:!0})]}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Sender allowlist"}),(0,a.jsxs)("div",{className:"row tight",style:{flexWrap:"wrap",gap:6},children:[0===t.allowlist.length&&(0,a.jsx)("span",{className:"muted",style:{fontSize:11},children:"no entries yet"}),t.allowlist.map(e=>(0,a.jsxs)("span",{className:"row tight",style:{gap:4},children:[(0,a.jsx)(i.v,{tone:"accent",children:e}),(0,a.jsx)("button",{type:"button",onClick:()=>{M(t.allowlist.filter(t=>t!==e))},style:{background:"transparent",border:0,color:"var(--fg-3)",cursor:"pointer",fontSize:11},"aria-label":"Remove ".concat(e),children:"\xd7"})]},e))]}),(0,a.jsxs)("div",{className:"row tight",style:{marginTop:6,gap:6},children:[(0,a.jsx)("input",{ref:f,value:v,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&x(),placeholder:"discord user id or name#tag",className:"mono",style:{flex:1,background:"var(--bg-inset)",border:"1px solid var(--line-1)",borderRadius:5,padding:"4px 8px",color:"var(--fg-0)",fontSize:11,outline:"none"}}),(0,a.jsx)(r.t,{size:"sm",variant:"ghost",icon:"plus",onClick:x,disabled:!v.trim(),children:"Add"})]})]}),(0,a.jsxs)("div",{className:"row",style:{padding:"4px 0"},children:[(0,a.jsxs)("div",{style:{flex:1},children:[(0,a.jsx)("div",{style:{fontSize:12,color:"var(--fg-0)"},children:"Auto-start on daemon"}),(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:"channel.discord.enabled"})]}),(0,a.jsx)(c.l,{on:t.autoStart,onChange:function(e){p(null),(0,d.yJ)("channel.discord.enabled",e?"true":"false").catch(e=>p(e instanceof Error?e.message:String(e)))}})]}),(0,a.jsx)("div",{className:"row tight",style:{marginTop:6},children:(0,a.jsx)(r.t,{size:"sm",icon:"refresh",disabled:null!==h||!y,onClick:()=>j("restart",d.$Z),children:"restart"===h?"Restarting…":"Restart"})})]})}),(0,a.jsx)(l.Z,{title:"Session logs",sub:y?"live hardcopy":"session not running",tools:y?(0,a.jsxs)("span",{className:"chip accent mono",style:{gap:5},children:[(0,a.jsx)("span",{style:{width:5,height:5,borderRadius:3,background:"var(--accent)"}}),"live"]}):void 0,flush:!0,children:(0,a.jsx)("div",{style:{padding:"10px 12px",maxHeight:320,overflowY:"auto"},children:0===t.logs.length?(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:y?"No log output captured yet.":"Start the channel to see live logs."}):t.logs.map((e,t)=>(0,a.jsxs)("div",{style:{display:"flex",gap:10,padding:"3px 0",fontFamily:"var(--font-mono), monospace",fontSize:11},children:[e.t&&(0,a.jsx)("span",{className:"muted",style:{minWidth:56},children:e.t}),(0,a.jsx)("span",{style:{color:"var(--fg-1)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.m})]},"".concat(t,"-").concat(e.t,"-").concat(e.m.slice(0,20))))})})]})]})}function u(){return(0,a.jsx)(h,{})}},8763:(e,t,n)=>{Promise.resolve().then(n.bind(n,7957))}},e=>{e.O(0,[441,255,358],()=>e(e.s=8763)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[837],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=s[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function l(e){return a("/api/token-ledger",e)}function r(e){return a("/api/file-index",e)}function c(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function h(e){return a("/api/bugs",e)}function u(e){return a("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function v(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function p(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function y(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function S(){return a("/api/sync")}async function N(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function b(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return a("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function T(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function I(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function L(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function C(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function D(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:C(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:C(t),body:JSON.stringify({content:e})})).json()}async function H(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:C(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>I,Aq:()=>k,D:()=>O,Dz:()=>y,EP:()=>i,FW:()=>w,G1:()=>z,Gs:()=>S,Iw:()=>V,MP:()=>h,On:()=>P,P:()=>f,Vo:()=>l,WH:()=>T,Z4:()=>v,ZN:()=>L,ab:()=>j,co:()=>o,e2:()=>c,fX:()=>M,hD:()=>p,hY:()=>u,jm:()=>N,kH:()=>b,p4:()=>D,pu:()=>d,tf:()=>H,vj:()=>s,vo:()=>g,xl:()=>r,yJ:()=>x,yP:()=>m})},3512:(e,t,n)=>{Promise.resolve().then(n.bind(n,9691))},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,a.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,a.jsx)(s.I,{name:t}),r]})}},7e3:(e,t,n)=>{"use strict";function a(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function s(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/60),a=Math.floor(n/60);return a>0?a+"h "+n%60+"m":n>0?n+"m "+t%60+"s":t+"s"}function i(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}n.d(t,{Y0:()=>s,aT:()=>a,r6:()=>i})},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}},9691:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(5155),s=n(2115),i=n(3928),l=n(3742),r=n(7125),c=n(6845),o=n(1044),d=n(2327),h=n(7e3);function u(e){let t=new Date(e).getTime();if(!t)return"cold";let n=(Date.now()-t)/36e5;return n<1?"hot":n<24?"fresh":n<336?"stale":"cold"}function m(e){return"hot"===e?"accent":"fresh"===e?"":"stale"===e?"amber":"red"}function f(){var e;let t=(0,i.f)(e=>e.fileIndex),n=(0,i.f)(e=>e.activeProjectId),[f,v]=(0,s.useState)(""),[p,M]=(0,s.useState)(null),[g,j]=(0,s.useState)(!1),y=(0,s.useMemo)(()=>{let e=null==t?void 0:t.entries;return Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[]},[t]),x=(0,s.useMemo)(()=>{if(!f)return y;let e=f.toLowerCase();return y.filter(t=>{var n;return t.filePath.toLowerCase().includes(e)||(null!=(n=t.description)?n:"").toLowerCase().includes(e)})},[y,f]),w=y.find(e=>{var t;return e.filePath===(null!=p?p:null==(t=x[0])?void 0:t.filePath)});async function S(){j(!0);try{await (0,d.hD)(null!=n?n:void 0)}finally{j(!1)}}return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title",children:"File index"}),(0,a.jsxs)("p",{className:"page-sub",children:[y.length," files indexed \xb7 last rescan"," ",(null==t||null==(e=t.header)?void 0:e.lastScanTimestamp)?(0,h.r6)(t.header.lastScanTimestamp):"—"]})]}),(0,a.jsx)("div",{className:"page-actions",children:(0,a.jsx)(c.t,{icon:"refresh",onClick:S,disabled:g,children:g?"Rescanning…":"Rescan"})})]}),(0,a.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"1fr 360px",gap:14},children:[(0,a.jsx)(l.Z,{title:(0,a.jsxs)("div",{className:"row",style:{width:"100%"},children:[(0,a.jsx)("span",{children:"All files"}),(0,a.jsxs)("div",{className:"row",style:{marginLeft:12,flex:1,maxWidth:300},children:[(0,a.jsx)(o.I,{name:"search",size:12,className:"muted"}),(0,a.jsx)("input",{value:f,onChange:e=>v(e.target.value),placeholder:"Filter by path or description…","aria-label":"Filter files",style:{flex:1,background:"transparent",border:0,color:"var(--fg-0)",fontSize:11.5,outline:"none",fontFamily:"var(--font-mono), monospace"}})]})]}),flush:!0,children:0===x.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No files match"})}):(0,a.jsx)("div",{style:{maxHeight:560,overflow:"auto"},children:(0,a.jsxs)("table",{className:"tbl",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Path"}),(0,a.jsx)("th",{children:"Description"}),(0,a.jsx)("th",{className:"right",children:"Tokens"}),(0,a.jsx)("th",{className:"right",children:"Seen"}),(0,a.jsx)("th",{children:"State"})]})}),(0,a.jsx)("tbody",{children:x.map(e=>{var t,n;let s=u(e.lastIndexed),i=(null!=p?p:null==(t=x[0])?void 0:t.filePath)===e.filePath;return(0,a.jsxs)("tr",{onClick:()=>M(e.filePath),style:{cursor:"pointer",background:i?"var(--bg-2)":void 0},children:[(0,a.jsx)("td",{className:"mono",style:{fontSize:11},children:e.filePath}),(0,a.jsx)("td",{className:"muted",style:{maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.description||"—"}),(0,a.jsx)("td",{className:"right num muted",children:(n=e.estimatedTokens)>=1e3?"".concat((n/1e3).toFixed(1),"k tok"):"".concat(n," tok")}),(0,a.jsx)("td",{className:"right num muted",children:function(e){let t=new Date(e).getTime();if(!t)return"—";let n=Date.now()-t,a=n/36e5;return a<1?"".concat(Math.round(n/6e4),"m"):a<24?"".concat(Math.round(a),"h"):"".concat(Math.round(a/24),"d")}(e.lastIndexed)}),(0,a.jsx)("td",{children:(0,a.jsx)(r.v,{tone:m(s),children:s})})]},e.filePath)})})]})})}),(0,a.jsx)(l.Z,{title:"File details",sub:w?u(w.lastIndexed):"—",children:w?(0,a.jsxs)("div",{className:"vstack",style:{gap:10},children:[(0,a.jsx)("div",{className:"mono",style:{fontSize:12,color:"var(--fg-0)",wordBreak:"break-all"},children:w.filePath}),(0,a.jsxs)("div",{className:"inset",children:[(0,a.jsx)("div",{className:"c",children:"// description"}),w.description||"no description"]}),(0,a.jsxs)("div",{className:"grid g-2",style:{gap:8},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"muted",style:{fontSize:10},children:"TOKENS"}),(0,a.jsx)("div",{className:"mono strong",children:(0,h.aT)(w.estimatedTokens)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"muted",style:{fontSize:10},children:"LAST INDEXED"}),(0,a.jsx)("div",{className:"mono strong",children:(0,h.r6)(w.lastIndexed)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"muted",style:{fontSize:10},children:"LAST MODIFIED"}),(0,a.jsx)("div",{className:"mono strong",children:(0,h.r6)(w.lastModified)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"muted",style:{fontSize:10},children:"STATE"}),(0,a.jsx)(r.v,{tone:m(u(w.lastIndexed)),children:u(w.lastIndexed)})]})]})]}):(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("div",{children:"Select a file to see details"})})})]})]})}function v(){return(0,a.jsx)(f,{})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3512)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[171],{1617:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(5155),r=s(3928),n=s(3209),i=s(7812),l=s(8122),d=s(7e3),c=s(814);let o=(0,c.A)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),u=(0,c.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function g(){let e=(0,r.f)(e=>e.wasteFlags);if(!(0,r.f)(e=>e.ledger))return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(l.E,{className:"h-8 w-48"}),(0,a.jsx)(l.E,{className:"h-32"})]});let t=e.reduce((e,t)=>e+t.estimatedTokensWasted,0);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(o,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"Active Flags:"}),(0,a.jsx)("span",{className:"font-medium",children:e.length})]}),t>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Est. Tokens Wasted:"})," ",(0,a.jsx)("span",{className:"font-medium text-destructive",children:(0,d.aT)(t)})]})]}),0===e.length?(0,a.jsx)(n.Zp,{children:(0,a.jsx)(n.Wu,{className:"py-8",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(o,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No waste patterns detected. Run waste detection to analyze token usage."})]})})}):(0,a.jsx)("div",{className:"space-y-3",children:e.map((e,t)=>(0,a.jsxs)(n.Zp,{children:[(0,a.jsx)(n.aR,{className:"pb-2",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)(n.ZB,{className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(u,{className:"h-4 w-4 text-yellow-500"}),function(e){switch(e){case"repeated-reads":return"Repeated Reads";case"missed-index-opportunity":return"Missed Index";case"action-log-bloat":return"Log Bloat";case"learning-memory-staleness":return"Stale Memory";case"index-miss-rate":return"High Miss Rate";default:return e}}(e.pattern)]}),(0,a.jsxs)(i.E,{variant:"destructive",className:"text-[10px]",children:["~",(0,d.aT)(e.estimatedTokensWasted)," wasted"]})]})}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsx)("p",{className:"text-sm",children:e.description}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:e.suggestion})]})]},t))})]})}function m(){return(0,a.jsx)(g,{})}},3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>d,ZB:()=>l,Zp:()=>n,aR:()=>i});var a=s(5155);s(2115);var r=s(5016);function n(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...s})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...s})}},3928:(e,t,s)=>{"use strict";s.d(t,{f:()=>a});let a=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,s)=>e({projects:t,activeProjectId:s}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var s;return e({ledger:t,wasteFlags:null!=(s=t.wasteFlags)?s:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,s,a)=>e({tasks:t,taskDefinitions:s,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var a=s(2821),r=s(5889);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}},7e3:(e,t,s)=>{"use strict";function a(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function r(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),s=Math.floor(t/60),a=Math.floor(s/60);return a>0?a+"h "+s%60+"m":s>0?s+"m "+t%60+"s":t+"s"}function n(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}s.d(t,{Y0:()=>r,aT:()=>a,r6:()=>n})},7812:(e,t,s)=>{"use strict";s.d(t,{E:()=>d});var a=s(5155);s(2115);var r=s(3101),n=s(2467),i=s(5016);let l=(0,r.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function d(e){let{className:t,variant:s="default",asChild:r=!1,...d}=e,c=r?n.bL:"span";return(0,a.jsx)(c,{"data-slot":"badge","data-variant":s,className:(0,i.cn)(l({variant:s}),t),...d})}},8022:(e,t,s)=>{Promise.resolve().then(s.bind(s,1617))},8122:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var a=s(5155),r=s(5016);function n(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("animate-pulse rounded-md bg-accent",t),...s})}}},e=>{e.O(0,[738,441,255,358],()=>e(e.s=8022)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[120],{35:(e,l,s)=>{Promise.resolve().then(s.bind(s,2462))},1044:(e,l,s)=>{"use strict";s.d(l,{I:()=>n});var t=s(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:l,size:s=14,stroke:n=1.7,className:i=""}=e,r=a[l];return r?(0,t.jsx)("svg",{className:"icn ".concat(i).trim(),width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:r})}):null}},2462:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>d});var t=s(5155),a=s(2115),n=s(3928),i=s(3742),r=s(6845),c=s(1044);let o=[{key:"User Preferences",tabLabel:"Preferences",title:"Preferences",sub:"How the human likes to work"},{key:"Key Learnings",tabLabel:"Learnings",title:"Learnings",sub:"Facts discovered this project"},{key:"Do-Not-Repeat",tabLabel:"Do-not-repeat",title:"Do-not-repeat",sub:"Mistakes already corrected"},{key:"Decision Log",tabLabel:"Decisions",title:"Decision log",sub:"Committed project decisions"}];function h(){var e,l,s;let h=(0,n.f)(e=>e.learningMemory),[d,u]=(0,a.useState)("User Preferences"),M=null!=(e=null==h?void 0:h.sections)?e:{},v=null!=(l=o.find(e=>e.key===d))?l:o[0],m=null!=(s=M[v.key])?s:[];return(0,t.jsxs)("div",{className:"page",children:[(0,t.jsxs)("div",{className:"page-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"page-title",children:"Learning memory"}),(0,t.jsxs)("p",{className:"page-sub",children:["4-section knowledge store \xb7 ",(null==h?void 0:h.projectName)||"—"]})]}),(0,t.jsx)("div",{className:"page-actions",children:(0,t.jsx)(r.t,{icon:"plus",variant:"primary",disabled:!0,title:"Write endpoint coming soon",children:"Add rule"})})]}),(0,t.jsx)("div",{className:"grid g-4",style:{marginBottom:14},children:o.map(e=>{var l;let s=(null!=(l=M[e.key])?l:[]).length;return(0,t.jsxs)("button",{type:"button",className:"kpi",style:{cursor:"pointer",borderColor:d===e.key?"var(--accent)":void 0,textAlign:"left"},onClick:()=>u(e.key),children:[(0,t.jsx)("div",{className:"label",children:e.title}),(0,t.jsx)("div",{className:"value mono",children:s}),(0,t.jsx)("div",{className:"delta",children:e.sub})]},e.key)})}),(0,t.jsx)(i.Z,{title:v.title,sub:v.sub,tools:(0,t.jsxs)("div",{className:"row tight",children:[(0,t.jsx)(r.t,{size:"sm",icon:"search",variant:"ghost",disabled:!0,children:"Search"}),(0,t.jsx)(r.t,{size:"sm",icon:"download",variant:"ghost",disabled:!0,children:"Export"})]}),flush:!0,children:0===m.length?(0,t.jsxs)("div",{className:"empty",children:[(0,t.jsx)("h4",{children:"No entries yet"}),(0,t.jsx)("span",{children:"rules will appear here as Claude learns from your sessions."})]}):(0,t.jsxs)("table",{className:"tbl",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"#"}),(0,t.jsx)("th",{children:"Rule"}),(0,t.jsx)("th",{})]})}),(0,t.jsx)("tbody",{children:m.map((e,l)=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"mono muted",style:{width:40},children:l+1}),(0,t.jsx)("td",{children:e}),(0,t.jsx)("td",{className:"right",children:(0,t.jsx)("div",{className:"row tight",style:{justifyContent:"flex-end"},children:(0,t.jsx)("button",{type:"button",className:"tb-icon-btn","aria-label":"Preview rule",title:"Preview",children:(0,t.jsx)(c.I,{name:"eye",size:12})})})})]},"".concat(v.key,"-").concat(l)))})]})})]})}function d(){return(0,t.jsx)(h,{})}},3742:(e,l,s)=>{"use strict";s.d(l,{Z:()=>a});var t=s(5155);function a(e){let{title:l,sub:s,tools:a,flush:n,className:i="",style:r,children:c}=e,o=null!=l||null!=a;return(0,t.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[o&&(0,t.jsxs)("div",{className:"card-head",children:[null!=l&&("string"==typeof l?(0,t.jsx)("h3",{children:l}):l),null!=s&&(0,t.jsx)("span",{className:"sub",children:s}),null!=a&&(0,t.jsx)("div",{className:"tools",children:a})]}),(0,t.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,l,s)=>{"use strict";s.d(l,{f:()=>t});let t=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:l=>e({connected:l}),setProjects:(l,s)=>e({projects:l,activeProjectId:s}),setActiveProject:l=>e({activeProjectId:l,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:l=>e({overview:l}),setLedger:l=>{var s;return e({ledger:l,wasteFlags:null!=(s=l.wasteFlags)?s:[]})},setFileIndex:l=>e({fileIndex:l}),setScheduler:(l,s,t)=>e({tasks:l,taskDefinitions:s,deadLetters:t}),setHealth:l=>e({health:l}),setLearningMemory:l=>e({learningMemory:l}),setActionLog:l=>e({actionLog:l}),setBugs:l=>e({bugs:l}),setWasteFlags:l=>e({wasteFlags:l}),setDesignImages:l=>e({designImages:l}),setConfig:l=>e({config:l}),setSync:l=>e({sync:l}),setChannel:l=>e({channel:l}),setWiki:l=>e({wiki:l}),setWikiNote:l=>e({wikiNote:l})}))},5959:(e,l,s)=>{"use strict";s.d(l,{v:()=>i});var t=s(2115);let a=e=>{let l,s=new Set,t=(e,t)=>{let a="function"==typeof e?e(l):e;if(!Object.is(a,l)){let e=l;l=(null!=t?t:"object"!=typeof a||null===a)?a:Object.assign({},l,a),s.forEach(s=>s(l,e))}},a=()=>l,n={setState:t,getState:a,getInitialState:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e))},i=l=e(t,a,n);return n},n=e=>{let l=(e=>e?a(e):a)(e),s=e=>(function(e,l=e=>e){let s=t.useSyncExternalStore(e.subscribe,t.useCallback(()=>l(e.getState()),[e,l]),t.useCallback(()=>l(e.getInitialState()),[e,l]));return t.useDebugValue(s),s})(l,e);return Object.assign(s,l),s},i=e=>e?n(e):n},6845:(e,l,s)=>{"use strict";s.d(l,{t:()=>n});var t=s(5155),a=s(1044);function n(e){let{icon:l,variant:s,size:n,className:i="",children:r,...c}=e,o=["btn"];return s&&o.push(s),n&&o.push(n),i&&o.push(i),(0,t.jsxs)("button",{className:o.join(" "),...c,children:[l&&(0,t.jsx)(a.I,{name:l}),r]})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=35)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[161],{264:(e,l,t)=>{Promise.resolve().then(t.bind(t,6258))},1044:(e,l,t)=>{"use strict";t.d(l,{I:()=>a});var s=t(5155);let n={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function a(e){let{name:l,size:t=14,stroke:a=1.7,className:i=""}=e,r=n[l];return r?(0,s.jsx)("svg",{className:"icn ".concat(i).trim(),width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:r})}):null}},3742:(e,l,t)=>{"use strict";t.d(l,{Z:()=>n});var s=t(5155);function n(e){let{title:l,sub:t,tools:n,flush:a,className:i="",style:r,children:o}=e,c=null!=l||null!=n;return(0,s.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[c&&(0,s.jsxs)("div",{className:"card-head",children:[null!=l&&("string"==typeof l?(0,s.jsx)("h3",{children:l}):l),null!=t&&(0,s.jsx)("span",{className:"sub",children:t}),null!=n&&(0,s.jsx)("div",{className:"tools",children:n})]}),(0,s.jsx)("div",{className:"card-body ".concat(a?"flush":"").trim(),children:o})]})}},3928:(e,l,t)=>{"use strict";t.d(l,{f:()=>s});let s=(0,t(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:l=>e({connected:l}),setProjects:(l,t)=>e({projects:l,activeProjectId:t}),setActiveProject:l=>e({activeProjectId:l,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:l=>e({overview:l}),setLedger:l=>{var t;return e({ledger:l,wasteFlags:null!=(t=l.wasteFlags)?t:[]})},setFileIndex:l=>e({fileIndex:l}),setScheduler:(l,t,s)=>e({tasks:l,taskDefinitions:t,deadLetters:s}),setHealth:l=>e({health:l}),setLearningMemory:l=>e({learningMemory:l}),setActionLog:l=>e({actionLog:l}),setBugs:l=>e({bugs:l}),setWasteFlags:l=>e({wasteFlags:l}),setDesignImages:l=>e({designImages:l}),setConfig:l=>e({config:l}),setSync:l=>e({sync:l}),setChannel:l=>e({channel:l}),setWiki:l=>e({wiki:l}),setWikiNote:l=>e({wikiNote:l})}))},5959:(e,l,t)=>{"use strict";t.d(l,{v:()=>i});var s=t(2115);let n=e=>{let l,t=new Set,s=(e,s)=>{let n="function"==typeof e?e(l):e;if(!Object.is(n,l)){let e=l;l=(null!=s?s:"object"!=typeof n||null===n)?n:Object.assign({},l,n),t.forEach(t=>t(l,e))}},n=()=>l,a={setState:s,getState:n,getInitialState:()=>i,subscribe:e=>(t.add(e),()=>t.delete(e))},i=l=e(s,n,a);return a},a=e=>{let l=(e=>e?n(e):n)(e),t=e=>(function(e,l=e=>e){let t=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>l(e.getState()),[e,l]),s.useCallback(()=>l(e.getInitialState()),[e,l]));return s.useDebugValue(t),t})(l,e);return Object.assign(t,l),t},i=e=>e?a(e):a},6258:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>x});var s=t(5155),n=t(2115),a=t(3928),i=t(3742),r=t(9503),o=t(7125),c=t(6845),d=t(6970);function h(e){let{series:l,width:t=720,height:n=180}=e;if(!l.length||!l[0].data.length)return(0,s.jsx)("div",{className:"empty",style:{height:n,display:"grid",placeItems:"center"},children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{children:"No data yet"}),(0,s.jsx)("span",{children:"chart will populate when sessions arrive"})]})});let a=l[0].data.map(e=>e.x),i=1.15*Math.max(...l.flatMap(e=>e.data.map(e=>e.y)))||1,r=t-36-12,o=n-14-24,c=e=>36+(1===a.length?r/2:e/(a.length-1)*r),d=e=>14+o-(e-0)/(i-0||1)*o,h=Array.from({length:5},(e,l)=>{let t=0+(i-0)/4*l;return{v:t,y:d(t)}});return(0,s.jsxs)("svg",{width:t,height:n,style:{display:"block",maxWidth:"100%"},children:[h.map((e,l)=>(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:36,x2:t-12,y1:e.y,y2:e.y,stroke:"var(--line-1)",strokeDasharray:"2 3"}),(0,s.jsxs)("text",{x:30,y:e.y+3,textAnchor:"end",fontSize:"9",fontFamily:"var(--font-mono), monospace",fill:"var(--fg-3)",children:[Math.round(e.v),"k"]})]},l)),a.map((e,l)=>(0,s.jsx)("text",{x:c(l),y:n-6,textAnchor:"middle",fontSize:"9",fontFamily:"var(--font-mono), monospace",fill:"var(--fg-3)",children:e},l)),l.map((e,l)=>{let t=e.data.map((e,l)=>"".concat(0===l?"M":"L").concat(c(l),",").concat(d(e.y))).join(" "),n="".concat(t," L").concat(c(e.data.length-1),",").concat(d(0)," L").concat(c(0),",").concat(d(0)," Z");return(0,s.jsxs)("g",{children:[e.fill&&(0,s.jsx)("path",{d:n,fill:e.color,opacity:"0.12"}),(0,s.jsx)("path",{d:t,fill:"none",stroke:e.color,strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round"}),e.data.map((l,t)=>(0,s.jsx)("circle",{cx:c(t),cy:d(l.y),r:"2",fill:"var(--bg-0)",stroke:e.color,strokeWidth:"1.4"},t))]},l)})]})}var u=t(7e3);function v(e){return e?e.toLocaleString():"0"}function m(){var e,l,t,m,x,g,j,M,f,p,y,k,N,b,z,w,S,L,T,I,H;let V=(0,a.f)(e=>e.overview),D=(0,a.f)(e=>e.ledger),C=(0,a.f)(e=>e.health),F=null==V?void 0:V.summary,W=null!=(p=null==D?void 0:D.sessions)?p:[],A=W.length>0?W[W.length-1]:null,B=(0,n.useMemo)(()=>(function(e){let l=Date.now(),t={},s=[];for(let e=6;e>=0;e--){let n=new Date(l-864e5*e).toLocaleDateString(void 0,{month:"short",day:"numeric"});t[n]={x:n,inT:0,outT:0,saved:0},s.push(n)}for(let l of e){var n,a,i,r,o;let e=function(e){try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch(l){return e.slice(0,10)}}(l.startTimestamp);if(!t[e])continue;let s=null!=(i=null==(n=l.totals)?void 0:n.estimatedTokens)?i:0,c=(null!=(r=null==(a=l.totals)?void 0:a.writeCount)?r:0)*600;t[e].inT+=Math.max(0,s-c),t[e].outT+=c,t[e].saved+=null!=(o=l.estimatedSavings)?o:0}return s.map(e=>t[e])})(W),[W]),E=[{name:"saved",color:"var(--accent)",fill:!0,data:B.map(e=>({x:e.x,y:Math.round(e.saved/1e3)}))},{name:"in",color:"var(--fg-2)",fill:!1,data:B.map(e=>({x:e.x,y:Math.round(e.inT/1e3)}))},{name:"out",color:"var(--fg-3)",fill:!1,data:B.map(e=>({x:e.x,y:Math.round(e.outT/1e3)}))}],O=null!=(y=null==A||null==(e=A.totals)?void 0:e.readCount)?y:0,P=null!=(k=null==A||null==(l=A.totals)?void 0:l.writeCount)?k:0,Z=null!=(N=null==A||null==(t=A.totals)?void 0:t.estimatedTokens)?N:0,_=null!=(b=null==A?void 0:A.estimatedSavings)?b:0,R=A&&!A.endTimestamp;return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Sessions"}),(0,s.jsxs)("p",{className:"page-sub",children:[null!=(z=null==V||null==(m=V.project)?void 0:m.name)?z:"—"," \xb7 ",(null==V||null==(x=V.daemon)?void 0:x.running)?"daemon online \xb7 uptime ".concat((0,u.Y0)(null!=(w=null==C?void 0:C.uptimeMs)?w:0)):"daemon offline"]})]}),(0,s.jsx)("div",{className:"page-actions",children:(0,s.jsx)(c.t,{icon:"refresh",variant:"ghost",onClick:()=>location.reload(),children:"Refresh"})})]}),(0,s.jsxs)(i.Z,{title:(0,s.jsxs)("span",{className:"row tight",children:[(0,s.jsx)("span",{children:R?"Active session":"Most recent session"}),R&&(0,s.jsx)("span",{className:"chip accent mono",children:"● live"})]}),sub:(0,s.jsx)("span",{className:"mono",children:null!=(S=null==A?void 0:A.sessionId)?S:"—"}),children:[(0,s.jsxs)("div",{className:"grid g-4",style:{marginBottom:12},children:[(0,s.jsx)(r.h,{label:"Tokens (session)",value:v(Z),live:!!R}),(0,s.jsx)(r.h,{label:"Reads",value:v(O),live:!!R}),(0,s.jsx)(r.h,{label:"Writes",value:v(P),live:!!R}),(0,s.jsx)(r.h,{label:"Saved",value:v(_),deltaTone:"up",delta:_>0?"▲ vs unassisted":void 0,spark:B.map(e=>Math.round(e.saved/1e3)),sparkTone:"accent",live:!!R})]}),(0,s.jsxs)("div",{className:"grid g-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:10.5,color:"var(--fg-3)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,fontWeight:600},children:"Reads"}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)("span",{className:"mono strong",style:{fontSize:20},children:O}),(0,s.jsx)(d.y,{value:O,max:200})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:10.5,color:"var(--fg-3)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,fontWeight:600},children:"Writes"}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)("span",{className:"mono strong",style:{fontSize:20},children:P}),(0,s.jsx)(d.y,{value:P,max:80})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:10.5,color:"var(--fg-3)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,fontWeight:600},children:"File-index hits"}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)("span",{className:"mono strong",style:{fontSize:20},children:null!=(L=null==A||null==(g=A.totals)?void 0:g.fileIndexHits)?L:0}),(0,s.jsx)(d.y,{value:null!=(T=null==A||null==(j=A.totals)?void 0:j.fileIndexHits)?T:0,max:Math.max(1,(null!=(I=null==A||null==(M=A.totals)?void 0:M.fileIndexHits)?I:0)+(null!=(H=null==A||null==(f=A.totals)?void 0:f.fileIndexMisses)?H:0))})]})]})]})]}),(0,s.jsx)("div",{style:{height:14}}),(0,s.jsxs)("div",{className:"grid g-2",children:[(0,s.jsxs)(i.Z,{title:"Token usage — last 7 days",sub:"in \xb7 out \xb7 saved",children:[(0,s.jsx)(h,{series:E,width:560,height:180}),(0,s.jsxs)("div",{className:"chart-legend",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("i",{style:{background:"var(--accent)"}}),"saved"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("i",{style:{background:"var(--fg-2)"}}),"in"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("i",{style:{background:"var(--fg-3)"}}),"out"]})]})]}),(0,s.jsx)(i.Z,{title:"Lifetime totals",sub:"from token ledger",children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsx)(r.h,{label:"Total sessions",value:v(null==F?void 0:F.totalSessions),className:"kpi"}),(0,s.jsx)(r.h,{label:"Total tokens",value:v(null==F?void 0:F.totalTokens)}),(0,s.jsx)(r.h,{label:"Est. savings",value:v(null==F?void 0:F.estimatedSavings),deltaTone:"up",delta:"▲ lifetime"})]})})]}),(0,s.jsx)("div",{style:{height:14}}),(0,s.jsx)(i.Z,{title:"Session history",sub:"".concat(W.length," sessions"),flush:!0,children:0===W.length?(0,s.jsxs)("div",{className:"empty",children:[(0,s.jsx)("h4",{children:"No sessions recorded yet"}),(0,s.jsx)("span",{children:"start Claude Code in a project with mink hooks to see data."})]}):(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"ID"}),(0,s.jsx)("th",{children:"Started"}),(0,s.jsx)("th",{className:"right",children:"Reads"}),(0,s.jsx)("th",{className:"right",children:"Writes"}),(0,s.jsx)("th",{className:"right",children:"Tokens"}),(0,s.jsx)("th",{className:"right",children:"Saved"})]})}),(0,s.jsx)("tbody",{children:[...W].reverse().slice(0,30).map(e=>{var l,t,n,a,i;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:e.endTimestamp?(0,s.jsx)("span",{className:"muted mono",style:{fontSize:10},children:"done"}):(0,s.jsx)(o.v,{tone:"accent",children:"● live"})}),(0,s.jsx)("td",{className:"mono",children:e.sessionId}),(0,s.jsx)("td",{children:e.startTimestamp?new Date(e.startTimestamp).toLocaleString():"—"}),(0,s.jsx)("td",{className:"right num",children:null!=(a=null==(l=e.totals)?void 0:l.readCount)?a:0}),(0,s.jsx)("td",{className:"right num",children:null!=(i=null==(t=e.totals)?void 0:t.writeCount)?i:0}),(0,s.jsx)("td",{className:"right num",children:v(null==(n=e.totals)?void 0:n.estimatedTokens)}),(0,s.jsx)("td",{className:"right num",children:(0,s.jsx)("span",{className:"strong",children:v(e.estimatedSavings)})})]},e.sessionId)})})]})})]})}function x(){return(0,s.jsx)(m,{})}},6845:(e,l,t)=>{"use strict";t.d(l,{t:()=>a});var s=t(5155),n=t(1044);function a(e){let{icon:l,variant:t,size:a,className:i="",children:r,...o}=e,c=["btn"];return t&&c.push(t),a&&c.push(a),i&&c.push(i),(0,s.jsxs)("button",{className:c.join(" "),...o,children:[l&&(0,s.jsx)(n.I,{name:l}),r]})}},6970:(e,l,t)=>{"use strict";t.d(l,{y:()=>n});var s=t(5155);function n(e){let{value:l,max:t=100,tone:n="",className:a=""}=e,i=Math.max(0,Math.min(100,l/t*100));return(0,s.jsx)("div",{className:"bar ".concat(n," ").concat(a).trim(),children:(0,s.jsx)("span",{style:{width:"".concat(i,"%")}})})}},7e3:(e,l,t)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function n(e){if(!e||e<=0)return"—";let l=Math.floor(e/1e3),t=Math.floor(l/60),s=Math.floor(t/60);return s>0?s+"h "+t%60+"m":t>0?t+"m "+l%60+"s":l+"s"}function a(e){if(!e)return"—";try{let l=new Date(e);return l.toLocaleDateString()+" "+l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(l){return e}}t.d(l,{Y0:()=>n,aT:()=>s,r6:()=>a})},7125:(e,l,t)=>{"use strict";t.d(l,{v:()=>n});var s=t(5155);function n(e){let{tone:l="",children:t,className:n=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(l," ").concat(n).trim(),children:t})}},9503:(e,l,t)=>{"use strict";t.d(l,{h:()=>a});var s=t(5155);function n(e){let{data:l,width:t=60,height:n=22,tone:a=""}=e;if(!l.length)return null;let i=Math.min(...l),r=Math.max(...l)-i||1,o=l.map((e,s)=>{let a=1===l.length?0:s/(l.length-1)*t,o=n-(e-i)/r*n;return"".concat(a.toFixed(1),",").concat(o.toFixed(1))}).join(" ");return(0,s.jsx)("svg",{width:t,height:n,className:"spark",children:(0,s.jsx)("polyline",{points:o,fill:"none",stroke:"accent"===a?"var(--accent)":"red"===a?"var(--red)":"var(--fg-2)",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function a(e){let{label:l,value:t,delta:a,deltaTone:i="",spark:r,sparkTone:o,live:c,className:d="",style:h}=e;return(0,s.jsxs)("div",{className:"kpi ".concat(d).trim(),style:h,children:[(0,s.jsx)("div",{className:"label",children:l}),(0,s.jsx)("div",{className:"value mono ".concat(c?"live-num":"").trim(),children:t}),a&&(0,s.jsx)("div",{className:"delta ".concat(i).trim(),children:a}),r&&(0,s.jsx)("div",{className:"spark",children:(0,s.jsx)(n,{data:r,tone:o})})]})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=264)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[395],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>l});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function l(e){let{name:t,size:n=14,stroke:l=1.7,className:i=""}=e,c=s[t];return c?(0,a.jsx)("svg",{className:"icn ".concat(i).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:c})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function l(e){return a("/api/overview",e)}function i(e){return a("/api/token-ledger",e)}function c(e){return a("/api/file-index",e)}function r(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function h(e){return a("/api/bugs",e)}function u(e){return a("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function v(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function j(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function p(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function x(){return a("/api/config")}async function y(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function b(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function N(){return a("/api/sync")}async function w(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return a("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function L(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function T(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function C(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function V(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:C(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function H(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:C(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:C(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>O,Aq:()=>S,D:()=>I,Dz:()=>x,EP:()=>l,FW:()=>b,G1:()=>z,Gs:()=>N,Iw:()=>H,MP:()=>h,On:()=>P,P:()=>v,Vo:()=>i,WH:()=>L,Z4:()=>f,ZN:()=>T,ab:()=>M,co:()=>o,e2:()=>r,fX:()=>p,hD:()=>j,hY:()=>u,jm:()=>w,kH:()=>k,p4:()=>V,pu:()=>d,tf:()=>D,vj:()=>s,vo:()=>g,xl:()=>c,yJ:()=>y,yP:()=>m})},3187:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(5155),s=n(2115),l=n(3928),i=n(3742),c=n(7125),r=n(6845),o=n(4239);function d(e){let{tabs:t,active:n,onChange:s,className:l=""}=e;return(0,a.jsx)("div",{className:"tabs ".concat(l).trim(),children:t.map(e=>(0,a.jsxs)("button",{type:"button",className:"tab ".concat(n===e.id?"on":"").trim(),onClick:()=>s(e.id),children:[e.label,null!=e.count&&(0,a.jsx)("span",{className:"muted mono",style:{marginLeft:6,fontSize:10},children:e.count})]},e.id))})}var h=n(2327),u=n(7e3);function m(){var e;let t=(0,l.f)(e=>e.taskDefinitions),n=(0,l.f)(e=>e.tasks),m=(0,l.f)(e=>e.deadLetters),v=(0,l.f)(e=>e.activeProjectId),[f,j]=(0,s.useState)("tasks"),[p,g]=(0,s.useState)(new Set);function M(e,t){g(t=>new Set(t).add(e)),t().finally(()=>{g(t=>{let n=new Set(t);return n.delete(e),n})})}let x=n.map(e=>e.nextRunAt).filter(Boolean).sort()[0],y=(()=>{let e=n.length;if(0===e)return"—";let t=n.filter(e=>0===e.consecutiveFailures).length;return"".concat((t/e*100).toFixed(1),"%")})();return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title",children:"Scheduler"}),(0,a.jsx)("p",{className:"page-sub",children:"Cron-based tasks \xb7 retry with exponential backoff \xb7 dead letter queue"})]}),(0,a.jsx)("div",{className:"page-actions",children:(0,a.jsx)(r.t,{icon:"plus",variant:"primary",disabled:!0,title:"Write endpoint coming soon",children:"New task"})})]}),(0,a.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Tasks"}),(0,a.jsx)("div",{className:"value mono",children:t.length}),(0,a.jsxs)("div",{className:"delta",children:[t.filter(e=>e.enabled).length," enabled"]})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Next run"}),(0,a.jsx)("div",{className:"value mono",style:{fontSize:14},children:x?null!=(e=(0,u.r6)(x).split(" ")[1])?e:(0,u.r6)(x):"—"})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Success rate"}),(0,a.jsx)("div",{className:"value mono",children:y}),(0,a.jsx)("div",{className:"delta",children:"consecutive-success based"})]}),(0,a.jsxs)("div",{className:"kpi",children:[(0,a.jsx)("div",{className:"label",children:"Dead-letter"}),(0,a.jsx)("div",{className:"value mono",style:{color:m.length?"var(--amber)":void 0},children:m.length}),(0,a.jsx)("div",{className:"delta",children:"retryable"})]})]}),(0,a.jsx)(d,{tabs:[{id:"tasks",label:"Tasks",count:t.length},{id:"dlq",label:"Dead letter",count:m.length}],active:f,onChange:j}),"tasks"===f&&(0,a.jsx)(i.Z,{flush:!0,children:0===t.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No tasks configured"})}):(0,a.jsxs)("table",{className:"tbl",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{}),(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Schedule"}),(0,a.jsx)("th",{children:"Last"}),(0,a.jsx)("th",{children:"Next"}),(0,a.jsx)("th",{children:"Status"}),(0,a.jsx)("th",{})]})}),(0,a.jsx)("tbody",{children:t.map(e=>{var t,s,l;let i=n.find(t=>t.taskId===e.id),d=null!=(t=null==i?void 0:i.status)?t:"idle",m=p.has(e.id);return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsx)(o.l,{on:e.enabled,className:""})}),(0,a.jsx)("td",{className:"mono strong",children:e.name}),(0,a.jsx)("td",{className:"mono muted",children:e.schedule}),(0,a.jsx)("td",{className:"mono muted",children:(0,u.r6)(null!=(s=null==i?void 0:i.lastRunAt)?s:"")}),(0,a.jsx)("td",{className:"mono",children:(0,u.r6)(null!=(l=null==i?void 0:i.nextRunAt)?l:"")}),(0,a.jsx)("td",{children:(0,a.jsx)(c.v,{tone:"running"===d?"accent":"retrying"===d?"amber":"dead-lettered"===d?"red":"",children:d})}),(0,a.jsx)("td",{className:"right",children:(0,a.jsx)(r.t,{size:"sm",variant:"ghost",icon:m?"refresh":"play",disabled:m,onClick:()=>M(e.id,()=>(0,h.P)(e.id,null!=v?v:void 0)),children:m?"Running…":"Run"})})]},e.id)})})]})}),"dlq"===f&&(0,a.jsx)(i.Z,{title:"Dead letter queue",sub:"".concat(m.length," failed runs retained"),flush:!0,children:0===m.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No dead-lettered tasks"})}):(0,a.jsxs)("table",{className:"tbl",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Task"}),(0,a.jsx)("th",{children:"Last error"}),(0,a.jsx)("th",{className:"right",children:"Attempts"}),(0,a.jsx)("th",{children:"At"}),(0,a.jsx)("th",{})]})}),(0,a.jsx)("tbody",{children:m.map(e=>{var t;let n="dl-".concat(e.taskId),s=p.has(n),l=null==(t=e.errorMessages)?void 0:t[e.errorMessages.length-1];return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"mono strong",children:e.taskId}),(0,a.jsx)("td",{className:"muted",style:{maxWidth:380,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:null!=l?l:"—"}),(0,a.jsx)("td",{className:"right num",children:e.attemptCount}),(0,a.jsx)("td",{className:"mono muted",children:(0,u.r6)(e.deadLetteredAt)}),(0,a.jsx)("td",{className:"right",children:(0,a.jsx)(r.t,{size:"sm",icon:"refresh",disabled:s,onClick:()=>M(n,()=>(0,h.Z4)(e.taskId,null!=v?v:void 0)),children:s?"Retrying…":"Retry"})})]},e.taskId)})})]})})]})}function v(){return(0,a.jsx)(m,{})}},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:l,className:i="",style:c,children:r}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(i).trim(),style:c,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(l?"flush":"").trim(),children:r})]})}},3772:(e,t,n)=>{Promise.resolve().then(n.bind(n,3187))},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var a=n(5155);function s(e){let{on:t,onChange:n,className:s="",ariaLabel:l}=e;return(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":l,className:"toggle ".concat(t?"on":""," ").concat(s).trim(),onClick:()=>null==n?void 0:n(!t)})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>i});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,l={setState:a,getState:s,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(a,s,l);return l},l=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},i=e=>e?l(e):l},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>l});var a=n(5155),s=n(1044);function l(e){let{icon:t,variant:n,size:l,className:i="",children:c,...r}=e,o=["btn"];return n&&o.push(n),l&&o.push(l),i&&o.push(i),(0,a.jsxs)("button",{className:o.join(" "),...r,children:[t&&(0,a.jsx)(s.I,{name:t}),c]})}},7e3:(e,t,n)=>{"use strict";function a(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function s(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/60),a=Math.floor(n/60);return a>0?a+"h "+n%60+"m":n>0?n+"m "+t%60+"s":t+"s"}function l(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}n.d(t,{Y0:()=>s,aT:()=>a,r6:()=>l})},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3772)),_N_E=e.O()}]);