syntaur 0.16.2 → 0.17.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 (77) hide show
  1. package/dashboard/dist/assets/{_basePickBy-DTuHiZCP.js → _basePickBy-Dek5-ACb.js} +1 -1
  2. package/dashboard/dist/assets/{_baseUniq-BjbISCNN.js → _baseUniq-BeLddDKU.js} +1 -1
  3. package/dashboard/dist/assets/{arc-D9mCa8If.js → arc-kotdj4Uh.js} +1 -1
  4. package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-CLWheiZu.js → architectureDiagram-2XIMDMQ5-BaqFXQ-q.js} +1 -1
  5. package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-BBxrVTWB.js → blockDiagram-WCTKOSBZ-BSyGne6h.js} +1 -1
  6. package/dashboard/dist/assets/{c4Diagram-IC4MRINW-DnhDZ2W3.js → c4Diagram-IC4MRINW-iYjZFKOW.js} +1 -1
  7. package/dashboard/dist/assets/channel-eXdj7ayV.js +1 -0
  8. package/dashboard/dist/assets/{chunk-4BX2VUAB-DeAfVeDa.js → chunk-4BX2VUAB-DvY9Y7jB.js} +1 -1
  9. package/dashboard/dist/assets/{chunk-55IACEB6-cKEeGDNI.js → chunk-55IACEB6-2vCDm2cJ.js} +1 -1
  10. package/dashboard/dist/assets/{chunk-FMBD7UC4-7RuZ6HEq.js → chunk-FMBD7UC4-BVPaoRtV.js} +1 -1
  11. package/dashboard/dist/assets/{chunk-JSJVCQXG-B5dwG0bv.js → chunk-JSJVCQXG-B9uJpMzd.js} +1 -1
  12. package/dashboard/dist/assets/{chunk-KX2RTZJC-DeyQYDVj.js → chunk-KX2RTZJC-CHcjjGaq.js} +1 -1
  13. package/dashboard/dist/assets/{chunk-NQ4KR5QH-NYo4hSqA.js → chunk-NQ4KR5QH-B8n19pSs.js} +1 -1
  14. package/dashboard/dist/assets/{chunk-QZHKN3VN-CtJFICF8.js → chunk-QZHKN3VN-CF9ZYFGK.js} +1 -1
  15. package/dashboard/dist/assets/{chunk-WL4C6EOR-DZ3WYdab.js → chunk-WL4C6EOR-mY_1Vmdf.js} +1 -1
  16. package/dashboard/dist/assets/classDiagram-VBA2DB6C-B-bBQACr.js +1 -0
  17. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-B-bBQACr.js +1 -0
  18. package/dashboard/dist/assets/clone-CL04pv9J.js +1 -0
  19. package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-DaYOsf-M.js → cose-bilkent-S5V4N54A-DOYoG3gB.js} +1 -1
  20. package/dashboard/dist/assets/{dagre-KLK3FWXG-DzLc7ykF.js → dagre-KLK3FWXG-CZFrp-Yq.js} +1 -1
  21. package/dashboard/dist/assets/{diagram-E7M64L7V-kpjEdOqb.js → diagram-E7M64L7V-F3rF5YwM.js} +1 -1
  22. package/dashboard/dist/assets/{diagram-IFDJBPK2-D3EHoh6j.js → diagram-IFDJBPK2-BynWv-Vo.js} +1 -1
  23. package/dashboard/dist/assets/{diagram-P4PSJMXO-Cp6Un2ys.js → diagram-P4PSJMXO-NIyzhm_M.js} +1 -1
  24. package/dashboard/dist/assets/{erDiagram-INFDFZHY-DDjOUPWk.js → erDiagram-INFDFZHY-Ca9NbihE.js} +1 -1
  25. package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-CfO51xge.js → flowDiagram-PKNHOUZH-YhS0MOu4.js} +1 -1
  26. package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-BDzAtkcp.js → ganttDiagram-A5KZAMGK-G7P3qq_2.js} +1 -1
  27. package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-JPMFN2zF.js → gitGraphDiagram-K3NZZRJ6-BJAK7M7E.js} +1 -1
  28. package/dashboard/dist/assets/{graph-DXDryilu.js → graph-11geMy3f.js} +1 -1
  29. package/dashboard/dist/assets/index--qwybK3W.js +535 -0
  30. package/dashboard/dist/assets/index-DwrhlK8r.css +1 -0
  31. package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-CYi5kkvz.js → infoDiagram-LFFYTUFH-COcQYcLf.js} +1 -1
  32. package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-DQl_IUe8.js → ishikawaDiagram-PHBUUO56-B7Jjyw8J.js} +1 -1
  33. package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-BXXGPcrS.js → journeyDiagram-4ABVD52K--snU-QAX.js} +1 -1
  34. package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-BqJestUY.js → kanban-definition-K7BYSVSG-BucLoc89.js} +1 -1
  35. package/dashboard/dist/assets/{layout-D5VdYmWn.js → layout-Bcgxdz8A.js} +1 -1
  36. package/dashboard/dist/assets/{linear-dZA_O_GN.js → linear-CRF8xwvk.js} +1 -1
  37. package/dashboard/dist/assets/{mermaid.core-B0Ixd1yP.js → mermaid.core-D5JD5uYg.js} +4 -4
  38. package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-CSJYdSMG.js → mindmap-definition-YRQLILUH-BqGcTcbk.js} +1 -1
  39. package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-DmYrRZHN.js → pieDiagram-SKSYHLDU-CnQ2EkyX.js} +1 -1
  40. package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-La3ce5kE.js → quadrantDiagram-337W2JSQ-CKCfmTRc.js} +1 -1
  41. package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-DPitIZQl.js → requirementDiagram-Z7DCOOCP-B9J4bvUK.js} +1 -1
  42. package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-CAmCqGkr.js → sankeyDiagram-WA2Y5GQK-CMSzI5rg.js} +1 -1
  43. package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-6lEzNTWG.js → sequenceDiagram-2WXFIKYE-BFQDtxd0.js} +1 -1
  44. package/dashboard/dist/assets/{stateDiagram-RAJIS63D-DyGKCS2C.js → stateDiagram-RAJIS63D-DgWYKT02.js} +1 -1
  45. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-Nmwft4cR.js +1 -0
  46. package/dashboard/dist/assets/{timeline-definition-YZTLITO2-D9RxQE3j.js → timeline-definition-YZTLITO2-jANu0e7M.js} +1 -1
  47. package/dashboard/dist/assets/{treemap-KZPCXAKY-TuXbGNN4.js → treemap-KZPCXAKY-BFjWMkyM.js} +1 -1
  48. package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-Bly5knr-.js → vennDiagram-LZ73GAT5-DGwrAJYj.js} +1 -1
  49. package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-CA-5z7-4.js → xychartDiagram-JWTSCODW-BLCPfoFM.js} +1 -1
  50. package/dashboard/dist/index.html +2 -2
  51. package/dist/dashboard/server.js +2220 -479
  52. package/dist/dashboard/server.js.map +1 -1
  53. package/dist/db/leases-db.js.map +1 -1
  54. package/dist/index.js +4499 -1127
  55. package/dist/index.js.map +1 -1
  56. package/dist/launch/index.js +127 -63
  57. package/dist/launch/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/platforms/claude-code/skills/bundle-worktree/SKILL.md +107 -0
  60. package/platforms/claude-code/skills/complete-bundle/SKILL.md +113 -0
  61. package/platforms/claude-code/skills/grab-bundle/SKILL.md +111 -0
  62. package/platforms/claude-code/skills/plan-bundle/SKILL.md +88 -0
  63. package/platforms/codex/skills/bundle-worktree/SKILL.md +107 -0
  64. package/platforms/codex/skills/complete-bundle/SKILL.md +113 -0
  65. package/platforms/codex/skills/grab-bundle/SKILL.md +111 -0
  66. package/platforms/codex/skills/plan-bundle/SKILL.md +88 -0
  67. package/skills/bundle-worktree/SKILL.md +107 -0
  68. package/skills/complete-bundle/SKILL.md +113 -0
  69. package/skills/grab-bundle/SKILL.md +111 -0
  70. package/skills/plan-bundle/SKILL.md +88 -0
  71. package/dashboard/dist/assets/channel-CN5VmjNa.js +0 -1
  72. package/dashboard/dist/assets/classDiagram-VBA2DB6C-CqLb9GuU.js +0 -1
  73. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-CqLb9GuU.js +0 -1
  74. package/dashboard/dist/assets/clone-DwvrjCQs.js +0 -1
  75. package/dashboard/dist/assets/index-D7UtkCYM.js +0 -515
  76. package/dashboard/dist/assets/index-DTXSWSzH.css +0 -1
  77. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-BOmRICoY.js +0 -1
@@ -1,515 +0,0 @@
1
- var FN=Object.defineProperty;var zN=(e,t,n)=>t in e?FN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ly=(e,t,n)=>zN(e,typeof t!="symbol"?t+"":t,n);function BN(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(s,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function wu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xF(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),n}var Mf={exports:{}},ha={},_f={exports:{}},Je={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var $y;function UN(){if($y)return Je;$y=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function w(M,ee,L){this.props=M,this.context=ee,this.refs=j,this.updater=L||v}w.prototype.isReactComponent={},w.prototype.setState=function(M,ee){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,ee,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=w.prototype;function T(M,ee,L){this.props=M,this.context=ee,this.refs=j,this.updater=L||v}var N=T.prototype=new S;N.constructor=T,C(N,w.prototype),N.isPureReactComponent=!0;var A=Array.isArray,$=Object.prototype.hasOwnProperty,R={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function I(M,ee,L){var ae,ce={},Z=null,ge=null;if(ee!=null)for(ae in ee.ref!==void 0&&(ge=ee.ref),ee.key!==void 0&&(Z=""+ee.key),ee)$.call(ee,ae)&&!O.hasOwnProperty(ae)&&(ce[ae]=ee[ae]);var je=arguments.length-2;if(je===1)ce.children=L;else if(1<je){for(var Ne=Array(je),ke=0;ke<je;ke++)Ne[ke]=arguments[ke+2];ce.children=Ne}if(M&&M.defaultProps)for(ae in je=M.defaultProps,je)ce[ae]===void 0&&(ce[ae]=je[ae]);return{$$typeof:e,type:M,key:Z,ref:ge,props:ce,_owner:R.current}}function K(M,ee){return{$$typeof:e,type:M.type,key:ee,ref:M.ref,props:M.props,_owner:M._owner}}function X(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function _(M){var ee={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(L){return ee[L]})}var H=/\/+/g;function J(M,ee){return typeof M=="object"&&M!==null&&M.key!=null?_(""+M.key):ee.toString(36)}function U(M,ee,L,ae,ce){var Z=typeof M;(Z==="undefined"||Z==="boolean")&&(M=null);var ge=!1;if(M===null)ge=!0;else switch(Z){case"string":case"number":ge=!0;break;case"object":switch(M.$$typeof){case e:case t:ge=!0}}if(ge)return ge=M,ce=ce(ge),M=ae===""?"."+J(ge,0):ae,A(ce)?(L="",M!=null&&(L=M.replace(H,"$&/")+"/"),U(ce,ee,L,"",function(ke){return ke})):ce!=null&&(X(ce)&&(ce=K(ce,L+(!ce.key||ge&&ge.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+M)),ee.push(ce)),1;if(ge=0,ae=ae===""?".":ae+":",A(M))for(var je=0;je<M.length;je++){Z=M[je];var Ne=ae+J(Z,je);ge+=U(Z,ee,L,Ne,ce)}else if(Ne=y(M),typeof Ne=="function")for(M=Ne.call(M),je=0;!(Z=M.next()).done;)Z=Z.value,Ne=ae+J(Z,je++),ge+=U(Z,ee,L,Ne,ce);else if(Z==="object")throw ee=String(M),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return ge}function Y(M,ee,L){if(M==null)return M;var ae=[],ce=0;return U(M,ae,"","",function(Z){return ee.call(L,Z,ce++)}),ae}function z(M){if(M._status===-1){var ee=M._result;ee=ee(),ee.then(function(L){(M._status===0||M._status===-1)&&(M._status=1,M._result=L)},function(L){(M._status===0||M._status===-1)&&(M._status=2,M._result=L)}),M._status===-1&&(M._status=0,M._result=ee)}if(M._status===1)return M._result.default;throw M._result}var V={current:null},D={transition:null},Q={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:D,ReactCurrentOwner:R};function E(){throw Error("act(...) is not supported in production builds of React.")}return Je.Children={map:Y,forEach:function(M,ee,L){Y(M,function(){ee.apply(this,arguments)},L)},count:function(M){var ee=0;return Y(M,function(){ee++}),ee},toArray:function(M){return Y(M,function(ee){return ee})||[]},only:function(M){if(!X(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Je.Component=w,Je.Fragment=n,Je.Profiler=a,Je.PureComponent=T,Je.StrictMode=s,Je.Suspense=f,Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Je.act=E,Je.cloneElement=function(M,ee,L){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ae=C({},M.props),ce=M.key,Z=M.ref,ge=M._owner;if(ee!=null){if(ee.ref!==void 0&&(Z=ee.ref,ge=R.current),ee.key!==void 0&&(ce=""+ee.key),M.type&&M.type.defaultProps)var je=M.type.defaultProps;for(Ne in ee)$.call(ee,Ne)&&!O.hasOwnProperty(Ne)&&(ae[Ne]=ee[Ne]===void 0&&je!==void 0?je[Ne]:ee[Ne])}var Ne=arguments.length-2;if(Ne===1)ae.children=L;else if(1<Ne){je=Array(Ne);for(var ke=0;ke<Ne;ke++)je[ke]=arguments[ke+2];ae.children=je}return{$$typeof:e,type:M.type,key:ce,ref:Z,props:ae,_owner:ge}},Je.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:l,_context:M},M.Consumer=M},Je.createElement=I,Je.createFactory=function(M){var ee=I.bind(null,M);return ee.type=M,ee},Je.createRef=function(){return{current:null}},Je.forwardRef=function(M){return{$$typeof:d,render:M}},Je.isValidElement=X,Je.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:z}},Je.memo=function(M,ee){return{$$typeof:m,type:M,compare:ee===void 0?null:ee}},Je.startTransition=function(M){var ee=D.transition;D.transition={};try{M()}finally{D.transition=ee}},Je.unstable_act=E,Je.useCallback=function(M,ee){return V.current.useCallback(M,ee)},Je.useContext=function(M){return V.current.useContext(M)},Je.useDebugValue=function(){},Je.useDeferredValue=function(M){return V.current.useDeferredValue(M)},Je.useEffect=function(M,ee){return V.current.useEffect(M,ee)},Je.useId=function(){return V.current.useId()},Je.useImperativeHandle=function(M,ee,L){return V.current.useImperativeHandle(M,ee,L)},Je.useInsertionEffect=function(M,ee){return V.current.useInsertionEffect(M,ee)},Je.useLayoutEffect=function(M,ee){return V.current.useLayoutEffect(M,ee)},Je.useMemo=function(M,ee){return V.current.useMemo(M,ee)},Je.useReducer=function(M,ee,L){return V.current.useReducer(M,ee,L)},Je.useRef=function(M){return V.current.useRef(M)},Je.useState=function(M){return V.current.useState(M)},Je.useSyncExternalStore=function(M,ee,L){return V.current.useSyncExternalStore(M,ee,L)},Je.useTransition=function(){return V.current.useTransition()},Je.version="18.3.1",Je}var My;function xm(){return My||(My=1,_f.exports=UN()),_f.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var _y;function HN(){if(_y)return ha;_y=1;var e=xm(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(d,f,m){var g,x={},y=null,v=null;m!==void 0&&(y=""+m),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(v=f.ref);for(g in f)s.call(f,g)&&!l.hasOwnProperty(g)&&(x[g]=f[g]);if(d&&d.defaultProps)for(g in f=d.defaultProps,f)x[g]===void 0&&(x[g]=f[g]);return{$$typeof:t,type:d,key:y,ref:v,props:x,_owner:a.current}}return ha.Fragment=n,ha.jsx=c,ha.jsxs=c,ha}var Fy;function WN(){return Fy||(Fy=1,Mf.exports=HN()),Mf.exports}var r=WN(),p=xm();const Lt=wu(p),cw=BN({__proto__:null,default:Lt},[p]);var kc={},Ff={exports:{}},Ln={},zf={exports:{}},Bf={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var zy;function VN(){return zy||(zy=1,(function(e){function t(D,Q){var E=D.length;D.push(Q);e:for(;0<E;){var M=E-1>>>1,ee=D[M];if(0<a(ee,Q))D[M]=Q,D[E]=ee,E=M;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var Q=D[0],E=D.pop();if(E!==Q){D[0]=E;e:for(var M=0,ee=D.length,L=ee>>>1;M<L;){var ae=2*(M+1)-1,ce=D[ae],Z=ae+1,ge=D[Z];if(0>a(ce,E))Z<ee&&0>a(ge,ce)?(D[M]=ge,D[Z]=E,M=Z):(D[M]=ce,D[ae]=E,M=ae);else if(Z<ee&&0>a(ge,E))D[M]=ge,D[Z]=E,M=Z;else break e}}return Q}function a(D,Q){var E=D.sortIndex-Q.sortIndex;return E!==0?E:D.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],m=[],g=1,x=null,y=3,v=!1,C=!1,j=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(D){for(var Q=n(m);Q!==null;){if(Q.callback===null)s(m);else if(Q.startTime<=D)s(m),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=n(m)}}function A(D){if(j=!1,N(D),!C)if(n(f)!==null)C=!0,z($);else{var Q=n(m);Q!==null&&V(A,Q.startTime-D)}}function $(D,Q){C=!1,j&&(j=!1,S(I),I=-1),v=!0;var E=y;try{for(N(Q),x=n(f);x!==null&&(!(x.expirationTime>Q)||D&&!_());){var M=x.callback;if(typeof M=="function"){x.callback=null,y=x.priorityLevel;var ee=M(x.expirationTime<=Q);Q=e.unstable_now(),typeof ee=="function"?x.callback=ee:x===n(f)&&s(f),N(Q)}else s(f);x=n(f)}if(x!==null)var L=!0;else{var ae=n(m);ae!==null&&V(A,ae.startTime-Q),L=!1}return L}finally{x=null,y=E,v=!1}}var R=!1,O=null,I=-1,K=5,X=-1;function _(){return!(e.unstable_now()-X<K)}function H(){if(O!==null){var D=e.unstable_now();X=D;var Q=!0;try{Q=O(!0,D)}finally{Q?J():(R=!1,O=null)}}else R=!1}var J;if(typeof T=="function")J=function(){T(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,Y=U.port2;U.port1.onmessage=H,J=function(){Y.postMessage(null)}}else J=function(){w(H,0)};function z(D){O=D,R||(R=!0,J())}function V(D,Q){I=w(function(){D(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){C||v||(C=!0,z($))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var E=y;y=Q;try{return D()}finally{y=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,Q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var E=y;y=D;try{return Q()}finally{y=E}},e.unstable_scheduleCallback=function(D,Q,E){var M=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?M+E:M):E=M,D){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=E+ee,D={id:g++,callback:Q,priorityLevel:D,startTime:E,expirationTime:ee,sortIndex:-1},E>M?(D.sortIndex=E,t(m,D),n(f)===null&&D===n(m)&&(j?(S(I),I=-1):j=!0,V(A,E-M))):(D.sortIndex=ee,t(f,D),C||v||(C=!0,z($))),D},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(D){var Q=y;return function(){var E=y;y=Q;try{return D.apply(this,arguments)}finally{y=E}}}})(Bf)),Bf}var By;function qN(){return By||(By=1,zf.exports=VN()),zf.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Uy;function KN(){if(Uy)return Ln;Uy=1;var e=xm(),t=qN();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+o+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(o,i){c(o,i),c(o+"Capture",i)}function c(o,i){for(a[o]=i,o=0;o<i.length;o++)s.add(i[o])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},x={};function y(o){return f.call(x,o)?!0:f.call(g,o)?!1:m.test(o)?x[o]=!0:(g[o]=!0,!1)}function v(o,i,u,h){if(u!==null&&u.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function C(o,i,u,h){if(i===null||typeof i>"u"||v(o,i,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function j(o,i,u,h,b,k,P){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=b,this.mustUseProperty=u,this.propertyName=o,this.type=i,this.sanitizeURL=k,this.removeEmptyString=P}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new j(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var i=o[0];w[i]=new j(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new j(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new j(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new j(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new j(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new j(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new j(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new j(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function T(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var i=o.replace(S,T);w[i]=new j(i,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var i=o.replace(S,T);w[i]=new j(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var i=o.replace(S,T);w[i]=new j(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!0,!0)});function N(o,i,u,h){var b=w.hasOwnProperty(i)?w[i]:null;(b!==null?b.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(C(i,u,b,h)&&(u=null),h||b===null?y(i)&&(u===null?o.removeAttribute(i):o.setAttribute(i,""+u)):b.mustUseProperty?o[b.propertyName]=u===null?b.type===3?!1:"":u:(i=b.attributeName,h=b.attributeNamespace,u===null?o.removeAttribute(i):(b=b.type,u=b===3||b===4&&u===!0?"":""+u,h?o.setAttributeNS(h,i,u):o.setAttribute(i,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),R=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),_=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),D=Symbol.iterator;function Q(o){return o===null||typeof o!="object"?null:(o=D&&o[D]||o["@@iterator"],typeof o=="function"?o:null)}var E=Object.assign,M;function ee(o){if(M===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);M=i&&i[1]||""}return`
34
- `+M+o}var L=!1;function ae(o,i){if(!o||L)return"";L=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(oe){var h=oe}Reflect.construct(o,[],i)}else{try{i.call()}catch(oe){h=oe}o.call(i.prototype)}else{try{throw Error()}catch(oe){h=oe}o()}}catch(oe){if(oe&&h&&typeof oe.stack=="string"){for(var b=oe.stack.split(`
35
- `),k=h.stack.split(`
36
- `),P=b.length-1,F=k.length-1;1<=P&&0<=F&&b[P]!==k[F];)F--;for(;1<=P&&0<=F;P--,F--)if(b[P]!==k[F]){if(P!==1||F!==1)do if(P--,F--,0>F||b[P]!==k[F]){var q=`
37
- `+b[P].replace(" at new "," at ");return o.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",o.displayName)),q}while(1<=P&&0<=F);break}}}finally{L=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?ee(o):""}function ce(o){switch(o.tag){case 5:return ee(o.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return o=ae(o.type,!1),o;case 11:return o=ae(o.type.render,!1),o;case 1:return o=ae(o.type,!0),o;default:return""}}function Z(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case O:return"Fragment";case R:return"Portal";case K:return"Profiler";case I:return"StrictMode";case J:return"Suspense";case U:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case _:return(o.displayName||"Context")+".Consumer";case X:return(o._context.displayName||"Context")+".Provider";case H:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Y:return i=o.displayName||null,i!==null?i:Z(o.type)||"Memo";case z:i=o._payload,o=o._init;try{return Z(o(i))}catch{}}return null}function ge(o){var i=o.type;switch(o.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=i.render,o=o.displayName||o.name||"",i.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(i);case 8:return i===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function je(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ne(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ke(o){var i=Ne(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),h=""+o[i];if(!o.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,k=u.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return b.call(this)},set:function(P){h=""+P,k.call(this,P)}}),Object.defineProperty(o,i,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(P){h=""+P},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function We(o){o._valueTracker||(o._valueTracker=ke(o))}function Ye(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return o&&(h=Ne(o)?o.checked?"true":"false":o.value),o=h,o!==u?(i.setValue(o),!0):!1}function ie(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ne(o,i){var u=i.checked;return E({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function le(o,i){var u=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;u=je(i.value!=null?i.value:u),o._wrapperState={initialChecked:h,initialValue:u,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function W(o,i){i=i.checked,i!=null&&N(o,"checked",i,!1)}function pe(o,i){W(o,i);var u=je(i.value),h=i.type;if(u!=null)h==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(h==="submit"||h==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?_e(o,i.type,u):i.hasOwnProperty("defaultValue")&&_e(o,i.type,je(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function ve(o,i,u){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+o._wrapperState.initialValue,u||i===o.value||(o.value=i),o.defaultValue=i}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function _e(o,i,u){(i!=="number"||ie(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var Oe=Array.isArray;function st(o,i,u,h){if(o=o.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<o.length;u++)b=i.hasOwnProperty("$"+o[u].value),o[u].selected!==b&&(o[u].selected=b),b&&h&&(o[u].defaultSelected=!0)}else{for(u=""+je(u),i=null,b=0;b<o.length;b++){if(o[b].value===u){o[b].selected=!0,h&&(o[b].defaultSelected=!0);return}i!==null||o[b].disabled||(i=o[b])}i!==null&&(i.selected=!0)}}function lt(o,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return E({},i,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function _t(o,i){var u=i.value;if(u==null){if(u=i.children,i=i.defaultValue,u!=null){if(i!=null)throw Error(n(92));if(Oe(u)){if(1<u.length)throw Error(n(93));u=u[0]}i=u}i==null&&(i=""),u=i}o._wrapperState={initialValue:je(u)}}function St(o,i){var u=je(i.value),h=je(i.defaultValue);u!=null&&(u=""+u,u!==o.value&&(o.value=u),i.defaultValue==null&&o.defaultValue!==u&&(o.defaultValue=u)),h!=null&&(o.defaultValue=""+h)}function Nt(o){var i=o.textContent;i===o._wrapperState.initialValue&&i!==""&&i!==null&&(o.value=i)}function se(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function me(o,i){return o==null||o==="http://www.w3.org/1999/xhtml"?se(i):o==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Pe,Fe=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,u,h,b){MSApp.execUnsafeLocalFunction(function(){return o(i,u,h,b)})}:o})(function(o,i){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=i;else{for(Pe=Pe||document.createElement("div"),Pe.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Pe.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;i.firstChild;)o.appendChild(i.firstChild)}});function Ve(o,i){if(i){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=i;return}}o.textContent=i}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cn=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(o){cn.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),tt[i]=tt[o]})});function ue(o,i,u){return i==null||typeof i=="boolean"||i===""?"":u||typeof i!="number"||i===0||tt.hasOwnProperty(o)&&tt[o]?(""+i).trim():i+"px"}function Ge(o,i){o=o.style;for(var u in i)if(i.hasOwnProperty(u)){var h=u.indexOf("--")===0,b=ue(u,i[u],h);u==="float"&&(u="cssFloat"),h?o.setProperty(u,b):o[u]=b}}var He=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mt(o,i){if(i){if(He[o]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function Tn(o,i){if(o.indexOf("-")===-1)return typeof i.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Qt=null;function Hn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var mr=null,Ar=null,ht=null;function Ft(o){if(o=ea(o)){if(typeof mr!="function")throw Error(n(280));var i=o.stateNode;i&&(i=_l(i),mr(o.stateNode,o.type,i))}}function qt(o){Ar?ht?ht.push(o):ht=[o]:Ar=o}function kn(){if(Ar){var o=Ar,i=ht;if(ht=Ar=null,Ft(o),i)for(o=0;o<i.length;o++)Ft(i[o])}}function un(o,i){return o(i)}function Zt(){}var ct=!1;function hr(o,i,u){if(ct)return o(i,u);ct=!0;try{return un(o,i,u)}finally{ct=!1,(Ar!==null||ht!==null)&&(Zt(),kn())}}function ut(o,i){var u=o.stateNode;if(u===null)return null;var h=_l(u);if(h===null)return null;u=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var Pn=!1;if(d)try{var en={};Object.defineProperty(en,"passive",{get:function(){Pn=!0}}),window.addEventListener("test",en,en),window.removeEventListener("test",en,en)}catch{Pn=!1}function Wn(o,i,u,h,b,k,P,F,q){var oe=Array.prototype.slice.call(arguments,3);try{i.apply(u,oe)}catch(he){this.onError(he)}}var tn=!1,B=null,de=!1,Se=null,Xe={onError:function(o){tn=!0,B=o}};function er(o,i,u,h,b,k,P,F,q){tn=!1,B=null,Wn.apply(Xe,arguments)}function hn(o,i,u,h,b,k,P,F,q){if(er.apply(this,arguments),tn){if(tn){var oe=B;tn=!1,B=null}else throw Error(n(198));de||(de=!0,Se=oe)}}function dt(o){var i=o,u=o;if(o.alternate)for(;i.return;)i=i.return;else{o=i;do i=o,(i.flags&4098)!==0&&(u=i.return),o=i.return;while(o)}return i.tag===3?u:null}function Rt(o){if(o.tag===13){var i=o.memoizedState;if(i===null&&(o=o.alternate,o!==null&&(i=o.memoizedState)),i!==null)return i.dehydrated}return null}function nn(o){if(dt(o)!==o)throw Error(n(188))}function ko(o){var i=o.alternate;if(!i){if(i=dt(o),i===null)throw Error(n(188));return i!==o?null:o}for(var u=o,h=i;;){var b=u.return;if(b===null)break;var k=b.alternate;if(k===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===k.child){for(k=b.child;k;){if(k===u)return nn(b),o;if(k===h)return nn(b),i;k=k.sibling}throw Error(n(188))}if(u.return!==h.return)u=b,h=k;else{for(var P=!1,F=b.child;F;){if(F===u){P=!0,u=b,h=k;break}if(F===h){P=!0,h=b,u=k;break}F=F.sibling}if(!P){for(F=k.child;F;){if(F===u){P=!0,u=k,h=b;break}if(F===h){P=!0,h=k,u=b;break}F=F.sibling}if(!P)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?o:i}function ts(o){return o=ko(o),o!==null?xl(o):null}function xl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var i=xl(o);if(i!==null)return i;o=o.sibling}return null}var lg=t.unstable_scheduleCallback,cg=t.unstable_cancelCallback,J1=t.unstable_shouldYield,X1=t.unstable_requestPaint,$t=t.unstable_now,Q1=t.unstable_getCurrentPriorityLevel,nd=t.unstable_ImmediatePriority,ug=t.unstable_UserBlockingPriority,yl=t.unstable_NormalPriority,Z1=t.unstable_LowPriority,dg=t.unstable_IdlePriority,vl=null,Dr=null;function eS(o){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot(vl,o,void 0,(o.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:rS,tS=Math.log,nS=Math.LN2;function rS(o){return o>>>=0,o===0?32:31-(tS(o)/nS|0)|0}var bl=64,wl=4194304;function $i(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function jl(o,i){var u=o.pendingLanes;if(u===0)return 0;var h=0,b=o.suspendedLanes,k=o.pingedLanes,P=u&268435455;if(P!==0){var F=P&~b;F!==0?h=$i(F):(k&=P,k!==0&&(h=$i(k)))}else P=u&~b,P!==0?h=$i(P):k!==0&&(h=$i(k));if(h===0)return 0;if(i!==0&&i!==h&&(i&b)===0&&(b=h&-h,k=i&-i,b>=k||b===16&&(k&4194240)!==0))return i;if((h&4)!==0&&(h|=u&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=h;0<i;)u=31-gr(i),b=1<<u,h|=o[u],i&=~b;return h}function sS(o,i){switch(o){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oS(o,i){for(var u=o.suspendedLanes,h=o.pingedLanes,b=o.expirationTimes,k=o.pendingLanes;0<k;){var P=31-gr(k),F=1<<P,q=b[P];q===-1?((F&u)===0||(F&h)!==0)&&(b[P]=sS(F,i)):q<=i&&(o.expiredLanes|=F),k&=~F}}function rd(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function fg(){var o=bl;return bl<<=1,(bl&4194240)===0&&(bl=64),o}function sd(o){for(var i=[],u=0;31>u;u++)i.push(o);return i}function Mi(o,i,u){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-gr(i),o[i]=u}function iS(o,i){var u=o.pendingLanes&~i;o.pendingLanes=i,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=i,o.mutableReadLanes&=i,o.entangledLanes&=i,i=o.entanglements;var h=o.eventTimes;for(o=o.expirationTimes;0<u;){var b=31-gr(u),k=1<<b;i[b]=0,h[b]=-1,o[b]=-1,u&=~k}}function od(o,i){var u=o.entangledLanes|=i;for(o=o.entanglements;u;){var h=31-gr(u),b=1<<h;b&i|o[h]&i&&(o[h]|=i),u&=~b}}var it=0;function pg(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var mg,id,hg,gg,xg,ad=!1,kl=[],gs=null,xs=null,ys=null,_i=new Map,Fi=new Map,vs=[],aS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yg(o,i){switch(o){case"focusin":case"focusout":gs=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":_i.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(i.pointerId)}}function zi(o,i,u,h,b,k){return o===null||o.nativeEvent!==k?(o={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:k,targetContainers:[b]},i!==null&&(i=ea(i),i!==null&&id(i)),o):(o.eventSystemFlags|=h,i=o.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),o)}function lS(o,i,u,h,b){switch(i){case"focusin":return gs=zi(gs,o,i,u,h,b),!0;case"dragenter":return xs=zi(xs,o,i,u,h,b),!0;case"mouseover":return ys=zi(ys,o,i,u,h,b),!0;case"pointerover":var k=b.pointerId;return _i.set(k,zi(_i.get(k)||null,o,i,u,h,b)),!0;case"gotpointercapture":return k=b.pointerId,Fi.set(k,zi(Fi.get(k)||null,o,i,u,h,b)),!0}return!1}function vg(o){var i=Qs(o.target);if(i!==null){var u=dt(i);if(u!==null){if(i=u.tag,i===13){if(i=Rt(u),i!==null){o.blockedOn=i,xg(o.priority,function(){hg(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Sl(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var u=cd(o.domEventName,o.eventSystemFlags,i[0],o.nativeEvent);if(u===null){u=o.nativeEvent;var h=new u.constructor(u.type,u);Qt=h,u.target.dispatchEvent(h),Qt=null}else return i=ea(u),i!==null&&id(i),o.blockedOn=u,!1;i.shift()}return!0}function bg(o,i,u){Sl(o)&&u.delete(i)}function cS(){ad=!1,gs!==null&&Sl(gs)&&(gs=null),xs!==null&&Sl(xs)&&(xs=null),ys!==null&&Sl(ys)&&(ys=null),_i.forEach(bg),Fi.forEach(bg)}function Bi(o,i){o.blockedOn===i&&(o.blockedOn=null,ad||(ad=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,cS)))}function Ui(o){function i(b){return Bi(b,o)}if(0<kl.length){Bi(kl[0],o);for(var u=1;u<kl.length;u++){var h=kl[u];h.blockedOn===o&&(h.blockedOn=null)}}for(gs!==null&&Bi(gs,o),xs!==null&&Bi(xs,o),ys!==null&&Bi(ys,o),_i.forEach(i),Fi.forEach(i),u=0;u<vs.length;u++)h=vs[u],h.blockedOn===o&&(h.blockedOn=null);for(;0<vs.length&&(u=vs[0],u.blockedOn===null);)vg(u),u.blockedOn===null&&vs.shift()}var So=A.ReactCurrentBatchConfig,Nl=!0;function uS(o,i,u,h){var b=it,k=So.transition;So.transition=null;try{it=1,ld(o,i,u,h)}finally{it=b,So.transition=k}}function dS(o,i,u,h){var b=it,k=So.transition;So.transition=null;try{it=4,ld(o,i,u,h)}finally{it=b,So.transition=k}}function ld(o,i,u,h){if(Nl){var b=cd(o,i,u,h);if(b===null)Cd(o,i,h,Cl,u),yg(o,h);else if(lS(b,o,i,u,h))h.stopPropagation();else if(yg(o,h),i&4&&-1<aS.indexOf(o)){for(;b!==null;){var k=ea(b);if(k!==null&&mg(k),k=cd(o,i,u,h),k===null&&Cd(o,i,h,Cl,u),k===b)break;b=k}b!==null&&h.stopPropagation()}else Cd(o,i,h,null,u)}}var Cl=null;function cd(o,i,u,h){if(Cl=null,o=Hn(h),o=Qs(o),o!==null)if(i=dt(o),i===null)o=null;else if(u=i.tag,u===13){if(o=Rt(i),o!==null)return o;o=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null);return Cl=o,null}function wg(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Q1()){case nd:return 1;case ug:return 4;case yl:case Z1:return 16;case dg:return 536870912;default:return 16}default:return 16}}var bs=null,ud=null,El=null;function jg(){if(El)return El;var o,i=ud,u=i.length,h,b="value"in bs?bs.value:bs.textContent,k=b.length;for(o=0;o<u&&i[o]===b[o];o++);var P=u-o;for(h=1;h<=P&&i[u-h]===b[k-h];h++);return El=b.slice(o,1<h?1-h:void 0)}function Tl(o){var i=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&i===13&&(o=13)):o=i,o===10&&(o=13),32<=o||o===13?o:0}function Pl(){return!0}function kg(){return!1}function Vn(o){function i(u,h,b,k,P){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=k,this.target=P,this.currentTarget=null;for(var F in o)o.hasOwnProperty(F)&&(u=o[F],this[F]=u?u(k):k[F]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Pl:kg,this.isPropagationStopped=kg,this}return E(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),i}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dd=Vn(No),Hi=E({},No,{view:0,detail:0}),fS=Vn(Hi),fd,pd,Wi,Rl=E({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hd,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Wi&&(Wi&&o.type==="mousemove"?(fd=o.screenX-Wi.screenX,pd=o.screenY-Wi.screenY):pd=fd=0,Wi=o),fd)},movementY:function(o){return"movementY"in o?o.movementY:pd}}),Sg=Vn(Rl),pS=E({},Rl,{dataTransfer:0}),mS=Vn(pS),hS=E({},Hi,{relatedTarget:0}),md=Vn(hS),gS=E({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),xS=Vn(gS),yS=E({},No,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),vS=Vn(yS),bS=E({},No,{data:0}),Ng=Vn(bS),wS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},kS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SS(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=kS[o])?!!i[o]:!1}function hd(){return SS}var NS=E({},Hi,{key:function(o){if(o.key){var i=wS[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=Tl(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?jS[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hd,charCode:function(o){return o.type==="keypress"?Tl(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Tl(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),CS=Vn(NS),ES=E({},Rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cg=Vn(ES),TS=E({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hd}),PS=Vn(TS),RS=E({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),AS=Vn(RS),DS=E({},Rl,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),OS=Vn(DS),IS=[9,13,27,32],gd=d&&"CompositionEvent"in window,Vi=null;d&&"documentMode"in document&&(Vi=document.documentMode);var LS=d&&"TextEvent"in window&&!Vi,Eg=d&&(!gd||Vi&&8<Vi&&11>=Vi),Tg=" ",Pg=!1;function Rg(o,i){switch(o){case"keyup":return IS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ag(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Co=!1;function $S(o,i){switch(o){case"compositionend":return Ag(i);case"keypress":return i.which!==32?null:(Pg=!0,Tg);case"textInput":return o=i.data,o===Tg&&Pg?null:o;default:return null}}function MS(o,i){if(Co)return o==="compositionend"||!gd&&Rg(o,i)?(o=jg(),El=ud=bs=null,Co=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Eg&&i.locale!=="ko"?null:i.data;default:return null}}var _S={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dg(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!_S[o.type]:i==="textarea"}function Og(o,i,u,h){qt(h),i=Ll(i,"onChange"),0<i.length&&(u=new dd("onChange","change",null,u,h),o.push({event:u,listeners:i}))}var qi=null,Ki=null;function FS(o){Xg(o,0)}function Al(o){var i=Ao(o);if(Ye(i))return o}function zS(o,i){if(o==="change")return i}var Ig=!1;if(d){var xd;if(d){var yd="oninput"in document;if(!yd){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),yd=typeof Lg.oninput=="function"}xd=yd}else xd=!1;Ig=xd&&(!document.documentMode||9<document.documentMode)}function $g(){qi&&(qi.detachEvent("onpropertychange",Mg),Ki=qi=null)}function Mg(o){if(o.propertyName==="value"&&Al(Ki)){var i=[];Og(i,Ki,o,Hn(o)),hr(FS,i)}}function BS(o,i,u){o==="focusin"?($g(),qi=i,Ki=u,qi.attachEvent("onpropertychange",Mg)):o==="focusout"&&$g()}function US(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Al(Ki)}function HS(o,i){if(o==="click")return Al(i)}function WS(o,i){if(o==="input"||o==="change")return Al(i)}function VS(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var xr=typeof Object.is=="function"?Object.is:VS;function Gi(o,i){if(xr(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var u=Object.keys(o),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!f.call(i,b)||!xr(o[b],i[b]))return!1}return!0}function _g(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Fg(o,i){var u=_g(o);o=0;for(var h;u;){if(u.nodeType===3){if(h=o+u.textContent.length,o<=i&&h>=i)return{node:u,offset:i-o};o=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=_g(u)}}function zg(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?zg(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function Bg(){for(var o=window,i=ie();i instanceof o.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)o=i.contentWindow;else break;i=ie(o.document)}return i}function vd(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}function qS(o){var i=Bg(),u=o.focusedElem,h=o.selectionRange;if(i!==u&&u&&u.ownerDocument&&zg(u.ownerDocument.documentElement,u)){if(h!==null&&vd(u)){if(i=h.start,o=h.end,o===void 0&&(o=i),"selectionStart"in u)u.selectionStart=i,u.selectionEnd=Math.min(o,u.value.length);else if(o=(i=u.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var b=u.textContent.length,k=Math.min(h.start,b);h=h.end===void 0?k:Math.min(h.end,b),!o.extend&&k>h&&(b=h,h=k,k=b),b=Fg(u,k);var P=Fg(u,h);b&&P&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==P.node||o.focusOffset!==P.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),o.removeAllRanges(),k>h?(o.addRange(i),o.extend(P.node,P.offset)):(i.setEnd(P.node,P.offset),o.addRange(i)))}}for(i=[],o=u;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<i.length;u++)o=i[u],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var KS=d&&"documentMode"in document&&11>=document.documentMode,Eo=null,bd=null,Yi=null,wd=!1;function Ug(o,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;wd||Eo==null||Eo!==ie(h)||(h=Eo,"selectionStart"in h&&vd(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Yi&&Gi(Yi,h)||(Yi=h,h=Ll(bd,"onSelect"),0<h.length&&(i=new dd("onSelect","select",null,i,u),o.push({event:i,listeners:h}),i.target=Eo)))}function Dl(o,i){var u={};return u[o.toLowerCase()]=i.toLowerCase(),u["Webkit"+o]="webkit"+i,u["Moz"+o]="moz"+i,u}var To={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionend:Dl("Transition","TransitionEnd")},jd={},Hg={};d&&(Hg=document.createElement("div").style,"AnimationEvent"in window||(delete To.animationend.animation,delete To.animationiteration.animation,delete To.animationstart.animation),"TransitionEvent"in window||delete To.transitionend.transition);function Ol(o){if(jd[o])return jd[o];if(!To[o])return o;var i=To[o],u;for(u in i)if(i.hasOwnProperty(u)&&u in Hg)return jd[o]=i[u];return o}var Wg=Ol("animationend"),Vg=Ol("animationiteration"),qg=Ol("animationstart"),Kg=Ol("transitionend"),Gg=new Map,Yg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ws(o,i){Gg.set(o,i),l(i,[o])}for(var kd=0;kd<Yg.length;kd++){var Sd=Yg[kd],GS=Sd.toLowerCase(),YS=Sd[0].toUpperCase()+Sd.slice(1);ws(GS,"on"+YS)}ws(Wg,"onAnimationEnd"),ws(Vg,"onAnimationIteration"),ws(qg,"onAnimationStart"),ws("dblclick","onDoubleClick"),ws("focusin","onFocus"),ws("focusout","onBlur"),ws(Kg,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ji="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),JS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ji));function Jg(o,i,u){var h=o.type||"unknown-event";o.currentTarget=u,hn(h,i,void 0,o),o.currentTarget=null}function Xg(o,i){i=(i&4)!==0;for(var u=0;u<o.length;u++){var h=o[u],b=h.event;h=h.listeners;e:{var k=void 0;if(i)for(var P=h.length-1;0<=P;P--){var F=h[P],q=F.instance,oe=F.currentTarget;if(F=F.listener,q!==k&&b.isPropagationStopped())break e;Jg(b,F,oe),k=q}else for(P=0;P<h.length;P++){if(F=h[P],q=F.instance,oe=F.currentTarget,F=F.listener,q!==k&&b.isPropagationStopped())break e;Jg(b,F,oe),k=q}}}if(de)throw o=Se,de=!1,Se=null,o}function vt(o,i){var u=i[Dd];u===void 0&&(u=i[Dd]=new Set);var h=o+"__bubble";u.has(h)||(Qg(i,o,2,!1),u.add(h))}function Nd(o,i,u){var h=0;i&&(h|=4),Qg(u,o,h,i)}var Il="_reactListening"+Math.random().toString(36).slice(2);function Xi(o){if(!o[Il]){o[Il]=!0,s.forEach(function(u){u!=="selectionchange"&&(JS.has(u)||Nd(u,!1,o),Nd(u,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[Il]||(i[Il]=!0,Nd("selectionchange",!1,i))}}function Qg(o,i,u,h){switch(wg(i)){case 1:var b=uS;break;case 4:b=dS;break;default:b=ld}u=b.bind(null,i,u,o),b=void 0,!Pn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),h?b!==void 0?o.addEventListener(i,u,{capture:!0,passive:b}):o.addEventListener(i,u,!0):b!==void 0?o.addEventListener(i,u,{passive:b}):o.addEventListener(i,u,!1)}function Cd(o,i,u,h,b){var k=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var P=h.tag;if(P===3||P===4){var F=h.stateNode.containerInfo;if(F===b||F.nodeType===8&&F.parentNode===b)break;if(P===4)for(P=h.return;P!==null;){var q=P.tag;if((q===3||q===4)&&(q=P.stateNode.containerInfo,q===b||q.nodeType===8&&q.parentNode===b))return;P=P.return}for(;F!==null;){if(P=Qs(F),P===null)return;if(q=P.tag,q===5||q===6){h=k=P;continue e}F=F.parentNode}}h=h.return}hr(function(){var oe=k,he=Hn(u),xe=[];e:{var fe=Gg.get(o);if(fe!==void 0){var Ee=dd,Re=o;switch(o){case"keypress":if(Tl(u)===0)break e;case"keydown":case"keyup":Ee=CS;break;case"focusin":Re="focus",Ee=md;break;case"focusout":Re="blur",Ee=md;break;case"beforeblur":case"afterblur":Ee=md;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ee=Sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ee=mS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ee=PS;break;case Wg:case Vg:case qg:Ee=xS;break;case Kg:Ee=AS;break;case"scroll":Ee=fS;break;case"wheel":Ee=OS;break;case"copy":case"cut":case"paste":Ee=vS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ee=Cg}var Ae=(i&4)!==0,Mt=!Ae&&o==="scroll",te=Ae?fe!==null?fe+"Capture":null:fe;Ae=[];for(var G=oe,re;G!==null;){re=G;var be=re.stateNode;if(re.tag===5&&be!==null&&(re=be,te!==null&&(be=ut(G,te),be!=null&&Ae.push(Qi(G,be,re)))),Mt)break;G=G.return}0<Ae.length&&(fe=new Ee(fe,Re,null,u,he),xe.push({event:fe,listeners:Ae}))}}if((i&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",Ee=o==="mouseout"||o==="pointerout",fe&&u!==Qt&&(Re=u.relatedTarget||u.fromElement)&&(Qs(Re)||Re[ns]))break e;if((Ee||fe)&&(fe=he.window===he?he:(fe=he.ownerDocument)?fe.defaultView||fe.parentWindow:window,Ee?(Re=u.relatedTarget||u.toElement,Ee=oe,Re=Re?Qs(Re):null,Re!==null&&(Mt=dt(Re),Re!==Mt||Re.tag!==5&&Re.tag!==6)&&(Re=null)):(Ee=null,Re=oe),Ee!==Re)){if(Ae=Sg,be="onMouseLeave",te="onMouseEnter",G="mouse",(o==="pointerout"||o==="pointerover")&&(Ae=Cg,be="onPointerLeave",te="onPointerEnter",G="pointer"),Mt=Ee==null?fe:Ao(Ee),re=Re==null?fe:Ao(Re),fe=new Ae(be,G+"leave",Ee,u,he),fe.target=Mt,fe.relatedTarget=re,be=null,Qs(he)===oe&&(Ae=new Ae(te,G+"enter",Re,u,he),Ae.target=re,Ae.relatedTarget=Mt,be=Ae),Mt=be,Ee&&Re)t:{for(Ae=Ee,te=Re,G=0,re=Ae;re;re=Po(re))G++;for(re=0,be=te;be;be=Po(be))re++;for(;0<G-re;)Ae=Po(Ae),G--;for(;0<re-G;)te=Po(te),re--;for(;G--;){if(Ae===te||te!==null&&Ae===te.alternate)break t;Ae=Po(Ae),te=Po(te)}Ae=null}else Ae=null;Ee!==null&&Zg(xe,fe,Ee,Ae,!1),Re!==null&&Mt!==null&&Zg(xe,Mt,Re,Ae,!0)}}e:{if(fe=oe?Ao(oe):window,Ee=fe.nodeName&&fe.nodeName.toLowerCase(),Ee==="select"||Ee==="input"&&fe.type==="file")var De=zS;else if(Dg(fe))if(Ig)De=WS;else{De=US;var $e=BS}else(Ee=fe.nodeName)&&Ee.toLowerCase()==="input"&&(fe.type==="checkbox"||fe.type==="radio")&&(De=HS);if(De&&(De=De(o,oe))){Og(xe,De,u,he);break e}$e&&$e(o,fe,oe),o==="focusout"&&($e=fe._wrapperState)&&$e.controlled&&fe.type==="number"&&_e(fe,"number",fe.value)}switch($e=oe?Ao(oe):window,o){case"focusin":(Dg($e)||$e.contentEditable==="true")&&(Eo=$e,bd=oe,Yi=null);break;case"focusout":Yi=bd=Eo=null;break;case"mousedown":wd=!0;break;case"contextmenu":case"mouseup":case"dragend":wd=!1,Ug(xe,u,he);break;case"selectionchange":if(KS)break;case"keydown":case"keyup":Ug(xe,u,he)}var Me;if(gd)e:{switch(o){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Co?Rg(o,u)&&(Be="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(Be="onCompositionStart");Be&&(Eg&&u.locale!=="ko"&&(Co||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Co&&(Me=jg()):(bs=he,ud="value"in bs?bs.value:bs.textContent,Co=!0)),$e=Ll(oe,Be),0<$e.length&&(Be=new Ng(Be,o,null,u,he),xe.push({event:Be,listeners:$e}),Me?Be.data=Me:(Me=Ag(u),Me!==null&&(Be.data=Me)))),(Me=LS?$S(o,u):MS(o,u))&&(oe=Ll(oe,"onBeforeInput"),0<oe.length&&(he=new Ng("onBeforeInput","beforeinput",null,u,he),xe.push({event:he,listeners:oe}),he.data=Me))}Xg(xe,i)})}function Qi(o,i,u){return{instance:o,listener:i,currentTarget:u}}function Ll(o,i){for(var u=i+"Capture",h=[];o!==null;){var b=o,k=b.stateNode;b.tag===5&&k!==null&&(b=k,k=ut(o,u),k!=null&&h.unshift(Qi(o,k,b)),k=ut(o,i),k!=null&&h.push(Qi(o,k,b))),o=o.return}return h}function Po(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Zg(o,i,u,h,b){for(var k=i._reactName,P=[];u!==null&&u!==h;){var F=u,q=F.alternate,oe=F.stateNode;if(q!==null&&q===h)break;F.tag===5&&oe!==null&&(F=oe,b?(q=ut(u,k),q!=null&&P.unshift(Qi(u,q,F))):b||(q=ut(u,k),q!=null&&P.push(Qi(u,q,F)))),u=u.return}P.length!==0&&o.push({event:i,listeners:P})}var XS=/\r\n?/g,QS=/\u0000|\uFFFD/g;function ex(o){return(typeof o=="string"?o:""+o).replace(XS,`
38
- `).replace(QS,"")}function $l(o,i,u){if(i=ex(i),ex(o)!==i&&u)throw Error(n(425))}function Ml(){}var Ed=null,Td=null;function Pd(o,i){return o==="textarea"||o==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Rd=typeof setTimeout=="function"?setTimeout:void 0,ZS=typeof clearTimeout=="function"?clearTimeout:void 0,tx=typeof Promise=="function"?Promise:void 0,eN=typeof queueMicrotask=="function"?queueMicrotask:typeof tx<"u"?function(o){return tx.resolve(null).then(o).catch(tN)}:Rd;function tN(o){setTimeout(function(){throw o})}function Ad(o,i){var u=i,h=0;do{var b=u.nextSibling;if(o.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"){if(h===0){o.removeChild(b),Ui(i);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=b}while(u);Ui(i)}function js(o){for(;o!=null;o=o.nextSibling){var i=o.nodeType;if(i===1||i===3)break;if(i===8){if(i=o.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return o}function nx(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return o;i--}else u==="/$"&&i++}o=o.previousSibling}return null}var Ro=Math.random().toString(36).slice(2),Or="__reactFiber$"+Ro,Zi="__reactProps$"+Ro,ns="__reactContainer$"+Ro,Dd="__reactEvents$"+Ro,nN="__reactListeners$"+Ro,rN="__reactHandles$"+Ro;function Qs(o){var i=o[Or];if(i)return i;for(var u=o.parentNode;u;){if(i=u[ns]||u[Or]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(o=nx(o);o!==null;){if(u=o[Or])return u;o=nx(o)}return i}o=u,u=o.parentNode}return null}function ea(o){return o=o[Or]||o[ns],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ao(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function _l(o){return o[Zi]||null}var Od=[],Do=-1;function ks(o){return{current:o}}function bt(o){0>Do||(o.current=Od[Do],Od[Do]=null,Do--)}function gt(o,i){Do++,Od[Do]=o.current,o.current=i}var Ss={},gn=ks(Ss),Rn=ks(!1),Zs=Ss;function Oo(o,i){var u=o.type.contextTypes;if(!u)return Ss;var h=o.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var b={},k;for(k in u)b[k]=i[k];return h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=b),b}function An(o){return o=o.childContextTypes,o!=null}function Fl(){bt(Rn),bt(gn)}function rx(o,i,u){if(gn.current!==Ss)throw Error(n(168));gt(gn,i),gt(Rn,u)}function sx(o,i,u){var h=o.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var b in h)if(!(b in i))throw Error(n(108,ge(o)||"Unknown",b));return E({},u,h)}function zl(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ss,Zs=gn.current,gt(gn,o),gt(Rn,Rn.current),!0}function ox(o,i,u){var h=o.stateNode;if(!h)throw Error(n(169));u?(o=sx(o,i,Zs),h.__reactInternalMemoizedMergedChildContext=o,bt(Rn),bt(gn),gt(gn,o)):bt(Rn),gt(Rn,u)}var rs=null,Bl=!1,Id=!1;function ix(o){rs===null?rs=[o]:rs.push(o)}function sN(o){Bl=!0,ix(o)}function Ns(){if(!Id&&rs!==null){Id=!0;var o=0,i=it;try{var u=rs;for(it=1;o<u.length;o++){var h=u[o];do h=h(!0);while(h!==null)}rs=null,Bl=!1}catch(b){throw rs!==null&&(rs=rs.slice(o+1)),lg(nd,Ns),b}finally{it=i,Id=!1}}return null}var Io=[],Lo=0,Ul=null,Hl=0,tr=[],nr=0,eo=null,ss=1,os="";function to(o,i){Io[Lo++]=Hl,Io[Lo++]=Ul,Ul=o,Hl=i}function ax(o,i,u){tr[nr++]=ss,tr[nr++]=os,tr[nr++]=eo,eo=o;var h=ss;o=os;var b=32-gr(h)-1;h&=~(1<<b),u+=1;var k=32-gr(i)+b;if(30<k){var P=b-b%5;k=(h&(1<<P)-1).toString(32),h>>=P,b-=P,ss=1<<32-gr(i)+b|u<<b|h,os=k+o}else ss=1<<k|u<<b|h,os=o}function Ld(o){o.return!==null&&(to(o,1),ax(o,1,0))}function $d(o){for(;o===Ul;)Ul=Io[--Lo],Io[Lo]=null,Hl=Io[--Lo],Io[Lo]=null;for(;o===eo;)eo=tr[--nr],tr[nr]=null,os=tr[--nr],tr[nr]=null,ss=tr[--nr],tr[nr]=null}var qn=null,Kn=null,Ct=!1,yr=null;function lx(o,i){var u=ir(5,null,null,0);u.elementType="DELETED",u.stateNode=i,u.return=o,i=o.deletions,i===null?(o.deletions=[u],o.flags|=16):i.push(u)}function cx(o,i){switch(o.tag){case 5:var u=o.type;return i=i.nodeType!==1||u.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(o.stateNode=i,qn=o,Kn=js(i.firstChild),!0):!1;case 6:return i=o.pendingProps===""||i.nodeType!==3?null:i,i!==null?(o.stateNode=i,qn=o,Kn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(u=eo!==null?{id:ss,overflow:os}:null,o.memoizedState={dehydrated:i,treeContext:u,retryLane:1073741824},u=ir(18,null,null,0),u.stateNode=i,u.return=o,o.child=u,qn=o,Kn=null,!0):!1;default:return!1}}function Md(o){return(o.mode&1)!==0&&(o.flags&128)===0}function _d(o){if(Ct){var i=Kn;if(i){var u=i;if(!cx(o,i)){if(Md(o))throw Error(n(418));i=js(u.nextSibling);var h=qn;i&&cx(o,i)?lx(h,u):(o.flags=o.flags&-4097|2,Ct=!1,qn=o)}}else{if(Md(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ct=!1,qn=o}}}function ux(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qn=o}function Wl(o){if(o!==qn)return!1;if(!Ct)return ux(o),Ct=!0,!1;var i;if((i=o.tag!==3)&&!(i=o.tag!==5)&&(i=o.type,i=i!=="head"&&i!=="body"&&!Pd(o.type,o.memoizedProps)),i&&(i=Kn)){if(Md(o))throw dx(),Error(n(418));for(;i;)lx(o,i),i=js(i.nextSibling)}if(ux(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="/$"){if(i===0){Kn=js(o.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++}o=o.nextSibling}Kn=null}}else Kn=qn?js(o.stateNode.nextSibling):null;return!0}function dx(){for(var o=Kn;o;)o=js(o.nextSibling)}function $o(){Kn=qn=null,Ct=!1}function Fd(o){yr===null?yr=[o]:yr.push(o)}var oN=A.ReactCurrentBatchConfig;function ta(o,i,u){if(o=u.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,o));var b=h,k=""+o;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===k?i.ref:(i=function(P){var F=b.refs;P===null?delete F[k]:F[k]=P},i._stringRef=k,i)}if(typeof o!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,o))}return o}function Vl(o,i){throw o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o))}function fx(o){var i=o._init;return i(o._payload)}function px(o){function i(te,G){if(o){var re=te.deletions;re===null?(te.deletions=[G],te.flags|=16):re.push(G)}}function u(te,G){if(!o)return null;for(;G!==null;)i(te,G),G=G.sibling;return null}function h(te,G){for(te=new Map;G!==null;)G.key!==null?te.set(G.key,G):te.set(G.index,G),G=G.sibling;return te}function b(te,G){return te=Os(te,G),te.index=0,te.sibling=null,te}function k(te,G,re){return te.index=re,o?(re=te.alternate,re!==null?(re=re.index,re<G?(te.flags|=2,G):re):(te.flags|=2,G)):(te.flags|=1048576,G)}function P(te){return o&&te.alternate===null&&(te.flags|=2),te}function F(te,G,re,be){return G===null||G.tag!==6?(G=Af(re,te.mode,be),G.return=te,G):(G=b(G,re),G.return=te,G)}function q(te,G,re,be){var De=re.type;return De===O?he(te,G,re.props.children,be,re.key):G!==null&&(G.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===z&&fx(De)===G.type)?(be=b(G,re.props),be.ref=ta(te,G,re),be.return=te,be):(be=hc(re.type,re.key,re.props,null,te.mode,be),be.ref=ta(te,G,re),be.return=te,be)}function oe(te,G,re,be){return G===null||G.tag!==4||G.stateNode.containerInfo!==re.containerInfo||G.stateNode.implementation!==re.implementation?(G=Df(re,te.mode,be),G.return=te,G):(G=b(G,re.children||[]),G.return=te,G)}function he(te,G,re,be,De){return G===null||G.tag!==7?(G=co(re,te.mode,be,De),G.return=te,G):(G=b(G,re),G.return=te,G)}function xe(te,G,re){if(typeof G=="string"&&G!==""||typeof G=="number")return G=Af(""+G,te.mode,re),G.return=te,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case $:return re=hc(G.type,G.key,G.props,null,te.mode,re),re.ref=ta(te,null,G),re.return=te,re;case R:return G=Df(G,te.mode,re),G.return=te,G;case z:var be=G._init;return xe(te,be(G._payload),re)}if(Oe(G)||Q(G))return G=co(G,te.mode,re,null),G.return=te,G;Vl(te,G)}return null}function fe(te,G,re,be){var De=G!==null?G.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return De!==null?null:F(te,G,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case $:return re.key===De?q(te,G,re,be):null;case R:return re.key===De?oe(te,G,re,be):null;case z:return De=re._init,fe(te,G,De(re._payload),be)}if(Oe(re)||Q(re))return De!==null?null:he(te,G,re,be,null);Vl(te,re)}return null}function Ee(te,G,re,be,De){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(re)||null,F(G,te,""+be,De);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case $:return te=te.get(be.key===null?re:be.key)||null,q(G,te,be,De);case R:return te=te.get(be.key===null?re:be.key)||null,oe(G,te,be,De);case z:var $e=be._init;return Ee(te,G,re,$e(be._payload),De)}if(Oe(be)||Q(be))return te=te.get(re)||null,he(G,te,be,De,null);Vl(G,be)}return null}function Re(te,G,re,be){for(var De=null,$e=null,Me=G,Be=G=0,on=null;Me!==null&&Be<re.length;Be++){Me.index>Be?(on=Me,Me=null):on=Me.sibling;var Ze=fe(te,Me,re[Be],be);if(Ze===null){Me===null&&(Me=on);break}o&&Me&&Ze.alternate===null&&i(te,Me),G=k(Ze,G,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze,Me=on}if(Be===re.length)return u(te,Me),Ct&&to(te,Be),De;if(Me===null){for(;Be<re.length;Be++)Me=xe(te,re[Be],be),Me!==null&&(G=k(Me,G,Be),$e===null?De=Me:$e.sibling=Me,$e=Me);return Ct&&to(te,Be),De}for(Me=h(te,Me);Be<re.length;Be++)on=Ee(Me,te,Be,re[Be],be),on!==null&&(o&&on.alternate!==null&&Me.delete(on.key===null?Be:on.key),G=k(on,G,Be),$e===null?De=on:$e.sibling=on,$e=on);return o&&Me.forEach(function(Is){return i(te,Is)}),Ct&&to(te,Be),De}function Ae(te,G,re,be){var De=Q(re);if(typeof De!="function")throw Error(n(150));if(re=De.call(re),re==null)throw Error(n(151));for(var $e=De=null,Me=G,Be=G=0,on=null,Ze=re.next();Me!==null&&!Ze.done;Be++,Ze=re.next()){Me.index>Be?(on=Me,Me=null):on=Me.sibling;var Is=fe(te,Me,Ze.value,be);if(Is===null){Me===null&&(Me=on);break}o&&Me&&Is.alternate===null&&i(te,Me),G=k(Is,G,Be),$e===null?De=Is:$e.sibling=Is,$e=Is,Me=on}if(Ze.done)return u(te,Me),Ct&&to(te,Be),De;if(Me===null){for(;!Ze.done;Be++,Ze=re.next())Ze=xe(te,Ze.value,be),Ze!==null&&(G=k(Ze,G,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze);return Ct&&to(te,Be),De}for(Me=h(te,Me);!Ze.done;Be++,Ze=re.next())Ze=Ee(Me,te,Be,Ze.value,be),Ze!==null&&(o&&Ze.alternate!==null&&Me.delete(Ze.key===null?Be:Ze.key),G=k(Ze,G,Be),$e===null?De=Ze:$e.sibling=Ze,$e=Ze);return o&&Me.forEach(function(_N){return i(te,_N)}),Ct&&to(te,Be),De}function Mt(te,G,re,be){if(typeof re=="object"&&re!==null&&re.type===O&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case $:e:{for(var De=re.key,$e=G;$e!==null;){if($e.key===De){if(De=re.type,De===O){if($e.tag===7){u(te,$e.sibling),G=b($e,re.props.children),G.return=te,te=G;break e}}else if($e.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===z&&fx(De)===$e.type){u(te,$e.sibling),G=b($e,re.props),G.ref=ta(te,$e,re),G.return=te,te=G;break e}u(te,$e);break}else i(te,$e);$e=$e.sibling}re.type===O?(G=co(re.props.children,te.mode,be,re.key),G.return=te,te=G):(be=hc(re.type,re.key,re.props,null,te.mode,be),be.ref=ta(te,G,re),be.return=te,te=be)}return P(te);case R:e:{for($e=re.key;G!==null;){if(G.key===$e)if(G.tag===4&&G.stateNode.containerInfo===re.containerInfo&&G.stateNode.implementation===re.implementation){u(te,G.sibling),G=b(G,re.children||[]),G.return=te,te=G;break e}else{u(te,G);break}else i(te,G);G=G.sibling}G=Df(re,te.mode,be),G.return=te,te=G}return P(te);case z:return $e=re._init,Mt(te,G,$e(re._payload),be)}if(Oe(re))return Re(te,G,re,be);if(Q(re))return Ae(te,G,re,be);Vl(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,G!==null&&G.tag===6?(u(te,G.sibling),G=b(G,re),G.return=te,te=G):(u(te,G),G=Af(re,te.mode,be),G.return=te,te=G),P(te)):u(te,G)}return Mt}var Mo=px(!0),mx=px(!1),ql=ks(null),Kl=null,_o=null,zd=null;function Bd(){zd=_o=Kl=null}function Ud(o){var i=ql.current;bt(ql),o._currentValue=i}function Hd(o,i,u){for(;o!==null;){var h=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),o===u)break;o=o.return}}function Fo(o,i){Kl=o,zd=_o=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(Dn=!0),o.firstContext=null)}function rr(o){var i=o._currentValue;if(zd!==o)if(o={context:o,memoizedValue:i,next:null},_o===null){if(Kl===null)throw Error(n(308));_o=o,Kl.dependencies={lanes:0,firstContext:o}}else _o=_o.next=o;return i}var no=null;function Wd(o){no===null?no=[o]:no.push(o)}function hx(o,i,u,h){var b=i.interleaved;return b===null?(u.next=u,Wd(i)):(u.next=b.next,b.next=u),i.interleaved=u,is(o,h)}function is(o,i){o.lanes|=i;var u=o.alternate;for(u!==null&&(u.lanes|=i),u=o,o=o.return;o!==null;)o.childLanes|=i,u=o.alternate,u!==null&&(u.childLanes|=i),u=o,o=o.return;return u.tag===3?u.stateNode:null}var Cs=!1;function Vd(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gx(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function as(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function Es(o,i,u){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Qe&2)!==0){var b=h.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),h.pending=i,is(o,u)}return b=h.interleaved,b===null?(i.next=i,Wd(h)):(i.next=b.next,b.next=i),h.interleaved=i,is(o,u)}function Gl(o,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194240)!==0)){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,od(o,u)}}function xx(o,i){var u=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var P={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?b=k=P:k=k.next=P,u=u.next}while(u!==null);k===null?b=k=i:k=k.next=i}else b=k=i;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:k,shared:h.shared,effects:h.effects},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=i:o.next=i,u.lastBaseUpdate=i}function Yl(o,i,u,h){var b=o.updateQueue;Cs=!1;var k=b.firstBaseUpdate,P=b.lastBaseUpdate,F=b.shared.pending;if(F!==null){b.shared.pending=null;var q=F,oe=q.next;q.next=null,P===null?k=oe:P.next=oe,P=q;var he=o.alternate;he!==null&&(he=he.updateQueue,F=he.lastBaseUpdate,F!==P&&(F===null?he.firstBaseUpdate=oe:F.next=oe,he.lastBaseUpdate=q))}if(k!==null){var xe=b.baseState;P=0,he=oe=q=null,F=k;do{var fe=F.lane,Ee=F.eventTime;if((h&fe)===fe){he!==null&&(he=he.next={eventTime:Ee,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Re=o,Ae=F;switch(fe=i,Ee=u,Ae.tag){case 1:if(Re=Ae.payload,typeof Re=="function"){xe=Re.call(Ee,xe,fe);break e}xe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ae.payload,fe=typeof Re=="function"?Re.call(Ee,xe,fe):Re,fe==null)break e;xe=E({},xe,fe);break e;case 2:Cs=!0}}F.callback!==null&&F.lane!==0&&(o.flags|=64,fe=b.effects,fe===null?b.effects=[F]:fe.push(F))}else Ee={eventTime:Ee,lane:fe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},he===null?(oe=he=Ee,q=xe):he=he.next=Ee,P|=fe;if(F=F.next,F===null){if(F=b.shared.pending,F===null)break;fe=F,F=fe.next,fe.next=null,b.lastBaseUpdate=fe,b.shared.pending=null}}while(!0);if(he===null&&(q=xe),b.baseState=q,b.firstBaseUpdate=oe,b.lastBaseUpdate=he,i=b.shared.interleaved,i!==null){b=i;do P|=b.lane,b=b.next;while(b!==i)}else k===null&&(b.shared.lanes=0);oo|=P,o.lanes=P,o.memoizedState=xe}}function yx(o,i,u){if(o=i.effects,i.effects=null,o!==null)for(i=0;i<o.length;i++){var h=o[i],b=h.callback;if(b!==null){if(h.callback=null,h=u,typeof b!="function")throw Error(n(191,b));b.call(h)}}}var na={},Ir=ks(na),ra=ks(na),sa=ks(na);function ro(o){if(o===na)throw Error(n(174));return o}function qd(o,i){switch(gt(sa,i),gt(ra,o),gt(Ir,na),o=i.nodeType,o){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:me(null,"");break;default:o=o===8?i.parentNode:i,i=o.namespaceURI||null,o=o.tagName,i=me(i,o)}bt(Ir),gt(Ir,i)}function zo(){bt(Ir),bt(ra),bt(sa)}function vx(o){ro(sa.current);var i=ro(Ir.current),u=me(i,o.type);i!==u&&(gt(ra,o),gt(Ir,u))}function Kd(o){ra.current===o&&(bt(Ir),bt(ra))}var At=ks(0);function Jl(o){for(var i=o;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Gd=[];function Yd(){for(var o=0;o<Gd.length;o++)Gd[o]._workInProgressVersionPrimary=null;Gd.length=0}var Xl=A.ReactCurrentDispatcher,Jd=A.ReactCurrentBatchConfig,so=0,Dt=null,Kt=null,rn=null,Ql=!1,oa=!1,ia=0,iN=0;function xn(){throw Error(n(321))}function Xd(o,i){if(i===null)return!1;for(var u=0;u<i.length&&u<o.length;u++)if(!xr(o[u],i[u]))return!1;return!0}function Qd(o,i,u,h,b,k){if(so=k,Dt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Xl.current=o===null||o.memoizedState===null?uN:dN,o=u(h,b),oa){k=0;do{if(oa=!1,ia=0,25<=k)throw Error(n(301));k+=1,rn=Kt=null,i.updateQueue=null,Xl.current=fN,o=u(h,b)}while(oa)}if(Xl.current=tc,i=Kt!==null&&Kt.next!==null,so=0,rn=Kt=Dt=null,Ql=!1,i)throw Error(n(300));return o}function Zd(){var o=ia!==0;return ia=0,o}function Lr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Dt.memoizedState=rn=o:rn=rn.next=o,rn}function sr(){if(Kt===null){var o=Dt.alternate;o=o!==null?o.memoizedState:null}else o=Kt.next;var i=rn===null?Dt.memoizedState:rn.next;if(i!==null)rn=i,Kt=o;else{if(o===null)throw Error(n(310));Kt=o,o={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},rn===null?Dt.memoizedState=rn=o:rn=rn.next=o}return rn}function aa(o,i){return typeof i=="function"?i(o):i}function ef(o){var i=sr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=Kt,b=h.baseQueue,k=u.pending;if(k!==null){if(b!==null){var P=b.next;b.next=k.next,k.next=P}h.baseQueue=b=k,u.pending=null}if(b!==null){k=b.next,h=h.baseState;var F=P=null,q=null,oe=k;do{var he=oe.lane;if((so&he)===he)q!==null&&(q=q.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),h=oe.hasEagerState?oe.eagerState:o(h,oe.action);else{var xe={lane:he,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};q===null?(F=q=xe,P=h):q=q.next=xe,Dt.lanes|=he,oo|=he}oe=oe.next}while(oe!==null&&oe!==k);q===null?P=h:q.next=F,xr(h,i.memoizedState)||(Dn=!0),i.memoizedState=h,i.baseState=P,i.baseQueue=q,u.lastRenderedState=h}if(o=u.interleaved,o!==null){b=o;do k=b.lane,Dt.lanes|=k,oo|=k,b=b.next;while(b!==o)}else b===null&&(u.lanes=0);return[i.memoizedState,u.dispatch]}function tf(o){var i=sr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=u.dispatch,b=u.pending,k=i.memoizedState;if(b!==null){u.pending=null;var P=b=b.next;do k=o(k,P.action),P=P.next;while(P!==b);xr(k,i.memoizedState)||(Dn=!0),i.memoizedState=k,i.baseQueue===null&&(i.baseState=k),u.lastRenderedState=k}return[k,h]}function bx(){}function wx(o,i){var u=Dt,h=sr(),b=i(),k=!xr(h.memoizedState,b);if(k&&(h.memoizedState=b,Dn=!0),h=h.queue,nf(Sx.bind(null,u,h,o),[o]),h.getSnapshot!==i||k||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,la(9,kx.bind(null,u,h,b,i),void 0,null),sn===null)throw Error(n(349));(so&30)!==0||jx(u,i,b)}return b}function jx(o,i,u){o.flags|=16384,o={getSnapshot:i,value:u},i=Dt.updateQueue,i===null?(i={lastEffect:null,stores:null},Dt.updateQueue=i,i.stores=[o]):(u=i.stores,u===null?i.stores=[o]:u.push(o))}function kx(o,i,u,h){i.value=u,i.getSnapshot=h,Nx(i)&&Cx(o)}function Sx(o,i,u){return u(function(){Nx(i)&&Cx(o)})}function Nx(o){var i=o.getSnapshot;o=o.value;try{var u=i();return!xr(o,u)}catch{return!0}}function Cx(o){var i=is(o,1);i!==null&&jr(i,o,1,-1)}function Ex(o){var i=Lr();return typeof o=="function"&&(o=o()),i.memoizedState=i.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:o},i.queue=o,o=o.dispatch=cN.bind(null,Dt,o),[i.memoizedState,o]}function la(o,i,u,h){return o={tag:o,create:i,destroy:u,deps:h,next:null},i=Dt.updateQueue,i===null?(i={lastEffect:null,stores:null},Dt.updateQueue=i,i.lastEffect=o.next=o):(u=i.lastEffect,u===null?i.lastEffect=o.next=o:(h=u.next,u.next=o,o.next=h,i.lastEffect=o)),o}function Tx(){return sr().memoizedState}function Zl(o,i,u,h){var b=Lr();Dt.flags|=o,b.memoizedState=la(1|i,u,void 0,h===void 0?null:h)}function ec(o,i,u,h){var b=sr();h=h===void 0?null:h;var k=void 0;if(Kt!==null){var P=Kt.memoizedState;if(k=P.destroy,h!==null&&Xd(h,P.deps)){b.memoizedState=la(i,u,k,h);return}}Dt.flags|=o,b.memoizedState=la(1|i,u,k,h)}function Px(o,i){return Zl(8390656,8,o,i)}function nf(o,i){return ec(2048,8,o,i)}function Rx(o,i){return ec(4,2,o,i)}function Ax(o,i){return ec(4,4,o,i)}function Dx(o,i){if(typeof i=="function")return o=o(),i(o),function(){i(null)};if(i!=null)return o=o(),i.current=o,function(){i.current=null}}function Ox(o,i,u){return u=u!=null?u.concat([o]):null,ec(4,4,Dx.bind(null,i,o),u)}function rf(){}function Ix(o,i){var u=sr();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&Xd(i,h[1])?h[0]:(u.memoizedState=[o,i],o)}function Lx(o,i){var u=sr();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&Xd(i,h[1])?h[0]:(o=o(),u.memoizedState=[o,i],o)}function $x(o,i,u){return(so&21)===0?(o.baseState&&(o.baseState=!1,Dn=!0),o.memoizedState=u):(xr(u,i)||(u=fg(),Dt.lanes|=u,oo|=u,o.baseState=!0),i)}function aN(o,i){var u=it;it=u!==0&&4>u?u:4,o(!0);var h=Jd.transition;Jd.transition={};try{o(!1),i()}finally{it=u,Jd.transition=h}}function Mx(){return sr().memoizedState}function lN(o,i,u){var h=As(o);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},_x(o))Fx(i,u);else if(u=hx(o,i,u,h),u!==null){var b=Nn();jr(u,o,h,b),zx(u,i,h)}}function cN(o,i,u){var h=As(o),b={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(_x(o))Fx(i,b);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=i.lastRenderedReducer,k!==null))try{var P=i.lastRenderedState,F=k(P,u);if(b.hasEagerState=!0,b.eagerState=F,xr(F,P)){var q=i.interleaved;q===null?(b.next=b,Wd(i)):(b.next=q.next,q.next=b),i.interleaved=b;return}}catch{}finally{}u=hx(o,i,b,h),u!==null&&(b=Nn(),jr(u,o,h,b),zx(u,i,h))}}function _x(o){var i=o.alternate;return o===Dt||i!==null&&i===Dt}function Fx(o,i){oa=Ql=!0;var u=o.pending;u===null?i.next=i:(i.next=u.next,u.next=i),o.pending=i}function zx(o,i,u){if((u&4194240)!==0){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,od(o,u)}}var tc={readContext:rr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},uN={readContext:rr,useCallback:function(o,i){return Lr().memoizedState=[o,i===void 0?null:i],o},useContext:rr,useEffect:Px,useImperativeHandle:function(o,i,u){return u=u!=null?u.concat([o]):null,Zl(4194308,4,Dx.bind(null,i,o),u)},useLayoutEffect:function(o,i){return Zl(4194308,4,o,i)},useInsertionEffect:function(o,i){return Zl(4,2,o,i)},useMemo:function(o,i){var u=Lr();return i=i===void 0?null:i,o=o(),u.memoizedState=[o,i],o},useReducer:function(o,i,u){var h=Lr();return i=u!==void 0?u(i):i,h.memoizedState=h.baseState=i,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:i},h.queue=o,o=o.dispatch=lN.bind(null,Dt,o),[h.memoizedState,o]},useRef:function(o){var i=Lr();return o={current:o},i.memoizedState=o},useState:Ex,useDebugValue:rf,useDeferredValue:function(o){return Lr().memoizedState=o},useTransition:function(){var o=Ex(!1),i=o[0];return o=aN.bind(null,o[1]),Lr().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,u){var h=Dt,b=Lr();if(Ct){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),sn===null)throw Error(n(349));(so&30)!==0||jx(h,i,u)}b.memoizedState=u;var k={value:u,getSnapshot:i};return b.queue=k,Px(Sx.bind(null,h,k,o),[o]),h.flags|=2048,la(9,kx.bind(null,h,k,u,i),void 0,null),u},useId:function(){var o=Lr(),i=sn.identifierPrefix;if(Ct){var u=os,h=ss;u=(h&~(1<<32-gr(h)-1)).toString(32)+u,i=":"+i+"R"+u,u=ia++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=iN++,i=":"+i+"r"+u.toString(32)+":";return o.memoizedState=i},unstable_isNewReconciler:!1},dN={readContext:rr,useCallback:Ix,useContext:rr,useEffect:nf,useImperativeHandle:Ox,useInsertionEffect:Rx,useLayoutEffect:Ax,useMemo:Lx,useReducer:ef,useRef:Tx,useState:function(){return ef(aa)},useDebugValue:rf,useDeferredValue:function(o){var i=sr();return $x(i,Kt.memoizedState,o)},useTransition:function(){var o=ef(aa)[0],i=sr().memoizedState;return[o,i]},useMutableSource:bx,useSyncExternalStore:wx,useId:Mx,unstable_isNewReconciler:!1},fN={readContext:rr,useCallback:Ix,useContext:rr,useEffect:nf,useImperativeHandle:Ox,useInsertionEffect:Rx,useLayoutEffect:Ax,useMemo:Lx,useReducer:tf,useRef:Tx,useState:function(){return tf(aa)},useDebugValue:rf,useDeferredValue:function(o){var i=sr();return Kt===null?i.memoizedState=o:$x(i,Kt.memoizedState,o)},useTransition:function(){var o=tf(aa)[0],i=sr().memoizedState;return[o,i]},useMutableSource:bx,useSyncExternalStore:wx,useId:Mx,unstable_isNewReconciler:!1};function vr(o,i){if(o&&o.defaultProps){i=E({},i),o=o.defaultProps;for(var u in o)i[u]===void 0&&(i[u]=o[u]);return i}return i}function sf(o,i,u,h){i=o.memoizedState,u=u(h,i),u=u==null?i:E({},i,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var nc={isMounted:function(o){return(o=o._reactInternals)?dt(o)===o:!1},enqueueSetState:function(o,i,u){o=o._reactInternals;var h=Nn(),b=As(o),k=as(h,b);k.payload=i,u!=null&&(k.callback=u),i=Es(o,k,b),i!==null&&(jr(i,o,b,h),Gl(i,o,b))},enqueueReplaceState:function(o,i,u){o=o._reactInternals;var h=Nn(),b=As(o),k=as(h,b);k.tag=1,k.payload=i,u!=null&&(k.callback=u),i=Es(o,k,b),i!==null&&(jr(i,o,b,h),Gl(i,o,b))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var u=Nn(),h=As(o),b=as(u,h);b.tag=2,i!=null&&(b.callback=i),i=Es(o,b,h),i!==null&&(jr(i,o,h,u),Gl(i,o,h))}};function Bx(o,i,u,h,b,k,P){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,k,P):i.prototype&&i.prototype.isPureReactComponent?!Gi(u,h)||!Gi(b,k):!0}function Ux(o,i,u){var h=!1,b=Ss,k=i.contextType;return typeof k=="object"&&k!==null?k=rr(k):(b=An(i)?Zs:gn.current,h=i.contextTypes,k=(h=h!=null)?Oo(o,b):Ss),i=new i(u,k),o.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=nc,o.stateNode=i,i._reactInternals=o,h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=k),i}function Hx(o,i,u,h){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==o&&nc.enqueueReplaceState(i,i.state,null)}function of(o,i,u,h){var b=o.stateNode;b.props=u,b.state=o.memoizedState,b.refs={},Vd(o);var k=i.contextType;typeof k=="object"&&k!==null?b.context=rr(k):(k=An(i)?Zs:gn.current,b.context=Oo(o,k)),b.state=o.memoizedState,k=i.getDerivedStateFromProps,typeof k=="function"&&(sf(o,i,k,u),b.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(i=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),i!==b.state&&nc.enqueueReplaceState(b,b.state,null),Yl(o,u,b,h),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Bo(o,i){try{var u="",h=i;do u+=ce(h),h=h.return;while(h);var b=u}catch(k){b=`
39
- Error generating stack: `+k.message+`
40
- `+k.stack}return{value:o,source:i,stack:b,digest:null}}function af(o,i,u){return{value:o,source:null,stack:u??null,digest:i??null}}function lf(o,i){try{console.error(i.value)}catch(u){setTimeout(function(){throw u})}}var pN=typeof WeakMap=="function"?WeakMap:Map;function Wx(o,i,u){u=as(-1,u),u.tag=3,u.payload={element:null};var h=i.value;return u.callback=function(){cc||(cc=!0,kf=h),lf(o,i)},u}function Vx(o,i,u){u=as(-1,u),u.tag=3;var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var b=i.value;u.payload=function(){return h(b)},u.callback=function(){lf(o,i)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){lf(o,i),typeof h!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var P=i.stack;this.componentDidCatch(i.value,{componentStack:P!==null?P:""})}),u}function qx(o,i,u){var h=o.pingCache;if(h===null){h=o.pingCache=new pN;var b=new Set;h.set(i,b)}else b=h.get(i),b===void 0&&(b=new Set,h.set(i,b));b.has(u)||(b.add(u),o=EN.bind(null,o,i,u),i.then(o,o))}function Kx(o){do{var i;if((i=o.tag===13)&&(i=o.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return o;o=o.return}while(o!==null);return null}function Gx(o,i,u,h,b){return(o.mode&1)===0?(o===i?o.flags|=65536:(o.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(i=as(-1,1),i.tag=2,Es(u,i,1))),u.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var mN=A.ReactCurrentOwner,Dn=!1;function Sn(o,i,u,h){i.child=o===null?mx(i,null,u,h):Mo(i,o.child,u,h)}function Yx(o,i,u,h,b){u=u.render;var k=i.ref;return Fo(i,b),h=Qd(o,i,u,h,k,b),u=Zd(),o!==null&&!Dn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,ls(o,i,b)):(Ct&&u&&Ld(i),i.flags|=1,Sn(o,i,h,b),i.child)}function Jx(o,i,u,h,b){if(o===null){var k=u.type;return typeof k=="function"&&!Rf(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(i.tag=15,i.type=k,Xx(o,i,k,h,b)):(o=hc(u.type,null,h,i,i.mode,b),o.ref=i.ref,o.return=i,i.child=o)}if(k=o.child,(o.lanes&b)===0){var P=k.memoizedProps;if(u=u.compare,u=u!==null?u:Gi,u(P,h)&&o.ref===i.ref)return ls(o,i,b)}return i.flags|=1,o=Os(k,h),o.ref=i.ref,o.return=i,i.child=o}function Xx(o,i,u,h,b){if(o!==null){var k=o.memoizedProps;if(Gi(k,h)&&o.ref===i.ref)if(Dn=!1,i.pendingProps=h=k,(o.lanes&b)!==0)(o.flags&131072)!==0&&(Dn=!0);else return i.lanes=o.lanes,ls(o,i,b)}return cf(o,i,u,h,b)}function Qx(o,i,u){var h=i.pendingProps,b=h.children,k=o!==null?o.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Ho,Gn),Gn|=u;else{if((u&1073741824)===0)return o=k!==null?k.baseLanes|u:u,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:o,cachePool:null,transitions:null},i.updateQueue=null,gt(Ho,Gn),Gn|=o,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=k!==null?k.baseLanes:u,gt(Ho,Gn),Gn|=h}else k!==null?(h=k.baseLanes|u,i.memoizedState=null):h=u,gt(Ho,Gn),Gn|=h;return Sn(o,i,b,u),i.child}function Zx(o,i){var u=i.ref;(o===null&&u!==null||o!==null&&o.ref!==u)&&(i.flags|=512,i.flags|=2097152)}function cf(o,i,u,h,b){var k=An(u)?Zs:gn.current;return k=Oo(i,k),Fo(i,b),u=Qd(o,i,u,h,k,b),h=Zd(),o!==null&&!Dn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,ls(o,i,b)):(Ct&&h&&Ld(i),i.flags|=1,Sn(o,i,u,b),i.child)}function ey(o,i,u,h,b){if(An(u)){var k=!0;zl(i)}else k=!1;if(Fo(i,b),i.stateNode===null)sc(o,i),Ux(i,u,h),of(i,u,h,b),h=!0;else if(o===null){var P=i.stateNode,F=i.memoizedProps;P.props=F;var q=P.context,oe=u.contextType;typeof oe=="object"&&oe!==null?oe=rr(oe):(oe=An(u)?Zs:gn.current,oe=Oo(i,oe));var he=u.getDerivedStateFromProps,xe=typeof he=="function"||typeof P.getSnapshotBeforeUpdate=="function";xe||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==h||q!==oe)&&Hx(i,P,h,oe),Cs=!1;var fe=i.memoizedState;P.state=fe,Yl(i,h,P,b),q=i.memoizedState,F!==h||fe!==q||Rn.current||Cs?(typeof he=="function"&&(sf(i,u,he,h),q=i.memoizedState),(F=Cs||Bx(i,u,F,h,fe,q,oe))?(xe||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(i.flags|=4194308)):(typeof P.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=q),P.props=h,P.state=q,P.context=oe,h=F):(typeof P.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{P=i.stateNode,gx(o,i),F=i.memoizedProps,oe=i.type===i.elementType?F:vr(i.type,F),P.props=oe,xe=i.pendingProps,fe=P.context,q=u.contextType,typeof q=="object"&&q!==null?q=rr(q):(q=An(u)?Zs:gn.current,q=Oo(i,q));var Ee=u.getDerivedStateFromProps;(he=typeof Ee=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==xe||fe!==q)&&Hx(i,P,h,q),Cs=!1,fe=i.memoizedState,P.state=fe,Yl(i,h,P,b);var Re=i.memoizedState;F!==xe||fe!==Re||Rn.current||Cs?(typeof Ee=="function"&&(sf(i,u,Ee,h),Re=i.memoizedState),(oe=Cs||Bx(i,u,oe,h,fe,Re,q)||!1)?(he||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(h,Re,q),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(h,Re,q)),typeof P.componentDidUpdate=="function"&&(i.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof P.componentDidUpdate!="function"||F===o.memoizedProps&&fe===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&fe===o.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=Re),P.props=h,P.state=Re,P.context=q,h=oe):(typeof P.componentDidUpdate!="function"||F===o.memoizedProps&&fe===o.memoizedState||(i.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&fe===o.memoizedState||(i.flags|=1024),h=!1)}return uf(o,i,u,h,k,b)}function uf(o,i,u,h,b,k){Zx(o,i);var P=(i.flags&128)!==0;if(!h&&!P)return b&&ox(i,u,!1),ls(o,i,k);h=i.stateNode,mN.current=i;var F=P&&typeof u.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,o!==null&&P?(i.child=Mo(i,o.child,null,k),i.child=Mo(i,null,F,k)):Sn(o,i,F,k),i.memoizedState=h.state,b&&ox(i,u,!0),i.child}function ty(o){var i=o.stateNode;i.pendingContext?rx(o,i.pendingContext,i.pendingContext!==i.context):i.context&&rx(o,i.context,!1),qd(o,i.containerInfo)}function ny(o,i,u,h,b){return $o(),Fd(b),i.flags|=256,Sn(o,i,u,h),i.child}var df={dehydrated:null,treeContext:null,retryLane:0};function ff(o){return{baseLanes:o,cachePool:null,transitions:null}}function ry(o,i,u){var h=i.pendingProps,b=At.current,k=!1,P=(i.flags&128)!==0,F;if((F=P)||(F=o!==null&&o.memoizedState===null?!1:(b&2)!==0),F?(k=!0,i.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),gt(At,b&1),o===null)return _d(i),o=i.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((i.mode&1)===0?i.lanes=1:o.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(P=h.children,o=h.fallback,k?(h=i.mode,k=i.child,P={mode:"hidden",children:P},(h&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=P):k=gc(P,h,0,null),o=co(o,h,u,null),k.return=i,o.return=i,k.sibling=o,i.child=k,i.child.memoizedState=ff(u),i.memoizedState=df,o):pf(i,P));if(b=o.memoizedState,b!==null&&(F=b.dehydrated,F!==null))return hN(o,i,P,h,F,b,u);if(k){k=h.fallback,P=i.mode,b=o.child,F=b.sibling;var q={mode:"hidden",children:h.children};return(P&1)===0&&i.child!==b?(h=i.child,h.childLanes=0,h.pendingProps=q,i.deletions=null):(h=Os(b,q),h.subtreeFlags=b.subtreeFlags&14680064),F!==null?k=Os(F,k):(k=co(k,P,u,null),k.flags|=2),k.return=i,h.return=i,h.sibling=k,i.child=h,h=k,k=i.child,P=o.child.memoizedState,P=P===null?ff(u):{baseLanes:P.baseLanes|u,cachePool:null,transitions:P.transitions},k.memoizedState=P,k.childLanes=o.childLanes&~u,i.memoizedState=df,h}return k=o.child,o=k.sibling,h=Os(k,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=u),h.return=i,h.sibling=null,o!==null&&(u=i.deletions,u===null?(i.deletions=[o],i.flags|=16):u.push(o)),i.child=h,i.memoizedState=null,h}function pf(o,i){return i=gc({mode:"visible",children:i},o.mode,0,null),i.return=o,o.child=i}function rc(o,i,u,h){return h!==null&&Fd(h),Mo(i,o.child,null,u),o=pf(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function hN(o,i,u,h,b,k,P){if(u)return i.flags&256?(i.flags&=-257,h=af(Error(n(422))),rc(o,i,P,h)):i.memoizedState!==null?(i.child=o.child,i.flags|=128,null):(k=h.fallback,b=i.mode,h=gc({mode:"visible",children:h.children},b,0,null),k=co(k,b,P,null),k.flags|=2,h.return=i,k.return=i,h.sibling=k,i.child=h,(i.mode&1)!==0&&Mo(i,o.child,null,P),i.child.memoizedState=ff(P),i.memoizedState=df,k);if((i.mode&1)===0)return rc(o,i,P,null);if(b.data==="$!"){if(h=b.nextSibling&&b.nextSibling.dataset,h)var F=h.dgst;return h=F,k=Error(n(419)),h=af(k,h,void 0),rc(o,i,P,h)}if(F=(P&o.childLanes)!==0,Dn||F){if(h=sn,h!==null){switch(P&-P){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(h.suspendedLanes|P))!==0?0:b,b!==0&&b!==k.retryLane&&(k.retryLane=b,is(o,b),jr(h,o,b,-1))}return Pf(),h=af(Error(n(421))),rc(o,i,P,h)}return b.data==="$?"?(i.flags|=128,i.child=o.child,i=TN.bind(null,o),b._reactRetry=i,null):(o=k.treeContext,Kn=js(b.nextSibling),qn=i,Ct=!0,yr=null,o!==null&&(tr[nr++]=ss,tr[nr++]=os,tr[nr++]=eo,ss=o.id,os=o.overflow,eo=i),i=pf(i,h.children),i.flags|=4096,i)}function sy(o,i,u){o.lanes|=i;var h=o.alternate;h!==null&&(h.lanes|=i),Hd(o.return,i,u)}function mf(o,i,u,h,b){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=b)}function oy(o,i,u){var h=i.pendingProps,b=h.revealOrder,k=h.tail;if(Sn(o,i,h.children,u),h=At.current,(h&2)!==0)h=h&1|2,i.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=i.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&sy(o,u,i);else if(o.tag===19)sy(o,u,i);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}h&=1}if(gt(At,h),(i.mode&1)===0)i.memoizedState=null;else switch(b){case"forwards":for(u=i.child,b=null;u!==null;)o=u.alternate,o!==null&&Jl(o)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),mf(i,!1,b,u,k);break;case"backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(o=b.alternate,o!==null&&Jl(o)===null){i.child=b;break}o=b.sibling,b.sibling=u,u=b,b=o}mf(i,!0,u,null,k);break;case"together":mf(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function sc(o,i){(i.mode&1)===0&&o!==null&&(o.alternate=null,i.alternate=null,i.flags|=2)}function ls(o,i,u){if(o!==null&&(i.dependencies=o.dependencies),oo|=i.lanes,(u&i.childLanes)===0)return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,u=Os(o,o.pendingProps),i.child=u,u.return=i;o.sibling!==null;)o=o.sibling,u=u.sibling=Os(o,o.pendingProps),u.return=i;u.sibling=null}return i.child}function gN(o,i,u){switch(i.tag){case 3:ty(i),$o();break;case 5:vx(i);break;case 1:An(i.type)&&zl(i);break;case 4:qd(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,b=i.memoizedProps.value;gt(ql,h._currentValue),h._currentValue=b;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(gt(At,At.current&1),i.flags|=128,null):(u&i.child.childLanes)!==0?ry(o,i,u):(gt(At,At.current&1),o=ls(o,i,u),o!==null?o.sibling:null);gt(At,At.current&1);break;case 19:if(h=(u&i.childLanes)!==0,(o.flags&128)!==0){if(h)return oy(o,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),gt(At,At.current),h)break;return null;case 22:case 23:return i.lanes=0,Qx(o,i,u)}return ls(o,i,u)}var iy,hf,ay,ly;iy=function(o,i){for(var u=i.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)break;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},hf=function(){},ay=function(o,i,u,h){var b=o.memoizedProps;if(b!==h){o=i.stateNode,ro(Ir.current);var k=null;switch(u){case"input":b=ne(o,b),h=ne(o,h),k=[];break;case"select":b=E({},b,{value:void 0}),h=E({},h,{value:void 0}),k=[];break;case"textarea":b=lt(o,b),h=lt(o,h),k=[];break;default:typeof b.onClick!="function"&&typeof h.onClick=="function"&&(o.onclick=Ml)}mt(u,h);var P;u=null;for(oe in b)if(!h.hasOwnProperty(oe)&&b.hasOwnProperty(oe)&&b[oe]!=null)if(oe==="style"){var F=b[oe];for(P in F)F.hasOwnProperty(P)&&(u||(u={}),u[P]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(a.hasOwnProperty(oe)?k||(k=[]):(k=k||[]).push(oe,null));for(oe in h){var q=h[oe];if(F=b!=null?b[oe]:void 0,h.hasOwnProperty(oe)&&q!==F&&(q!=null||F!=null))if(oe==="style")if(F){for(P in F)!F.hasOwnProperty(P)||q&&q.hasOwnProperty(P)||(u||(u={}),u[P]="");for(P in q)q.hasOwnProperty(P)&&F[P]!==q[P]&&(u||(u={}),u[P]=q[P])}else u||(k||(k=[]),k.push(oe,u)),u=q;else oe==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,F=F?F.__html:void 0,q!=null&&F!==q&&(k=k||[]).push(oe,q)):oe==="children"?typeof q!="string"&&typeof q!="number"||(k=k||[]).push(oe,""+q):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(a.hasOwnProperty(oe)?(q!=null&&oe==="onScroll"&&vt("scroll",o),k||F===q||(k=[])):(k=k||[]).push(oe,q))}u&&(k=k||[]).push("style",u);var oe=k;(i.updateQueue=oe)&&(i.flags|=4)}},ly=function(o,i,u,h){u!==h&&(i.flags|=4)};function ca(o,i){if(!Ct)switch(o.tailMode){case"hidden":i=o.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function yn(o){var i=o.alternate!==null&&o.alternate.child===o.child,u=0,h=0;if(i)for(var b=o.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&14680064,h|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=h,o.childLanes=u,i}function xN(o,i,u){var h=i.pendingProps;switch($d(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(i),null;case 1:return An(i.type)&&Fl(),yn(i),null;case 3:return h=i.stateNode,zo(),bt(Rn),bt(gn),Yd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Wl(i)?i.flags|=4:o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yr!==null&&(Cf(yr),yr=null))),hf(o,i),yn(i),null;case 5:Kd(i);var b=ro(sa.current);if(u=i.type,o!==null&&i.stateNode!=null)ay(o,i,u,h,b),o.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(n(166));return yn(i),null}if(o=ro(Ir.current),Wl(i)){h=i.stateNode,u=i.type;var k=i.memoizedProps;switch(h[Or]=i,h[Zi]=k,o=(i.mode&1)!==0,u){case"dialog":vt("cancel",h),vt("close",h);break;case"iframe":case"object":case"embed":vt("load",h);break;case"video":case"audio":for(b=0;b<Ji.length;b++)vt(Ji[b],h);break;case"source":vt("error",h);break;case"img":case"image":case"link":vt("error",h),vt("load",h);break;case"details":vt("toggle",h);break;case"input":le(h,k),vt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!k.multiple},vt("invalid",h);break;case"textarea":_t(h,k),vt("invalid",h)}mt(u,k),b=null;for(var P in k)if(k.hasOwnProperty(P)){var F=k[P];P==="children"?typeof F=="string"?h.textContent!==F&&(k.suppressHydrationWarning!==!0&&$l(h.textContent,F,o),b=["children",F]):typeof F=="number"&&h.textContent!==""+F&&(k.suppressHydrationWarning!==!0&&$l(h.textContent,F,o),b=["children",""+F]):a.hasOwnProperty(P)&&F!=null&&P==="onScroll"&&vt("scroll",h)}switch(u){case"input":We(h),ve(h,k,!0);break;case"textarea":We(h),Nt(h);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(h.onclick=Ml)}h=b,i.updateQueue=h,h!==null&&(i.flags|=4)}else{P=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=se(u)),o==="http://www.w3.org/1999/xhtml"?u==="script"?(o=P.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof h.is=="string"?o=P.createElement(u,{is:h.is}):(o=P.createElement(u),u==="select"&&(P=o,h.multiple?P.multiple=!0:h.size&&(P.size=h.size))):o=P.createElementNS(o,u),o[Or]=i,o[Zi]=h,iy(o,i,!1,!1),i.stateNode=o;e:{switch(P=Tn(u,h),u){case"dialog":vt("cancel",o),vt("close",o),b=h;break;case"iframe":case"object":case"embed":vt("load",o),b=h;break;case"video":case"audio":for(b=0;b<Ji.length;b++)vt(Ji[b],o);b=h;break;case"source":vt("error",o),b=h;break;case"img":case"image":case"link":vt("error",o),vt("load",o),b=h;break;case"details":vt("toggle",o),b=h;break;case"input":le(o,h),b=ne(o,h),vt("invalid",o);break;case"option":b=h;break;case"select":o._wrapperState={wasMultiple:!!h.multiple},b=E({},h,{value:void 0}),vt("invalid",o);break;case"textarea":_t(o,h),b=lt(o,h),vt("invalid",o);break;default:b=h}mt(u,b),F=b;for(k in F)if(F.hasOwnProperty(k)){var q=F[k];k==="style"?Ge(o,q):k==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Fe(o,q)):k==="children"?typeof q=="string"?(u!=="textarea"||q!=="")&&Ve(o,q):typeof q=="number"&&Ve(o,""+q):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(a.hasOwnProperty(k)?q!=null&&k==="onScroll"&&vt("scroll",o):q!=null&&N(o,k,q,P))}switch(u){case"input":We(o),ve(o,h,!1);break;case"textarea":We(o),Nt(o);break;case"option":h.value!=null&&o.setAttribute("value",""+je(h.value));break;case"select":o.multiple=!!h.multiple,k=h.value,k!=null?st(o,!!h.multiple,k,!1):h.defaultValue!=null&&st(o,!!h.multiple,h.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=Ml)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return yn(i),null;case 6:if(o&&i.stateNode!=null)ly(o,i,o.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(n(166));if(u=ro(sa.current),ro(Ir.current),Wl(i)){if(h=i.stateNode,u=i.memoizedProps,h[Or]=i,(k=h.nodeValue!==u)&&(o=qn,o!==null))switch(o.tag){case 3:$l(h.nodeValue,u,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&$l(h.nodeValue,u,(o.mode&1)!==0)}k&&(i.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[Or]=i,i.stateNode=h}return yn(i),null;case 13:if(bt(At),h=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ct&&Kn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)dx(),$o(),i.flags|=98560,k=!1;else if(k=Wl(i),h!==null&&h.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=i.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Or]=i}else $o(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yn(i),k=!1}else yr!==null&&(Cf(yr),yr=null),k=!0;if(!k)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=u,i):(h=h!==null,h!==(o!==null&&o.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(o===null||(At.current&1)!==0?Gt===0&&(Gt=3):Pf())),i.updateQueue!==null&&(i.flags|=4),yn(i),null);case 4:return zo(),hf(o,i),o===null&&Xi(i.stateNode.containerInfo),yn(i),null;case 10:return Ud(i.type._context),yn(i),null;case 17:return An(i.type)&&Fl(),yn(i),null;case 19:if(bt(At),k=i.memoizedState,k===null)return yn(i),null;if(h=(i.flags&128)!==0,P=k.rendering,P===null)if(h)ca(k,!1);else{if(Gt!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(P=Jl(o),P!==null){for(i.flags|=128,ca(k,!1),h=P.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=u,u=i.child;u!==null;)k=u,o=h,k.flags&=14680066,P=k.alternate,P===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=P.childLanes,k.lanes=P.lanes,k.child=P.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=P.memoizedProps,k.memoizedState=P.memoizedState,k.updateQueue=P.updateQueue,k.type=P.type,o=P.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),u=u.sibling;return gt(At,At.current&1|2),i.child}o=o.sibling}k.tail!==null&&$t()>Wo&&(i.flags|=128,h=!0,ca(k,!1),i.lanes=4194304)}else{if(!h)if(o=Jl(P),o!==null){if(i.flags|=128,h=!0,u=o.updateQueue,u!==null&&(i.updateQueue=u,i.flags|=4),ca(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!Ct)return yn(i),null}else 2*$t()-k.renderingStartTime>Wo&&u!==1073741824&&(i.flags|=128,h=!0,ca(k,!1),i.lanes=4194304);k.isBackwards?(P.sibling=i.child,i.child=P):(u=k.last,u!==null?u.sibling=P:i.child=P,k.last=P)}return k.tail!==null?(i=k.tail,k.rendering=i,k.tail=i.sibling,k.renderingStartTime=$t(),i.sibling=null,u=At.current,gt(At,h?u&1|2:u&1),i):(yn(i),null);case 22:case 23:return Tf(),h=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(Gn&1073741824)!==0&&(yn(i),i.subtreeFlags&6&&(i.flags|=8192)):yn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function yN(o,i){switch($d(i),i.tag){case 1:return An(i.type)&&Fl(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return zo(),bt(Rn),bt(gn),Yd(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return Kd(i),null;case 13:if(bt(At),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));$o()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return bt(At),null;case 4:return zo(),null;case 10:return Ud(i.type._context),null;case 22:case 23:return Tf(),null;case 24:return null;default:return null}}var oc=!1,vn=!1,vN=typeof WeakSet=="function"?WeakSet:Set,Te=null;function Uo(o,i){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){It(o,i,h)}else u.current=null}function gf(o,i,u){try{u()}catch(h){It(o,i,h)}}var cy=!1;function bN(o,i){if(Ed=Nl,o=Bg(),vd(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,k=h.focusNode;h=h.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var P=0,F=-1,q=-1,oe=0,he=0,xe=o,fe=null;t:for(;;){for(var Ee;xe!==u||b!==0&&xe.nodeType!==3||(F=P+b),xe!==k||h!==0&&xe.nodeType!==3||(q=P+h),xe.nodeType===3&&(P+=xe.nodeValue.length),(Ee=xe.firstChild)!==null;)fe=xe,xe=Ee;for(;;){if(xe===o)break t;if(fe===u&&++oe===b&&(F=P),fe===k&&++he===h&&(q=P),(Ee=xe.nextSibling)!==null)break;xe=fe,fe=xe.parentNode}xe=Ee}u=F===-1||q===-1?null:{start:F,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Td={focusedElem:o,selectionRange:u},Nl=!1,Te=i;Te!==null;)if(i=Te,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,Te=o;else for(;Te!==null;){i=Te;try{var Re=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ae=Re.memoizedProps,Mt=Re.memoizedState,te=i.stateNode,G=te.getSnapshotBeforeUpdate(i.elementType===i.type?Ae:vr(i.type,Ae),Mt);te.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var re=i.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){It(i,i.return,be)}if(o=i.sibling,o!==null){o.return=i.return,Te=o;break}Te=i.return}return Re=cy,cy=!1,Re}function ua(o,i,u){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var b=h=h.next;do{if((b.tag&o)===o){var k=b.destroy;b.destroy=void 0,k!==void 0&&gf(i,u,k)}b=b.next}while(b!==h)}}function ic(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&o)===o){var h=u.create;u.destroy=h()}u=u.next}while(u!==i)}}function xf(o){var i=o.ref;if(i!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof i=="function"?i(o):i.current=o}}function uy(o){var i=o.alternate;i!==null&&(o.alternate=null,uy(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[Or],delete i[Zi],delete i[Dd],delete i[nN],delete i[rN])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function dy(o){return o.tag===5||o.tag===3||o.tag===4}function fy(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||dy(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function yf(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(o,i):u.insertBefore(o,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(o,u)):(i=u,i.appendChild(o)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Ml));else if(h!==4&&(o=o.child,o!==null))for(yf(o,i,u),o=o.sibling;o!==null;)yf(o,i,u),o=o.sibling}function vf(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.insertBefore(o,i):u.appendChild(o);else if(h!==4&&(o=o.child,o!==null))for(vf(o,i,u),o=o.sibling;o!==null;)vf(o,i,u),o=o.sibling}var dn=null,br=!1;function Ts(o,i,u){for(u=u.child;u!==null;)py(o,i,u),u=u.sibling}function py(o,i,u){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(vl,u)}catch{}switch(u.tag){case 5:vn||Uo(u,i);case 6:var h=dn,b=br;dn=null,Ts(o,i,u),dn=h,br=b,dn!==null&&(br?(o=dn,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):dn.removeChild(u.stateNode));break;case 18:dn!==null&&(br?(o=dn,u=u.stateNode,o.nodeType===8?Ad(o.parentNode,u):o.nodeType===1&&Ad(o,u),Ui(o)):Ad(dn,u.stateNode));break;case 4:h=dn,b=br,dn=u.stateNode.containerInfo,br=!0,Ts(o,i,u),dn=h,br=b;break;case 0:case 11:case 14:case 15:if(!vn&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){b=h=h.next;do{var k=b,P=k.destroy;k=k.tag,P!==void 0&&((k&2)!==0||(k&4)!==0)&&gf(u,i,P),b=b.next}while(b!==h)}Ts(o,i,u);break;case 1:if(!vn&&(Uo(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(F){It(u,i,F)}Ts(o,i,u);break;case 21:Ts(o,i,u);break;case 22:u.mode&1?(vn=(h=vn)||u.memoizedState!==null,Ts(o,i,u),vn=h):Ts(o,i,u);break;default:Ts(o,i,u)}}function my(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new vN),i.forEach(function(h){var b=PN.bind(null,o,h);u.has(h)||(u.add(h),h.then(b,b))})}}function wr(o,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h];try{var k=o,P=i,F=P;e:for(;F!==null;){switch(F.tag){case 5:dn=F.stateNode,br=!1;break e;case 3:dn=F.stateNode.containerInfo,br=!0;break e;case 4:dn=F.stateNode.containerInfo,br=!0;break e}F=F.return}if(dn===null)throw Error(n(160));py(k,P,b),dn=null,br=!1;var q=b.alternate;q!==null&&(q.return=null),b.return=null}catch(oe){It(b,i,oe)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)hy(i,o),i=i.sibling}function hy(o,i){var u=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(wr(i,o),$r(o),h&4){try{ua(3,o,o.return),ic(3,o)}catch(Ae){It(o,o.return,Ae)}try{ua(5,o,o.return)}catch(Ae){It(o,o.return,Ae)}}break;case 1:wr(i,o),$r(o),h&512&&u!==null&&Uo(u,u.return);break;case 5:if(wr(i,o),$r(o),h&512&&u!==null&&Uo(u,u.return),o.flags&32){var b=o.stateNode;try{Ve(b,"")}catch(Ae){It(o,o.return,Ae)}}if(h&4&&(b=o.stateNode,b!=null)){var k=o.memoizedProps,P=u!==null?u.memoizedProps:k,F=o.type,q=o.updateQueue;if(o.updateQueue=null,q!==null)try{F==="input"&&k.type==="radio"&&k.name!=null&&W(b,k),Tn(F,P);var oe=Tn(F,k);for(P=0;P<q.length;P+=2){var he=q[P],xe=q[P+1];he==="style"?Ge(b,xe):he==="dangerouslySetInnerHTML"?Fe(b,xe):he==="children"?Ve(b,xe):N(b,he,xe,oe)}switch(F){case"input":pe(b,k);break;case"textarea":St(b,k);break;case"select":var fe=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!k.multiple;var Ee=k.value;Ee!=null?st(b,!!k.multiple,Ee,!1):fe!==!!k.multiple&&(k.defaultValue!=null?st(b,!!k.multiple,k.defaultValue,!0):st(b,!!k.multiple,k.multiple?[]:"",!1))}b[Zi]=k}catch(Ae){It(o,o.return,Ae)}}break;case 6:if(wr(i,o),$r(o),h&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,k=o.memoizedProps;try{b.nodeValue=k}catch(Ae){It(o,o.return,Ae)}}break;case 3:if(wr(i,o),$r(o),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Ui(i.containerInfo)}catch(Ae){It(o,o.return,Ae)}break;case 4:wr(i,o),$r(o);break;case 13:wr(i,o),$r(o),b=o.child,b.flags&8192&&(k=b.memoizedState!==null,b.stateNode.isHidden=k,!k||b.alternate!==null&&b.alternate.memoizedState!==null||(jf=$t())),h&4&&my(o);break;case 22:if(he=u!==null&&u.memoizedState!==null,o.mode&1?(vn=(oe=vn)||he,wr(i,o),vn=oe):wr(i,o),$r(o),h&8192){if(oe=o.memoizedState!==null,(o.stateNode.isHidden=oe)&&!he&&(o.mode&1)!==0)for(Te=o,he=o.child;he!==null;){for(xe=Te=he;Te!==null;){switch(fe=Te,Ee=fe.child,fe.tag){case 0:case 11:case 14:case 15:ua(4,fe,fe.return);break;case 1:Uo(fe,fe.return);var Re=fe.stateNode;if(typeof Re.componentWillUnmount=="function"){h=fe,u=fe.return;try{i=h,Re.props=i.memoizedProps,Re.state=i.memoizedState,Re.componentWillUnmount()}catch(Ae){It(h,u,Ae)}}break;case 5:Uo(fe,fe.return);break;case 22:if(fe.memoizedState!==null){yy(xe);continue}}Ee!==null?(Ee.return=fe,Te=Ee):yy(xe)}he=he.sibling}e:for(he=null,xe=o;;){if(xe.tag===5){if(he===null){he=xe;try{b=xe.stateNode,oe?(k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(F=xe.stateNode,q=xe.memoizedProps.style,P=q!=null&&q.hasOwnProperty("display")?q.display:null,F.style.display=ue("display",P))}catch(Ae){It(o,o.return,Ae)}}}else if(xe.tag===6){if(he===null)try{xe.stateNode.nodeValue=oe?"":xe.memoizedProps}catch(Ae){It(o,o.return,Ae)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===o)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===o)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===o)break e;he===xe&&(he=null),xe=xe.return}he===xe&&(he=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:wr(i,o),$r(o),h&4&&my(o);break;case 21:break;default:wr(i,o),$r(o)}}function $r(o){var i=o.flags;if(i&2){try{e:{for(var u=o.return;u!==null;){if(dy(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var b=h.stateNode;h.flags&32&&(Ve(b,""),h.flags&=-33);var k=fy(o);vf(o,k,b);break;case 3:case 4:var P=h.stateNode.containerInfo,F=fy(o);yf(o,F,P);break;default:throw Error(n(161))}}catch(q){It(o,o.return,q)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function wN(o,i,u){Te=o,gy(o)}function gy(o,i,u){for(var h=(o.mode&1)!==0;Te!==null;){var b=Te,k=b.child;if(b.tag===22&&h){var P=b.memoizedState!==null||oc;if(!P){var F=b.alternate,q=F!==null&&F.memoizedState!==null||vn;F=oc;var oe=vn;if(oc=P,(vn=q)&&!oe)for(Te=b;Te!==null;)P=Te,q=P.child,P.tag===22&&P.memoizedState!==null?vy(b):q!==null?(q.return=P,Te=q):vy(b);for(;k!==null;)Te=k,gy(k),k=k.sibling;Te=b,oc=F,vn=oe}xy(o)}else(b.subtreeFlags&8772)!==0&&k!==null?(k.return=b,Te=k):xy(o)}}function xy(o){for(;Te!==null;){var i=Te;if((i.flags&8772)!==0){var u=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:vn||ic(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!vn)if(u===null)h.componentDidMount();else{var b=i.elementType===i.type?u.memoizedProps:vr(i.type,u.memoizedProps);h.componentDidUpdate(b,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var k=i.updateQueue;k!==null&&yx(i,k,h);break;case 3:var P=i.updateQueue;if(P!==null){if(u=null,i.child!==null)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}yx(i,P,u)}break;case 5:var F=i.stateNode;if(u===null&&i.flags&4){u=F;var q=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&u.focus();break;case"img":q.src&&(u.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var oe=i.alternate;if(oe!==null){var he=oe.memoizedState;if(he!==null){var xe=he.dehydrated;xe!==null&&Ui(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vn||i.flags&512&&xf(i)}catch(fe){It(i,i.return,fe)}}if(i===o){Te=null;break}if(u=i.sibling,u!==null){u.return=i.return,Te=u;break}Te=i.return}}function yy(o){for(;Te!==null;){var i=Te;if(i===o){Te=null;break}var u=i.sibling;if(u!==null){u.return=i.return,Te=u;break}Te=i.return}}function vy(o){for(;Te!==null;){var i=Te;try{switch(i.tag){case 0:case 11:case 15:var u=i.return;try{ic(4,i)}catch(q){It(i,u,q)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var b=i.return;try{h.componentDidMount()}catch(q){It(i,b,q)}}var k=i.return;try{xf(i)}catch(q){It(i,k,q)}break;case 5:var P=i.return;try{xf(i)}catch(q){It(i,P,q)}}}catch(q){It(i,i.return,q)}if(i===o){Te=null;break}var F=i.sibling;if(F!==null){F.return=i.return,Te=F;break}Te=i.return}}var jN=Math.ceil,ac=A.ReactCurrentDispatcher,bf=A.ReactCurrentOwner,or=A.ReactCurrentBatchConfig,Qe=0,sn=null,zt=null,fn=0,Gn=0,Ho=ks(0),Gt=0,da=null,oo=0,lc=0,wf=0,fa=null,On=null,jf=0,Wo=1/0,cs=null,cc=!1,kf=null,Ps=null,uc=!1,Rs=null,dc=0,pa=0,Sf=null,fc=-1,pc=0;function Nn(){return(Qe&6)!==0?$t():fc!==-1?fc:fc=$t()}function As(o){return(o.mode&1)===0?1:(Qe&2)!==0&&fn!==0?fn&-fn:oN.transition!==null?(pc===0&&(pc=fg()),pc):(o=it,o!==0||(o=window.event,o=o===void 0?16:wg(o.type)),o)}function jr(o,i,u,h){if(50<pa)throw pa=0,Sf=null,Error(n(185));Mi(o,u,h),((Qe&2)===0||o!==sn)&&(o===sn&&((Qe&2)===0&&(lc|=u),Gt===4&&Ds(o,fn)),In(o,h),u===1&&Qe===0&&(i.mode&1)===0&&(Wo=$t()+500,Bl&&Ns()))}function In(o,i){var u=o.callbackNode;oS(o,i);var h=jl(o,o===sn?fn:0);if(h===0)u!==null&&cg(u),o.callbackNode=null,o.callbackPriority=0;else if(i=h&-h,o.callbackPriority!==i){if(u!=null&&cg(u),i===1)o.tag===0?sN(wy.bind(null,o)):ix(wy.bind(null,o)),eN(function(){(Qe&6)===0&&Ns()}),u=null;else{switch(pg(h)){case 1:u=nd;break;case 4:u=ug;break;case 16:u=yl;break;case 536870912:u=dg;break;default:u=yl}u=Py(u,by.bind(null,o))}o.callbackPriority=i,o.callbackNode=u}}function by(o,i){if(fc=-1,pc=0,(Qe&6)!==0)throw Error(n(327));var u=o.callbackNode;if(Vo()&&o.callbackNode!==u)return null;var h=jl(o,o===sn?fn:0);if(h===0)return null;if((h&30)!==0||(h&o.expiredLanes)!==0||i)i=mc(o,h);else{i=h;var b=Qe;Qe|=2;var k=ky();(sn!==o||fn!==i)&&(cs=null,Wo=$t()+500,ao(o,i));do try{NN();break}catch(F){jy(o,F)}while(!0);Bd(),ac.current=k,Qe=b,zt!==null?i=0:(sn=null,fn=0,i=Gt)}if(i!==0){if(i===2&&(b=rd(o),b!==0&&(h=b,i=Nf(o,b))),i===1)throw u=da,ao(o,0),Ds(o,h),In(o,$t()),u;if(i===6)Ds(o,h);else{if(b=o.current.alternate,(h&30)===0&&!kN(b)&&(i=mc(o,h),i===2&&(k=rd(o),k!==0&&(h=k,i=Nf(o,k))),i===1))throw u=da,ao(o,0),Ds(o,h),In(o,$t()),u;switch(o.finishedWork=b,o.finishedLanes=h,i){case 0:case 1:throw Error(n(345));case 2:lo(o,On,cs);break;case 3:if(Ds(o,h),(h&130023424)===h&&(i=jf+500-$t(),10<i)){if(jl(o,0)!==0)break;if(b=o.suspendedLanes,(b&h)!==h){Nn(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Rd(lo.bind(null,o,On,cs),i);break}lo(o,On,cs);break;case 4:if(Ds(o,h),(h&4194240)===h)break;for(i=o.eventTimes,b=-1;0<h;){var P=31-gr(h);k=1<<P,P=i[P],P>b&&(b=P),h&=~k}if(h=b,h=$t()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*jN(h/1960))-h,10<h){o.timeoutHandle=Rd(lo.bind(null,o,On,cs),h);break}lo(o,On,cs);break;case 5:lo(o,On,cs);break;default:throw Error(n(329))}}}return In(o,$t()),o.callbackNode===u?by.bind(null,o):null}function Nf(o,i){var u=fa;return o.current.memoizedState.isDehydrated&&(ao(o,i).flags|=256),o=mc(o,i),o!==2&&(i=On,On=u,i!==null&&Cf(i)),o}function Cf(o){On===null?On=o:On.push.apply(On,o)}function kN(o){for(var i=o;;){if(i.flags&16384){var u=i.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var b=u[h],k=b.getSnapshot;b=b.value;try{if(!xr(k(),b))return!1}catch{return!1}}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ds(o,i){for(i&=~wf,i&=~lc,o.suspendedLanes|=i,o.pingedLanes&=~i,o=o.expirationTimes;0<i;){var u=31-gr(i),h=1<<u;o[u]=-1,i&=~h}}function wy(o){if((Qe&6)!==0)throw Error(n(327));Vo();var i=jl(o,0);if((i&1)===0)return In(o,$t()),null;var u=mc(o,i);if(o.tag!==0&&u===2){var h=rd(o);h!==0&&(i=h,u=Nf(o,h))}if(u===1)throw u=da,ao(o,0),Ds(o,i),In(o,$t()),u;if(u===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=i,lo(o,On,cs),In(o,$t()),null}function Ef(o,i){var u=Qe;Qe|=1;try{return o(i)}finally{Qe=u,Qe===0&&(Wo=$t()+500,Bl&&Ns())}}function io(o){Rs!==null&&Rs.tag===0&&(Qe&6)===0&&Vo();var i=Qe;Qe|=1;var u=or.transition,h=it;try{if(or.transition=null,it=1,o)return o()}finally{it=h,or.transition=u,Qe=i,(Qe&6)===0&&Ns()}}function Tf(){Gn=Ho.current,bt(Ho)}function ao(o,i){o.finishedWork=null,o.finishedLanes=0;var u=o.timeoutHandle;if(u!==-1&&(o.timeoutHandle=-1,ZS(u)),zt!==null)for(u=zt.return;u!==null;){var h=u;switch($d(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Fl();break;case 3:zo(),bt(Rn),bt(gn),Yd();break;case 5:Kd(h);break;case 4:zo();break;case 13:bt(At);break;case 19:bt(At);break;case 10:Ud(h.type._context);break;case 22:case 23:Tf()}u=u.return}if(sn=o,zt=o=Os(o.current,null),fn=Gn=i,Gt=0,da=null,wf=lc=oo=0,On=fa=null,no!==null){for(i=0;i<no.length;i++)if(u=no[i],h=u.interleaved,h!==null){u.interleaved=null;var b=h.next,k=u.pending;if(k!==null){var P=k.next;k.next=b,h.next=P}u.pending=h}no=null}return o}function jy(o,i){do{var u=zt;try{if(Bd(),Xl.current=tc,Ql){for(var h=Dt.memoizedState;h!==null;){var b=h.queue;b!==null&&(b.pending=null),h=h.next}Ql=!1}if(so=0,rn=Kt=Dt=null,oa=!1,ia=0,bf.current=null,u===null||u.return===null){Gt=1,da=i,zt=null;break}e:{var k=o,P=u.return,F=u,q=i;if(i=fn,F.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=q,he=F,xe=he.tag;if((he.mode&1)===0&&(xe===0||xe===11||xe===15)){var fe=he.alternate;fe?(he.updateQueue=fe.updateQueue,he.memoizedState=fe.memoizedState,he.lanes=fe.lanes):(he.updateQueue=null,he.memoizedState=null)}var Ee=Kx(P);if(Ee!==null){Ee.flags&=-257,Gx(Ee,P,F,k,i),Ee.mode&1&&qx(k,oe,i),i=Ee,q=oe;var Re=i.updateQueue;if(Re===null){var Ae=new Set;Ae.add(q),i.updateQueue=Ae}else Re.add(q);break e}else{if((i&1)===0){qx(k,oe,i),Pf();break e}q=Error(n(426))}}else if(Ct&&F.mode&1){var Mt=Kx(P);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),Gx(Mt,P,F,k,i),Fd(Bo(q,F));break e}}k=q=Bo(q,F),Gt!==4&&(Gt=2),fa===null?fa=[k]:fa.push(k),k=P;do{switch(k.tag){case 3:k.flags|=65536,i&=-i,k.lanes|=i;var te=Wx(k,q,i);xx(k,te);break e;case 1:F=q;var G=k.type,re=k.stateNode;if((k.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Ps===null||!Ps.has(re)))){k.flags|=65536,i&=-i,k.lanes|=i;var be=Vx(k,F,i);xx(k,be);break e}}k=k.return}while(k!==null)}Ny(u)}catch(De){i=De,zt===u&&u!==null&&(zt=u=u.return);continue}break}while(!0)}function ky(){var o=ac.current;return ac.current=tc,o===null?tc:o}function Pf(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),sn===null||(oo&268435455)===0&&(lc&268435455)===0||Ds(sn,fn)}function mc(o,i){var u=Qe;Qe|=2;var h=ky();(sn!==o||fn!==i)&&(cs=null,ao(o,i));do try{SN();break}catch(b){jy(o,b)}while(!0);if(Bd(),Qe=u,ac.current=h,zt!==null)throw Error(n(261));return sn=null,fn=0,Gt}function SN(){for(;zt!==null;)Sy(zt)}function NN(){for(;zt!==null&&!J1();)Sy(zt)}function Sy(o){var i=Ty(o.alternate,o,Gn);o.memoizedProps=o.pendingProps,i===null?Ny(o):zt=i,bf.current=null}function Ny(o){var i=o;do{var u=i.alternate;if(o=i.return,(i.flags&32768)===0){if(u=xN(u,i,Gn),u!==null){zt=u;return}}else{if(u=yN(u,i),u!==null){u.flags&=32767,zt=u;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Gt=6,zt=null;return}}if(i=i.sibling,i!==null){zt=i;return}zt=i=o}while(i!==null);Gt===0&&(Gt=5)}function lo(o,i,u){var h=it,b=or.transition;try{or.transition=null,it=1,CN(o,i,u,h)}finally{or.transition=b,it=h}return null}function CN(o,i,u,h){do Vo();while(Rs!==null);if((Qe&6)!==0)throw Error(n(327));u=o.finishedWork;var b=o.finishedLanes;if(u===null)return null;if(o.finishedWork=null,o.finishedLanes=0,u===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=u.lanes|u.childLanes;if(iS(o,k),o===sn&&(zt=sn=null,fn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||uc||(uc=!0,Py(yl,function(){return Vo(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=or.transition,or.transition=null;var P=it;it=1;var F=Qe;Qe|=4,bf.current=null,bN(o,u),hy(u,o),qS(Td),Nl=!!Ed,Td=Ed=null,o.current=u,wN(u),X1(),Qe=F,it=P,or.transition=k}else o.current=u;if(uc&&(uc=!1,Rs=o,dc=b),k=o.pendingLanes,k===0&&(Ps=null),eS(u.stateNode),In(o,$t()),i!==null)for(h=o.onRecoverableError,u=0;u<i.length;u++)b=i[u],h(b.value,{componentStack:b.stack,digest:b.digest});if(cc)throw cc=!1,o=kf,kf=null,o;return(dc&1)!==0&&o.tag!==0&&Vo(),k=o.pendingLanes,(k&1)!==0?o===Sf?pa++:(pa=0,Sf=o):pa=0,Ns(),null}function Vo(){if(Rs!==null){var o=pg(dc),i=or.transition,u=it;try{if(or.transition=null,it=16>o?16:o,Rs===null)var h=!1;else{if(o=Rs,Rs=null,dc=0,(Qe&6)!==0)throw Error(n(331));var b=Qe;for(Qe|=4,Te=o.current;Te!==null;){var k=Te,P=k.child;if((Te.flags&16)!==0){var F=k.deletions;if(F!==null){for(var q=0;q<F.length;q++){var oe=F[q];for(Te=oe;Te!==null;){var he=Te;switch(he.tag){case 0:case 11:case 15:ua(8,he,k)}var xe=he.child;if(xe!==null)xe.return=he,Te=xe;else for(;Te!==null;){he=Te;var fe=he.sibling,Ee=he.return;if(uy(he),he===oe){Te=null;break}if(fe!==null){fe.return=Ee,Te=fe;break}Te=Ee}}}var Re=k.alternate;if(Re!==null){var Ae=Re.child;if(Ae!==null){Re.child=null;do{var Mt=Ae.sibling;Ae.sibling=null,Ae=Mt}while(Ae!==null)}}Te=k}}if((k.subtreeFlags&2064)!==0&&P!==null)P.return=k,Te=P;else e:for(;Te!==null;){if(k=Te,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ua(9,k,k.return)}var te=k.sibling;if(te!==null){te.return=k.return,Te=te;break e}Te=k.return}}var G=o.current;for(Te=G;Te!==null;){P=Te;var re=P.child;if((P.subtreeFlags&2064)!==0&&re!==null)re.return=P,Te=re;else e:for(P=G;Te!==null;){if(F=Te,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:ic(9,F)}}catch(De){It(F,F.return,De)}if(F===P){Te=null;break e}var be=F.sibling;if(be!==null){be.return=F.return,Te=be;break e}Te=F.return}}if(Qe=b,Ns(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot(vl,o)}catch{}h=!0}return h}finally{it=u,or.transition=i}}return!1}function Cy(o,i,u){i=Bo(u,i),i=Wx(o,i,1),o=Es(o,i,1),i=Nn(),o!==null&&(Mi(o,1,i),In(o,i))}function It(o,i,u){if(o.tag===3)Cy(o,o,u);else for(;i!==null;){if(i.tag===3){Cy(i,o,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ps===null||!Ps.has(h))){o=Bo(u,o),o=Vx(i,o,1),i=Es(i,o,1),o=Nn(),i!==null&&(Mi(i,1,o),In(i,o));break}}i=i.return}}function EN(o,i,u){var h=o.pingCache;h!==null&&h.delete(i),i=Nn(),o.pingedLanes|=o.suspendedLanes&u,sn===o&&(fn&u)===u&&(Gt===4||Gt===3&&(fn&130023424)===fn&&500>$t()-jf?ao(o,0):wf|=u),In(o,i)}function Ey(o,i){i===0&&((o.mode&1)===0?i=1:(i=wl,wl<<=1,(wl&130023424)===0&&(wl=4194304)));var u=Nn();o=is(o,i),o!==null&&(Mi(o,i,u),In(o,u))}function TN(o){var i=o.memoizedState,u=0;i!==null&&(u=i.retryLane),Ey(o,u)}function PN(o,i){var u=0;switch(o.tag){case 13:var h=o.stateNode,b=o.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=o.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(i),Ey(o,u)}var Ty;Ty=function(o,i,u){if(o!==null)if(o.memoizedProps!==i.pendingProps||Rn.current)Dn=!0;else{if((o.lanes&u)===0&&(i.flags&128)===0)return Dn=!1,gN(o,i,u);Dn=(o.flags&131072)!==0}else Dn=!1,Ct&&(i.flags&1048576)!==0&&ax(i,Hl,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;sc(o,i),o=i.pendingProps;var b=Oo(i,gn.current);Fo(i,u),b=Qd(null,i,h,o,b,u);var k=Zd();return i.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,An(h)?(k=!0,zl(i)):k=!1,i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Vd(i),b.updater=nc,i.stateNode=b,b._reactInternals=i,of(i,h,o,u),i=uf(null,i,h,!0,k,u)):(i.tag=0,Ct&&k&&Ld(i),Sn(null,i,b,u),i=i.child),i;case 16:h=i.elementType;e:{switch(sc(o,i),o=i.pendingProps,b=h._init,h=b(h._payload),i.type=h,b=i.tag=AN(h),o=vr(h,o),b){case 0:i=cf(null,i,h,o,u);break e;case 1:i=ey(null,i,h,o,u);break e;case 11:i=Yx(null,i,h,o,u);break e;case 14:i=Jx(null,i,h,vr(h.type,o),u);break e}throw Error(n(306,h,""))}return i;case 0:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:vr(h,b),cf(o,i,h,b,u);case 1:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:vr(h,b),ey(o,i,h,b,u);case 3:e:{if(ty(i),o===null)throw Error(n(387));h=i.pendingProps,k=i.memoizedState,b=k.element,gx(o,i),Yl(i,h,null,u);var P=i.memoizedState;if(h=P.element,k.isDehydrated)if(k={element:h,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},i.updateQueue.baseState=k,i.memoizedState=k,i.flags&256){b=Bo(Error(n(423)),i),i=ny(o,i,h,u,b);break e}else if(h!==b){b=Bo(Error(n(424)),i),i=ny(o,i,h,u,b);break e}else for(Kn=js(i.stateNode.containerInfo.firstChild),qn=i,Ct=!0,yr=null,u=mx(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if($o(),h===b){i=ls(o,i,u);break e}Sn(o,i,h,u)}i=i.child}return i;case 5:return vx(i),o===null&&_d(i),h=i.type,b=i.pendingProps,k=o!==null?o.memoizedProps:null,P=b.children,Pd(h,b)?P=null:k!==null&&Pd(h,k)&&(i.flags|=32),Zx(o,i),Sn(o,i,P,u),i.child;case 6:return o===null&&_d(i),null;case 13:return ry(o,i,u);case 4:return qd(i,i.stateNode.containerInfo),h=i.pendingProps,o===null?i.child=Mo(i,null,h,u):Sn(o,i,h,u),i.child;case 11:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:vr(h,b),Yx(o,i,h,b,u);case 7:return Sn(o,i,i.pendingProps,u),i.child;case 8:return Sn(o,i,i.pendingProps.children,u),i.child;case 12:return Sn(o,i,i.pendingProps.children,u),i.child;case 10:e:{if(h=i.type._context,b=i.pendingProps,k=i.memoizedProps,P=b.value,gt(ql,h._currentValue),h._currentValue=P,k!==null)if(xr(k.value,P)){if(k.children===b.children&&!Rn.current){i=ls(o,i,u);break e}}else for(k=i.child,k!==null&&(k.return=i);k!==null;){var F=k.dependencies;if(F!==null){P=k.child;for(var q=F.firstContext;q!==null;){if(q.context===h){if(k.tag===1){q=as(-1,u&-u),q.tag=2;var oe=k.updateQueue;if(oe!==null){oe=oe.shared;var he=oe.pending;he===null?q.next=q:(q.next=he.next,he.next=q),oe.pending=q}}k.lanes|=u,q=k.alternate,q!==null&&(q.lanes|=u),Hd(k.return,u,i),F.lanes|=u;break}q=q.next}}else if(k.tag===10)P=k.type===i.type?null:k.child;else if(k.tag===18){if(P=k.return,P===null)throw Error(n(341));P.lanes|=u,F=P.alternate,F!==null&&(F.lanes|=u),Hd(P,u,i),P=k.sibling}else P=k.child;if(P!==null)P.return=k;else for(P=k;P!==null;){if(P===i){P=null;break}if(k=P.sibling,k!==null){k.return=P.return,P=k;break}P=P.return}k=P}Sn(o,i,b.children,u),i=i.child}return i;case 9:return b=i.type,h=i.pendingProps.children,Fo(i,u),b=rr(b),h=h(b),i.flags|=1,Sn(o,i,h,u),i.child;case 14:return h=i.type,b=vr(h,i.pendingProps),b=vr(h.type,b),Jx(o,i,h,b,u);case 15:return Xx(o,i,i.type,i.pendingProps,u);case 17:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:vr(h,b),sc(o,i),i.tag=1,An(h)?(o=!0,zl(i)):o=!1,Fo(i,u),Ux(i,h,b),of(i,h,b,u),uf(null,i,h,!0,o,u);case 19:return oy(o,i,u);case 22:return Qx(o,i,u)}throw Error(n(156,i.tag))};function Py(o,i){return lg(o,i)}function RN(o,i,u,h){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(o,i,u,h){return new RN(o,i,u,h)}function Rf(o){return o=o.prototype,!(!o||!o.isReactComponent)}function AN(o){if(typeof o=="function")return Rf(o)?1:0;if(o!=null){if(o=o.$$typeof,o===H)return 11;if(o===Y)return 14}return 2}function Os(o,i){var u=o.alternate;return u===null?(u=ir(o.tag,i,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=i,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,i=o.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function hc(o,i,u,h,b,k){var P=2;if(h=o,typeof o=="function")Rf(o)&&(P=1);else if(typeof o=="string")P=5;else e:switch(o){case O:return co(u.children,b,k,i);case I:P=8,b|=8;break;case K:return o=ir(12,u,i,b|2),o.elementType=K,o.lanes=k,o;case J:return o=ir(13,u,i,b),o.elementType=J,o.lanes=k,o;case U:return o=ir(19,u,i,b),o.elementType=U,o.lanes=k,o;case V:return gc(u,b,k,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case X:P=10;break e;case _:P=9;break e;case H:P=11;break e;case Y:P=14;break e;case z:P=16,h=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=ir(P,u,i,b),i.elementType=o,i.type=h,i.lanes=k,i}function co(o,i,u,h){return o=ir(7,o,h,i),o.lanes=u,o}function gc(o,i,u,h){return o=ir(22,o,h,i),o.elementType=V,o.lanes=u,o.stateNode={isHidden:!1},o}function Af(o,i,u){return o=ir(6,o,null,i),o.lanes=u,o}function Df(o,i,u){return i=ir(4,o.children!==null?o.children:[],o.key,i),i.lanes=u,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function DN(o,i,u,h,b){this.tag=i,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sd(0),this.expirationTimes=sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sd(0),this.identifierPrefix=h,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Of(o,i,u,h,b,k,P,F,q){return o=new DN(o,i,u,F,q),i===1?(i=1,k===!0&&(i|=8)):i=0,k=ir(3,null,null,i),o.current=k,k.stateNode=o,k.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vd(k),o}function ON(o,i,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:h==null?null:""+h,children:o,containerInfo:i,implementation:u}}function Ry(o){if(!o)return Ss;o=o._reactInternals;e:{if(dt(o)!==o||o.tag!==1)throw Error(n(170));var i=o;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(An(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(o.tag===1){var u=o.type;if(An(u))return sx(o,u,i)}return i}function Ay(o,i,u,h,b,k,P,F,q){return o=Of(u,h,!0,o,b,k,P,F,q),o.context=Ry(null),u=o.current,h=Nn(),b=As(u),k=as(h,b),k.callback=i??null,Es(u,k,b),o.current.lanes=b,Mi(o,b,h),In(o,h),o}function xc(o,i,u,h){var b=i.current,k=Nn(),P=As(b);return u=Ry(u),i.context===null?i.context=u:i.pendingContext=u,i=as(k,P),i.payload={element:o},h=h===void 0?null:h,h!==null&&(i.callback=h),o=Es(b,i,P),o!==null&&(jr(o,b,P,k),Gl(o,b,P)),P}function yc(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Dy(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<i?u:i}}function If(o,i){Dy(o,i),(o=o.alternate)&&Dy(o,i)}function IN(){return null}var Oy=typeof reportError=="function"?reportError:function(o){console.error(o)};function Lf(o){this._internalRoot=o}vc.prototype.render=Lf.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));xc(o,i,null,null)},vc.prototype.unmount=Lf.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;io(function(){xc(null,o,null,null)}),i[ns]=null}};function vc(o){this._internalRoot=o}vc.prototype.unstable_scheduleHydration=function(o){if(o){var i=gg();o={blockedOn:null,target:o,priority:i};for(var u=0;u<vs.length&&i!==0&&i<vs[u].priority;u++);vs.splice(u,0,o),u===0&&vg(o)}};function $f(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function bc(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Iy(){}function LN(o,i,u,h,b){if(b){if(typeof h=="function"){var k=h;h=function(){var oe=yc(P);k.call(oe)}}var P=Ay(i,h,o,0,null,!1,!1,"",Iy);return o._reactRootContainer=P,o[ns]=P.current,Xi(o.nodeType===8?o.parentNode:o),io(),P}for(;b=o.lastChild;)o.removeChild(b);if(typeof h=="function"){var F=h;h=function(){var oe=yc(q);F.call(oe)}}var q=Of(o,0,!1,null,null,!1,!1,"",Iy);return o._reactRootContainer=q,o[ns]=q.current,Xi(o.nodeType===8?o.parentNode:o),io(function(){xc(i,q,u,h)}),q}function wc(o,i,u,h,b){var k=u._reactRootContainer;if(k){var P=k;if(typeof b=="function"){var F=b;b=function(){var q=yc(P);F.call(q)}}xc(i,P,o,b)}else P=LN(u,i,o,b,h);return yc(P)}mg=function(o){switch(o.tag){case 3:var i=o.stateNode;if(i.current.memoizedState.isDehydrated){var u=$i(i.pendingLanes);u!==0&&(od(i,u|1),In(i,$t()),(Qe&6)===0&&(Wo=$t()+500,Ns()))}break;case 13:io(function(){var h=is(o,1);if(h!==null){var b=Nn();jr(h,o,1,b)}}),If(o,1)}},id=function(o){if(o.tag===13){var i=is(o,134217728);if(i!==null){var u=Nn();jr(i,o,134217728,u)}If(o,134217728)}},hg=function(o){if(o.tag===13){var i=As(o),u=is(o,i);if(u!==null){var h=Nn();jr(u,o,i,h)}If(o,i)}},gg=function(){return it},xg=function(o,i){var u=it;try{return it=o,i()}finally{it=u}},mr=function(o,i,u){switch(i){case"input":if(pe(o,u),i=u.name,u.type==="radio"&&i!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==o&&h.form===o.form){var b=_l(h);if(!b)throw Error(n(90));Ye(h),pe(h,b)}}}break;case"textarea":St(o,u);break;case"select":i=u.value,i!=null&&st(o,!!u.multiple,i,!1)}},un=Ef,Zt=io;var $N={usingClientEntryPoint:!1,Events:[ea,Ao,_l,qt,kn,Ef]},ma={findFiberByHostInstance:Qs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},MN={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=ts(o),o===null?null:o.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||IN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jc.isDisabled&&jc.supportsFiber)try{vl=jc.inject(MN),Dr=jc}catch{}}return Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$N,Ln.createPortal=function(o,i){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$f(i))throw Error(n(200));return ON(o,i,null,u)},Ln.createRoot=function(o,i){if(!$f(o))throw Error(n(299));var u=!1,h="",b=Oy;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=Of(o,1,!1,null,null,u,!1,h,b),o[ns]=i.current,Xi(o.nodeType===8?o.parentNode:o),new Lf(i)},Ln.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var i=o._reactInternals;if(i===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=ts(i),o=o===null?null:o.stateNode,o},Ln.flushSync=function(o){return io(o)},Ln.hydrate=function(o,i,u){if(!bc(i))throw Error(n(200));return wc(null,o,i,!0,u)},Ln.hydrateRoot=function(o,i,u){if(!$f(o))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,b=!1,k="",P=Oy;if(u!=null&&(u.unstable_strictMode===!0&&(b=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),i=Ay(i,null,o,1,u??null,b,!1,k,P),o[ns]=i.current,Xi(o),h)for(o=0;o<h.length;o++)u=h[o],b=u._getVersion,b=b(u._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[u,b]:i.mutableSourceEagerHydrationData.push(u,b);return new vc(i)},Ln.render=function(o,i,u){if(!bc(i))throw Error(n(200));return wc(null,o,i,!1,u)},Ln.unmountComponentAtNode=function(o){if(!bc(o))throw Error(n(40));return o._reactRootContainer?(io(function(){wc(null,null,o,!1,function(){o._reactRootContainer=null,o[ns]=null})}),!0):!1},Ln.unstable_batchedUpdates=Ef,Ln.unstable_renderSubtreeIntoContainer=function(o,i,u,h){if(!bc(u))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return wc(o,i,u,!1,h)},Ln.version="18.3.1-next-f1338f8080-20240426",Ln}var Hy;function uw(){if(Hy)return Ff.exports;Hy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ff.exports=KN(),Ff.exports}var Wy;function GN(){if(Wy)return kc;Wy=1;var e=uw();return kc.createRoot=e.createRoot,kc.hydrateRoot=e.hydrateRoot,kc}var YN=GN();/**
41
- * react-router v7.13.1
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var Vy="popstate";function qy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function JN(e={}){function t(s,a){var m;let l=(m=a.state)==null?void 0:m.masked,{pathname:c,search:d,hash:f}=l||s.location;return Op("",{pathname:c,search:d,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,a){return typeof a=="string"?a:Ba(a)}return QN(t,n,null,e)}function Ot(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XN(){return Math.random().toString(36).substring(2,10)}function Ky(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Op(e,t,n=null,s,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?bi(t):t,state:n,key:t&&t.key||s||XN(),unstable_mask:a}}function Ba({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function bi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function QN(e,t,n,s={}){let{window:a=document.defaultView,v5Compat:l=!1}=s,c=a.history,d="POP",f=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function x(){d="POP";let w=g(),S=w==null?null:w-m;m=w,f&&f({action:d,location:j.location,delta:S})}function y(w,S){d="PUSH";let T=qy(w)?w:Op(j.location,w,S);m=g()+1;let N=Ky(T,m),A=j.createHref(T.unstable_mask||T);try{c.pushState(N,"",A)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(A)}l&&f&&f({action:d,location:j.location,delta:1})}function v(w,S){d="REPLACE";let T=qy(w)?w:Op(j.location,w,S);m=g();let N=Ky(T,m),A=j.createHref(T.unstable_mask||T);c.replaceState(N,"",A),l&&f&&f({action:d,location:j.location,delta:0})}function C(w){return ZN(w)}let j={get action(){return d},get location(){return e(a,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Vy,x),f=w,()=>{a.removeEventListener(Vy,x),f=null}},createHref(w){return t(a,w)},createURL:C,encodeLocation(w){let S=C(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:v,go(w){return c.go(w)}};return j}function ZN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ot(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ba(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function dw(e,t,n="/"){return eC(e,t,n,!1)}function eC(e,t,n,s){let a=typeof t=="string"?bi(t):t,l=ds(a.pathname||"/",n);if(l==null)return null;let c=fw(e);tC(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let m=fC(l);d=uC(c[f],m,s)}return d}function fw(e,t=[],n=[],s="",a=!1){let l=(c,d,f=a,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(s)&&f)return;Ot(g.relativePath.startsWith(s),`Absolute route path "${g.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(s.length)}let x=Hr([s,g.relativePath]),y=n.concat(g);c.children&&c.children.length>0&&(Ot(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),fw(c.children,t,y,x,f)),!(c.path==null&&!c.index)&&t.push({path:x,score:lC(x,c.index),routesMeta:y})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))l(c,d);else for(let m of pw(c.path))l(c,d,!0,m)}),t}function pw(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return a?[l,""]:[l];let c=pw(s.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),a&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function tC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cC(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var nC=/^:[\w-]+$/,rC=3,sC=2,oC=1,iC=10,aC=-2,Gy=e=>e==="*";function lC(e,t){let n=e.split("/"),s=n.length;return n.some(Gy)&&(s+=aC),t&&(s+=sC),n.filter(a=>!Gy(a)).reduce((a,l)=>a+(nC.test(l)?rC:l===""?oC:iC),s)}function cC(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function uC(e,t,n=!1){let{routesMeta:s}=e,a={},l="/",c=[];for(let d=0;d<s.length;++d){let f=s[d],m=d===s.length-1,g=l==="/"?t:t.slice(l.length)||"/",x=eu({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},g),y=f.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=eu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!x)return null;Object.assign(a,x.params),c.push({params:a,pathname:Hr([l,x.pathname]),pathnameBase:gC(Hr([l,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(l=Hr([l,x.pathnameBase]))}return c}function eu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=dC(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:s.reduce((m,{paramName:g,isOptional:x},y)=>{if(g==="*"){let C=d[y]||"";c=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const v=d[y];return x&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function dC(e,t=!1,n=!0){Sr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f,m,g)=>{if(s.push({paramName:d,isOptional:f!=null}),f){let x=g.charAt(m+c.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function fC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ds(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var pC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function mC(e,t="/"){let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?bi(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Yy(n.substring(1),"/"):l=Yy(n,t)):l=t,{pathname:l,search:xC(s),hash:yC(a)}}function Yy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Uf(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mw(e){let t=hC(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function ym(e,t,n,s=!1){let a;typeof e=="string"?a=bi(e):(a={...e},Ot(!a.pathname||!a.pathname.includes("?"),Uf("?","pathname","search",a)),Ot(!a.pathname||!a.pathname.includes("#"),Uf("#","pathname","hash",a)),Ot(!a.search||!a.search.includes("#"),Uf("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let x=t.length-1;if(!s&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),x-=1;a.pathname=y.join("/")}d=x>=0?t[x]:"/"}let f=mC(a,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||g)&&(f.pathname+="/"),f}var Hr=e=>e.join("/").replace(/\/\/+/g,"/"),gC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vC=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wC(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gw(e,t){let n=e;if(typeof n!="string"||!pC.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,a=!1;if(hw)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=ds(c.pathname,t);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{Sr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xw=["POST","PUT","PATCH","DELETE"];new Set(xw);var jC=["GET",...xw];new Set(jC);var wi=p.createContext(null);wi.displayName="DataRouter";var ju=p.createContext(null);ju.displayName="DataRouterState";var kC=p.createContext(!1),yw=p.createContext({isTransitioning:!1});yw.displayName="ViewTransition";var SC=p.createContext(new Map);SC.displayName="Fetchers";var NC=p.createContext(null);NC.displayName="Await";var ur=p.createContext(null);ur.displayName="Navigation";var el=p.createContext(null);el.displayName="Location";var Tr=p.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName="Route";var vm=p.createContext(null);vm.displayName="RouteError";var vw="REACT_ROUTER_ERROR",CC="REDIRECT",EC="ROUTE_ERROR_RESPONSE";function TC(e){if(e.startsWith(`${vw}:${CC}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function PC(e){if(e.startsWith(`${vw}:${EC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new vC(t.status,t.statusText,t.data)}catch{}}function RC(e,{relative:t}={}){Ot(tl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=p.useContext(ur),{hash:a,pathname:l,search:c}=nl(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Hr([n,l])),s.createHref({pathname:d,search:c,hash:a})}function tl(){return p.useContext(el)!=null}function En(){return Ot(tl(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(el).location}var bw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ww(e){p.useContext(ur).static||p.useLayoutEffect(e)}function Tt(){let{isDataRoute:e}=p.useContext(Tr);return e?VC():AC()}function AC(){Ot(tl(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(wi),{basename:t,navigator:n}=p.useContext(ur),{matches:s}=p.useContext(Tr),{pathname:a}=En(),l=JSON.stringify(mw(s)),c=p.useRef(!1);return ww(()=>{c.current=!0}),p.useCallback((f,m={})=>{if(Sr(c.current,bw),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=ym(f,JSON.parse(l),a,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Hr([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,a,e])}var DC=p.createContext(null);function OC(e){let t=p.useContext(Tr).outlet;return p.useMemo(()=>t&&p.createElement(DC.Provider,{value:e},t),[t,e])}function kt(){let{matches:e}=p.useContext(Tr),t=e[e.length-1];return t?t.params:{}}function nl(e,{relative:t}={}){let{matches:n}=p.useContext(Tr),{pathname:s}=En(),a=JSON.stringify(mw(n));return p.useMemo(()=>ym(e,JSON.parse(a),s,t==="path"),[e,a,s,t])}function IC(e,t){return jw(e,t)}function jw(e,t,n){var w;Ot(tl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext(ur),{matches:a}=p.useContext(Tr),l=a[a.length-1],c=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";Sw(d,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let g=En(),x;if(t){let S=typeof t=="string"?bi(t):t;Ot(f==="/"||((w=S.pathname)==null?void 0:w.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${S.pathname}" was given in the \`location\` prop.`),x=S}else x=g;let y=x.pathname||"/",v=y;if(f!=="/"){let S=f.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=dw(e,{pathname:v});Sr(m||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Sr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=FC(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Hr([f,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Hr([f,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&j?p.createElement(el.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},j):j}function LC(){let e=WC(),t=bC(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:a},n):null,c)}var $C=p.createElement(LC,null),kw=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=PC(e.digest);n&&(e=n)}let t=e!==void 0?p.createElement(Tr.Provider,{value:this.props.routeContext},p.createElement(vm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?p.createElement(MC,{error:e},t):t}};kw.contextType=kC;var Hf=new WeakMap;function MC({children:e,error:t}){let{basename:n}=p.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=TC(t.digest);if(s){let a=Hf.get(t);if(a)throw a;let l=gw(s.location,n);if(hw&&!Hf.get(t))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Hf.set(t,c),c}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function _C({routeContext:e,match:t,children:n}){let s=p.useContext(wi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Tr.Provider,{value:e},n)}function FC(e,t=[],n){let s=n==null?void 0:n.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let a=e,l=s==null?void 0:s.errors;if(l!=null){let g=a.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);Ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,g+1))}let c=!1,d=-1;if(n&&s){c=s.renderFallback;for(let g=0;g<a.length;g++){let x=a[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(d=g),x.route.id){let{loaderData:y,errors:v}=s,C=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||C){n.isStatic&&(c=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,m=s&&f?(g,x)=>{var y,v;f(g,{location:s.location,params:((v=(y=s.matches)==null?void 0:y[0])==null?void 0:v.params)??{},unstable_pattern:wC(s.matches),errorInfo:x})}:void 0;return a.reduceRight((g,x,y)=>{let v,C=!1,j=null,w=null;s&&(v=l&&x.route.id?l[x.route.id]:void 0,j=x.route.errorElement||$C,c&&(d<0&&y===0?(Sw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):d===y&&(C=!0,w=x.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,y+1)),T=()=>{let N;return v?N=j:C?N=w:x.route.Component?N=p.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=g,p.createElement(_C,{match:x,routeContext:{outlet:g,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?p.createElement(kw,{location:s.location,revalidation:s.revalidation,component:j,error:v,children:T(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):T()},null)}function bm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zC(e){let t=p.useContext(wi);return Ot(t,bm(e)),t}function BC(e){let t=p.useContext(ju);return Ot(t,bm(e)),t}function UC(e){let t=p.useContext(Tr);return Ot(t,bm(e)),t}function wm(e){let t=UC(e),n=t.matches[t.matches.length-1];return Ot(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function HC(){return wm("useRouteId")}function WC(){var s;let e=p.useContext(vm),t=BC("useRouteError"),n=wm("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function VC(){let{router:e}=zC("useNavigate"),t=wm("useNavigate"),n=p.useRef(!1);return ww(()=>{n.current=!0}),p.useCallback(async(a,l={})=>{Sr(n.current,bw),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var Jy={};function Sw(e,t,n){!t&&!Jy[e]&&(Jy[e]=!0,Sr(!1,n))}p.memo(qC);function qC({routes:e,future:t,state:n,isStatic:s,onError:a}){return jw(e,void 0,{state:n,isStatic:s,onError:a})}function KC(e){return OC(e.context)}function Ie(e){Ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function GC({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){Ot(!tl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=p.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[d,a,l,c]);typeof n=="string"&&(n=bi(n));let{pathname:m="/",search:g="",hash:x="",state:y=null,key:v="default",unstable_mask:C}=n,j=p.useMemo(()=>{let w=ds(m,d);return w==null?null:{location:{pathname:w,search:g,hash:x,state:y,key:v,unstable_mask:C},navigationType:s}},[d,m,g,x,y,v,s,C]);return Sr(j!=null,`<Router basename="${d}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:p.createElement(ur.Provider,{value:f},p.createElement(el.Provider,{children:t,value:j}))}function YC({children:e,location:t}){return IC(Ip(e),t)}function Ip(e,t=[]){let n=[];return p.Children.forEach(e,(s,a)=>{if(!p.isValidElement(s))return;let l=[...t,a];if(s.type===p.Fragment){n.push.apply(n,Ip(s.props.children,l));return}Ot(s.type===Ie,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ot(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=Ip(s.props.children,l)),n.push(c)}),n}var Bc="get",Uc="application/x-www-form-urlencoded";function ku(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function JC(e){return ku(e)&&e.tagName.toLowerCase()==="button"}function XC(e){return ku(e)&&e.tagName.toLowerCase()==="form"}function QC(e){return ku(e)&&e.tagName.toLowerCase()==="input"}function ZC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eE(e,t){return e.button===0&&(!t||t==="_self")&&!ZC(e)}function Lp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function tE(e,t){let n=Lp(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var Sc=null;function nE(){if(Sc===null)try{new FormData(document.createElement("form"),0),Sc=!1}catch{Sc=!0}return Sc}var rE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wf(e){return e!=null&&!rE.has(e)?(Sr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Uc}"`),null):e}function sE(e,t){let n,s,a,l,c;if(XC(e)){let d=e.getAttribute("action");s=d?ds(d,t):null,n=e.getAttribute("method")||Bc,a=Wf(e.getAttribute("enctype"))||Uc,l=new FormData(e)}else if(JC(e)||QC(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(s=f?ds(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Bc,a=Wf(e.getAttribute("formenctype"))||Wf(d.getAttribute("enctype"))||Uc,l=new FormData(d,e),!nE()){let{name:m,type:g,value:x}=e;if(g==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,x)}}else{if(ku(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Bc,s=null,a=Uc,c=e}return l&&a==="text/plain"&&(c=l,l=void 0),{action:s,method:n.toLowerCase(),encType:a,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jm(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oE(e,t,n,s){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${s}`:a.pathname=`${a.pathname}.${s}`:a.pathname==="/"?a.pathname=`_root.${s}`:t&&ds(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${s}`,a}async function iE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function aE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function lE(e,t,n){let s=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let c=await iE(l,n);return c.links?c.links():[]}return[]}));return fE(s.flat(1).filter(aE).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Xy(e,t,n,s,a,l){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,d=(f,m)=>{var g;return n[m].pathname!==f.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,m)=>c(f,m)||d(f,m)):l==="data"?t.filter((f,m)=>{var x;let g=s.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,m)||d(f,m))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function cE(e,t,{includeHydrateFallback:n}={}){return uE(e.map(s=>{let a=t.routes[s.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function uE(e){return[...new Set(e)]}function dE(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function fE(e,t){let n=new Set;return new Set(t),e.reduce((s,a)=>{let l=JSON.stringify(dE(a));return n.has(l)||(n.add(l),s.push({key:l,link:a})),s},[])}function Nw(){let e=p.useContext(wi);return jm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function pE(){let e=p.useContext(ju);return jm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var km=p.createContext(void 0);km.displayName="FrameworkContext";function Cw(){let e=p.useContext(km);return jm(e,"You must render this element inside a <HydratedRouter> element"),e}function mE(e,t){let n=p.useContext(km),[s,a]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=t,y=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=S=>{S.forEach(T=>{c(T.isIntersecting)})},w=new IntersectionObserver(j,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),p.useEffect(()=>{if(s){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[s]);let v=()=>{a(!0)},C=()=>{a(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:ga(d,v),onBlur:ga(f,C),onMouseEnter:ga(m,v),onMouseLeave:ga(g,C),onTouchStart:ga(x,v)}]:[!1,y,{}]}function ga(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function hE({page:e,...t}){let{router:n}=Nw(),s=p.useMemo(()=>dw(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?p.createElement(xE,{page:e,matches:s,...t}):null}function gE(e){let{manifest:t,routeModules:n}=Cw(),[s,a]=p.useState([]);return p.useEffect(()=>{let l=!1;return lE(e,t,n).then(c=>{l||a(c)}),()=>{l=!0}},[e,t,n]),s}function xE({page:e,matches:t,...n}){let s=En(),{future:a,manifest:l,routeModules:c}=Cw(),{basename:d}=Nw(),{loaderData:f,matches:m}=pE(),g=p.useMemo(()=>Xy(e,t,m,l,s,"data"),[e,t,m,l,s]),x=p.useMemo(()=>Xy(e,t,m,l,s,"assets"),[e,t,m,l,s]),y=p.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let j=new Set,w=!1;if(t.forEach(T=>{var A;let N=l.routes[T.route.id];!N||!N.hasLoader||(!g.some($=>$.route.id===T.route.id)&&T.route.id in f&&((A=c[T.route.id])!=null&&A.shouldRevalidate)||N.hasClientLoader?w=!0:j.add(T.route.id))}),j.size===0)return[];let S=oE(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return w&&j.size>0&&S.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[d,a.unstable_trailingSlashAwareDataRequests,f,s,l,g,t,e,c]),v=p.useMemo(()=>cE(x,l),[x,l]),C=gE(x);return p.createElement(p.Fragment,null,y.map(j=>p.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),v.map(j=>p.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),C.map(({key:j,link:w})=>p.createElement("link",{key:j,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function yE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vE&&(window.__reactRouterVersion="7.13.1")}catch{}function bE({basename:e,children:t,unstable_useTransitions:n,window:s}){let a=p.useRef();a.current==null&&(a.current=JN({window:s,v5Compat:!0}));let l=a.current,[c,d]=p.useState({action:l.action,location:l.location}),f=p.useCallback(m=>{n===!1?d(m):p.startTransition(()=>d(m))},[n]);return p.useLayoutEffect(()=>l.listen(f),[l,f]),p.createElement(GC,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var Ew=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=p.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:a,reloadDocument:l,replace:c,unstable_mask:d,state:f,target:m,to:g,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:v,...C},j){let{basename:w,navigator:S,unstable_useTransitions:T}=p.useContext(ur),N=typeof g=="string"&&Ew.test(g),A=gw(g,w);g=A.to;let $=RC(g,{relative:a}),R=En(),O=null;if(d){let Y=ym(d,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(Y.pathname=Y.pathname==="/"?w:Hr([w,Y.pathname])),O=S.createHref(Y)}let[I,K,X]=mE(s,C),_=SE(g,{replace:c,unstable_mask:d,state:f,target:m,preventScrollReset:x,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:T});function H(Y){t&&t(Y),Y.defaultPrevented||_(Y)}let J=!(A.isExternal||l),U=p.createElement("a",{...C,...X,href:(J?O:void 0)||A.absoluteURL||$,onClick:J?H:t,ref:yE(j,K),target:m,"data-discover":!N&&n==="render"?"true":void 0});return I&&!N?p.createElement(p.Fragment,null,U,p.createElement(hE,{page:$})):U});we.displayName="Link";var wE=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:a=!1,style:l,to:c,viewTransition:d,children:f,...m},g){let x=nl(c,{relative:m.relative}),y=En(),v=p.useContext(ju),{navigator:C,basename:j}=p.useContext(ur),w=v!=null&&PE(x)&&d===!0,S=C.encodeLocation?C.encodeLocation(x).pathname:x.pathname,T=y.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&j&&(N=ds(N,j)||N);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let $=T===S||!a&&T.startsWith(S)&&T.charAt(A)==="/",R=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),O={isActive:$,isPending:R,isTransitioning:w},I=$?t:void 0,K;typeof s=="function"?K=s(O):K=[s,$?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let X=typeof l=="function"?l(O):l;return p.createElement(we,{...m,"aria-current":I,className:K,ref:g,style:X,to:c,viewTransition:d},typeof f=="function"?f(O):f)});wE.displayName="NavLink";var jE=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:a,state:l,method:c=Bc,action:d,onSubmit:f,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:y,...v},C)=>{let{unstable_useTransitions:j}=p.useContext(ur),w=EE(),S=TE(d,{relative:m}),T=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&Ew.test(d),A=$=>{if(f&&f($),$.defaultPrevented)return;$.preventDefault();let R=$.nativeEvent.submitter,O=(R==null?void 0:R.getAttribute("formmethod"))||c,I=()=>w(R||$.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:a,state:l,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:y});j&&n!==!1?p.startTransition(()=>I()):I()};return p.createElement("form",{ref:C,method:T,action:S,onSubmit:s?f:A,...v,"data-discover":!N&&e==="render"?"true":void 0})});jE.displayName="Form";function kE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tw(e){let t=p.useContext(wi);return Ot(t,kE(e)),t}function SE(e,{target:t,replace:n,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:m}={}){let g=Tt(),x=En(),y=nl(e,{relative:c});return p.useCallback(v=>{if(eE(v,t)){v.preventDefault();let C=n!==void 0?n:Ba(x)===Ba(y),j=()=>g(e,{replace:C,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f});m?p.startTransition(()=>j()):j()}},[x,g,y,n,s,a,t,e,l,c,d,f,m])}function Xr(e){Sr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(Lp(e)),n=p.useRef(!1),s=En(),a=p.useMemo(()=>tE(s.search,n.current?null:t.current),[s.search]),l=Tt(),c=p.useCallback((d,f)=>{const m=Lp(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+m,f)},[l,a]);return[a,c]}var NE=0,CE=()=>`__${String(++NE)}__`;function EE(){let{router:e}=Tw("useSubmit"),{basename:t}=p.useContext(ur),n=HC(),s=e.fetch,a=e.navigate;return p.useCallback(async(l,c={})=>{let{action:d,method:f,encType:m,formData:g,body:x}=sE(l,t);if(c.navigate===!1){let y=c.fetcherKey||CE();await s(y,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:x,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await a(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:x,formMethod:c.method||f,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[s,a,t,n])}function TE(e,{relative:t}={}){let{basename:n}=p.useContext(ur),s=p.useContext(Tr);Ot(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),l={...nl(e||".",{relative:t})},c=En();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(x=>x).forEach(x=>d.append("index",x));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Hr([n,l.pathname])),Ba(l)}function PE(e,{relative:t}={}){let n=p.useContext(yw);Ot(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Tw("useViewTransitionState"),a=nl(e,{relative:t});if(!n.isTransitioning)return!1;let l=ds(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=ds(n.nextLocation.pathname,s)||n.nextLocation.pathname;return eu(a.pathname,c)!=null||eu(a.pathname,l)!=null}var Us=uw();const RE=wu(Us);/**
52
- * @license lucide-react v0.460.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const AE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pw=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
57
- * @license lucide-react v0.460.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */var DE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
- * @license lucide-react v0.460.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const OE=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...d},f)=>p.createElement("svg",{ref:f,...DE,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Pw("lucide",a),...d},[...c.map(([m,g])=>p.createElement(m,g)),...Array.isArray(l)?l:[l]]));/**
67
- * @license lucide-react v0.460.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Ce=(e,t)=>{const n=p.forwardRef(({className:s,...a},l)=>p.createElement(OE,{ref:l,iconNode:t,className:Pw(`lucide-${AE(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
72
- * @license lucide-react v0.460.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const Sm=Ce("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
77
- * @license lucide-react v0.460.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const Rw=Ce("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
82
- * @license lucide-react v0.460.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const rl=Ce("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
87
- * @license lucide-react v0.460.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const Aw=Ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
92
- * @license lucide-react v0.460.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const tu=Ce("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
97
- * @license lucide-react v0.460.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const IE=Ce("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
102
- * @license lucide-react v0.460.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const Dw=Ce("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
107
- * @license lucide-react v0.460.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const Nm=Ce("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
112
- * @license lucide-react v0.460.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const LE=Ce("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
117
- * @license lucide-react v0.460.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const ji=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
122
- * @license lucide-react v0.460.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Ua=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
127
- * @license lucide-react v0.460.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const $E=Ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
132
- * @license lucide-react v0.460.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Ow=Ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
137
- * @license lucide-react v0.460.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const $p=Ce("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
142
- * @license lucide-react v0.460.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const Cm=Ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
147
- * @license lucide-react v0.460.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const Mp=Ce("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
152
- * @license lucide-react v0.460.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const ME=Ce("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
157
- * @license lucide-react v0.460.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const _E=Ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
162
- * @license lucide-react v0.460.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const FE=Ce("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
167
- * @license lucide-react v0.460.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const zE=Ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
172
- * @license lucide-react v0.460.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const BE=Ce("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
177
- * @license lucide-react v0.460.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const Iw=Ce("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
182
- * @license lucide-react v0.460.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const Ha=Ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
187
- * @license lucide-react v0.460.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const UE=Ce("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
192
- * @license lucide-react v0.460.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const HE=Ce("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
197
- * @license lucide-react v0.460.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const Em=Ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
202
- * @license lucide-react v0.460.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const Qy=Ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
207
- * @license lucide-react v0.460.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const WE=Ce("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
212
- * @license lucide-react v0.460.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const VE=Ce("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
217
- * @license lucide-react v0.460.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const Lw=Ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
222
- * @license lucide-react v0.460.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const $w=Ce("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
227
- * @license lucide-react v0.460.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const qE=Ce("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);/**
232
- * @license lucide-react v0.460.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const Tm=Ce("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
237
- * @license lucide-react v0.460.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const KE=Ce("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
242
- * @license lucide-react v0.460.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const Pm=Ce("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
247
- * @license lucide-react v0.460.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const GE=Ce("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
252
- * @license lucide-react v0.460.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const Rm=Ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
257
- * @license lucide-react v0.460.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const _p=Ce("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
262
- * @license lucide-react v0.460.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const YE=Ce("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
267
- * @license lucide-react v0.460.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const JE=Ce("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
272
- * @license lucide-react v0.460.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const XE=Ce("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
277
- * @license lucide-react v0.460.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const QE=Ce("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
282
- * @license lucide-react v0.460.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const Am=Ce("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
287
- * @license lucide-react v0.460.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const ZE=Ce("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
292
- * @license lucide-react v0.460.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const Dm=Ce("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
297
- * @license lucide-react v0.460.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const e2=Ce("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/**
302
- * @license lucide-react v0.460.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const Vf=Ce("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
307
- * @license lucide-react v0.460.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const ki=Ce("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
312
- * @license lucide-react v0.460.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const t2=Ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
317
- * @license lucide-react v0.460.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const Ht=Ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
322
- * @license lucide-react v0.460.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const Mw=Ce("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
327
- * @license lucide-react v0.460.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const n2=Ce("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
332
- * @license lucide-react v0.460.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const gi=Ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
337
- * @license lucide-react v0.460.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const Su=Ce("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
342
- * @license lucide-react v0.460.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const r2=Ce("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
347
- * @license lucide-react v0.460.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const qs=Ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
352
- * @license lucide-react v0.460.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const s2=Ce("SendToBack",[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1",key:"pao6x6"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1",key:"19tdru"}]]);/**
357
- * @license lucide-react v0.460.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const o2=Ce("ServerOff",[["path",{d:"M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5",key:"bt2siv"}],["path",{d:"M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z",key:"1hjrv1"}],["path",{d:"M22 17v-1a2 2 0 0 0-2-2h-1",key:"1iynyr"}],["path",{d:"M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z",key:"161ggg"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
362
- * @license lucide-react v0.460.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const i2=Ce("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
367
- * @license lucide-react v0.460.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const a2=Ce("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
372
- * @license lucide-react v0.460.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const cr=Ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
377
- * @license lucide-react v0.460.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const Zy=Ce("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
382
- * @license lucide-react v0.460.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const Om=Ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
387
- * @license lucide-react v0.460.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const l2=Ce("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
392
- * @license lucide-react v0.460.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const _w=Ce("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
397
- * @license lucide-react v0.460.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const Wa=Ce("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
402
- * @license lucide-react v0.460.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const zn=Ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
407
- * @license lucide-react v0.460.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const Im=Ce("TriangleAlert",[["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"}]]);/**
412
- * @license lucide-react v0.460.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const c2=Ce("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
417
- * @license lucide-react v0.460.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const u2=Ce("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
422
- * @license lucide-react v0.460.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const Lm=Ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Fw(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Fw(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function d2(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Fw(e))&&(s&&(s+=" "),s+=t);return s}const $m="-",f2=e=>{const t=m2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const d=c.split($m);return d[0]===""&&d.length!==1&&d.shift(),zw(d,t)||p2(c)},getConflictingClassGroupIds:(c,d)=>{const f=n[c]||[];return d&&s[c]?[...f,...s[c]]:f}}},zw=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?zw(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join($m);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},ev=/^\[(.+)\]$/,p2=e=>{if(ev.test(e)){const t=ev.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},m2=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return g2(Object.entries(e.classGroups),n).forEach(([l,c])=>{Fp(c,s,l,t)}),s},Fp=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:tv(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(h2(a)){Fp(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Fp(c,tv(t,l),n,s)})})},tv=(e,t)=>{let n=e;return t.split($m).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},h2=e=>e.isThemeGetter,g2=(e,t)=>t?e.map(([n,s])=>{const a=s.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,a]}):e,x2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,s=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=s.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},Bw="!",y2=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],l=t.length,c=d=>{const f=[];let m=0,g=0,x;for(let w=0;w<d.length;w++){let S=d[w];if(m===0){if(S===a&&(s||d.slice(w,w+l)===t)){f.push(d.slice(g,w)),g=w+l;continue}if(S==="/"){x=w;continue}}S==="["?m++:S==="]"&&m--}const y=f.length===0?d:d.substring(g),v=y.startsWith(Bw),C=v?y.substring(1):y,j=x&&x>g?x-g:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:j}};return n?d=>n({className:d,parseClassName:c}):c},v2=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},b2=e=>({cache:x2(e.cacheSize),parseClassName:y2(e),...f2(e)}),w2=/\s+/,j2=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(w2);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}=n(m);let C=!!v,j=s(C?y.substring(0,v):y);if(!j){if(!C){d=m+(d.length>0?" "+d:d);continue}if(j=s(y),!j){d=m+(d.length>0?" "+d:d);continue}C=!1}const w=v2(g).join(":"),S=x?w+Bw:w,T=S+j;if(l.includes(T))continue;l.push(T);const N=a(j,C);for(let A=0;A<N.length;++A){const $=N[A];l.push(S+$)}d=m+(d.length>0?" "+d:d)}return d};function k2(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Uw(t))&&(s&&(s+=" "),s+=n);return s}const Uw=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Uw(e[s]))&&(n&&(n+=" "),n+=t);return n};function S2(e,...t){let n,s,a,l=c;function c(f){const m=t.reduce((g,x)=>x(g),e());return n=b2(m),s=n.cache.get,a=n.cache.set,l=d,d(f)}function d(f){const m=s(f);if(m)return m;const g=j2(f,n);return a(f,g),g}return function(){return l(k2.apply(null,arguments))}}const wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Hw=/^\[(?:([a-z-]+):)?(.+)\]$/i,N2=/^\d+\/\d+$/,C2=new Set(["px","full","screen"]),E2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,R2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,A2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,us=e=>ii(e)||C2.has(e)||N2.test(e),Ls=e=>Si(e,"length",F2),ii=e=>!!e&&!Number.isNaN(Number(e)),qf=e=>Si(e,"number",ii),xa=e=>!!e&&Number.isInteger(Number(e)),D2=e=>e.endsWith("%")&&ii(e.slice(0,-1)),qe=e=>Hw.test(e),$s=e=>E2.test(e),O2=new Set(["length","size","percentage"]),I2=e=>Si(e,O2,Ww),L2=e=>Si(e,"position",Ww),$2=new Set(["image","url"]),M2=e=>Si(e,$2,B2),_2=e=>Si(e,"",z2),ya=()=>!0,Si=(e,t,n)=>{const s=Hw.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},F2=e=>T2.test(e)&&!P2.test(e),Ww=()=>!1,z2=e=>R2.test(e),B2=e=>A2.test(e),U2=()=>{const e=wt("colors"),t=wt("spacing"),n=wt("blur"),s=wt("brightness"),a=wt("borderColor"),l=wt("borderRadius"),c=wt("borderSpacing"),d=wt("borderWidth"),f=wt("contrast"),m=wt("grayscale"),g=wt("hueRotate"),x=wt("invert"),y=wt("gap"),v=wt("gradientColorStops"),C=wt("gradientColorStopPositions"),j=wt("inset"),w=wt("margin"),S=wt("opacity"),T=wt("padding"),N=wt("saturate"),A=wt("scale"),$=wt("sepia"),R=wt("skew"),O=wt("space"),I=wt("translate"),K=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",qe,t],H=()=>[qe,t],J=()=>["",us,Ls],U=()=>["auto",ii,qe],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",qe],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[ii,qe];return{cacheSize:500,separator:":",theme:{colors:[ya],spacing:[us,Ls],blur:["none","",$s,qe],brightness:M(),borderColor:[e],borderRadius:["none","","full",$s,qe],borderSpacing:H(),borderWidth:J(),contrast:M(),grayscale:Q(),hueRotate:M(),invert:Q(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[D2,Ls],inset:_(),margin:_(),opacity:M(),padding:H(),saturate:M(),scale:M(),sepia:Q(),skew:M(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),qe]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xa,qe]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",xa,qe]}],"grid-cols":[{"grid-cols":[ya]}],"col-start-end":[{col:["auto",{span:["full",xa,qe]},qe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ya]}],"row-start-end":[{row:["auto",{span:[xa,qe]},qe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qf]}],"font-family":[{font:[ya]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",ii,qf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",us,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",us,Ls]}],"underline-offset":[{"underline-offset":["auto",us,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),L2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},M2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:z()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[us,qe]}],"outline-w":[{outline:[us,Ls]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[us,Ls]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,_2]}],"shadow-color":[{shadow:[ya]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",$s,qe]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[xa,qe]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[us,Ls,qf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},H2=S2(U2);function ze(...e){return H2(d2(e))}function Kr(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Gr(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function W2(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function V2(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Mm(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function pn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Vw(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function q2(e){let t=Vw(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/inventories")?"/inventories":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function qw(e,t){return q2(e)===t}function Kw(e){let n=Vw(e).split("/").filter(Boolean);const s=[];let a="Overview",l=null,c="";if(n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,s.push({label:pn(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0)return{title:a,breadcrumbs:s,projectSlug:l};if(n[0]==="projects"){if(s.push({label:"Projects",path:`${c}/projects`}),a="Projects",n[1]&&(l=n[1],s.push({label:pn(n[1]),path:`${c}/projects/${n[1]}`}),a=pn(n[1])),n[2]==="edit")a="Edit Project";else if(n[2]==="create"&&n[3]==="assignment")a="Create Assignment";else if(n[2]==="assignments"&&n[3])s.push({label:pn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),a=pn(n[3]),n[4]==="edit"?a="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?a="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?a="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?a="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(a="Append Decision");else if((n[2]==="memories"||n[2]==="resources")&&n[3]){const d=n[2]==="memories"?"Memories":"Resources",f=n[2]==="memories"?"/memories":"/resources";s.push({label:d,path:f}),s.push({label:pn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),a=pn(n[3]),n[4]==="edit"&&(a=n[2]==="memories"?"Edit Memory":"Edit Resource")}}else n[0]==="servers"?(a="Servers",s.push({label:"Servers",path:`${c}/servers`})):n[0]==="inventories"?(a="Inventories",s.push({label:"Inventories",path:`${c}/inventories`})):n[0]==="agent-sessions"?(a="Agent Sessions",s.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="assignments"?(a="Assignments",s.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),a="Playbooks",n[1]==="create"?a="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:pn(n[1]),path:`/playbooks/${n[1]}`}),a="Edit Playbook"):n[1]&&(s.push({label:pn(n[1]),path:`/playbooks/${n[1]}`}),a=pn(n[1]))):n[0]==="memories"?(s.push({label:"Memories",path:"/memories"}),a="Memories",n[1]==="new"&&(a="New Memory")):n[0]==="resources"?(s.push({label:"Resources",path:"/resources"}),a="Resources",n[1]==="new"&&(a="New Resource")):n[0]==="todos"?(a="Todos",s.push({label:"Todos",path:`${c}/todos`})):n[0]==="help"?(a="Help",s.push({label:"Help",path:"/help"})):n[0]==="settings"?(a="Settings",s.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(a="Create Project",s.push({label:"Create Project",path:`${c}/create/project`}));return{title:a,breadcrumbs:s,projectSlug:l}}function nv({items:e,onNavigate:t}){const n=En();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const a=s.icon,l=qw(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(we,{to:s.to,onClick:t,className:ze("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition",l?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"),children:[r.jsx(a,{className:"h-4 w-4"}),r.jsx("span",{children:s.label})]},s.to)})})}const Gw=[{slug:"default",label:"Syntaur",description:"Brand purple, warm yellow, coral & teal accents.",swatches:{primary:"oklch(70% 0.18 290)",secondary:"oklch(80% 0.14 75)",coral:"oklch(72% 0.17 15)",teal:"oklch(72% 0.14 185)",amber:"oklch(82% 0.16 75)"}},{slug:"ocean",label:"Midnight",description:"Deep indigo-blue with cyan accents. Inspired by One Dark Pro.",swatches:{primary:"oklch(70% 0.16 240)",secondary:"oklch(78% 0.13 200)",coral:"oklch(72% 0.18 350)",teal:"oklch(78% 0.14 195)",amber:"oklch(84% 0.15 90)"}},{slug:"forest",label:"Verdant",description:"Saturated emerald and pine on a dark olive base.",swatches:{primary:"oklch(72% 0.17 145)",secondary:"oklch(80% 0.13 110)",coral:"oklch(72% 0.17 25)",teal:"oklch(75% 0.13 175)",amber:"oklch(82% 0.16 95)"}},{slug:"sunset",label:"Ember",description:"Warm sepia surfaces with copper and amber accents.",swatches:{primary:"oklch(72% 0.18 35)",secondary:"oklch(80% 0.16 60)",coral:"oklch(72% 0.19 15)",teal:"oklch(72% 0.12 180)",amber:"oklch(86% 0.17 70)"}}],K2=Gw.map(e=>e.slug),nu="default";function Yw(e){return typeof e=="string"&&K2.includes(e)}const Jw={preset:nu,custom:!1};let Pa=null,qo=null;function _m(e){if(!e||typeof e!="object")return Jw;const t=e;return{preset:Yw(t.preset)?t.preset:nu,custom:t.custom===!0}}function G2(){return Pa?Promise.resolve(Pa):qo||(qo=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=_m(e);return Pa=t,qo=null,t}).catch(()=>(qo=null,Jw)),qo)}async function Y2(e){const t=await fetch("/api/config/theme",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:e})});if(!t.ok){const s=await t.json().catch(()=>({error:`HTTP ${t.status}`}));throw new Error(s.error??"Failed to save theme")}const n=_m(await t.json());return Pa=n,n}async function J2(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=_m(await e.json());return Pa=t,t}const zp="syntaur-theme",Hc="syntaur-preset",Xw=p.createContext(null);function Bp(){try{const e=window.localStorage.getItem(zp);return e==="light"||e==="dark"?e:null}catch{return null}}function Qw(){try{const e=window.localStorage.getItem(Hc);return Yw(e)?e:nu}catch{return nu}}function Zw(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function e0(e){document.documentElement.classList.toggle("dark",e==="dark")}function t0(e){document.documentElement.dataset.theme=e}function X2(){typeof document>"u"||(e0(Bp()??Zw()),t0(Qw()))}function Q2({children:e}){const[t,n]=p.useState(()=>Bp()),[s,a]=p.useState(()=>Bp()??Zw()),[l,c]=p.useState(()=>Qw());p.useEffect(()=>{e0(s)},[s]),p.useEffect(()=>{t0(l)},[l]),p.useEffect(()=>{let g=!1;return G2().then(x=>{if(!g&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(Hc,x.preset)}catch{}}}),()=>{g=!0}},[]),p.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||a(g.matches?"dark":"light")};return x(),g.addEventListener("change",x),()=>{g.removeEventListener("change",x)}},[t]);async function d(g){c(g);try{window.localStorage.setItem(Hc,g)}catch{}await Y2(g)}async function f(){const g=await J2();c(g.preset);try{window.localStorage.setItem(Hc,g.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:g=>{window.localStorage.setItem(zp,g),n(g),a(g)},toggleTheme:()=>{const g=s==="dark"?"light":"dark";window.localStorage.setItem(zp,g),n(g),a(g)},preset:l,setPreset:d,resetPreset:f};return r.jsx(Xw.Provider,{value:m,children:e})}function Fm(){const e=p.useContext(Xw);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Wc=new Set;let Mn=null,ai=null;function Z2(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function n0(){Mn&&(Mn.readyState===WebSocket.OPEN||Mn.readyState===WebSocket.CONNECTING)||(Mn=new WebSocket(Z2()),Mn.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of Wc)n(t)}catch{}},Mn.onclose=()=>{Mn=null,ai&&clearTimeout(ai),ai=setTimeout(n0,2e3)},Mn.onerror=()=>{Mn==null||Mn.close()})}function Nu(e){const t=p.useRef(e);t.current=e,p.useEffect(()=>{const n=s=>t.current(s);return Wc.add(n),n0(),()=>{Wc.delete(n),Wc.size===0&&Mn&&(ai&&clearTimeout(ai),ai=null,Mn.close(),Mn=null)}},[])}function Wt(e,t){const[n,s]=p.useState(null),[a,l]=p.useState(!0),[c,d]=p.useState(null),[f,m]=p.useState(0),g=p.useCallback(()=>{m(x=>x+1)},[]);return p.useEffect(()=>{if(!e){l(!1),s(null);return}let x=!1;return l(!0),d(null),fetch(e).then(async y=>{if(!y.ok){const v=await y.json().catch(()=>null);throw new Error((v==null?void 0:v.error)||`HTTP ${y.status}`)}return y.json()}).then(y=>{x||(s(y),l(!1))}).catch(y=>{x||(d(y.message),l(!1))}),()=>{x=!0}},[e,f]),Nu(x=>{t&&((x.type==="project-updated"||x.type==="assignment-updated")&&g(),x.type==="servers-updated"&&t==="servers"&&g(),x.type==="agent-sessions-updated"&&(t==="agent-sessions"||t==="overview")&&g(),x.type==="playbooks-updated"&&t==="playbooks"&&g(),x.type==="leases-updated"&&t==="inventories"&&g())}),{data:n,loading:a,error:c,refetch:g}}function Ni(){return Wt("/api/projects","projects")}function Cu(){return Wt("/api/workspaces","projects")}function Pt(){const{workspace:e}=kt();return e?`/w/${e}`:""}function eT(e={}){const t=new URLSearchParams;typeof e.staleLimit=="number"&&Number.isFinite(e.staleLimit)&&t.set("staleLimit",String(e.staleLimit)),typeof e.staleOffset=="number"&&Number.isFinite(e.staleOffset)&&t.set("staleOffset",String(e.staleOffset));const n=t.toString(),s=n?`/api/overview?${n}`:"/api/overview";return Wt(s,"overview")}function r0(){return Wt("/api/assignments","assignments")}function s0(){return Wt("/api/help")}function o0(e){const t=e?`/api/projects/${e}`:null;return Wt(t,"project")}function tT(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return Wt(n,"assignment")}function nT(e){const t=e?`/api/assignments/${e}`:null;return Wt(t,"assignment")}function i0(e){return Wt(e)}function zm(){return Wt("/api/servers","servers")}function rT(){return Wt("/api/leases","inventories")}function sT(){return Wt("/api/agent-sessions","agent-sessions")}function oT(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return Wt(n,"agent-sessions")}function iT(e){const t=e?`/api/assignments/${e}/sessions`:null;return Wt(t,"agent-sessions")}function a0(){return Wt("/api/playbooks","playbooks")}function aT(e){const t=e?`/api/playbooks/${e}`:null;return Wt(t,"playbooks")}function lT(){return Wt("/api/memories","project")}function cT(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return Wt(n,"project")}function uT(){return Wt("/api/resources","project")}function dT(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return Wt(n,"project")}const Eu=["new-workspace","new-project","new-todo","new-assignment"];function fT(e){return typeof e=="string"&&Eu.includes(e)}const pT=["mod+k","mod+shift+k","?","escape","enter","shift+t","g","g o","g m","g a","g t","g s","g !","g ,","j","k","o","a","e","/","r","p","h","d","s","[","]"],mT=["mod","ctrl","alt","shift"];function _n(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(_n).filter(d=>d.length>0).join(" ");const n=t.split("+").map(d=>d.trim()).filter(d=>d.length>0);if(n.length===0)return"";if(n.length===1)return n[0].toLowerCase();const s=n[n.length-1].toLowerCase(),a=n.slice(0,-1).map(d=>d.toLowerCase()),l=new Set,c=[];for(const d of mT)a.includes(d)&&!l.has(d)&&(c.push(d),l.add(d));for(const d of a)l.has(d)||(c.push(d),l.add(d));return[...c,s].join("+")}function hT(e){const t=_n(e);return t?pT.includes(t):!1}const gT={"new-workspace":_n("Mod+Shift+Alt+w"),"new-project":_n("Mod+Shift+Alt+p"),"new-todo":_n("Mod+Shift+Alt+t"),"new-assignment":_n("Mod+Shift+Alt+a")};function xT(e){const t={...gT};for(const n of Eu){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function mo(){if(typeof navigator>"u")return!1;const e=navigator.platform||"",t=navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)||/Mac OS X/.test(t)}function yT(e){const t=e.split("+").map(a=>a.trim()),n=t[t.length-1]??"",s=new Set(t.slice(0,-1).map(a=>a.toLowerCase()));return{key:n.toLowerCase(),mod:s.has("mod"),shift:s.has("shift"),alt:s.has("alt"),ctrl:s.has("ctrl")}}function Nc(e,t){const n=yT(t);if(e.key.toLowerCase()!==n.key)return!1;const a=mo()?e.metaKey:e.ctrlKey;return!(n.mod&&!a||!n.mod&&!n.ctrl&&a||n.ctrl&&!e.ctrlKey||n.shift&&!e.shiftKey||!n.shift&&!(n.key.length===1&&!/^[a-z0-9]$/.test(n.key))&&e.shiftKey||n.alt&&!e.altKey||!n.alt&&e.altKey)}function l0(e){const t=[],n=mo()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const s=e.key;let a;s===" "||s==="Spacebar"?a="space":(s.length,a=s.toLowerCase());const l=a.length===1&&/^[a-z0-9]$/.test(a);e.shiftKey&&l&&t.push("shift");const c=[...t,a].join("+");return _n(c)}function Wr(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?mo()?"⌘":"Ctrl":s==="shift"?mo()?"⇧":"Shift":s==="alt"?mo()?"⌥":"Alt":s==="ctrl"?mo()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(mo()?"":"+")}function vT(e){const[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(null),d=p.useCallback(async()=>{try{const f=await fetch(`/api/todos/${encodeURIComponent(e)}`);if(!f.ok)throw new Error(`HTTP ${f.status}`);n(await f.json()),c(null)}catch(f){c(f instanceof Error?f.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return p.useEffect(()=>{d()},[d]),Nu(f=>{f.type==="todos-updated"&&!f.projectSlug&&d()}),{data:t,loading:s,error:l,refetch:d}}function c0(){const[e,t]=p.useState(null),[n,s]=p.useState(!0),[a,l]=p.useState(null),c=p.useCallback(async()=>{try{const d=await fetch("/api/todos");if(!d.ok)throw new Error(`HTTP ${d.status}`);t(await d.json()),l(null)}catch(d){l(d instanceof Error?d.message:"Failed to fetch todos")}finally{s(!1)}},[]);return p.useEffect(()=>{c()},[c]),Nu(d=>{d.type==="todos-updated"&&!d.projectSlug&&c()}),{data:e,loading:n,error:a,refetch:c}}async function Bm(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function u0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function d0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function f0(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function p0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function bT(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function m0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function Um(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function wT(e,t){return await Um(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function jT(e){return await Um("/api/todos/promote-bulk",e)}async function kT(e,t,n){await Um(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const ST=new Set(["/projects","/assignments","/servers","/todos"]);function Vc(e,t){return ST.has(e)?`${t}${e}`:e}const NT=[{id:"page-overview",title:"Overview",basePath:"/",keywords:["home","dashboard"]},{id:"page-projects",title:"Projects",basePath:"/projects",keywords:[]},{id:"page-assignments",title:"Assignments",basePath:"/assignments",keywords:[]},{id:"page-todos",title:"Todos",basePath:"/todos",keywords:["tasks"]},{id:"page-servers",title:"Servers",basePath:"/servers",keywords:["sessions"]},{id:"page-playbooks",title:"Playbooks",basePath:"/playbooks",keywords:[]},{id:"page-memories",title:"Memories",basePath:"/memories",keywords:["knowledge","learnings"]},{id:"page-resources",title:"Resources",basePath:"/resources",keywords:["knowledge","reference"]},{id:"page-settings",title:"Settings",basePath:"/settings",keywords:[]},{id:"page-help",title:"Help",basePath:"/help",keywords:["shortcuts"]}];function CT(e){const t=[];for(const n of NT)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:Vc(n.basePath,e.wsPrefix)});for(const n of e.projects??[]){const s=n.workspace?`/w/${n.workspace}`:"";t.push({type:"project",id:`project-${n.slug}`,title:n.title,subtitle:n.slug,keywords:n.tags,route:`${s}/projects/${n.slug}`}),t.push({type:"todo",id:`project-todos-${n.slug}`,title:`${n.title} todos`,subtitle:`${n.slug} · project`,keywords:[...n.tags??[],"project","todos"],route:`${s}/projects/${n.slug}?tab=todos`})}for(const n of e.assignments??[]){const s=n.projectWorkspace?`/w/${n.projectWorkspace}`:"";t.push({type:"assignment",id:n.projectSlug===null?`assignment-standalone-${n.id}`:`assignment-${n.projectSlug}-${n.slug}`,title:n.title,subtitle:`${n.projectTitle} · ${n.status}`,keywords:[n.projectSlug??"standalone",n.assignee??""].filter(a=>!!a),route:n.projectSlug===null?`/assignments/${n.id}`:`${s}/projects/${n.projectSlug}/assignments/${n.slug}`})}for(const n of e.playbooks??[])t.push({type:"playbook",id:`playbook-${n.slug}`,title:n.name,subtitle:n.description,keywords:n.tags,route:`/playbooks/${n.slug}`});for(const n of e.servers??[])t.push({type:"server",id:`server-${n.name}`,title:n.name,subtitle:n.alive?"alive":"dead",route:`${Vc("/servers",e.wsPrefix)}#server-${encodeURIComponent(n.name)}`});for(const n of e.todos??[]){const s=n.workspace&&n.workspace!=="_ungrouped"?`/w/${n.workspace}`:e.wsPrefix,a=Vc("/todos",s);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${a}?focus=${encodeURIComponent(n.id)}`})}return t}function Jn(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function qc(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function ET(e,t,n){const s=t?"disable":"enable",a=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${s}`,{method:"POST"});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to ${s} playbook`)}n()}async function Kf(e,t){const n=await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error||`Failed to create todo (HTTP ${n.status})`)}}async function rv(){const e=await fetch("/api/workspaces");if(!e.ok)throw new Error(`Failed to load workspaces (HTTP ${e.status})`);const t=await e.json();return{workspaces:Array.isArray(t.workspaces)?t.workspaces:[],hasUngrouped:t.hasUngrouped===!0}}async function sv(){const e=await fetch("/api/projects");if(!e.ok)throw new Error(`Failed to load projects (HTTP ${e.status})`);const t=await e.json();return Array.isArray(t)?t:[]}async function Gf(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template (HTTP ${t.status})`);const n=await t.json();if(!n.content)throw new Error("Template returned no content");return n.content}function uo(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
427
- ${t}: ${JSON.stringify(n)}
428
- ---
429
- ${e}`;const a=s[1],l=s[2],c=s[3],d=e.slice(s[0].length),f=JSON.stringify(n),m=new RegExp(`^${t}:\\s*.*$`,"m");let g;return m.test(l)?g=l.replace(m,`${t}: ${f}`):g=`${l}
430
- ${t}: ${f}`,`${a}${g}${c}${d}`}const TT=/^[a-z0-9][a-z0-9-]*$/;function PT(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:a,wsPrefix:l,refetchPlaybooks:c,navigate:d,toggleTheme:f}=e,m=[];if(m.push({id:"new-workspace",title:"New Workspace",subtitle:"Create a Syntaur workspace",group:"Create",keywords:["new","create","workspace"],bindableKind:"new-workspace",flow:{steps:[{kind:"text",id:"name",label:"Workspace name",placeholder:"lowercase, hyphenated (e.g. acme-app)",required:!0,pattern:{regex:TT,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(g,x)=>{const y=(g.name??"").trim();if(!y)throw new Error("Name is required");const v=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!v.ok){const C=await v.json().catch(()=>({}));throw new Error(C.error||`Failed to create workspace (HTTP ${v.status})`)}x.navigate(`/w/${y}/projects`)}}}),m.push({id:"new-project",title:"New Project",subtitle:"Create a project (pick workspace)",group:"Create",keywords:["new","create","project"],bindableKind:"new-project",flow:{steps:[{kind:"picker",id:"workspace",label:"Workspace",emptyMessage:'No workspaces yet — create one with "New Workspace"',loadOptions:async()=>{const{workspaces:g,hasUngrouped:x}=await rv(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const v of g)y.push({value:v,label:v,hint:"workspace"});return y}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(g,x)=>{const y=(g.workspace??"").trim(),v=(g.title??"").trim();if(!v)throw new Error("Title is required");const C=Jn(v);if(!C)throw new Error("Title must contain at least one alphanumeric character");let j=await Gf("/api/templates/project");j=uo(j,"slug",C),j=uo(j,"title",v),y&&y!=="_ungrouped"&&(j=uo(j,"workspace",y));const w=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create project (HTTP ${w.status})`);const T=y&&y!=="_ungrouped"?`/w/${y}/projects/${S.slug??C}`:`/projects/${S.slug??C}`;x.navigate(T)}}}),m.push({id:"new-todo",title:"New Todo",subtitle:"Pick scope (global / workspace / project)",group:"Create",keywords:["new","create","todo","task"],bindableKind:"new-todo",flow:{steps:[{kind:"picker",id:"scope",label:"Scope",loadOptions:async()=>{const[{workspaces:g},x]=await Promise.all([rv(),sv()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const v of g)y.push({value:v,label:v,hint:"workspace"});for(const v of x){const C=v.workspace??"_ungrouped";y.push({value:C,label:`${v.title}`,hint:`project · ${v.workspace??"ungrouped"}`})}return y}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async g=>{const x=(g.scope??"_ungrouped").trim()||"_ungrouped",y=(g.description??"").trim();if(!y)throw new Error("Description is required");await Bm(x,y)}}}),m.push({id:"new-assignment",title:"New Assignment",subtitle:"Pick standalone or a project",group:"Create",keywords:["new","create","assignment"],bindableKind:"new-assignment",flow:{steps:[{kind:"picker",id:"project",label:"Project",loadOptions:async()=>{const g=await sv(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const y of g)x.push({value:y.slug,label:y.title,hint:y.workspace?`workspace · ${y.workspace}`:"ungrouped"});return x}},{kind:"text",id:"title",label:"Assignment title",placeholder:"What needs to get done?",required:!0}],submit:async(g,x)=>{var N;const y=(g.project??"_standalone").trim()||"_standalone",v=(g.title??"").trim();if(!v)throw new Error("Title is required");const C=Jn(v);if(!C)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let A=await Gf("/api/templates/assignment?standalone=1");A=uo(A,"slug",C),A=uo(A,"title",v);const $=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:A})}),R=await $.json().catch(()=>({}));if(!$.ok)throw new Error(R.error||`Failed to create assignment (HTTP ${$.status})`);const O=((N=R==null?void 0:R.assignment)==null?void 0:N.id)??(R==null?void 0:R.id);O?x.navigate(`/assignments/${O}`):x.navigate("/assignments");return}let j=await Gf("/api/templates/assignment");j=uo(j,"slug",C),j=uo(j,"title",v);const w=await fetch(`/api/projects/${encodeURIComponent(y)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create assignment (HTTP ${w.status})`);const T=S.slug??C;x.navigate(`/projects/${y}/assignments/${T}`)}}}),m.push({id:"create-project-route",title:"New Project (advanced editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","project","advanced","editor"],run:()=>d(`${l}/create/project`)}),m.push({id:"create-standalone-assignment",title:"New Standalone Assignment (editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","assignment","standalone","one-off","editor"],run:()=>d(`${l}/assignments/new`)}),n&&m.push({id:`create-assignment-in-${n}`,title:`New Assignment in ${s??n}`,subtitle:n,group:"Create",keywords:["new","create","assignment",n],run:()=>d(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>d("/playbooks/create")}),m.push({id:"create-todo-global",title:"New Todo (global, quick)",subtitle:"Ungrouped, single-step",group:"Create",keywords:["new","create","todo","global","ungrouped","quick"],requiresInput:{placeholder:"Describe the todo…",runWithInput:async g=>{const x=g.trim();x&&await Kf("_ungrouped",x)}}}),l){const g=l.replace(/^\/w\//,"");m.push({id:`create-todo-workspace-${g}`,title:`New Todo in workspace ${g}`,subtitle:g,group:"Create",keywords:["new","create","todo","workspace",g],requiresInput:{placeholder:`Describe the todo for workspace ${g}…`,runWithInput:async x=>{const y=x.trim();y&&await Kf(g,y)}}})}n&&a&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${s??n}`,subtitle:`${n} · workspace ${a}`,group:"Create",keywords:["new","create","todo","project",n,a],requiresInput:{placeholder:`Describe the todo for project ${s??n}…`,runWithInput:async g=>{const x=g.trim();x&&await Kf(a,x)}}});for(const g of t)m.push({id:`toggle-playbook-${g.slug}`,title:`Toggle Playbook: ${g.name}`,subtitle:g.enabled?"enabled":"disabled",group:"Toggle",keywords:["toggle","playbook",g.slug,...g.tags??[]],run:()=>ET(g.slug,g.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>f()}),m}function Et(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function ov(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tu(...e){return t=>{let n=!1;const s=e.map(a=>{const l=ov(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<s.length;a++){const l=s[a];typeof l=="function"?l():ov(e[a],null)}}}}function bn(...e){return p.useCallback(Tu(...e),e)}function RT(e,t){const n=p.createContext(t),s=l=>{const{children:c,...d}=l,f=p.useMemo(()=>d,Object.values(d));return r.jsx(n.Provider,{value:f,children:c})};s.displayName=e+"Provider";function a(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,a]}function bo(e,t=[]){let n=[];function s(l,c){const d=p.createContext(c),f=n.length;n=[...n,c];const m=x=>{var S;const{scope:y,children:v,...C}=x,j=((S=y==null?void 0:y[e])==null?void 0:S[f])||d,w=p.useMemo(()=>C,Object.values(C));return r.jsx(j.Provider,{value:w,children:v})};m.displayName=l+"Provider";function g(x,y){var j;const v=((j=y==null?void 0:y[e])==null?void 0:j[f])||d,C=p.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,g]}const a=()=>{const l=n.map(c=>p.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return a.scopeName=e,[s,AT(a,...t)]}function AT(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(l){const c=s.reduce((d,{useScope:f,scopeName:m})=>{const x=f(l)[`__scope${m}`];return{...d,...x}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Hs=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},DT=cw[" useId ".trim().toString()]||(()=>{}),OT=0;function li(e){const[t,n]=p.useState(DT());return Hs(()=>{n(s=>s??String(OT++))},[e]),e||(t?`radix-${t}`:"")}var IT=cw[" useInsertionEffect ".trim().toString()]||Hs;function Pu({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[a,l,c]=LT({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:a;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const x=g.current;x!==d&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. 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.`),g.current=d},[d,s])}const m=p.useCallback(g=>{var x;if(d){const y=$T(g)?g(e):g;y!==e&&((x=c.current)==null||x.call(c,y))}else l(g)},[d,e,l,c]);return[f,m]}function LT({defaultProp:e,onChange:t}){const[n,s]=p.useState(e),a=p.useRef(n),l=p.useRef(t);return IT(()=>{l.current=t},[t]),p.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,s,l]}function $T(e){return typeof e=="function"}function MT(e){const t=_T(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(zT);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function _T(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=UT(a),d=BT(l,a.props);return a.type!==p.Fragment&&(d.ref=s?Tu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FT=Symbol("radix.slottable");function zT(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FT}function BT(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function UT(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var HT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=HT.reduce((e,t)=>{const n=MT(`Primitive.${t}`),s=p.forwardRef((a,l)=>{const{asChild:c,...d}=a,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(f,{...d,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function WT(e,t){e&&Us.flushSync(()=>e.dispatchEvent(t))}function go(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function VT(e,t=globalThis==null?void 0:globalThis.document){const n=go(e);p.useEffect(()=>{const s=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var qT="DismissableLayer",Up="dismissableLayer.update",KT="dismissableLayer.pointerDownOutside",GT="dismissableLayer.focusOutside",iv,h0=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hm=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,m=p.useContext(h0),[g,x]=p.useState(null),y=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),C=bn(t,O=>x(O)),j=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(w),T=g?j.indexOf(g):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,A=T>=S,$=XT(O=>{const I=O.target,K=[...m.branches].some(X=>X.contains(I));!A||K||(a==null||a(O),c==null||c(O),O.defaultPrevented||d==null||d())},y),R=QT(O=>{const I=O.target;[...m.branches].some(X=>X.contains(I))||(l==null||l(O),c==null||c(O),O.defaultPrevented||d==null||d())},y);return VT(O=>{T===m.layers.size-1&&(s==null||s(O),!O.defaultPrevented&&d&&(O.preventDefault(),d()))},y),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(iv=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),av(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=iv)}},[g,y,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),av())},[g,m]),p.useEffect(()=>{const O=()=>v({});return document.addEventListener(Up,O),()=>document.removeEventListener(Up,O)},[]),r.jsx(Vt.div,{...f,ref:C,style:{pointerEvents:N?A?"auto":"none":void 0,...e.style},onFocusCapture:Et(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Et(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Et(e.onPointerDownCapture,$.onPointerDownCapture)})});Hm.displayName=qT;var YT="DismissableLayerBranch",JT=p.forwardRef((e,t)=>{const n=p.useContext(h0),s=p.useRef(null),a=bn(t,s);return p.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(Vt.div,{...e,ref:a})});JT.displayName=YT;function XT(e,t=globalThis==null?void 0:globalThis.document){const n=go(e),s=p.useRef(!1),a=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!s.current){let f=function(){g0(KT,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function QT(e,t=globalThis==null?void 0:globalThis.document){const n=go(e),s=p.useRef(!1);return p.useEffect(()=>{const a=l=>{l.target&&!s.current&&g0(GT,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function av(){const e=new CustomEvent(Up);document.dispatchEvent(e)}function g0(e,t,n,{discrete:s}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?WT(a,l):a.dispatchEvent(l)}var Yf="focusScope.autoFocusOnMount",Jf="focusScope.autoFocusOnUnmount",lv={bubbles:!1,cancelable:!0},ZT="FocusScope",x0=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[d,f]=p.useState(null),m=go(a),g=go(l),x=p.useRef(null),y=bn(t,j=>f(j)),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(s){let j=function(N){if(v.paused||!d)return;const A=N.target;d.contains(A)?x.current=A:zs(x.current,{select:!0})},w=function(N){if(v.paused||!d)return;const A=N.relatedTarget;A!==null&&(d.contains(A)||zs(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const $ of N)$.removedNodes.length>0&&zs(d)};document.addEventListener("focusin",j),document.addEventListener("focusout",w);const T=new MutationObserver(S);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),T.disconnect()}}},[s,d,v.paused]),p.useEffect(()=>{if(d){uv.add(v);const j=document.activeElement;if(!d.contains(j)){const S=new CustomEvent(Yf,lv);d.addEventListener(Yf,m),d.dispatchEvent(S),S.defaultPrevented||(eP(oP(y0(d)),{select:!0}),document.activeElement===j&&zs(d))}return()=>{d.removeEventListener(Yf,m),setTimeout(()=>{const S=new CustomEvent(Jf,lv);d.addEventListener(Jf,g),d.dispatchEvent(S),S.defaultPrevented||zs(j??document.body,{select:!0}),d.removeEventListener(Jf,g),uv.remove(v)},0)}}},[d,m,g,v]);const C=p.useCallback(j=>{if(!n&&!s||v.paused)return;const w=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(w&&S){const T=j.currentTarget,[N,A]=tP(T);N&&A?!j.shiftKey&&S===A?(j.preventDefault(),n&&zs(N,{select:!0})):j.shiftKey&&S===N&&(j.preventDefault(),n&&zs(A,{select:!0})):S===T&&j.preventDefault()}},[n,s,v.paused]);return r.jsx(Vt.div,{tabIndex:-1,...c,ref:y,onKeyDown:C})});x0.displayName=ZT;function eP(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(zs(s,{select:t}),document.activeElement!==n)return}function tP(e){const t=y0(e),n=cv(t,e),s=cv(t.reverse(),e);return[n,s]}function y0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function cv(e,t){for(const n of e)if(!nP(n,{upTo:t}))return n}function nP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rP(e){return e instanceof HTMLInputElement&&"select"in e}function zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rP(e)&&t&&e.select()}}var uv=sP();function sP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dv(e,t),e.unshift(t)},remove(t){var n;e=dv(e,t),(n=e[0])==null||n.resume()}}}function dv(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function oP(e){return e.filter(t=>t.tagName!=="A")}var iP="Portal",Wm=p.forwardRef((e,t)=>{var d;const{container:n,...s}=e,[a,l]=p.useState(!1);Hs(()=>l(!0),[]);const c=n||a&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?RE.createPortal(r.jsx(Vt.div,{...s,ref:t}),c):null});Wm.displayName=iP;function aP(e,t){return p.useReducer((n,s)=>t[n][s]??n,e)}var wo=e=>{const{present:t,children:n}=e,s=lP(t),a=typeof n=="function"?n({present:s.isPresent}):p.Children.only(n),l=bn(s.ref,cP(a));return typeof n=="function"||s.isPresent?p.cloneElement(a,{ref:l}):null};wo.displayName="Presence";function lP(e){const[t,n]=p.useState(),s=p.useRef(null),a=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,f]=aP(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=Cc(s.current);l.current=d==="mounted"?m:"none"},[d]),Hs(()=>{const m=s.current,g=a.current;if(g!==e){const y=l.current,v=Cc(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(g&&y!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),Hs(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,x=v=>{const j=Cc(s.current).includes(CSS.escape(v.animationName));if(v.target===t&&j&&(f("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},y=v=>{v.target===t&&(l.current=Cc(s.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function Cc(e){return(e==null?void 0:e.animationName)||"none"}function cP(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xf=0;function uP(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fv()),document.body.insertAdjacentElement("beforeend",e[1]??fv()),Xf++,()=>{Xf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xf--}},[])}function fv(){const 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 _r=function(){return _r=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},_r.apply(this,arguments)};function v0(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function dP(e,t,n){if(n||arguments.length===2)for(var s=0,a=t.length,l;s<a;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var Kc="right-scroll-bar-position",Gc="width-before-scroll-bar",fP="with-scroll-bars-hidden",pP="--removed-body-scroll-bar-size";function Qf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mP(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var a=n.value;a!==s&&(n.value=s,n.callback(s,a))}}}})[0];return n.callback=t,n.facade}var hP=typeof window<"u"?p.useLayoutEffect:p.useEffect,pv=new WeakMap;function gP(e,t){var n=mP(null,function(s){return e.forEach(function(a){return Qf(a,s)})});return hP(function(){var s=pv.get(n);if(s){var a=new Set(s),l=new Set(e),c=n.current;a.forEach(function(d){l.has(d)||Qf(d,null)}),l.forEach(function(d){a.has(d)||Qf(d,c)})}pv.set(n,e)},[e]),n}function xP(e){return e}function yP(e,t){t===void 0&&(t=xP);var n=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,s);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return a}function vP(e){e===void 0&&(e={});var t=yP(null);return t.options=_r({async:!0,ssr:!1},e),t}var b0=function(e){var t=e.sideCar,n=v0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return p.createElement(s,_r({},n))};b0.isSideCarExport=!0;function bP(e,t){return e.useMedium(t),b0}var w0=vP(),Zf=function(){},Ru=p.forwardRef(function(e,t){var n=p.useRef(null),s=p.useState({onScrollCapture:Zf,onWheelCapture:Zf,onTouchMoveCapture:Zf}),a=s[0],l=s[1],c=e.forwardProps,d=e.children,f=e.className,m=e.removeScrollBar,g=e.enabled,x=e.shards,y=e.sideCar,v=e.noRelative,C=e.noIsolation,j=e.inert,w=e.allowPinchZoom,S=e.as,T=S===void 0?"div":S,N=e.gapMode,A=v0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),$=y,R=gP([n,t]),O=_r(_r({},A),a);return p.createElement(p.Fragment,null,g&&p.createElement($,{sideCar:w0,removeScrollBar:m,shards:x,noRelative:v,noIsolation:C,inert:j,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:N}),c?p.cloneElement(p.Children.only(d),_r(_r({},O),{ref:R})):p.createElement(T,_r({},O,{className:f,ref:R}),d))});Ru.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ru.classNames={fullWidth:Gc,zeroRight:Kc};var wP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wP();return t&&e.setAttribute("nonce",t),e}function kP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jP())&&(kP(t,n),SP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},CP=function(){var e=NP();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},j0=function(){var e=CP(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},EP={left:0,top:0,right:0,gap:0},ep=function(e){return parseInt(e||"",10)||0},TP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[ep(n),ep(s),ep(a)]},PP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return EP;var t=TP(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},RP=j0(),ci="data-scroll-locked",AP=function(e,t,n,s){var a=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
431
- .`.concat(fP,` {
432
- overflow: hidden `).concat(s,`;
433
- padding-right: `).concat(d,"px ").concat(s,`;
434
- }
435
- body[`).concat(ci,`] {
436
- overflow: hidden `).concat(s,`;
437
- overscroll-behavior: contain;
438
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
439
- padding-left: `.concat(a,`px;
440
- padding-top: `).concat(l,`px;
441
- padding-right: `).concat(c,`px;
442
- margin-left:0;
443
- margin-top:0;
444
- margin-right: `).concat(d,"px ").concat(s,`;
445
- `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
446
- }
447
-
448
- .`).concat(Kc,` {
449
- right: `).concat(d,"px ").concat(s,`;
450
- }
451
-
452
- .`).concat(Gc,` {
453
- margin-right: `).concat(d,"px ").concat(s,`;
454
- }
455
-
456
- .`).concat(Kc," .").concat(Kc,` {
457
- right: 0 `).concat(s,`;
458
- }
459
-
460
- .`).concat(Gc," .").concat(Gc,` {
461
- margin-right: 0 `).concat(s,`;
462
- }
463
-
464
- body[`).concat(ci,`] {
465
- `).concat(pP,": ").concat(d,`px;
466
- }
467
- `)},mv=function(){var e=parseInt(document.body.getAttribute(ci)||"0",10);return isFinite(e)?e:0},DP=function(){p.useEffect(function(){return document.body.setAttribute(ci,(mv()+1).toString()),function(){var e=mv()-1;e<=0?document.body.removeAttribute(ci):document.body.setAttribute(ci,e.toString())}},[])},OP=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;DP();var l=p.useMemo(function(){return PP(a)},[a]);return p.createElement(RP,{styles:AP(l,!t,a,n?"":"!important")})},Hp=!1;if(typeof window<"u")try{var Ec=Object.defineProperty({},"passive",{get:function(){return Hp=!0,!0}});window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{Hp=!1}var Ko=Hp?{passive:!1}:!1,IP=function(e){return e.tagName==="TEXTAREA"},k0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!IP(e)&&n[t]==="visible")},LP=function(e){return k0(e,"overflowY")},$P=function(e){return k0(e,"overflowX")},hv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=S0(e,s);if(a){var l=N0(e,s),c=l[1],d=l[2];if(c>d)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},MP=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},_P=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},S0=function(e,t){return e==="v"?LP(t):$P(t)},N0=function(e,t){return e==="v"?MP(t):_P(t)},FP=function(e,t){return e==="h"&&t==="rtl"?-1:1},zP=function(e,t,n,s,a){var l=FP(e,window.getComputedStyle(t).direction),c=l*s,d=n.target,f=t.contains(d),m=!1,g=c>0,x=0,y=0;do{if(!d)break;var v=N0(e,d),C=v[0],j=v[1],w=v[2],S=j-w-l*C;(C||S)&&S0(e,d)&&(x+=S,y+=C);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(x)<1||!g&&Math.abs(y)<1)&&(m=!0),m},Tc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gv=function(e){return[e.deltaX,e.deltaY]},xv=function(e){return e&&"current"in e?e.current:e},BP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UP=function(e){return`
468
- .block-interactivity-`.concat(e,` {pointer-events: none;}
469
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
470
- `)},HP=0,Go=[];function WP(e){var t=p.useRef([]),n=p.useRef([0,0]),s=p.useRef(),a=p.useState(HP++)[0],l=p.useState(j0)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=dP([e.lockRef.current],(e.shards||[]).map(xv),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(j,w){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var S=Tc(j),T=n.current,N="deltaX"in j?j.deltaX:T[0]-S[0],A="deltaY"in j?j.deltaY:T[1]-S[1],$,R=j.target,O=Math.abs(N)>Math.abs(A)?"h":"v";if("touches"in j&&O==="h"&&R.type==="range")return!1;var I=window.getSelection(),K=I&&I.anchorNode,X=K?K===R||K.contains(R):!1;if(X)return!1;var _=hv(O,R);if(!_)return!0;if(_?$=O:($=O==="v"?"h":"v",_=hv(O,R)),!_)return!1;if(!s.current&&"changedTouches"in j&&(N||A)&&(s.current=$),!$)return!0;var H=s.current||$;return zP(H,w,j,H==="h"?N:A)},[]),f=p.useCallback(function(j){var w=j;if(!(!Go.length||Go[Go.length-1]!==l)){var S="deltaY"in w?gv(w):Tc(w),T=t.current.filter(function($){return $.name===w.type&&($.target===w.target||w.target===$.shadowParent)&&BP($.delta,S)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var N=(c.current.shards||[]).map(xv).filter(Boolean).filter(function($){return $.contains(w.target)}),A=N.length>0?d(w,N[0]):!c.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),m=p.useCallback(function(j,w,S,T){var N={name:j,delta:w,target:S,should:T,shadowParent:VP(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(A){return A!==N})},1)},[]),g=p.useCallback(function(j){n.current=Tc(j),s.current=void 0},[]),x=p.useCallback(function(j){m(j.type,gv(j),j.target,d(j,e.lockRef.current))},[]),y=p.useCallback(function(j){m(j.type,Tc(j),j.target,d(j,e.lockRef.current))},[]);p.useEffect(function(){return Go.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Ko),document.addEventListener("touchmove",f,Ko),document.addEventListener("touchstart",g,Ko),function(){Go=Go.filter(function(j){return j!==l}),document.removeEventListener("wheel",f,Ko),document.removeEventListener("touchmove",f,Ko),document.removeEventListener("touchstart",g,Ko)}},[]);var v=e.removeScrollBar,C=e.inert;return p.createElement(p.Fragment,null,C?p.createElement(l,{styles:UP(a)}):null,v?p.createElement(OP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function VP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qP=bP(w0,WP);var C0=p.forwardRef(function(e,t){return p.createElement(Ru,_r({},e,{ref:t,sideCar:qP}))});C0.classNames=Ru.classNames;var KP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,Pc=new WeakMap,Rc={},tp=0,E0=function(e){return e&&(e.host||E0(e.parentNode))},GP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=E0(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},YP=function(e,t,n,s){var a=GP(t,Array.isArray(e)?e:[e]);Rc[n]||(Rc[n]=new WeakMap);var l=Rc[n],c=[],d=new Set,f=new Set(a),m=function(x){!x||d.has(x)||(d.add(x),m(x.parentNode))};a.forEach(m);var g=function(x){!x||f.has(x)||Array.prototype.forEach.call(x.children,function(y){if(d.has(y))g(y);else try{var v=y.getAttribute(s),C=v!==null&&v!=="false",j=(Yo.get(y)||0)+1,w=(l.get(y)||0)+1;Yo.set(y,j),l.set(y,w),c.push(y),j===1&&C&&Pc.set(y,!0),w===1&&y.setAttribute(n,"true"),C||y.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return g(t),d.clear(),tp++,function(){c.forEach(function(x){var y=Yo.get(x)-1,v=l.get(x)-1;Yo.set(x,y),l.set(x,v),y||(Pc.has(x)||x.removeAttribute(s),Pc.delete(x)),v||x.removeAttribute(n)}),tp--,tp||(Yo=new WeakMap,Yo=new WeakMap,Pc=new WeakMap,Rc={})}},JP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=KP(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),YP(s,a,n,"aria-hidden")):function(){return null}};function XP(e){const t=QP(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(eR);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function QP(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=nR(a),d=tR(l,a.props);return a.type!==p.Fragment&&(d.ref=s?Tu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZP=Symbol("radix.slottable");function eR(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZP}function tR(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function nR(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Au="Dialog",[T0,P0]=bo(Au),[rR,Pr]=T0(Au),R0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),f=p.useRef(null),[m,g]=Pu({prop:s,defaultProp:a??!1,onChange:l,caller:Au});return r.jsx(rR,{scope:t,triggerRef:d,contentRef:f,contentId:li(),titleId:li(),descriptionId:li(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(x=>!x),[g]),modal:c,children:n})};R0.displayName=Au;var A0="DialogTrigger",D0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Pr(A0,n),l=bn(t,a.triggerRef);return r.jsx(Vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Km(a.open),...s,ref:l,onClick:Et(e.onClick,a.onOpenToggle)})});D0.displayName=A0;var Vm="DialogPortal",[sR,O0]=T0(Vm,{forceMount:void 0}),I0=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,l=Pr(Vm,t);return r.jsx(sR,{scope:t,forceMount:n,children:p.Children.map(s,c=>r.jsx(wo,{present:n||l.open,children:r.jsx(Wm,{asChild:!0,container:a,children:c})}))})};I0.displayName=Vm;var ru="DialogOverlay",L0=p.forwardRef((e,t)=>{const n=O0(ru,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Pr(ru,e.__scopeDialog);return l.modal?r.jsx(wo,{present:s||l.open,children:r.jsx(iR,{...a,ref:t})}):null});L0.displayName=ru;var oR=XP("DialogOverlay.RemoveScroll"),iR=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Pr(ru,n);return r.jsx(C0,{as:oR,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(Vt.div,{"data-state":Km(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),xo="DialogContent",$0=p.forwardRef((e,t)=>{const n=O0(xo,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=Pr(xo,e.__scopeDialog);return r.jsx(wo,{present:s||l.open,children:l.modal?r.jsx(aR,{...a,ref:t}):r.jsx(lR,{...a,ref:t})})});$0.displayName=xo;var aR=p.forwardRef((e,t)=>{const n=Pr(xo,e.__scopeDialog),s=p.useRef(null),a=bn(t,n.contentRef,s);return p.useEffect(()=>{const l=s.current;if(l)return JP(l)},[]),r.jsx(M0,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Et(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Et(e.onFocusOutside,l=>l.preventDefault())})}),lR=p.forwardRef((e,t)=>{const n=Pr(xo,e.__scopeDialog),s=p.useRef(!1),a=p.useRef(!1);return r.jsx(M0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),M0=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,d=Pr(xo,n),f=p.useRef(null),m=bn(t,f);return uP(),r.jsxs(r.Fragment,{children:[r.jsx(x0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:r.jsx(Hm,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Km(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(uR,{titleId:d.titleId}),r.jsx(fR,{contentRef:f,descriptionId:d.descriptionId})]})]})}),qm="DialogTitle",_0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Pr(qm,n);return r.jsx(Vt.h2,{id:a.titleId,...s,ref:t})});_0.displayName=qm;var F0="DialogDescription",z0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Pr(F0,n);return r.jsx(Vt.p,{id:a.descriptionId,...s,ref:t})});z0.displayName=F0;var B0="DialogClose",U0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Pr(B0,n);return r.jsx(Vt.button,{type:"button",...s,ref:t,onClick:Et(e.onClick,()=>a.onOpenChange(!1))})});U0.displayName=B0;function Km(e){return e?"open":"closed"}var H0="DialogTitleWarning",[cR,W0]=RT(H0,{contentName:xo,titleName:qm,docsSlug:"dialog"}),uR=({titleId:e})=>{const t=W0(H0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
471
-
472
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
473
-
474
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},dR="DialogDescriptionWarning",fR=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W0(dR).contentName}}.`;return p.useEffect(()=>{var l;const a=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},V0=R0,pR=D0,q0=I0,Gm=L0,Ym=$0,Jm=_0,Xm=z0,Qm=U0;const Rr=V0,mR=q0,hR=Qm,K0=p.forwardRef(({className:e,...t},n)=>r.jsx(Gm,{ref:n,className:ze("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));K0.displayName=Gm.displayName;const dr=p.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(mR,{children:[r.jsx(K0,{}),r.jsx(Ym,{ref:s,className:ze("chrome-card fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 !p-6 outline-none",e),...n,children:t})]}));dr.displayName=Ym.displayName;function Ks({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col space-y-2 text-left",e),...t})}function Gs({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const fr=p.forwardRef(({className:e,...t},n)=>r.jsx(Jm,{ref:n,className:ze("text-lg font-semibold tracking-tight text-foreground",e),...t}));fr.displayName=Jm.displayName;const Qr=p.forwardRef(({className:e,...t},n)=>r.jsx(Xm,{ref:n,className:ze("text-sm leading-6 text-muted-foreground",e),...t}));Qr.displayName=Xm.displayName;const gR=-1,xR=-40;function np(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,s=0,a=-2,l=0;for(let c=0;c<e.length;c++){const d=e[c];let f=!1;for(;s<t.length;)if(t[s]===d){if(n+=100,s===a+1&&(n+=20),s===0)n+=30;else{const m=t[s-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max(xR,l*gR)),a=s,l=0,s++,f=!0;break}else l++,s++;if(!f)return-1/0}return n}const yv={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function Zm(e,t,n=50){const s=e.toLowerCase();if(!s)return t.slice(0,n).map(c=>({...c,score:0}));const l=t.map(c=>{var x;const d=np(s,c.title.toLowerCase())*1,f=c.subtitle?np(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?np(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,g=Math.max(d,f,m);return{...c,score:g}}).filter(c=>c.score>-1/0);return l.sort((c,d)=>d.score!==c.score?d.score-c.score:c.title.length!==d.title.length?c.title.length-d.title.length:c.title!==d.title?c.title<d.title?-1:1:(yv[c.type]??99)-(yv[d.type]??99)),l.slice(0,n)}const yR={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function vR({entries:e}){const{paletteOpen:t,closePalette:n}=Ys(),s=Tt(),[a,l]=p.useState(""),[c,d]=p.useState(0),f=p.useRef(null),m=p.useMemo(()=>Zm(a,e,50),[a,e]);p.useEffect(()=>{d(0)},[a,t]),p.useEffect(()=>{t||l("")},[t]),p.useEffect(()=>{var v;const y=(v=f.current)==null?void 0:v.querySelector(`[data-palette-idx="${c}"]`);y==null||y.scrollIntoView({block:"nearest"})},[c]);function g(y){s(y.route),n()}function x(y){if(y.key==="ArrowDown")y.preventDefault(),d(v=>Math.min(m.length-1,v+1));else if(y.key==="ArrowUp")y.preventDefault(),d(v=>Math.max(0,v-1));else if(y.key==="Enter"){y.preventDefault();const v=m[c];v&&g(v)}}return r.jsx(Rr,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(dr,{className:"max-w-xl p-0 gap-0",children:[r.jsx(fr,{className:"sr-only",children:"Command palette"}),r.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:y=>l(y.target.value),onKeyDown:x,placeholder:"Search projects, assignments, playbooks, servers, todos…",className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0"}),r.jsx("div",{ref:f,className:"max-h-[60vh] overflow-y-auto p-1",children:m.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:a?"No matches":"Start typing to search"}):m.map((y,v)=>{const C=v===c;return r.jsxs("button",{type:"button","data-palette-idx":v,onClick:()=>g(y),onMouseEnter:()=>d(v),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${C?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:yR[y.type]??y.type}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.title}),y.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:y.subtitle}):null]},y.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," open ","·"," Esc close"]}),r.jsxs("span",{children:[m.length," result",m.length===1?"":"s"]})]})]})})}function bR({label:e,onBack:t,disabled:n,stepCounter:s}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-3 py-2",children:[r.jsxs("button",{type:"button",onClick:t,disabled:n,className:"inline-flex h-7 items-center gap-1 rounded border border-border/70 bg-background/60 px-2 text-[11px] text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground disabled:opacity-50","aria-label":"Back",children:[r.jsx($E,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Back"})]}),r.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),s?r.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/80",children:["step ",s.current," of ",s.total]}):null]})}function wR({step:e,initialValue:t,disabled:n,onSubmit:s}){const[a,l]=p.useState(t??""),[c,d]=p.useState(!1),f=p.useRef(null);p.useEffect(()=>{var C;(C=f.current)==null||C.focus()},[]);const m=a.trim(),g=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),y=!n&&(!g||m.length>0)&&!x;function v(C){if(C.key==="Enter"){if(C.preventDefault(),!y){d(!0);return}s(m)}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:f,type:"text",value:a,onChange:C=>{l(C.target.value),d(!1)},onKeyDown:v,placeholder:e.placeholder,disabled:n,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),c&&e.pattern&&x?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:e.pattern.message}):null]})}function jR({step:e,disabled:t,onSubmit:n}){const[s,a]=p.useState({phase:"loading"}),[l,c]=p.useState(""),[d,f]=p.useState(0),[m,g]=p.useState(0),x=p.useRef(null),y=p.useRef(null);p.useEffect(()=>{var j;(j=x.current)==null||j.focus()},[]),p.useEffect(()=>{let j=!1;return a({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(w=>{j||a({phase:"loaded",options:w})}).catch(w=>{if(j)return;const S=w instanceof Error?w.message:"Failed to load options";a({phase:"error",message:S})}),()=>{j=!0}},[e,m]);const v=p.useMemo(()=>{if(s.phase!=="loaded")return[];const j=s.options.map(w=>({type:"option",title:w.label,subtitle:w.hint,keywords:[w.value],option:w}));return Zm(l,j,100)},[s,l]);p.useEffect(()=>{f(0)},[v.length]),p.useEffect(()=>{var w;const j=(w=y.current)==null?void 0:w.querySelector(`[data-picker-idx="${d}"]`);j==null||j.scrollIntoView({block:"nearest"})},[d]);function C(j){if(s.phase==="loaded"){if(j.key==="ArrowDown")j.preventDefault(),f(w=>Math.min(v.length-1,w+1));else if(j.key==="ArrowUp")j.preventDefault(),f(w=>Math.max(0,w-1));else if(j.key==="Enter"){j.preventDefault();const w=v[d];w&&n(w.option.value)}}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:x,type:"text",value:l,onChange:j=>c(j.target.value),onKeyDown:C,placeholder:`Filter ${e.label.toLowerCase()}…`,disabled:t||s.phase==="loading",className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),r.jsx("div",{ref:y,className:"max-h-[60vh] min-h-[120px] overflow-y-auto p-1",children:s.phase==="loading"?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):s.phase==="error"?r.jsxs("div",{className:"px-4 py-4 text-sm",children:[r.jsxs("div",{className:"mb-2 text-destructive",children:["Failed to load: ",s.message]}),r.jsx("button",{type:"button",onClick:()=>g(j=>j+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):v.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s.options.length===0?e.emptyMessage??"No options available":"No matches"}):v.map((j,w)=>{const S=w===d;return r.jsxs("button",{type:"button","data-picker-idx":w,onClick:()=>n(j.option.value),onMouseEnter:()=>f(w),disabled:t,className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${S?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"min-w-0 flex-1 truncate",children:j.option.label}),j.option.hint?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:j.option.hint}):null]},j.option.value)})})]})}function kR({entries:e}){var ae,ce;const t=Tt(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:a,bindAction:l,findConflict:c,pendingActionKind:d,consumePendingActionKind:f}=Ys(),[m,g]=p.useState(""),[x,y]=p.useState(0),[v,C]=p.useState(null),[j,w]=p.useState(""),[S,T]=p.useState(null),[N,A]=p.useState(null),[$,R]=p.useState(!1),[O,I]=p.useState(null),K=p.useRef(null),X=p.useMemo(()=>e.map(Z=>({type:Z.group.toLowerCase(),title:Z.title,subtitle:Z.subtitle,keywords:Z.keywords,action:Z})),[e]),_=p.useMemo(()=>Zm(m,X,50),[m,X]);p.useEffect(()=>{y(0)},[m,n]),p.useEffect(()=>{n||(g(""),C(null),w(""),T(null),A(null),R(!1),I(null))},[n]),p.useEffect(()=>{if(!n||!d)return;const Z=f();if(!Z)return;const ge=e.find(je=>je.bindableKind===Z);ge&&H(ge)},[n,d]),p.useEffect(()=>{var ge;const Z=(ge=K.current)==null?void 0:ge.querySelector(`[data-palette-idx="${x}"]`);Z==null||Z.scrollIntoView({block:"nearest"})},[x]);async function H(Z){if(!$){if(Z.flow&&Z.flow.steps.length>0){T({action:Z,stepIndex:0,values:{}}),I(null);return}if(Z.requiresInput){C(Z),w(""),I(null);return}if(Z.run){R(!0),I(null);try{await Z.run(),s()}catch(ge){I(ge instanceof Error?ge.message:"Action failed")}finally{R(!1)}}}}async function J(Z){if(!S)return;const ge=S.action.flow.steps[S.stepIndex],je={...S.values,[ge.id]:Z};if(S.stepIndex+1<S.action.flow.steps.length){T({action:S.action,stepIndex:S.stepIndex+1,values:je});return}R(!0),I(null);try{await S.action.flow.submit(je,{navigate:t}),s()}catch(Ne){I(Ne instanceof Error?Ne.message:"Action failed")}finally{R(!1)}}function U(){if(S&&!$){if(S.stepIndex===0){T(null),I(null);return}T({action:S.action,stepIndex:S.stepIndex-1,values:S.values}),I(null)}}async function Y(){if($||!(v!=null&&v.requiresInput))return;const Z=j.trim();if(Z){R(!0),I(null);try{await v.requiresInput.runWithInput(Z),s()}catch(ge){I(ge instanceof Error?ge.message:"Action failed")}finally{R(!1)}}}function z(Z){if(Z.key==="ArrowDown")Z.preventDefault(),y(ge=>Math.min(_.length-1,ge+1));else if(Z.key==="ArrowUp")Z.preventDefault(),y(ge=>Math.max(0,ge-1));else if(Z.key==="Enter"&&(Z.metaKey||Z.ctrlKey)){Z.preventDefault();const ge=_[x];ge!=null&&ge.action.bindableKind&&A({action:ge.action,combo:null,conflict:null,saving:!1,error:null})}else if(Z.key==="Enter"){Z.preventDefault();const ge=_[x];ge&&H(ge.action)}}function V(Z){Z.key==="Enter"?(Z.preventDefault(),Y()):Z.key==="Escape"&&(Z.preventDefault(),C(null),w(""))}function D(Z){if(!N||Z.key==="Escape"||Z.key==="Enter"&&!N.combo)return;Z.preventDefault(),Z.stopPropagation();const ge=l0(Z.nativeEvent);if(!ge)return;const je=c(ge,N.action.bindableKind);A({...N,combo:ge,conflict:je,error:null})}async function Q(){var Z;if(!(!N||!N.combo||!N.action.bindableKind)){if((Z=N.conflict)!=null&&Z.description){A({...N,error:`Reserved: ${N.conflict.description}`});return}A({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),A(null)}catch(ge){A({...N,saving:!1,error:ge instanceof Error?ge.message:"Failed to save binding"})}}}const E=v!==null,M=S!==null,ee=N!==null,L=S?S.action.flow.steps[S.stepIndex]:null;return r.jsx(Rr,{open:n,onOpenChange:Z=>Z?null:s(),children:r.jsxs(dr,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:Z=>{if(!$){if(ee){Z.preventDefault(),A(null);return}if(M){Z.preventDefault(),U();return}E&&(Z.preventDefault(),C(null),w(""),I(null))}},children:[r.jsx(fr,{className:"sr-only",children:"Actions palette"}),ee&&N?r.jsxs("div",{onKeyDown:D,tabIndex:-1,autoFocus:!0,children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.jsx(_p,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("span",{className:"text-sm text-foreground",children:["Bind hotkey for ",N.action.title]})]}),r.jsx("div",{className:"px-4 py-6 text-center",children:N.combo?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-2xl font-semibold tracking-wide text-foreground",children:Wr(N.combo)}),(ae=N.conflict)!=null&&ae.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(ce=N.conflict)!=null&&ce.kind?r.jsxs("div",{className:"text-sm text-amber-500 dark:text-amber-400",children:['Already bound to "',N.conflict.kind,'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press Enter to save, or another key to retry."}),N.error?r.jsx("div",{className:"text-sm text-destructive",children:N.error}):null]}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press the key combination you want to bind…"})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"any key records · Enter saves · Esc cancels"}),r.jsx("span",{children:N.saving?"Saving…":""})]}),r.jsx("button",{type:"button",className:"sr-only",onClick:()=>void Q(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:Z=>{Z.key==="Enter"&&Q()}})]}):M&&L&&S?r.jsxs(r.Fragment,{children:[r.jsx(bR,{label:`${S.action.title} · ${L.label}`,onBack:U,disabled:$,stepCounter:{current:S.stepIndex+1,total:S.action.flow.steps.length}}),L.kind==="text"?r.jsx(wR,{step:L,initialValue:S.values[L.id],disabled:$,onSubmit:J}):r.jsx(jR,{step:L,disabled:$,onSubmit:J}),O?r.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:O}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"↵ next · ← back · Esc back"}),r.jsx("span",{children:$?"Running…":""})]})]}):E?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:v.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:Z=>w(Z.target.value),onKeyDown:V,placeholder:v.requiresInput.placeholder,disabled:$,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),O?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:O}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↵"," submit ","·"," Esc back"]}),r.jsx("span",{children:$?"Running…":""})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:Z=>g(Z.target.value),onKeyDown:z,placeholder:"Run an action: new project, new todo, toggle…",disabled:$,className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),O?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:O}):null,r.jsx("div",{ref:K,className:"max-h-[60vh] overflow-y-auto p-1",children:_.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:m?"No matches":"Start typing to search actions"}):_.map((Z,ge)=>{const je=ge===x,Ne=Z.action.bindableKind,ke=Ne?a[Ne]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":ge,onClick:()=>H(Z.action),onMouseEnter:()=>y(ge),disabled:$,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${je?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:Z.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:Z.action.title}),Z.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:Z.action.subtitle}):null,ke?r.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium tracking-wide text-foreground",children:Wr(ke)}):null,Ne?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:We=>{We.preventDefault(),We.stopPropagation(),A({action:Z.action,combo:null,conflict:null,saving:!1,error:null})},className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded border border-border/70 bg-background/60 text-muted-foreground transition-opacity hover:text-foreground ${je?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx(_p,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},Z.action.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," run ","·"," ⌘↵ bind ","·"," Esc close"]}),r.jsx("span",{children:$?"Running…":`${_.length} action${_.length===1?"":"s"}`})]})]})]})})}const SR=[{combo:"mod+k",description:"Open command palette",scope:"global"},{combo:"mod+shift+k",description:"Open actions palette",scope:"global"},{combo:"?",description:"Show keyboard shortcuts",scope:"global"},{combo:"escape",description:"Close dialog or cancel",scope:"global"},{combo:"enter",description:"Activate selected item",scope:"global"},{combo:"shift+t",description:"Toggle light/dark theme",scope:"global"},{combo:"g",description:"Start navigation chord",scope:"global"},{combo:"g o",description:"Go to Overview",scope:"global"},{combo:"g m",description:"Go to Projects",scope:"global"},{combo:"g a",description:"Go to Assignments",scope:"global"},{combo:"g t",description:"Go to Todos",scope:"global"},{combo:"g s",description:"Go to Servers",scope:"global"},{combo:"g !",description:"Go to Attention",scope:"global"},{combo:"g ,",description:"Go to Settings",scope:"global"},{combo:"j",description:"Move selection down",scope:"list"},{combo:"k",description:"Move selection up",scope:"list"},{combo:"o",description:"Open selected item",scope:"list"},{combo:"a",description:"New assignment in project",scope:"project"},{combo:"e",description:"Edit project / assignment",scope:"project|assignment"},{combo:"/",description:"Focus search",scope:"assignments-board"},{combo:"r",description:"Refresh board",scope:"assignments-board"},{combo:"p",description:"Edit plan",scope:"assignment"},{combo:"h",description:"Append handoff",scope:"assignment"},{combo:"d",description:"Append decision record",scope:"assignment"},{combo:"s",description:"Edit scratchpad",scope:"assignment"},{combo:"[",description:"Previous assignment",scope:"assignment"},{combo:"]",description:"Next assignment",scope:"assignment"}];function NR(e){const t=_n(e);return t?SR.find(n=>n.combo===t)??null:null}const va={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},CR={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},ER=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function vv(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${Wr(t)} then ${Wr(n)}`}return Wr(e)}function TR(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:a}=Ys(),l=p.useMemo(()=>{const f=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&f.add(_n(m));return f},[s]),c=p.useMemo(()=>{if(!e)return new Map;const f=n(),m=new Map;for(const g of f){if(l.has(_n(g.keys)))continue;const x=m.get(g.scope)??[];x.push({keys:g.keys,description:g.description}),m.set(g.scope,x)}return m},[e,n,l]),d=p.useMemo(()=>{const f=[];for(const[m,g]of Object.entries(s)){if(!g)continue;const x=a.find(y=>y.bindableKind===m);f.push({kind:m,combo:g,title:x?x.title:m})}return f},[s,a]);return r.jsx(Rr,{open:e,onOpenChange:f=>f?null:t(),children:r.jsxs(dr,{className:"max-w-2xl",children:[r.jsx(fr,{children:"Keyboard shortcuts"}),r.jsxs(Qr,{children:["Press Esc to close. ",Wr("Mod+k")," opens the command palette. Press g twice to restart the chord timer."]}),r.jsxs("div",{className:"mt-2 max-h-[60vh] space-y-4 overflow-y-auto pr-1",children:[ER.map(f=>{const m=c.get(f);return!m||m.length===0?null:r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:CR[f]}),r.jsx("ul",{className:"space-y-1",children:m.map((g,x)=>r.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[r.jsx("span",{className:"text-foreground",children:g.description}),r.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:vv(g.keys)})]},`${f}-${g.keys}-${x}`))})]},f)}),d.length>0?r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom bindings"}),r.jsx("ul",{className:"space-y-1",children:d.map(f=>r.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[r.jsx("span",{className:"text-foreground",children:f.title}),r.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:vv(f.combo)})]},`custom-${f.kind}`))})]}):null]})]})})}const eh={bindings:{},custom:!1};let Ra=null,Jo=null;const Wp=new Set;function G0(e){Ra=e;for(const t of Wp)t(e)}function th(e){if(!e||typeof e!="object")return eh;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[s,a]of Object.entries(t.bindings)){if(!fT(s)||typeof a!="string"||a.trim()==="")continue;const l=_n(a);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function PR(){return Ra?Promise.resolve(Ra):Jo||(Jo=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=th(e);return Ra=t,Jo=null,t}).catch(()=>(Jo=null,eh)),Jo)}function RR(){const[e,t]=p.useState(()=>Ra??eh);return p.useEffect(()=>{let n=!1;return PR().then(s=>{n||t(s)}),Wp.add(t),()=>{n=!0,Wp.delete(t)}},[]),e}async function bv(e){const t={};for(const a of Eu){const l=e[a];if(typeof l!="string")continue;const c=_n(l);c&&(t[a]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save hotkey bindings")}const s=th(await n.json());return G0(s),s}async function AR(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=th(await e.json());return G0(t),t}const wv=1500;function DR(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const Y0=p.createContext(null);function OR({children:e}){const{toggleTheme:t}=Fm(),n=En(),s=Tt(),a=DR(n.pathname),l=Ni(),c=r0(),d=a0(),f=zm(),m=c0(),g=p.useMemo(()=>{var _e,Oe,st,lt;const ie=l.data??[],ne=((_e=c.data)==null?void 0:_e.assignments)??[],le=((Oe=d.data)==null?void 0:Oe.playbooks)??[],W=((st=f.data)==null?void 0:st.sessions)??[],ve=(((lt=m.data)==null?void 0:lt.workspaces)??[]).flatMap(_t=>_t.items.map(St=>({...St,workspace:_t.workspace})));return CT({projects:ie,assignments:ne,playbooks:le,servers:W,todos:ve,wsPrefix:a})},[l.data,c.data,d.data,f.data,m.data,a]),y=p.useMemo(()=>Kw(n.pathname),[n.pathname]).projectSlug,v=p.useMemo(()=>{var ie;return y?((ie=l.data)==null?void 0:ie.find(ne=>ne.slug===y))??null:null},[l.data,y]),C=(v==null?void 0:v.title)??null,j=(v==null?void 0:v.workspace)??null,w=p.useMemo(()=>{var ie;return PT({playbooks:((ie=d.data)==null?void 0:ie.playbooks)??[],projectSlug:y,currentProjectTitle:C,currentProjectWorkspace:j,wsPrefix:a,refetchPlaybooks:d.refetch,navigate:s,toggleTheme:t})},[d.data,d.refetch,y,C,j,a,s,t]),S=p.useRef(new Map),T=p.useRef(["global"]),N=p.useRef({phase:"idle"}),A=p.useRef(null),$=p.useRef(1),[R,O]=p.useState(!1),[I,K]=p.useState(!1),[X,_]=p.useState(!1),[H,J]=p.useState(null),{bindings:U}=RR(),Y=p.useMemo(()=>xT(U),[U]),z=p.useCallback(ie=>{const ne=$.current++;return S.current.set(ne,{...ie,id:ne}),ne},[]),V=p.useCallback(ie=>{S.current.delete(ie)},[]),D=p.useCallback(ie=>{T.current.push(ie)},[]),Q=p.useCallback(ie=>{const ne=T.current;for(let le=ne.length-1;le>=0;le--)if(ne[le]===ie){ne.splice(le,1);return}},[]),E=p.useCallback(()=>O(!0),[]),M=p.useCallback(()=>O(!1),[]),ee=p.useCallback(()=>K(!0),[]),L=p.useCallback(()=>K(!1),[]),ae=p.useCallback(()=>_(!0),[]),ce=p.useCallback(()=>{_(!1),J(null)},[]),Z=p.useCallback(()=>Array.from(S.current.values()),[]),ge=p.useCallback(()=>{let ie=null;return J(ne=>(ie=ne,null)),ie},[]),je=p.useCallback(ie=>{J(ie),_(!0)},[]),Ne=p.useCallback((ie,ne)=>{const le=_n(ie);if(!le)return null;if(hT(le)){const W=NR(le);return{description:(W==null?void 0:W.description)??"Reserved built-in shortcut"}}for(const[W,pe]of Object.entries(Y))if(!(ne&&W===ne)&&pe===le)return{kind:W};return null},[Y]),ke=p.useCallback(async(ie,ne)=>{const le=_n(ne);if(!le)throw new Error("Empty combo");const W=Ne(le,ie);if(W){const ve=W.description?`Reserved: ${W.description}`:`Already bound to "${W.kind}"`;throw new Error(ve)}const pe={...U,[ie]:le};return await bv(pe),le},[U,Ne]),We=p.useCallback(async ie=>{if(!U[ie])return;const ne={...U};delete ne[ie],await bv(ne)},[U]);p.useEffect(()=>{N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[n.pathname]),p.useEffect(()=>{function ie(ve){if(!(ve instanceof HTMLElement))return!1;const _e=ve.tagName;return!!(_e==="INPUT"||_e==="TEXTAREA"||_e==="SELECT"||ve.isContentEditable||ve.closest('[role="combobox"], [role="textbox"]'))}function ne(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function le(){const ve=T.current;return ve[ve.length-1]??"global"}function W(ve){return ve.scope==="global"?!0:ve.scope===le()}function pe(ve){const _e=Nc(ve,"Mod+k"),Oe=Nc(ve,"Mod+Shift+k"),st=ve.key==="Escape",lt=_e||Oe||st;if(ne()&&!lt||ie(ve.target)&&!lt)return;const _t=N.current;if(_t.phase==="awaiting-second")if(Date.now()-_t.startedAt>wv)N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null);else{const se=Array.from(S.current.values());for(const me of se){if(!W(me))continue;const Pe=me.keys.split(" ");if(!(Pe.length!==2||Pe[0]!=="g")&&Nc(ve,Pe[1])&&!(me.when&&!me.when())){ve.preventDefault(),N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null),me.handler(ve);return}}N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)}const St=Array.from(S.current.values());for(const Nt of St){if(!W(Nt))continue;const se=Nt.keys.split(" ");if(se.length===1&&Nc(ve,se[0])&&!(Nt.when&&!Nt.when())){ve.preventDefault(),Nt.handler(ve);return}}ve.key==="g"&&!ve.metaKey&&!ve.ctrlKey&&!ve.altKey&&!ve.shiftKey&&Array.from(S.current.values()).some(se=>W(se)&&se.keys.startsWith("g "))&&(ve.preventDefault(),N.current={phase:"awaiting-second",startedAt:Date.now()},A.current!==null&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{N.current={phase:"idle"},A.current=null},wv))}return window.addEventListener("keydown",pe),()=>{window.removeEventListener("keydown",pe),A.current!==null&&(window.clearTimeout(A.current),A.current=null)}},[]),p.useEffect(()=>{const ie=z({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>V(ie)},[z,V,t]),p.useEffect(()=>{const ie=z({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>ee()});return()=>V(ie)},[z,V,ee]),p.useEffect(()=>{const ie=z({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(R){M();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||E()}});return()=>V(ie)},[z,V,E,M,R]),p.useEffect(()=>{const ie=z({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(X){ce();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||ae()}});return()=>V(ie)},[z,V,ae,ce,X]),p.useEffect(()=>{const ne=[{suffix:"o",basePath:"/",desc:"Go to Overview"},{suffix:"m",basePath:"/projects",desc:"Go to Projects"},{suffix:"a",basePath:"/assignments",desc:"Go to Assignments"},{suffix:"t",basePath:"/todos",desc:"Go to Todos"},{suffix:"s",basePath:"/servers",desc:"Go to Servers"},{suffix:",",basePath:"/settings",desc:"Go to Settings"}].map(le=>z({keys:`g ${le.suffix}`,scope:"global",description:le.desc,handler:()=>s(Vc(le.basePath,a))}));return()=>ne.forEach(V)},[z,V,s,a]),p.useEffect(()=>{const ie=[];for(const[ne,le]of Object.entries(Y)){if(!le)continue;const W=w.find(ve=>ve.bindableKind===ne),pe=W?`Custom: ${W.title}`:`Custom: ${ne}`;ie.push(z({keys:le,scope:"global",description:pe,handler:()=>{J(ne),_(!0)}}))}return()=>ie.forEach(V)},[z,V,Y,w]);const Ye=p.useMemo(()=>({register:z,unregister:V,pushScope:D,popScope:Q,openPalette:E,closePalette:M,paletteOpen:R,openCheatsheet:ee,closeCheatsheet:L,cheatsheetOpen:I,openActionsPalette:ae,closeActionsPalette:ce,actionsPaletteOpen:X,listBindings:Z,wsPrefix:a,paletteEntries:g,actionEntries:w,userBindings:U,customBindings:Y,bindAction:ke,unbindAction:We,findConflict:Ne,openActionsPaletteWithAction:je,pendingActionKind:H,consumePendingActionKind:ge}),[z,V,D,Q,E,M,R,ee,L,I,ae,ce,X,Z,a,g,w,U,Y,ke,We,Ne,je,H,ge]);return r.jsxs(Y0.Provider,{value:Ye,children:[e,r.jsx(vR,{entries:g}),r.jsx(kR,{entries:w}),r.jsx(TR,{})]})}function Ys(){const e=p.useContext(Y0);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function pt({keys:e,handler:t,scope:n="global",description:s,when:a,enabled:l=!0}){const{register:c,unregister:d}=Ys(),f=p.useRef(t),m=p.useRef(a);p.useEffect(()=>{f.current=t,m.current=a},[t,a]),p.useEffect(()=>{if(!l)return;const g=c({keys:e,handler:x=>f.current(x),scope:n,description:s,when:m.current?()=>m.current():void 0});return()=>d(g)},[c,d,e,n,s,l])}function Js(e){const{pushScope:t,popScope:n}=Ys();p.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function sl(e,t){const[n,s]=p.useState(e.length===0?-1:0),a=En();p.useEffect(()=>{s(e.length===0?-1:0)},[a.pathname]),p.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),p.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(d=>{const f=Number(d.getAttribute("data-hotkey-row-index"));d.setAttribute("data-hotkey-selected",f===n?"true":"false")}),n>=0){const d=document.querySelector(`[data-hotkey-row-index="${n}"]`);d==null||d.scrollIntoView({block:"nearest"})}},[n,e.length]),pt({keys:"j",scope:t.scope,description:"Select next row",handler:()=>s(c=>e.length===0?-1:Math.min(e.length-1,c<0?0:c+1))}),pt({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),pt({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),pt({keys:"o",scope:t.scope,description:"Open selected row",enabled:t.bindO??!0,handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}});const l=p.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function IR({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const a=Pt(),{resolvedTheme:l,toggleTheme:c}=Fm(),{openPalette:d}=Ys();return r.jsx("header",{className:"sticky top-0 z-30 border-b border-border/70 bg-background/70 backdrop-blur",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 lg:px-6",children:[r.jsx("button",{type:"button",onClick:s,className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-card/80 text-foreground lg:hidden","aria-label":"Open navigation",children:r.jsx(ZE,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[t.length>1?r.jsxs("nav",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:[t.slice(0,-1).map((f,m)=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?r.jsx("span",{children:"/"}):null,r.jsx(we,{to:f.path,className:"hover:text-foreground",children:f.label})]},f.path)),r.jsx("span",{children:"/"})]}):null,r.jsx("h1",{className:"truncate text-base font-semibold text-foreground",children:e})]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:d,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(qs,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:Wr("Mod+k")})]}),r.jsx(we,{className:"shell-action",to:"/help",children:"Help"}),r.jsxs(we,{className:"shell-action",to:`${a}/create/project`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Project"})]}),n?r.jsxs(we,{className:"shell-action",to:`${a}/projects/${n}/create/assignment`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}):null,r.jsxs("button",{type:"button",onClick:c,className:"shell-action","aria-label":"Toggle theme",children:[l==="dark"?r.jsx(l2,{className:"h-4 w-4"}):r.jsx(e2,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}var LR=Symbol("radix.slottable");function $R(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LR,t}var J0="AlertDialog",[MR]=bo(J0,[P0]),ms=P0(),X0=e=>{const{__scopeAlertDialog:t,...n}=e,s=ms(t);return r.jsx(V0,{...s,...n,modal:!0})};X0.displayName=J0;var _R="AlertDialogTrigger",FR=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(pR,{...a,...s,ref:t})});FR.displayName=_R;var zR="AlertDialogPortal",Q0=e=>{const{__scopeAlertDialog:t,...n}=e,s=ms(t);return r.jsx(q0,{...s,...n})};Q0.displayName=zR;var BR="AlertDialogOverlay",Z0=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(Gm,{...a,...s,ref:t})});Z0.displayName=BR;var ui="AlertDialogContent",[UR,HR]=MR(ui),WR=$R("AlertDialogContent"),ej=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,l=ms(n),c=p.useRef(null),d=bn(t,c),f=p.useRef(null);return r.jsx(cR,{contentName:ui,titleName:tj,docsSlug:"alert-dialog",children:r.jsx(UR,{scope:n,cancelRef:f,children:r.jsxs(Ym,{role:"alertdialog",...l,...a,ref:d,onOpenAutoFocus:Et(a.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(WR,{children:s}),r.jsx(qR,{contentRef:c})]})})})});ej.displayName=ui;var tj="AlertDialogTitle",nj=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(Jm,{...a,...s,ref:t})});nj.displayName=tj;var rj="AlertDialogDescription",sj=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(Xm,{...a,...s,ref:t})});sj.displayName=rj;var VR="AlertDialogAction",oj=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=ms(n);return r.jsx(Qm,{...a,...s,ref:t})});oj.displayName=VR;var ij="AlertDialogCancel",aj=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=HR(ij,n),l=ms(n),c=bn(t,a);return r.jsx(Qm,{...l,...s,ref:c})});aj.displayName=ij;var qR=({contentRef:e})=>{const t=`\`${ui}\` requires a description for the component to be accessible for screen reader users.
475
-
476
- You can add a description to the \`${ui}\` by passing a \`${rj}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
477
-
478
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ui}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
479
-
480
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},KR=X0,GR=Q0,lj=Z0,cj=ej,uj=oj,dj=aj,fj=nj,pj=sj;const nh=KR,YR=GR,mj=p.forwardRef(({className:e,...t},n)=>r.jsx(lj,{ref:n,className:ze("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));mj.displayName=lj.displayName;const Du=p.forwardRef(({className:e,...t},n)=>r.jsxs(YR,{children:[r.jsx(mj,{}),r.jsx(cj,{ref:n,className:ze("chrome-card fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 !p-6 outline-none",e),...t})]}));Du.displayName=cj.displayName;function rh({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col space-y-2 text-left",e),...t})}function sh({className:e,...t}){return r.jsx("div",{className:ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Ou=p.forwardRef(({className:e,...t},n)=>r.jsx(fj,{ref:n,className:ze("text-lg font-semibold tracking-tight text-foreground",e),...t}));Ou.displayName=fj.displayName;const Iu=p.forwardRef(({className:e,...t},n)=>r.jsx(pj,{ref:n,className:ze("text-sm leading-6 text-muted-foreground",e),...t}));Iu.displayName=pj.displayName;const Va=p.forwardRef(({className:e,...t},n)=>r.jsx(uj,{ref:n,className:ze(e),...t}));Va.displayName=uj.displayName;const Lu=p.forwardRef(({className:e,...t},n)=>r.jsx(dj,{ref:n,className:ze(e),...t}));Lu.displayName=dj.displayName;const JR=[{to:"/",label:"Overview",icon:Iw},{to:"/playbooks",label:"Playbooks",icon:Dw},{to:"/memories",label:"Memories",icon:LE},{to:"/resources",label:"Resources",icon:YE},{to:"/inventories",label:"Inventories",icon:Nm},{to:"/todos",label:"Todos",icon:cr}],XR=[{suffix:"/projects",label:"Projects",icon:$w},{suffix:"/assignments",label:"Assignments",icon:QE},{suffix:"/servers",label:"Servers",icon:Dm},{suffix:"/inventories",label:"Inventories",icon:Nm},{suffix:"/agent-sessions",label:"Agent Sessions",icon:Sm},{suffix:"/todos",label:"Todos",icon:cr}],QR=[{to:"/help",label:"Help",icon:JE},{to:"/settings",label:"Settings",icon:i2}],jv="syntaur.dashboard.sourceFirstNoticeDismissed";function ZR({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:a}){const[l,c]=p.useState(!1);pt({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[d,f]=p.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(jv)==="1"}catch{return!1}});function m(){if(f(!0),!(typeof window>"u"))try{window.localStorage.setItem(jv,"1")}catch{}}return r.jsx("div",{className:"min-h-screen bg-background",children:r.jsxs("div",{className:"relative grid min-h-screen lg:grid-cols-[240px_minmax(0,1fr)]",children:[r.jsx("aside",{className:"hidden max-h-screen sticky top-0 overflow-y-auto border-r border-border/70 bg-sidebar px-4 py-4 lg:flex lg:flex-col",children:r.jsx(kv,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s})}),l?r.jsx("div",{className:"fixed inset-0 z-40 bg-overlay/40 lg:hidden",children:r.jsxs("div",{className:"h-full max-w-xs border-r border-border/70 bg-sidebar p-4 shadow-2xl",children:[r.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[r.jsx(we,{to:"/",className:"text-lg font-semibold text-foreground",onClick:()=>c(!1),children:"Syntaur"}),r.jsx("button",{type:"button",onClick:()=>c(!1),className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-background/80",children:r.jsx(Lm,{className:"h-4 w-4"})})]}),r.jsx(kv,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(IR,{title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:()=>c(!0)}),r.jsx("main",{className:"mx-auto w-full max-w-[1480px] px-4 py-4 lg:px-6 lg:py-5",children:a})]})]})})}function kv({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:a}=Cu(),l=(a==null?void 0:a.workspaces)??[],c=(a==null?void 0:a.hasUngrouped)??!1,d=En(),[f,m]=p.useState(new Set),[g,x]=p.useState(!1),[y,v]=p.useState(""),[C,j]=p.useState(null),[w,S]=p.useState(null),[T,N]=p.useState(null),[A,$]=p.useState(!1),R=Tt();function O(_){m(H=>{const J=new Set(H);return J.has(_)?J.delete(_):J.add(_),J})}const I=[...l,...c?["_ungrouped"]:[]];async function K(_){if(w){$(!0);try{const H=`/api/workspaces/${encodeURIComponent(w)}${_?"?cascade=true":""}`,J=await fetch(H,{method:"DELETE"});if(J.status===409){const U=await J.json().catch(()=>({}));N((U==null?void 0:U.blockedBy)??{projects:[],standalones:[]});return}if(!J.ok){const U=await J.json().catch(()=>({}));throw new Error(U.error||"Failed to delete workspace")}S(null),N(null)}catch(H){console.error(H),alert(H instanceof Error?H.message:"Failed to delete workspace")}finally{$(!1)}}}async function X(_,H){try{if(_.type==="project"){const J=await fetch(`/api/projects/${encodeURIComponent(_.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:H})});if(!J.ok){const U=await J.json().catch(()=>({}));throw new Error(U.error||"Failed to move project")}return}if(_.type==="standalone-assignment"){const J=await fetch(`/api/assignments/${encodeURIComponent(_.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:H})});if(!J.ok){const U=await J.json().catch(()=>({}));throw new Error(U.error||"Failed to move assignment")}return}if(_.type==="project-assignment"){alert("Assignments inherit workspace from their project — drag the project (or move it) to change workspaces.");return}}catch(J){console.error(J),alert(J instanceof Error?J.message:"Failed to move item")}}return r.jsxs("div",{className:"flex h-full flex-col gap-3",children:[r.jsx("div",{className:"space-y-3",children:r.jsxs(we,{to:"/",className:"inline-flex items-center gap-3",onClick:s,children:[r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-lg bg-card text-foreground shadow-sm ring-1 ring-border/60",children:r.jsxs("svg",{viewBox:"0 0 43 51","aria-label":"Syntaur",role:"img",className:"h-4 w-auto",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M13 2C13 0.89543 13.8954 0 15 0H41C42.1046 0 43 0.895431 43 2V12C43 13.1046 42.1046 14 41 14H13V2Z"}),r.jsx("path",{d:"M0 15C0 13.8954 0.895431 13 2 13H14V25C14 26.1046 13.1046 27 12 27H2C0.89543 27 0 26.1046 0 25V15Z"}),r.jsx("path",{d:"M30 49C30 50.1046 29.1046 51 28 51L2 51C0.89543 51 0 50.1046 0 49L0 39C0 37.8954 0.895431 37 2 37L30 37L30 49Z"}),r.jsx("path",{d:"M42.9646 36C42.9646 37.1046 42.0692 38 40.9646 38H28.9646V26C28.9646 24.8954 29.86 24 30.9646 24H40.9646C42.0692 24 42.9646 24.8954 42.9646 26V36Z"})]})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Syntaur"}),r.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Local-first project control"})]})]})}),r.jsx(nv,{items:JR,onNavigate:s}),r.jsx("div",{className:"border-t border-border/40"}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[I.length===0&&!g&&r.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),I.map(_=>{const H=_==="_ungrouped",J=H?"Ungrouped":pn(_),U=H?"/w/_ungrouped":`/w/${_}`,Y=f.has(_),z=n===_||n===null&&H&&d.pathname.startsWith("/w/_ungrouped"),V=C===_;return r.jsxs("div",{className:`rounded-md transition ${V?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:D=>{D.dataTransfer.types.includes("application/json")&&(D.preventDefault(),D.dataTransfer.dropEffect="move",j(_))},onDragLeave:D=>{D.currentTarget.contains(D.relatedTarget)||j(Q=>Q===_?null:Q)},onDrop:async D=>{try{const Q=D.dataTransfer.getData("application/json");if(!Q)return;D.preventDefault();let E;try{E=JSON.parse(Q)}catch{return}if(!(E!=null&&E.type)||!(E!=null&&E.id))return;await X(E,H?null:_)}finally{j(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>O(_),className:`flex flex-1 items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${z?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[r.jsx(Ua,{className:`h-3 w-3 transition-transform ${Y?"-rotate-90":""}`}),J]}),H?null:r.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),S(_),N(null)},title:`Delete workspace "${_}"`,"aria-label":`Delete workspace "${_}"`,className:"mr-1 flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100",children:r.jsx(zn,{className:"h-3 w-3"})})]}),!Y&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:XR.map(D=>{const Q=`${U}${D.suffix}`,E=qw(d.pathname,D.suffix)&&d.pathname.startsWith(U),M=D.icon;return r.jsxs(we,{to:Q,onClick:s,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${E?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[r.jsx(M,{className:"h-4 w-4"}),r.jsx("span",{children:D.label})]},Q)})})]},_)}),g?r.jsx("form",{className:"px-3 py-1.5",onSubmit:_=>{_.preventDefault();const H=y.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");H&&(x(!1),v(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:H})}).then(()=>{s==null||s(),R(`/w/${H}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Escape"&&(x(!1),v(""))},onBlur:()=>{y.trim()||(x(!1),v(""))},placeholder:"workspace-name",className:"w-full rounded-md border border-border/60 bg-background/80 px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-foreground/40 focus:outline-none"})}):r.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium text-muted-foreground/60 transition hover:text-muted-foreground",children:[r.jsx(Ht,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(nv,{items:QR,onNavigate:s}),e?null:r.jsx("div",{className:"chrome-card",children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Source-first dashboard"}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Project and assignment markdown files stay authoritative. Derived files are read-only projections."})]}),r.jsx("button",{type:"button",onClick:t,className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border/70 bg-background/80 text-muted-foreground transition hover:text-foreground","aria-label":"Dismiss source-first dashboard notice",children:r.jsx(Lm,{className:"h-4 w-4"})})]})}),r.jsx(nh,{open:w!==null,onOpenChange:_=>{A||_||(S(null),N(null))},children:r.jsxs(Du,{children:[r.jsxs(rh,{children:[r.jsx(Ou,{children:T?"Workspace has references":"Delete workspace?"}),r.jsx(Iu,{children:T?r.jsxs(r.Fragment,{children:["The workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:w})," is still referenced by:"]}):r.jsxs(r.Fragment,{children:["Remove the workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:w})," from the registry. This does not affect projects or standalones unless you choose to cascade."]})})]}),T?r.jsxs("div",{className:"space-y-2 text-sm",children:[T.projects.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Projects (",T.projects.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:T.projects.map(_=>r.jsx("li",{children:r.jsx(we,{to:`/projects/${_}`,className:"hover:underline",children:_})},_))})]}):null,T.standalones.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Standalones (",T.standalones.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:T.standalones.map(_=>r.jsx("li",{children:r.jsx(we,{to:`/assignments/${_}`,className:"hover:underline",children:_})},_))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:['Choose "Clear references and delete" to set ',r.jsx("code",{children:"workspace:"})," / ",r.jsx("code",{children:"workspaceGroup:"})," to ",r.jsx("code",{children:"null"})," on each, then remove the workspace."]})]}):null,r.jsxs(sh,{children:[r.jsx(Lu,{disabled:A,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),T?r.jsx(Va,{disabled:A,onClick:_=>{_.preventDefault(),K(!0)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:A?"Working…":"Clear references and delete"}):r.jsx(Va,{disabled:A,onClick:_=>{_.preventDefault(),K(!1)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:A?"Working…":"Delete"})]})]})})]})}function eA(){const e=En(),{workspace:t}=kt(),{title:n,breadcrumbs:s,projectSlug:a}=Kw(e.pathname);return r.jsx(ZR,{title:n,breadcrumbs:s,projectSlug:a,workspace:t??null,children:r.jsx(KC,{})})}function at({label:e="Loading dashboard data…"}){return r.jsx("div",{className:"flex min-h-[240px] items-center justify-center",children:r.jsx("div",{className:"chrome-card !px-4 !py-3",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:e})})})}function et({title:e="Something went wrong",error:t,action:n}){return r.jsx("div",{className:"rounded-lg border border-error-foreground/30 bg-error px-4 py-5",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"text-lg font-semibold text-error-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-error-foreground/90",children:t}),n?r.jsx("div",{className:"pt-2",children:n}):null]})})}function Yc({command:e,description:t,example:n}){return r.jsxs("div",{className:"rounded-lg border border-border/70 bg-code px-3 py-3 text-code-foreground shadow-sm",children:[r.jsx("code",{className:"block overflow-x-auto font-mono text-sm",children:e}),t?r.jsx("p",{className:"mt-2 text-sm text-code-foreground/80",children:t}):null,n?r.jsx("p",{className:"mt-2 font-mono text-xs text-code-foreground/60",children:n}):null]})}function Le({title:e,description:t,children:n,className:s,actions:a}){return r.jsxs("section",{className:ze("surface-panel space-y-3",s),children:[e||a?r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,t?r.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),a]}):null,n]})}function tA({help:e,compact:t=!1}){const n=t?(e==null?void 0:e.firstProjectChecklist.slice(0,3))??[]:(e==null?void 0:e.firstProjectChecklist)??[];return r.jsx(Le,{title:t?"Getting Started Refresher":"Getting Started",description:t?"A fast reminder of the real flow for creating and running work in Syntaur.":"A first-run checklist that maps to the current CLI and dashboard flow.",actions:r.jsx(we,{className:"text-sm font-semibold text-primary hover:underline",to:"/help",children:"Open full help"}),children:r.jsx("div",{className:"space-y-3",children:n.map((s,a)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:a+1}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:s.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:s.detail}),s.command?r.jsx(Yc,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const rp={review:"{total} items ready for your review","review.singular":"Review {title}",ready_to_implement:"{total} plans ready to implement — start with {title}","ready_to_implement.singular":"Start implementing {title}",ready_for_planning:"{total} assignments ready to plan — start with {title}","ready_for_planning.singular":"Plan {title}",in_progress:"Resume {title} ({total} in progress)","in_progress.singular":"Resume {title}",draft:"Shape your {total} drafts — start with {title}","draft.singular":"Shape {title}",blocked:"Unblock {title} ({total} blocked)","blocked.singular":"Unblock {title}",stale:"Triage {total} stale items","stale.singular":"Triage {title} — sitting stale",clean:"You’re all clear. Nothing needs you right now."},nA={readyForReview:"No assignments waiting for your review.",readyToImplement:"No plans queued for implementation.",readyForPlanning:"No assignments waiting to be planned.",inProgress:"Nothing actively in progress.",drafts:"No drafts — ideas captured here will live until they’re shaped.",blocked:"Nothing is blocked. Good.",newestCreated:"No assignments created recently.",stale:"No stale work — everything is fresh."},Jc={readyForReview:"Ready for Review",readyToImplement:"Ready to Implement",readyForPlanning:"Ready for Planning",inProgress:"In Progress",drafts:"Drafts",blocked:"Blocked",newestCreated:"Newest Created",stale:"Stale"},Cn={claimAsTitle:"Claim assignments as",claimAsHint:"Used when you claim an assignment from this dashboard. You can change it later.",claimAsSubmit:"Save",quickCommentTitle:"Add a quick note",quickCommentPlaceholder:"Note…",quickCommentSubmit:"Post",bulkArchiveLabel:"Archive selected",bulkClearLabel:"Clear",emptyStateCleanTitle:"You’re all clear",emptyStateCleanCTA:"Browse projects",recentSessionsEmptyTitle:"No recent sessions",recentSessionsEmptyHint:"Use /grab-assignment or `syntaur track-session` to register one.",recentSessionsCopyPathLabel:"Copy path",recentSessionsCopyPathDisabled:"Session has no path",recentSessionsCopyFallbackHint:"Press ⌘C to copy"};function rA(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function sA({hero:e,itemsById:t}){const n=Pt();if(e.kind==="clean")return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-border/60 bg-background/60 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:Cn.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:rp.clean}),r.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"When work shows up — a draft, a review, a stale row — it’ll surface here."}),r.jsx("div",{className:"mt-4",children:r.jsx(we,{to:`${n}/projects`,className:"shell-action bg-foreground text-background hover:opacity-90",children:Cn.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,a=(s==null?void 0:s.assignmentTitle)??"",l=rp[e.copyKey]??rp[e.kind],c=rA(l,{total:e.total,title:a}),d=s?oA(s,n):`${n}/assignments`;return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-primary/20 bg-primary/5 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:"What needs you today"}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:c}),s?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["In ",r.jsx("span",{className:"font-medium text-foreground",children:s.projectTitle??"Standalone"})," ","· status ",r.jsx("span",{className:"font-medium text-foreground",children:s.status})]}):null,r.jsx("div",{className:"mt-4",children:r.jsxs(we,{to:d,className:"shell-action bg-foreground text-background hover:opacity-90",children:["Open ",a||"assignment"]})})]})}function oA(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const Ta="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",sp="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",iA="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",aA="border-status-review-foreground/30 bg-status-review text-status-review-foreground",lA="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",cA="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",uA="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",su={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:Ta,icon:ki},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:Ta,icon:FE},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:Ta,icon:Iw},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:sp,icon:t2},in_progress:{label:"In Progress",description:"Actively being worked on.",className:sp,icon:Am},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:iA,icon:$p},review:{label:"Review",description:"Ready for inspection or approval.",className:aA,icon:r2},completed:{label:"Completed",description:"Finished successfully.",className:lA,icon:Cm},failed:{label:"Failed",description:"Could not be completed as planned.",className:cA,icon:$p},active:{label:"Active",description:"The project has active or review work in flight.",className:sp,icon:Mp},stopped:{label:"Stopped",description:"Session ended without completing.",className:Ta,icon:ME},archived:{label:"Archived",description:"Archived by a human override.",className:uA,icon:Mp}};function wn({status:e,className:t,showIcon:n=!0,progress:s}){const a=su[e]??{label:e.replace(/_/g," ").replace(/\b\w/g,g=>g.toUpperCase()),description:`Status: ${e}`,className:Ta,icon:Mp},l=a.icon,c=s&&s.total>0,d=c?Math.min(1,Math.max(0,s.checked/s.total)):0,f=c?`${a.description} (${s.checked}/${s.total} criteria)`:a.description,m=n?c?r.jsxs("span",{className:"relative inline-flex h-3.5 w-3.5 items-center justify-center",children:[r.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"absolute inset-0 h-full w-full -rotate-90",children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:2*Math.PI*7,strokeDashoffset:2*Math.PI*7*(1-d)})]}),r.jsx(l,{className:"h-2.5 w-2.5"})]}):r.jsx(l,{className:"h-3.5 w-3.5"}):null;return r.jsxs("span",{title:f,className:ze("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium tracking-normal","shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0)] dark:shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0.04)]",a.className,t),children:[m,r.jsx("span",{children:a.label})]})}function hj(e){var t;return((t=su[e])==null?void 0:t.description)??`Status: ${e}`}const dA=["top","right","bottom","left"],Ws=Math.min,Xn=Math.max,ou=Math.round,Ac=Math.floor,Vr=e=>({x:e,y:e}),fA={left:"right",right:"left",bottom:"top",top:"bottom"};function Vp(e,t,n){return Xn(e,Ws(t,n))}function fs(e,t){return typeof e=="function"?e(t):e}function ps(e){return e.split("-")[0]}function Ci(e){return e.split("-")[1]}function oh(e){return e==="x"?"y":"x"}function ih(e){return e==="y"?"height":"width"}function zr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ah(e){return oh(zr(e))}function pA(e,t,n){n===void 0&&(n=!1);const s=Ci(e),a=ah(e),l=ih(a);let c=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=iu(c)),[c,iu(c)]}function mA(e){const t=iu(e);return[qp(e),t,qp(t)]}function qp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Sv=["left","right"],Nv=["right","left"],hA=["top","bottom"],gA=["bottom","top"];function xA(e,t,n){switch(e){case"top":case"bottom":return n?t?Nv:Sv:t?Sv:Nv;case"left":case"right":return t?hA:gA;default:return[]}}function yA(e,t,n,s){const a=Ci(e);let l=xA(ps(e),n==="start",s);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(qp)))),l}function iu(e){const t=ps(e);return fA[t]+e.slice(t.length)}function vA(e){return{top:0,right:0,bottom:0,left:0,...e}}function gj(e){return typeof e!="number"?vA(e):{top:e,right:e,bottom:e,left:e}}function au(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}function Cv(e,t,n){let{reference:s,floating:a}=e;const l=zr(t),c=ah(t),d=ih(c),f=ps(t),m=l==="y",g=s.x+s.width/2-a.width/2,x=s.y+s.height/2-a.height/2,y=s[d]/2-a[d]/2;let v;switch(f){case"top":v={x:g,y:s.y-a.height};break;case"bottom":v={x:g,y:s.y+s.height};break;case"right":v={x:s.x+s.width,y:x};break;case"left":v={x:s.x-a.width,y:x};break;default:v={x:s.x,y:s.y}}switch(Ci(t)){case"start":v[c]-=y*(n&&m?-1:1);break;case"end":v[c]+=y*(n&&m?-1:1);break}return v}async function bA(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:x="floating",altBoundary:y=!1,padding:v=0}=fs(t,e),C=gj(v),w=d[y?x==="floating"?"reference":"floating":x],S=au(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(w)))==null||n?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:f})),T=x==="floating"?{x:s,y:a,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},$=au(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:N,strategy:f}):T);return{top:(S.top-$.top+C.top)/A.y,bottom:($.bottom-S.bottom+C.bottom)/A.y,left:(S.left-$.left+C.left)/A.x,right:($.right-S.right+C.right)/A.x}}const wA=50,jA=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:bA},f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:g,y:x}=Cv(m,s,f),y=s,v=0;const C={};for(let j=0;j<l.length;j++){const w=l[j];if(!w)continue;const{name:S,fn:T}=w,{x:N,y:A,data:$,reset:R}=await T({x:g,y:x,initialPlacement:s,placement:y,strategy:a,middlewareData:C,rects:m,platform:d,elements:{reference:e,floating:t}});g=N??g,x=A??x,C[S]={...C[S],...$},R&&v<wA&&(v++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(m=R.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):R.rects),{x:g,y:x}=Cv(m,y,f)),j=-1)}return{x:g,y:x,placement:y,strategy:a,middlewareData:C}},kA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:m,padding:g=0}=fs(e,t)||{};if(m==null)return{};const x=gj(g),y={x:n,y:s},v=ah(a),C=ih(v),j=await c.getDimensions(m),w=v==="y",S=w?"top":"left",T=w?"bottom":"right",N=w?"clientHeight":"clientWidth",A=l.reference[C]+l.reference[v]-y[v]-l.floating[C],$=y[v]-l.reference[v],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let O=R?R[N]:0;(!O||!await(c.isElement==null?void 0:c.isElement(R)))&&(O=d.floating[N]||l.floating[C]);const I=A/2-$/2,K=O/2-j[C]/2-1,X=Ws(x[S],K),_=Ws(x[T],K),H=X,J=O-j[C]-_,U=O/2-j[C]/2+I,Y=Vp(H,U,J),z=!f.arrow&&Ci(a)!=null&&U!==Y&&l.reference[C]/2-(U<H?X:_)-j[C]/2<0,V=z?U<H?U-H:U-J:0;return{[v]:y[v]+V,data:{[v]:Y,centerOffset:U-Y-V,...z&&{alignmentOffset:V}},reset:z}}}),SA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:m}=t,{mainAxis:g=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:j=!0,...w}=fs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=ps(a),T=zr(d),N=ps(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(m.floating)),$=y||(N||!j?[iu(d)]:mA(d)),R=C!=="none";!y&&R&&$.push(...yA(d,j,C,A));const O=[d,...$],I=await f.detectOverflow(t,w),K=[];let X=((s=l.flip)==null?void 0:s.overflows)||[];if(g&&K.push(I[S]),x){const U=pA(a,c,A);K.push(I[U[0]],I[U[1]])}if(X=[...X,{placement:a,overflows:K}],!K.every(U=>U<=0)){var _,H;const U=(((_=l.flip)==null?void 0:_.index)||0)+1,Y=O[U];if(Y&&(!(x==="alignment"?T!==zr(Y):!1)||X.every(D=>zr(D.placement)===T?D.overflows[0]>0:!0)))return{data:{index:U,overflows:X},reset:{placement:Y}};let z=(H=X.filter(V=>V.overflows[0]<=0).sort((V,D)=>V.overflows[1]-D.overflows[1])[0])==null?void 0:H.placement;if(!z)switch(v){case"bestFit":{var J;const V=(J=X.filter(D=>{if(R){const Q=zr(D.placement);return Q===T||Q==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Q=>Q>0).reduce((Q,E)=>Q+E,0)]).sort((D,Q)=>D[1]-Q[1])[0])==null?void 0:J[0];V&&(z=V);break}case"initialPlacement":z=d;break}if(a!==z)return{reset:{placement:z}}}return{}}}};function Ev(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tv(e){return dA.some(t=>e[t]>=0)}const NA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:a="referenceHidden",...l}=fs(e,t);switch(a){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),d=Ev(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Tv(d)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),d=Ev(c,n.floating);return{data:{escapedOffsets:d,escaped:Tv(d)}}}default:return{}}}}},xj=new Set(["left","top"]);async function CA(e,t){const{placement:n,platform:s,elements:a}=e,l=await(s.isRTL==null?void 0:s.isRTL(a.floating)),c=ps(n),d=Ci(n),f=zr(n)==="y",m=xj.has(c)?-1:1,g=l&&f?-1:1,x=fs(t,e);let{mainAxis:y,crossAxis:v,alignmentAxis:C}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return d&&typeof C=="number"&&(v=d==="end"?C*-1:C),f?{x:v*g,y:y*m}:{x:y*m,y:v*g}}const EA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:l,placement:c,middlewareData:d}=t,f=await CA(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:l+f.y,data:{...f,placement:c}}}}},TA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a,platform:l}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:S=>{let{x:T,y:N}=S;return{x:T,y:N}}},...m}=fs(e,t),g={x:n,y:s},x=await l.detectOverflow(t,m),y=zr(ps(a)),v=oh(y);let C=g[v],j=g[y];if(c){const S=v==="y"?"top":"left",T=v==="y"?"bottom":"right",N=C+x[S],A=C-x[T];C=Vp(N,C,A)}if(d){const S=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=j+x[S],A=j-x[T];j=Vp(N,j,A)}const w=f.fn({...t,[v]:C,[y]:j});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[v]:c,[y]:d}}}}}},PA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=fs(e,t),g={x:n,y:s},x=zr(a),y=oh(x);let v=g[y],C=g[x];const j=fs(d,t),w=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const N=y==="y"?"height":"width",A=l.reference[y]-l.floating[N]+w.mainAxis,$=l.reference[y]+l.reference[N]-w.mainAxis;v<A?v=A:v>$&&(v=$)}if(m){var S,T;const N=y==="y"?"width":"height",A=xj.has(ps(a)),$=l.reference[x]-l.floating[N]+(A&&((S=c.offset)==null?void 0:S[x])||0)+(A?0:w.crossAxis),R=l.reference[x]+l.reference[N]+(A?0:((T=c.offset)==null?void 0:T[x])||0)-(A?w.crossAxis:0);C<$?C=$:C>R&&(C=R)}return{[y]:v,[x]:C}}}},RA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:a,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...m}=fs(e,t),g=await c.detectOverflow(t,m),x=ps(a),y=Ci(a),v=zr(a)==="y",{width:C,height:j}=l.floating;let w,S;x==="top"||x==="bottom"?(w=x,S=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=x,w=y==="end"?"top":"bottom");const T=j-g.top-g.bottom,N=C-g.left-g.right,A=Ws(j-g[w],T),$=Ws(C-g[S],N),R=!t.middlewareData.shift;let O=A,I=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(O=T),R&&!y){const X=Xn(g.left,0),_=Xn(g.right,0),H=Xn(g.top,0),J=Xn(g.bottom,0);v?I=C-2*(X!==0||_!==0?X+_:Xn(g.left,g.right)):O=j-2*(H!==0||J!==0?H+J:Xn(g.top,g.bottom))}await f({...t,availableWidth:I,availableHeight:O});const K=await c.getDimensions(d.floating);return C!==K.width||j!==K.height?{reset:{rects:!0}}:{}}}};function $u(){return typeof window<"u"}function Ei(e){return yj(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(yj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yj(e){return $u()?e instanceof Node||e instanceof Zn(e).Node:!1}function Nr(e){return $u()?e instanceof Element||e instanceof Zn(e).Element:!1}function hs(e){return $u()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function Pv(e){return!$u()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&a!=="inline"&&a!=="contents"}function AA(e){return/^(table|td|th)$/.test(Ei(e))}function Mu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const DA=/transform|translate|scale|rotate|perspective|filter/,OA=/paint|layout|strict|content/,fo=e=>!!e&&e!=="none";let op;function lh(e){const t=Nr(e)?Cr(e):e;return fo(t.transform)||fo(t.translate)||fo(t.scale)||fo(t.rotate)||fo(t.perspective)||!ch()&&(fo(t.backdropFilter)||fo(t.filter))||DA.test(t.willChange||"")||OA.test(t.contain||"")}function IA(e){let t=Vs(e);for(;hs(t)&&!xi(t);){if(lh(t))return t;if(Mu(t))return null;t=Vs(t)}return null}function ch(){return op==null&&(op=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),op}function xi(e){return/^(html|body|#document)$/.test(Ei(e))}function Cr(e){return Zn(e).getComputedStyle(e)}function _u(e){return Nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(Ei(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pv(e)&&e.host||Zr(e);return Pv(t)?t.host:t}function vj(e){const t=Vs(e);return xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&ol(t)?t:vj(t)}function qa(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=vj(e),l=a===((s=e.ownerDocument)==null?void 0:s.body),c=Zn(a);if(l){const d=Kp(c);return t.concat(c,c.visualViewport||[],ol(a)?a:[],d&&n?qa(d):[])}else return t.concat(a,qa(a,[],n))}function Kp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bj(e){const t=Cr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=hs(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:s,d=ou(n)!==l||ou(s)!==c;return d&&(n=l,s=c),{width:n,height:s,$:d}}function uh(e){return Nr(e)?e:e.contextElement}function di(e){const t=uh(e);if(!hs(t))return Vr(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:l}=bj(t);let c=(l?ou(n.width):n.width)/s,d=(l?ou(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const LA=Vr(0);function wj(e){const t=Zn(e);return!ch()||!t.visualViewport?LA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $A(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function yo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=uh(e);let c=Vr(1);t&&(s?Nr(s)&&(c=di(s)):c=di(e));const d=$A(l,n,s)?wj(l):Vr(0);let f=(a.left+d.x)/c.x,m=(a.top+d.y)/c.y,g=a.width/c.x,x=a.height/c.y;if(l){const y=Zn(l),v=s&&Nr(s)?Zn(s):s;let C=y,j=Kp(C);for(;j&&s&&v!==C;){const w=di(j),S=j.getBoundingClientRect(),T=Cr(j),N=S.left+(j.clientLeft+parseFloat(T.paddingLeft))*w.x,A=S.top+(j.clientTop+parseFloat(T.paddingTop))*w.y;f*=w.x,m*=w.y,g*=w.x,x*=w.y,f+=N,m+=A,C=Zn(j),j=Kp(C)}}return au({width:g,height:x,x:f,y:m})}function Fu(e,t){const n=_u(e).scrollLeft;return t?t.left+n:yo(Zr(e)).left+n}function jj(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Fu(e,n),a=n.top+t.scrollTop;return{x:s,y:a}}function MA(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const l=a==="fixed",c=Zr(s),d=t?Mu(t.floating):!1;if(s===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},m=Vr(1);const g=Vr(0),x=hs(s);if((x||!x&&!l)&&((Ei(s)!=="body"||ol(c))&&(f=_u(s)),x)){const v=yo(s);m=di(s),g.x=v.x+s.clientLeft,g.y=v.y+s.clientTop}const y=c&&!x&&!l?jj(c,f):Vr(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+y.x,y:n.y*m.y-f.scrollTop*m.y+g.y+y.y}}function _A(e){return Array.from(e.getClientRects())}function FA(e){const t=Zr(e),n=_u(e),s=e.ownerDocument.body,a=Xn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=Xn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Fu(e);const d=-n.scrollTop;return Cr(s).direction==="rtl"&&(c+=Xn(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:c,y:d}}const Rv=25;function zA(e,t){const n=Zn(e),s=Zr(e),a=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,d=0,f=0;if(a){l=a.width,c=a.height;const g=ch();(!g||g&&t==="fixed")&&(d=a.offsetLeft,f=a.offsetTop)}const m=Fu(s);if(m<=0){const g=s.ownerDocument,x=g.body,y=getComputedStyle(x),v=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,C=Math.abs(s.clientWidth-x.clientWidth-v);C<=Rv&&(l-=C)}else m<=Rv&&(l+=m);return{width:l,height:c,x:d,y:f}}function BA(e,t){const n=yo(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,l=hs(e)?di(e):Vr(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=a*l.x,m=s*l.y;return{width:c,height:d,x:f,y:m}}function Av(e,t,n){let s;if(t==="viewport")s=zA(e,n);else if(t==="document")s=FA(Zr(e));else if(Nr(t))s=BA(t,n);else{const a=wj(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return au(s)}function kj(e,t){const n=Vs(e);return n===t||!Nr(n)||xi(n)?!1:Cr(n).position==="fixed"||kj(n,t)}function UA(e,t){const n=t.get(e);if(n)return n;let s=qa(e,[],!1).filter(d=>Nr(d)&&Ei(d)!=="body"),a=null;const l=Cr(e).position==="fixed";let c=l?Vs(e):e;for(;Nr(c)&&!xi(c);){const d=Cr(c),f=lh(c);!f&&d.position==="fixed"&&(a=null),(l?!f&&!a:!f&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||ol(c)&&!f&&kj(e,c))?s=s.filter(g=>g!==c):a=d,c=Vs(c)}return t.set(e,s),s}function HA(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const c=[...n==="clippingAncestors"?Mu(t)?[]:UA(t,this._c):[].concat(n),s],d=Av(t,c[0],a);let f=d.top,m=d.right,g=d.bottom,x=d.left;for(let y=1;y<c.length;y++){const v=Av(t,c[y],a);f=Xn(v.top,f),m=Ws(v.right,m),g=Ws(v.bottom,g),x=Xn(v.left,x)}return{width:m-x,height:g-f,x,y:f}}function WA(e){const{width:t,height:n}=bj(e);return{width:t,height:n}}function VA(e,t,n){const s=hs(t),a=Zr(t),l=n==="fixed",c=yo(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Vr(0);function m(){f.x=Fu(a)}if(s||!s&&!l)if((Ei(t)!=="body"||ol(a))&&(d=_u(t)),s){const v=yo(t,!0,l,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else a&&m();l&&!s&&a&&m();const g=a&&!s&&!l?jj(a,d):Vr(0),x=c.left+d.scrollLeft-f.x-g.x,y=c.top+d.scrollTop-f.y-g.y;return{x,y,width:c.width,height:c.height}}function ip(e){return Cr(e).position==="static"}function Dv(e,t){if(!hs(e)||Cr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function Sj(e,t){const n=Zn(e);if(Mu(e))return n;if(!hs(e)){let a=Vs(e);for(;a&&!xi(a);){if(Nr(a)&&!ip(a))return a;a=Vs(a)}return n}let s=Dv(e,t);for(;s&&AA(s)&&ip(s);)s=Dv(s,t);return s&&xi(s)&&ip(s)&&!lh(s)?n:s||IA(e)||n}const qA=async function(e){const t=this.getOffsetParent||Sj,n=this.getDimensions,s=await n(e.floating);return{reference:VA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function KA(e){return Cr(e).direction==="rtl"}const GA={convertOffsetParentRelativeRectToViewportRelativeRect:MA,getDocumentElement:Zr,getClippingRect:HA,getOffsetParent:Sj,getElementRects:qA,getClientRects:_A,getDimensions:WA,getScale:di,isElement:Nr,isRTL:KA};function Nj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YA(e,t){let n=null,s;const a=Zr(e);function l(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:g,top:x,width:y,height:v}=m;if(d||t(),!y||!v)return;const C=Ac(x),j=Ac(a.clientWidth-(g+y)),w=Ac(a.clientHeight-(x+v)),S=Ac(g),N={rootMargin:-C+"px "+-j+"px "+-w+"px "+-S+"px",threshold:Xn(0,Ws(1,f))||1};let A=!0;function $(R){const O=R[0].intersectionRatio;if(O!==f){if(!A)return c();O?c(!1,O):s=setTimeout(()=>{c(!1,1e-7)},1e3)}O===1&&!Nj(m,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver($,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver($,N)}n.observe(e)}return c(!0),l}function JA(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=s,m=uh(e),g=a||l?[...m?qa(m):[],...t?qa(t):[]]:[];g.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&d?YA(m,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(S=>{let[T]=S;T&&T.target===m&&v&&t&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),m&&!f&&v.observe(m),t&&v.observe(t));let C,j=f?yo(e):null;f&&w();function w(){const S=yo(e);j&&!Nj(j,S)&&n(),j=S,C=requestAnimationFrame(w)}return n(),()=>{var S;g.forEach(T=>{a&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),x==null||x(),(S=v)==null||S.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const XA=EA,QA=TA,ZA=SA,e3=RA,t3=NA,Ov=kA,n3=PA,r3=(e,t,n)=>{const s=new Map,a={platform:GA,...n},l={...a.platform,_c:s};return jA(e,t,{...a,platform:l})};var s3=typeof document<"u",o3=function(){},Xc=s3?p.useLayoutEffect:o3;function lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!lu(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const l=a[s];if(!(l==="_owner"&&e.$$typeof)&&!lu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Cj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Iv(e,t){const n=Cj(e);return Math.round(t*n)/n}function ap(e){const t=p.useRef(e);return Xc(()=>{t.current=e}),t}function i3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:m}=e,[g,x]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=p.useState(s);lu(y,s)||v(s);const[C,j]=p.useState(null),[w,S]=p.useState(null),T=p.useCallback(D=>{D!==R.current&&(R.current=D,j(D))},[]),N=p.useCallback(D=>{D!==O.current&&(O.current=D,S(D))},[]),A=l||C,$=c||w,R=p.useRef(null),O=p.useRef(null),I=p.useRef(g),K=f!=null,X=ap(f),_=ap(a),H=ap(m),J=p.useCallback(()=>{if(!R.current||!O.current)return;const D={placement:t,strategy:n,middleware:y};_.current&&(D.platform=_.current),r3(R.current,O.current,D).then(Q=>{const E={...Q,isPositioned:H.current!==!1};U.current&&!lu(I.current,E)&&(I.current=E,Us.flushSync(()=>{x(E)}))})},[y,t,n,_,H]);Xc(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,x(D=>({...D,isPositioned:!1})))},[m]);const U=p.useRef(!1);Xc(()=>(U.current=!0,()=>{U.current=!1}),[]),Xc(()=>{if(A&&(R.current=A),$&&(O.current=$),A&&$){if(X.current)return X.current(A,$,J);J()}},[A,$,J,X,K]);const Y=p.useMemo(()=>({reference:R,floating:O,setReference:T,setFloating:N}),[T,N]),z=p.useMemo(()=>({reference:A,floating:$}),[A,$]),V=p.useMemo(()=>{const D={position:n,left:0,top:0};if(!z.floating)return D;const Q=Iv(z.floating,g.x),E=Iv(z.floating,g.y);return d?{...D,transform:"translate("+Q+"px, "+E+"px)",...Cj(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:E}},[n,d,z.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:J,refs:Y,elements:z,floatingStyles:V}),[g,J,Y,z,V])}const a3=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:a}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Ov({element:s.current,padding:a}).fn(n):{}:s?Ov({element:s,padding:a}).fn(n):{}}}},l3=(e,t)=>{const n=XA(e);return{name:n.name,fn:n.fn,options:[e,t]}},c3=(e,t)=>{const n=QA(e);return{name:n.name,fn:n.fn,options:[e,t]}},u3=(e,t)=>({fn:n3(e).fn,options:[e,t]}),d3=(e,t)=>{const n=ZA(e);return{name:n.name,fn:n.fn,options:[e,t]}},f3=(e,t)=>{const n=e3(e);return{name:n.name,fn:n.fn,options:[e,t]}},p3=(e,t)=>{const n=t3(e);return{name:n.name,fn:n.fn,options:[e,t]}},m3=(e,t)=>{const n=a3(e);return{name:n.name,fn:n.fn,options:[e,t]}};var h3="Arrow",Ej=p.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...l}=e;return r.jsx(Vt.svg,{...l,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ej.displayName=h3;var g3=Ej;function x3(e){const[t,n]=p.useState(void 0);return Hs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let c,d;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var dh="Popper",[Tj,Pj]=bo(dh),[y3,Rj]=Tj(dh),Aj=e=>{const{__scopePopper:t,children:n}=e,[s,a]=p.useState(null);return r.jsx(y3,{scope:t,anchor:s,onAnchorChange:a,children:n})};Aj.displayName=dh;var Dj="PopperAnchor",Oj=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,l=Rj(Dj,n),c=p.useRef(null),d=bn(t,c),f=p.useRef(null);return p.useEffect(()=>{const m=f.current;f.current=(s==null?void 0:s.current)||c.current,m!==f.current&&l.onAnchorChange(f.current)}),s?null:r.jsx(Vt.div,{...a,ref:d})});Oj.displayName=Dj;var fh="PopperContent",[v3,b3]=Tj(fh),Ij=p.forwardRef((e,t)=>{var ge,je,Ne,ke,We,Ye;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:C,...j}=e,w=Rj(fh,n),[S,T]=p.useState(null),N=bn(t,ie=>T(ie)),[A,$]=p.useState(null),R=x3(A),O=(R==null?void 0:R.width)??0,I=(R==null?void 0:R.height)??0,K=s+(l!=="center"?"-"+l:""),X=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},_=Array.isArray(m)?m:[m],H=_.length>0,J={padding:X,boundary:_.filter(j3),altBoundary:H},{refs:U,floatingStyles:Y,placement:z,isPositioned:V,middlewareData:D}=i3({strategy:"fixed",placement:K,whileElementsMounted:(...ie)=>JA(...ie,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[l3({mainAxis:a+I,alignmentAxis:c}),f&&c3({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?u3():void 0,...J}),f&&d3({...J}),f3({...J,apply:({elements:ie,rects:ne,availableWidth:le,availableHeight:W})=>{const{width:pe,height:ve}=ne.reference,_e=ie.floating.style;_e.setProperty("--radix-popper-available-width",`${le}px`),_e.setProperty("--radix-popper-available-height",`${W}px`),_e.setProperty("--radix-popper-anchor-width",`${pe}px`),_e.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),A&&m3({element:A,padding:d}),k3({arrowWidth:O,arrowHeight:I}),y&&p3({strategy:"referenceHidden",...J})]}),[Q,E]=Mj(z),M=go(C);Hs(()=>{V&&(M==null||M())},[V,M]);const ee=(ge=D.arrow)==null?void 0:ge.x,L=(je=D.arrow)==null?void 0:je.y,ae=((Ne=D.arrow)==null?void 0:Ne.centerOffset)!==0,[ce,Z]=p.useState();return Hs(()=>{S&&Z(window.getComputedStyle(S).zIndex)},[S]),r.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:V?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(ke=D.transformOrigin)==null?void 0:ke.x,(We=D.transformOrigin)==null?void 0:We.y].join(" "),...((Ye=D.hide)==null?void 0:Ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(v3,{scope:n,placedSide:Q,onArrowChange:$,arrowX:ee,arrowY:L,shouldHideArrow:ae,children:r.jsx(Vt.div,{"data-side":Q,"data-align":E,...j,ref:N,style:{...j.style,animation:V?void 0:"none"}})})})});Ij.displayName=fh;var Lj="PopperArrow",w3={top:"bottom",right:"left",bottom:"top",left:"right"},$j=p.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,l=b3(Lj,s),c=w3[l.placedSide];return r.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:r.jsx(g3,{...a,ref:n,style:{...a.style,display:"block"}})})});$j.displayName=Lj;function j3(e){return e!==null}var k3=e=>({name:"transformOrigin",options:e,fn(t){var w,S,T;const{placement:n,rects:s,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,g]=Mj(n),x={start:"0%",center:"50%",end:"100%"}[g],y=(((S=a.arrow)==null?void 0:S.x)??0)+d/2,v=(((T=a.arrow)==null?void 0:T.y)??0)+f/2;let C="",j="";return m==="bottom"?(C=c?x:`${y}px`,j=`${-f}px`):m==="top"?(C=c?x:`${y}px`,j=`${s.floating.height+f}px`):m==="right"?(C=`${-f}px`,j=c?x:`${v}px`):m==="left"&&(C=`${s.floating.width+f}px`,j=c?x:`${v}px`),{data:{x:C,y:j}}}});function Mj(e){const[t,n="center"]=e.split("-");return[t,n]}var S3=Aj,N3=Oj,C3=Ij,E3=$j,T3=Symbol("radix.slottable");function P3(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=T3,t}var R3=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),A3="VisuallyHidden",_j=p.forwardRef((e,t)=>r.jsx(Vt.span,{...e,ref:t,style:{...R3,...e.style}}));_j.displayName=A3;var D3=_j,[zu]=bo("Tooltip",[Pj]),Bu=Pj(),Fj="TooltipProvider",O3=700,Gp="tooltip.open",[I3,ph]=zu(Fj),zj=e=>{const{__scopeTooltip:t,delayDuration:n=O3,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),f=p.useRef(0);return p.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),r.jsx(I3,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:a,children:l})};zj.displayName=Fj;var Ka="Tooltip",[L3,il]=zu(Ka),Bj=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=ph(Ka,e.__scopeTooltip),m=Bu(t),[g,x]=p.useState(null),y=li(),v=p.useRef(0),C=c??f.disableHoverableContent,j=d??f.delayDuration,w=p.useRef(!1),[S,T]=Pu({prop:s,defaultProp:a??!1,onChange:O=>{O?(f.onOpen(),document.dispatchEvent(new CustomEvent(Gp))):f.onClose(),l==null||l(O)},caller:Ka}),N=p.useMemo(()=>S?w.current?"delayed-open":"instant-open":"closed",[S]),A=p.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,T(!0)},[T]),$=p.useCallback(()=>{window.clearTimeout(v.current),v.current=0,T(!1)},[T]),R=p.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,T(!0),v.current=0},j)},[j,T]);return p.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),r.jsx(S3,{...m,children:r.jsx(L3,{scope:t,contentId:y,open:S,stateAttribute:N,trigger:g,onTriggerChange:x,onTriggerEnter:p.useCallback(()=>{f.isOpenDelayedRef.current?R():A()},[f.isOpenDelayedRef,R,A]),onTriggerLeave:p.useCallback(()=>{C?$():(window.clearTimeout(v.current),v.current=0)},[$,C]),onOpen:A,onClose:$,disableHoverableContent:C,children:n})})};Bj.displayName=Ka;var Yp="TooltipTrigger",Uj=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=il(Yp,n),l=ph(Yp,n),c=Bu(n),d=p.useRef(null),f=bn(t,d,a.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),x=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(N3,{asChild:!0,...c,children:r.jsx(Vt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:f,onPointerMove:Et(e.onPointerMove,y=>{y.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),g.current=!0)}),onPointerLeave:Et(e.onPointerLeave,()=>{a.onTriggerLeave(),g.current=!1}),onPointerDown:Et(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Et(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:Et(e.onBlur,a.onClose),onClick:Et(e.onClick,a.onClose)})})});Uj.displayName=Yp;var mh="TooltipPortal",[$3,M3]=zu(mh,{forceMount:void 0}),Hj=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:a}=e,l=il(mh,t);return r.jsx($3,{scope:t,forceMount:n,children:r.jsx(wo,{present:n||l.open,children:r.jsx(Wm,{asChild:!0,container:a,children:s})})})};Hj.displayName=mh;var yi="TooltipContent",Wj=p.forwardRef((e,t)=>{const n=M3(yi,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...l}=e,c=il(yi,e.__scopeTooltip);return r.jsx(wo,{present:s||c.open,children:c.disableHoverableContent?r.jsx(Vj,{side:a,...l,ref:t}):r.jsx(_3,{side:a,...l,ref:t})})}),_3=p.forwardRef((e,t)=>{const n=il(yi,e.__scopeTooltip),s=ph(yi,e.__scopeTooltip),a=p.useRef(null),l=bn(t,a),[c,d]=p.useState(null),{trigger:f,onClose:m}=n,g=a.current,{onPointerInTransitChange:x}=s,y=p.useCallback(()=>{d(null),x(!1)},[x]),v=p.useCallback((C,j)=>{const w=C.currentTarget,S={x:C.clientX,y:C.clientY},T=H3(S,w.getBoundingClientRect()),N=W3(S,T),A=V3(j.getBoundingClientRect()),$=K3([...N,...A]);d($),x(!0)},[x]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(f&&g){const C=w=>v(w,g),j=w=>v(w,f);return f.addEventListener("pointerleave",C),g.addEventListener("pointerleave",j),()=>{f.removeEventListener("pointerleave",C),g.removeEventListener("pointerleave",j)}}},[f,g,v,y]),p.useEffect(()=>{if(c){const C=j=>{const w=j.target,S={x:j.clientX,y:j.clientY},T=(f==null?void 0:f.contains(w))||(g==null?void 0:g.contains(w)),N=!q3(S,c);T?y():N&&(y(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,g,c,m,y]),r.jsx(Vj,{...e,ref:l})}),[F3,z3]=zu(Ka,{isInside:!1}),B3=P3("TooltipContent"),Vj=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=il(yi,n),m=Bu(n),{onClose:g}=f;return p.useEffect(()=>(document.addEventListener(Gp,g),()=>document.removeEventListener(Gp,g)),[g]),p.useEffect(()=>{if(f.trigger){const x=y=>{const v=y.target;v!=null&&v.contains(f.trigger)&&g()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,g]),r.jsx(Hm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:g,children:r.jsxs(C3,{"data-state":f.stateAttribute,...m,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(B3,{children:s}),r.jsx(F3,{scope:n,isInside:!0,children:r.jsx(D3,{id:f.contentId,role:"tooltip",children:a||s})})]})})});Wj.displayName=yi;var qj="TooltipArrow",U3=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=Bu(n);return z3(qj,n).isInside?null:r.jsx(E3,{...a,...s,ref:t})});U3.displayName=qj;function H3(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,a,l)){case l:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function W3(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function V3(e){const{top:t,right:n,bottom:s,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:s},{x:a,y:s}]}function q3(e,t){const{x:n,y:s}=e;let a=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],m=d.x,g=d.y,x=f.x,y=f.y;g>s!=y>s&&n<(x-m)*(s-g)/(y-g)+m&&(a=!a)}return a}function K3(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),G3(t)}function G3(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Y3=zj,J3=Bj,X3=Uj,Q3=Hj,Kj=Wj;const ho=Y3,Br=J3,Ur=X3,kr=p.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(Q3,{children:r.jsx(Kj,{ref:s,sideOffset:t,className:ze("z-50 overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));kr.displayName=Kj.displayName;function hh({items:e,align:t="end"}){const[n,s]=p.useState(!1),a=p.useRef(null);return p.useEffect(()=>{if(!n)return;function l(d){a.current&&!a.current.contains(d.target)&&s(!1)}function c(d){d.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[n]),e.length===0?null:r.jsxs("div",{className:"relative",ref:a,children:[r.jsx("button",{type:"button",onClick:()=>s(l=>!l),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:r.jsx(HE,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:ze("absolute top-full mt-1 z-30 min-w-[220px] rounded-md border border-border/70 bg-background shadow-lg py-1",t==="end"?"right-0":"left-0"),children:r.jsx(ho,{delayDuration:200,children:e.map(l=>{const c=l.icon,d=ze("flex w-full items-center gap-2 px-3 py-1.5 text-sm text-left transition",l.disabled?"opacity-50 cursor-not-allowed":l.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),f=r.jsxs(r.Fragment,{children:[c?r.jsx(c,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"truncate",children:l.label})]});if(l.disabled){const m=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:d,children:f})});return l.disabledReason?r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:m}),r.jsx(kr,{side:"left",children:l.disabledReason})]},l.key):r.jsx("div",{children:m},l.key)}return l.href?r.jsx(we,{to:l.href,className:d,onClick:()=>s(!1),children:f},l.key):r.jsx("button",{type:"button",className:d,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:f},l.key)})})})]})}function Ms({id:e,items:t,total:n,filterText:s="",selectable:a=!1,selectedIds:l,onToggleSelect:c,onClaim:d,onAdvance:f,onComment:m,headerCTA:g,footer:x}){const y=Pt(),v=s.trim().toLowerCase(),C=v?t.filter(j=>j.assignmentTitle.toLowerCase().includes(v)||j.assignmentSlug.toLowerCase().includes(v)):t;return r.jsxs("section",{role:"region","aria-labelledby":`overview-seg-${e}`,className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsxs("header",{className:"flex items-center justify-between gap-3 border-b border-border/40 px-4 py-3",children:[r.jsxs("div",{className:"flex items-baseline gap-2",children:[r.jsx("h3",{id:`overview-seg-${e}`,className:"text-sm font-semibold text-foreground",children:Jc[e]}),n>0?r.jsx("span",{className:"text-xs text-muted-foreground",children:n>t.length?`${n} (showing ${t.length})`:n}):null]}),g?r.jsx(we,{to:g.href,className:"text-sm font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:g.label}):null]}),r.jsx("div",{className:"divide-y divide-border/40",children:C.length===0?r.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:v?"No matches.":nA[e]}):C.map(j=>r.jsx(eD,{item:j,prefix:y,selectable:a,selected:(l==null?void 0:l.has(j.id))??!1,onToggleSelect:c,onClaim:d,onAdvance:f,onComment:m},j.id))}),x]})}const Z3=["complete","review","implement","plan-ready","shape","start","unblock","reopen"];function eD({item:e,prefix:t,selectable:n,selected:s,onToggleSelect:a,onClaim:l,onAdvance:c,onComment:d}){const f=e.projectSlug?`${t}${e.href}`:e.href,m=tD(e);return r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[n?r.jsx("input",{type:"checkbox",checked:s,onChange:()=>a==null?void 0:a(e.id),className:"mt-1 h-4 w-4 cursor-pointer accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Select ${e.assignmentTitle}`}):null,r.jsxs(we,{to:f,className:"min-w-0 flex-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"truncate text-sm font-semibold text-foreground",children:e.assignmentTitle}),r.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[e.projectTitle??"Standalone",e.assignee?r.jsxs(r.Fragment,{children:[" · ",r.jsx("span",{className:"text-foreground/80",children:e.assignee})]}):null]})]}),r.jsx(wn,{status:e.status})]}),r.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:e.reason}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground/80",children:Mm(e.updated)})]}),r.jsx(hh,{items:[{key:"claim",label:"Claim",onSelect:()=>l==null?void 0:l(e),disabled:!l},{key:"advance",label:m?`Advance → ${m.label}`:"Advance",onSelect:m?()=>c==null?void 0:c(e):void 0,disabled:!m,disabledReason:m?void 0:"No transition available"},{key:"comment",label:"Comment",onSelect:()=>d==null?void 0:d(e),disabled:!d},{key:"open",label:"Open",href:f}]})]})}function tD(e){const t=e.availableTransitions.filter(n=>!n.disabled);for(const n of Z3){const s=t.find(a=>a.command===n);if(s)return s}return t[0]??null}const nD={readyForReview:"/assignments?status=review",readyToImplement:"/assignments?status=ready_to_implement",readyForPlanning:"/assignments?status=ready_for_planning",inProgress:"/assignments?status=in_progress",drafts:"/assignments?status=draft",blocked:"/assignments?status=blocked",newestCreated:"/assignments",stale:"/assignments?stale=1"};function rD({segments:e}){const t=Pt(),n=[["readyForReview",e.readyForReview.total],["readyToImplement",e.readyToImplement.total],["readyForPlanning",e.readyForPlanning.total],["inProgress",e.inProgress.total],["drafts",e.drafts.total],["blocked",e.blocked.total],["stale",e.stale.total],["newestCreated",e.newestCreated.total]],s=n.filter(([,l])=>l>0),a=n.filter(([,l])=>l===0);return s.length===0?null:r.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-border/40 bg-background/40 px-3 py-2 text-xs",children:[s.map(([l,c])=>r.jsxs(we,{to:`${t}${nD[l]??"/assignments"}`,className:"rounded-md border border-border/60 bg-background px-2 py-1 hover:border-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`${Jc[l]}: ${c}`,children:[r.jsx("span",{className:"font-medium text-foreground",children:c})," ",r.jsx("span",{className:"text-muted-foreground",children:Jc[l]})]},l)),a.length>0?r.jsxs("span",{className:"rounded-md border border-dashed border-border/50 bg-background/40 px-2 py-1 text-muted-foreground",title:`Clean: ${a.map(([l])=>Jc[l]).join(", ")}`,children:["+",a.length," clean"]}):null]})}function sD({count:e,loading:t=!1,partialFailureBanner:n,onArchive:s,onClear:a}){return e===0?null:r.jsx("div",{role:"region","aria-label":"Bulk actions",className:"fixed inset-x-0 bottom-0 z-30 flex justify-center pb-3 pointer-events-none",children:r.jsxs("div",{className:"pointer-events-auto flex max-w-3xl flex-col items-stretch gap-1 rounded-lg border border-border/70 bg-background shadow-lg",children:[n?r.jsx("p",{"aria-live":"polite",className:"rounded-t-lg bg-destructive/10 px-4 py-2 text-xs text-destructive",children:n}):null,r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[e," selected"]}),r.jsx("button",{type:"button",disabled:t,onClick:s,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:t?"Archiving…":`${Cn.bulkArchiveLabel} (${e})`}),r.jsx("button",{type:"button",disabled:t,onClick:a,className:"shell-action",children:Cn.bulkClearLabel})]})]})})}function qr({value:e,label:t,disabled:n=!1,disabledReason:s,onError:a}){const[l,c]=p.useState(!1);async function d(){if(!n)try{if(!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error("Clipboard API is unavailable in this context.");await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch(f){a==null||a(f instanceof Error?f:new Error(String(f)))}}return n?r.jsx("button",{type:"button",disabled:!0,"aria-disabled":"true",className:"cursor-not-allowed text-muted-foreground/50",title:s??"Copy unavailable","aria-label":t??"Copy",children:r.jsx(Ha,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded",title:l?"Copied!":t??`Copy: ${e}`,"aria-label":t??"Copy",children:l?r.jsx(ji,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(Ha,{className:"h-3 w-3","aria-hidden":"true"})})}function oD({sessions:e}){return r.jsxs("aside",{"aria-labelledby":"overview-sessions-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsx("header",{className:"border-b border-border/40 px-4 py-3",children:r.jsx("h3",{id:"overview-sessions-title",className:"text-sm font-semibold text-foreground",children:"Recent Sessions"})}),e.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:Cn.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:Cn.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(iD,{session:t})},t.sessionId))})]})}function iD({session:e}){const t=Pt(),[n,s]=p.useState(!1),a=aD(e,t),l=lD(e),c=!e.path;return r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(we,{to:a,className:"block text-sm font-medium text-foreground hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:e.agent}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l," · ",Mm(e.started)]}),n&&e.path?r.jsxs("div",{className:"mt-1 space-y-0.5",children:[r.jsx("code",{className:"block w-full select-all rounded bg-muted/40 px-1.5 py-0.5 text-xs text-foreground",children:e.path}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:Cn.recentSessionsCopyFallbackHint})]}):null]}),r.jsx(qr,{value:e.path,label:Cn.recentSessionsCopyPathLabel,disabled:c,disabledReason:Cn.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function aD(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function lD(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}const cD=p.forwardRef(function({value:t,onChange:n,onClear:s},a){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{ref:a,type:"text",value:t,placeholder:"Filter (press / to focus)","aria-label":"Filter Overview rows",onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Escape"&&(s(),l.target.blur())},className:"w-full max-w-sm rounded-md border border-border/60 bg-background px-3 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),t?r.jsx("button",{type:"button",onClick:s,className:"text-xs text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:"Clear"}):null]})});async function gh(e,t,n,s){const a=await fetch(`/api/projects/${e}/assignments/${t}/transitions/${n.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s?{reason:s}:{})}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${a.status}`);return l.assignment}async function Gj(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}),a=await s.json().catch(()=>null);if(!s.ok)throw new Error((a==null?void 0:a.error)||`HTTP ${s.status}`);return a.assignment}async function uD(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}`,{method:"DELETE"}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`)}function Yj(e){return e.requiresReason||e.command==="block"}async function dD(e,t,n){const s=await fetch(`/api/assignments/${e}/transitions/${t.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),a=await s.json().catch(()=>null);if(!s.ok)throw new Error((a==null?void 0:a.error)||`HTTP ${s.status}`);return a.assignment}async function fD(e,t){const n=await fetch("/api/assignments/bulk-status-override",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:e,reason:t})}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`);return s}async function pD(e){const t=await fetch(`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/assignee`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({assignee:e.assignee})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}async function mD(e){const t=await fetch(`/api/assignments/${e.id}/assignee`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({assignee:e.assignee})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}async function hD(e){let t;if(e.projectSlug&&e.assignmentSlug)t=`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/comments`;else if(e.id)t=`/api/assignments/${e.id}/comments`;else throw new Error("postQuickComment requires either (projectSlug + assignmentSlug) or id");const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:e.body,type:e.type??"note",author:e.author})}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`)}const cu="syntaur:dashboard:claimAs",gD="human";function uu(){try{const e=window.localStorage.getItem(cu);if(e&&e.trim().length>0)return e.trim()}catch{}return gD}function xD(e){try{e===null||e.trim().length===0?window.localStorage.removeItem(cu):window.localStorage.setItem(cu,e.trim())}catch{}}function yD(){try{const e=window.localStorage.getItem(cu);return!!(e&&e.trim().length>0)}catch{return!1}}class Jj extends Error{constructor(t,n){super(t),this.stderr=n,this.name="CreateWorktreeError"}}async function Xj(e){const t=await e.json().catch(()=>null);return new Jj((t==null?void 0:t.error)||`HTTP ${e.status}`,t==null?void 0:t.stderr)}async function vD(e){const t=await fetch(`/api/projects/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function bD(e){const t=await fetch(`/api/assignments/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function wD(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw await Xj(s);return(await s.json()).assignment}async function jD(e,t){const n=await fetch(`/api/assignments/${e}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await Xj(n);return(await n.json()).assignment}function kD({open:e,onOpenChange:t,onSubmit:n}){const[s,a]=p.useState(uu());return p.useEffect(()=>{e&&a(uu())},[e]),r.jsx(Rr,{open:e,onOpenChange:t,children:r.jsx(dr,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:l=>{l.preventDefault();const c=s.trim();c&&(xD(c),n(c),t(!1))},children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:Cn.claimAsTitle}),r.jsx(Qr,{children:Cn.claimAsHint})]}),r.jsx("input",{type:"text",value:s,autoFocus:!0,onChange:l=>a(l.target.value),placeholder:"human, claude, codex…",className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:s.trim().length===0,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:Cn.claimAsSubmit})]})]})})})}function SD({open:e,assignmentTitle:t,loading:n=!1,onSubmit:s,onOpenChange:a}){const[l,c]=p.useState(""),[d,f]=p.useState("note");return p.useEffect(()=>{e||(c(""),f("note"))},[e]),r.jsx(Rr,{open:e,onOpenChange:m=>n?void 0:a(m),children:r.jsx(dr,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-4",onSubmit:async m=>{m.preventDefault();const g=l.trim();g&&await s(g,d)},children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:Cn.quickCommentTitle}),r.jsxs(Qr,{children:["On “",t,"”"]})]}),r.jsx("textarea",{value:l,autoFocus:!0,rows:5,disabled:n,onChange:m=>c(m.target.value),placeholder:Cn.quickCommentPlaceholder,className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm leading-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"note",checked:d==="note",onChange:()=>f("note")}),"note"]}),r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"question",checked:d==="question",onChange:()=>f("question")}),"question"]}),r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"radio",name:"comment-type",value:"feedback",checked:d==="feedback",onChange:()=>f("feedback")}),"feedback"]})]}),r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>a(!1),className:"shell-action",disabled:n,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:n||l.trim().length===0,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:n?"Posting…":Cn.quickCommentSubmit})]})]})})})}const Lv=50,ND="archived";function CD(){const[e,t]=p.useState(0),{data:n,loading:s,error:a,refetch:l}=eT({staleLimit:Lv,staleOffset:e}),{data:c}=s0(),[d,f]=p.useState(""),m=p.useRef(null),[g,x]=p.useState(new Set),[y,v]=p.useState(!1),[C,j]=p.useState(null),[w,S]=p.useState(!1),T=p.useRef(null),[N,A]=p.useState(null),[$,R]=p.useState(!1);Js("list:overview"),pt({keys:"/",description:"Focus filter",scope:"list:overview",handler:z=>{var V,D;z.preventDefault(),(V=m.current)==null||V.focus(),(D=m.current)==null||D.select()}}),pt({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{l()}}),pt({keys:"Escape",description:"Clear selection / filter",scope:"list:overview",handler:()=>{x(new Set),f("")}});const O=p.useMemo(()=>ED(n==null?void 0:n.segments),[n==null?void 0:n.segments]),I=p.useCallback(async z=>z||!yD()?new Promise(V=>{T.current=D=>{V(D)},S(!0)}):uu(),[]),K=p.useCallback(async(z,V=!1)=>{const D=await I(V);if(D)try{z.projectSlug?await pD({projectSlug:z.projectSlug,assignmentSlug:z.assignmentSlug,assignee:D}):await mD({id:z.id.split(":")[1]??z.id,assignee:D}),await l()}catch(Q){console.error("Claim failed:",Q)}},[I,l]),X=p.useCallback(async z=>{const V=z.availableTransitions.filter(Q=>!Q.disabled);if(V.length===0)return;const D=V[0];try{if(z.projectSlug)await gh(z.projectSlug,z.assignmentSlug,D);else{const Q=z.id.split(":")[1]??z.id;await dD(Q,D)}await l()}catch(Q){console.error("Advance failed:",Q)}},[l]),_=p.useCallback(async(z,V)=>{if(N){R(!0);try{await hD({projectSlug:N.projectSlug,assignmentSlug:N.projectSlug?N.assignmentSlug:void 0,id:N.projectSlug?void 0:N.id.split(":")[1]??N.id,body:z,type:V}),A(null)}catch(D){console.error("Comment failed:",D)}finally{R(!1)}}},[N]),H=p.useCallback(async()=>{if(!(g.size===0||!n)){v(!0),j(null);try{const z=n.segments.stale.items.filter(D=>g.has(D.id)).map(D=>({projectSlug:D.projectSlug,assignmentSlug:D.projectSlug?D.assignmentSlug:void 0,id:D.projectSlug?void 0:D.id.split(":")[1]??D.id,status:ND})),V=await fD(z,"Bulk archive from Overview");V.failed>0&&j(`${V.failed} of ${z.length} items failed. The list has been refreshed.`),x(new Set),t(0),await l()}catch(z){console.error("Bulk archive failed:",z),j(z.message)}finally{v(!1)}}},[n,g,l]),J=p.useCallback(z=>{x(V=>{const D=new Set(V);return D.has(z)?D.delete(z):D.add(z),D})},[]);if(s&&!n)return r.jsx(at,{label:"Loading overview…"});if(a||!n)return r.jsx(et,{error:a||"Overview data is unavailable."});const U=n.segments.drafts.items[0]?{label:"Shape →",href:(n.segments.drafts.items[0].projectSlug,n.segments.drafts.items[0].href)}:void 0,Y=n.segments.stale.hasMore?r.jsx("div",{className:"flex justify-center px-4 py-3",children:r.jsxs("button",{type:"button",onClick:()=>t(z=>z+Lv),className:"shell-action",children:["Load more (",n.segments.stale.total-n.segments.stale.offset-n.segments.stale.items.length," remaining)"]})}):null;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsx("p",{className:"eyebrow",children:"Workspace Overview"}),r.jsx("h1",{className:"text-4xl font-semibold tracking-display text-foreground md:text-5xl",children:"What needs you today"})]}),r.jsx(cD,{ref:m,value:d,onChange:f,onClear:()=>f("")}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(360px,0.9fr)]",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx(sA,{hero:n.hero,itemsById:O}),r.jsx(Ms,{id:"readyForReview",items:n.segments.readyForReview.items,total:n.segments.readyForReview.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"readyToImplement",items:n.segments.readyToImplement.items,total:n.segments.readyToImplement.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"readyForPlanning",items:n.segments.readyForPlanning.items,total:n.segments.readyForPlanning.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"inProgress",items:n.segments.inProgress.items,total:n.segments.inProgress.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"blocked",items:n.segments.blocked.items,total:n.segments.blocked.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"drafts",items:n.segments.drafts.items,total:n.segments.drafts.total,filterText:d,headerCTA:U,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(Ms,{id:"stale",items:n.segments.stale.items,total:n.segments.stale.total,filterText:d,selectable:!0,selectedIds:g,onToggleSelect:J,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z),footer:Y}),r.jsx(Ms,{id:"newestCreated",items:n.segments.newestCreated.items,total:n.segments.newestCreated.total,filterText:d,onClaim:z=>K(z),onAdvance:X,onComment:z=>A(z)}),r.jsx(rD,{segments:n.segments}),n.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Dm,{className:"h-3 w-3","aria-hidden":"true"}),r.jsxs("span",{children:["● ",n.serverStats.totalPorts," ports ·"," ",n.serverStats.deadSessions>0?`${n.serverStats.deadSessions} dead`:"all healthy"]})]}):null]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(oD,{sessions:n.recentSessions}),n.firstRun?r.jsx(tA,{help:c}):null]})]}),r.jsx(sD,{count:g.size,loading:y,partialFailureBanner:C,onArchive:H,onClear:()=>x(new Set)}),r.jsx(kD,{open:w,onOpenChange:z=>{!z&&T.current&&(T.current(uu()),T.current=null),S(z)},onSubmit:z=>{T.current&&(T.current(z),T.current=null)}}),r.jsx(SD,{open:N!==null,assignmentTitle:(N==null?void 0:N.assignmentTitle)??"",loading:$,onSubmit:_,onOpenChange:z=>{z||A(null)}})]})}function ED(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const s=e[n];for(const a of s.items)t[a.id]=a}return t}function TD({term:e,description:t}){return r.jsx("span",{title:t,className:"cursor-help rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-foreground underline decoration-dotted underline-offset-4",children:e})}function PD(){const{data:e,loading:t,error:n}=s0(),{openCheatsheet:s}=Ys();return t?r.jsx(at,{label:"Loading help…"}):n||!e?r.jsx(et,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{title:"Keyboard Shortcuts",description:"Navigate the dashboard without reaching for the mouse.",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx("button",{type:"button",onClick:s,className:"inline-flex items-center gap-2 rounded-md border border-border/70 bg-background/80 px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent",children:"Open shortcuts cheatsheet"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["or press ",r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"?"})," ","anywhere. ",Wr("Mod+k")," opens the command palette."]})]})}),r.jsx(Le,{title:"What Syntaur Is",description:e.whatIsSyntaur.summary,children:r.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.whatIsSyntaur.bullets.map(a=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:a},a))})}),r.jsx(Le,{title:"Getting Started",children:r.jsx("div",{className:"space-y-3",children:e.workflow.map((a,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?r.jsx(Yc,{command:a.command.command,description:a.command.description,example:a.command.example}):null,a.href?r.jsx(we,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(Le,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(a=>r.jsx(TD,{term:a.term,description:a.description},a.term))}),r.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.term}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.term))})]}),r.jsx(Le,{title:"Status Guide",children:r.jsx("div",{className:"space-y-3",children:e.statusGuide.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(wn,{status:a.status}),r.jsx("p",{className:"font-semibold text-foreground",children:a.meaning})]}),r.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:a.useWhen})]},a.status))})})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Le,{title:"Ownership And File Rules",children:r.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description}),r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.files.map(l=>r.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 font-mono text-xs text-foreground",children:l},l))})]},a.label))})}),r.jsx(Le,{title:"How To Navigate The Dashboard",children:r.jsx("div",{className:"space-y-3",children:e.navigation.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),r.jsx(we,{className:"text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open"})]}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.label))})})]}),r.jsx(Le,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(a=>r.jsx(Yc,{command:a.command,description:a.description,example:a.example},a.command))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Le,{title:"FAQ",children:r.jsx("div",{className:"space-y-3",children:e.faq.map(a=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.question}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.answer})]},a.question))})}),r.jsx(Le,{title:"First Project Checklist",children:r.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((a,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?r.jsx(Yc,{command:a.command.command,example:a.command.example}):null,a.href?r.jsx(we,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})})]})]})}function ot({title:e,description:t,actions:n}){return r.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/40 px-4 py-6 text-center",children:r.jsxs("div",{className:"mx-auto max-w-xl space-y-2",children:[r.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:t}),n?r.jsx("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:n}):null]})})}function xh({children:e}){return r.jsx("div",{className:"chrome-card flex flex-col gap-2 !p-2.5 md:flex-row md:flex-wrap md:items-center",children:e})}const Uu=p.forwardRef(({value:e,onChange:t,placeholder:n="Search"},s)=>r.jsxs("label",{className:"relative flex min-w-[220px] flex-1 items-center",children:[r.jsx(qs,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),r.jsx("input",{ref:s,value:e,onChange:a=>t(a.target.value),placeholder:n,className:"h-9 w-full rounded-md border border-border/60 bg-background/90 pl-9 pr-3 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30"})]}));Uu.displayName="SearchInput";function yh({value:e,options:t,onChange:n}){return r.jsx("div",{className:"inline-flex rounded-md border border-border/60 bg-background/80 p-1",children:t.map(s=>r.jsx("button",{type:"button",onClick:()=>n(s.value),className:ze("rounded-sm px-2.5 py-1.5 text-sm font-medium transition",e===s.value?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}function Qj({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:a,canDrop:l,onMove:c,getExternalDragData:d,onCardContextMenu:f,emptyMessage:m="No cards in this column."}){const[g,x]=p.useState(null),[y,v]=p.useState(null),C=p.useRef(null),j=p.useMemo(()=>new Map(t.map(O=>[n(O),O])),[n,t]),w=p.useMemo(()=>e.map(O=>({column:O,items:t.filter(I=>s(I)===O.id)})),[e,s,t]),S=g?j.get(g)??null:null;function T(O){if(!S)return{allowed:!1};const I=s(S);return(l==null?void 0:l({item:S,fromColumnId:I,toColumnId:O}))??{allowed:!0}}function N(){x(null),v(null)}function A(O,I,K){const X=(d==null?void 0:d(I))??null;!c&&!X||(O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",K),X&&O.dataTransfer.setData("application/json",JSON.stringify(X)),c&&x(K))}function $(O,I,K){!c||!S||!T(I).allowed||(O.preventDefault(),O.dataTransfer.dropEffect="move",v(_=>(_==null?void 0:_.columnId)===I&&_.index===K?_:{columnId:I,index:K}))}async function R(O,I,K){var U;if(O.preventDefault(),!c||!S){N();return}const X=s(S),H=(((U=w.find(Y=>Y.column.id===X))==null?void 0:U.items)??[]).findIndex(Y=>n(Y)===n(S));if(!T(I).allowed||H<0){N();return}if(X===I&&(K===H||K===H+1)){N();return}try{await c({item:S,fromColumnId:X,toColumnId:I,fromIndex:H,toIndex:K})}finally{N()}}return r.jsx("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:r.jsx("div",{className:"grid min-w-max auto-cols-[minmax(260px,320px)] grid-flow-col gap-4",children:w.map(({column:O,items:I})=>{const K=T(O.id),X=(y==null?void 0:y.columnId)===O.id;return r.jsxs("section",{className:ze("flex min-h-[320px] flex-col rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",S&&!K.allowed?"border-dashed opacity-65":"",S&&K.allowed?"border-primary/30 bg-accent/30":"",X?"ring-2 ring-ring/30":""),title:S&&!K.allowed?K.reason:void 0,children:[r.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:"text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:O.title}),O.description?r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:O.description}):null]}),r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs font-semibold text-foreground",children:I.length})]}),r.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:_=>$(_,O.id,I.length),onDrop:_=>R(_,O.id,I.length),children:[I.length===0?r.jsx(RD,{active:(y==null?void 0:y.columnId)===O.id&&y.index===0,disabled:!!S&&!K.allowed,children:typeof m=="function"?m(O):m}):null,I.map((_,H)=>{const J=n(_),U=g===J;return r.jsxs(p.Fragment,{children:[r.jsx("div",{className:ze("h-2 rounded-full transition",(y==null?void 0:y.columnId)===O.id&&y.index===H?"bg-primary/70":"bg-transparent"),onDragOver:Y=>$(Y,O.id,H),onDrop:Y=>R(Y,O.id,H)}),r.jsx("div",{draggable:!!(c||d),onMouseDown:Y=>{C.current=Y.target},onDragStart:Y=>{const z=C.current;if(z!=null&&z.closest("a, button")){Y.preventDefault();return}A(Y,_,J)},onDragEnd:N,onContextMenu:Y=>{if(!f)return;const z=Y.target;z!=null&&z.closest('a, button, [role="button"]')||f(_,Y)},className:ze("transition",c||d?"cursor-grab active:cursor-grabbing":"",U?"scale-[0.98] opacity-50":""),children:a(_,{dragging:U})})]},J)}),I.length>0?r.jsx("div",{className:ze("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(y==null?void 0:y.columnId)===O.id&&y.index===I.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",S&&!K.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},O.id)})})})}function RD({active:e,disabled:t,children:n}){return r.jsx("div",{className:ze("flex min-h-[128px] items-center justify-center rounded-lg border border-dashed px-4 text-center text-sm text-muted-foreground transition",e?"border-primary/60 bg-primary/10 text-foreground":"border-border/60 bg-background/50",t?"opacity-45":""),children:n})}const Zj={statuses:[{id:"pending",label:"Pending"},{id:"in_progress",label:"In Progress"},{id:"blocked",label:"Blocked"},{id:"review",label:"Review"},{id:"completed",label:"Completed"},{id:"failed",label:"Failed"}],order:["pending","in_progress","blocked","review","completed","failed"],transitions:[],custom:!1};let Aa=null,po=null;function AD(){return Aa?Promise.resolve(Aa):po||(po=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Aa=e,po=null,e)).catch(()=>(po=null,Zj)),po)}function Hu(){const[e,t]=p.useState(()=>Aa??Zj);return p.useEffect(()=>{AD().then(t)},[]),e}function $v(){Aa=null,po=null}function DD(e,t){const n=e.statuses.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}const OD={completed:"bg-status-completed-foreground",in_progress:"bg-status-in-progress-foreground",review:"bg-status-review-foreground",blocked:"bg-status-blocked-foreground",failed:"bg-status-failed-foreground",pending:"bg-status-pending-foreground"},Mv=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function du({progress:e,className:t,showLegend:n=!1}){const s=Hu(),a=p.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(f=>f!=="total")).map(f=>({key:f,className:OD[f]??Mv[c++%Mv.length]}))},[s.order,e]),l=a.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:ze("space-y-2",t),children:[r.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded-lg border border-border/70 bg-muted/60",children:e.total===0?r.jsx("div",{className:"h-full w-full bg-muted"}):l.map(c=>r.jsx("div",{className:c.className,style:{width:`${(e[c.key]??0)/e.total*100}%`},title:`${pn(c.key)}: ${e[c.key]??0}`},c.key))}),n?r.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:a.map(c=>r.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-border/60 bg-background/80 px-2 py-1",children:[r.jsx("span",{className:ze("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:pn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const ID=["pending","active","blocked","failed","completed","archived"],vh=ID,LD=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function $D(e){return e&&e.length>0?e:[...LD]}function MD(e,t,n){if(t<0||t>=e.length)return e;const s=[...e],[a]=s.splice(t,1),l=t<n?n-1:n;return s.splice(Math.max(0,Math.min(l,s.length)),0,a),s}const _D=220,Dc=8;function ek({anchor:e,items:t,onClose:n}){const s=p.useRef(null),[a,l]=p.useState(null);return p.useLayoutEffect(()=>{if(!e){l(null);return}const c=s.current,d=(c==null?void 0:c.offsetWidth)??_D,f=(c==null?void 0:c.offsetHeight)??0,m=Math.max(Dc,window.innerWidth-d-Dc),g=Math.max(Dc,window.innerHeight-f-Dc);l({left:Math.min(e.x,m),top:Math.min(e.y,g)})},[e]),p.useEffect(()=>{if(!e)return;function c(m){s.current&&!s.current.contains(m.target)&&n()}function d(m){m.key==="Escape"&&n()}function f(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",d),document.addEventListener("contextmenu",c),window.addEventListener("scroll",f,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",d),document.removeEventListener("contextmenu",c),window.removeEventListener("scroll",f,!0)}},[e,n]),!e||t.length===0?null:r.jsx("div",{ref:s,role:"menu",className:"fixed z-50 min-w-[220px] rounded-md border border-border/70 bg-background py-1 shadow-lg",style:{left:(a==null?void 0:a.left)??e.x,top:(a==null?void 0:a.top)??e.y,visibility:a?"visible":"hidden"},children:r.jsx(ho,{delayDuration:200,children:t.map(c=>{const d=c.icon,f=ze("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition",c.disabled?"cursor-not-allowed opacity-50":c.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),m=r.jsxs(r.Fragment,{children:[d?r.jsx(d,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"truncate",children:c.label})]});if(c.disabled){const g=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:f,children:m})});return c.disabledReason?r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:g}),r.jsx(kr,{side:"left",children:c.disabledReason})]},c.key):r.jsx("div",{children:g},c.key)}return c.href?r.jsx(we,{to:c.href,className:f,onClick:()=>n(),children:m},c.key):r.jsx("button",{type:"button",className:f,onClick:()=>{var g;(g=c.onSelect)==null||g.call(c),n()},children:m},c.key)})})})}const FD="__ungrouped__";function bh({open:e,onOpenChange:t,currentWorkspace:n,onSubmit:s,title:a="Move to workspace",description:l="Pick the workspace this item should belong to."}){const{data:c,loading:d}=Cu(),[f,m]=p.useState(n),[g,x]=p.useState(!1),[y,v]=p.useState(null);p.useEffect(()=>{e&&(m(n),v(null))},[e,n]);const C=p.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(T=>({key:T,label:T,value:T})),{key:FD,label:"Ungrouped",value:null}],[c]),j=!g&&f!==n;async function w(){if(j){x(!0),v(null);try{await s(f),t(!1)}catch(S){v(S instanceof Error?S.message:"Failed to move item")}finally{x(!1)}}}return r.jsx(Rr,{open:e,onOpenChange:S=>g?void 0:t(S),children:r.jsxs(dr,{children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:a}),r.jsx(Qr,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:d&&C.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(Am,{className:"h-4 w-4 animate-spin"})," Loading workspaces…"]}):C.map(S=>{const T=S.value===n,N=S.value===f;return r.jsxs("button",{type:"button",disabled:T||g,onClick:()=>m(S.value),className:ze("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition",T?"cursor-not-allowed bg-foreground/5 text-muted-foreground":N?"bg-accent/40 text-foreground":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:ze("truncate",S.value===null?"italic text-muted-foreground":""),children:[S.label,T?r.jsx("span",{className:"ml-2 text-xs",children:"(current)"}):null]}),N?r.jsx(ji,{className:"h-4 w-4 text-foreground"}):null]},S.key)})}),y?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:y}):null,r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),disabled:g,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:w,disabled:!j,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:g?"Moving…":"Move"})]})]})})}function _v(){const{workspace:e}=kt(),t=Pt(),n=Tt(),{data:s,loading:a,error:l,refetch:c}=Ni(),d=p.useRef(null);Js("list:projects");const[f,m]=p.useState(""),[g,x]=p.useState("all"),[y,v]=p.useState("active"),[C,j]=p.useState("all"),[w,S]=p.useState("updated"),[T,N]=Xr(),A=T.get("view"),$=A==="table"||A==="kanban"?A:"cards",R=E=>{N(M=>{const ee=new URLSearchParams(M);return E==="cards"?ee.delete("view"):ee.set("view",E),ee})},[O,I]=p.useState({}),[K,X]=p.useState(null),[_,H]=p.useState(null),J=p.useMemo(()=>s?s.filter(E=>{if(e){if(e==="_ungrouped"){if(E.workspace!==null)return!1}else if(E.workspace!==e)return!1}return y==="active"&&E.archived||y==="archived"&&!E.archived||g!=="all"&&E.status!==g||C!=="all"&&!E.tags.includes(C)?!1:f.trim()?`${E.title} ${E.tags.join(" ")} ${E.slug}`.toLowerCase().includes(f.toLowerCase()):!0}).sort((E,M)=>UD(E,M,w)):[],[s,f,g,y,C,w,e]),U=J.map(E=>`${E.slug}:${E.status}`).join("|");p.useEffect(()=>{I(HD(J))},[U,w]);const Y=p.useMemo(()=>{const E=new Map(J.map(M=>[M.slug,M]));return vh.flatMap(M=>(O[M]??J.filter(L=>L.status===M).map(L=>L.slug)).map(L=>E.get(L)).filter(L=>!!L))},[J,O]),{visibleItems:z,visibleIndexByKey:V}=p.useMemo(()=>{const E=$==="kanban"?Y:J,M=new Map;return E.forEach((ee,L)=>M.set(ee.slug,L)),{visibleItems:E,visibleIndexByKey:M}},[$,J,Y]),{hotkeyRowProps:D}=sl(z,{scope:"list:projects",onOpen:E=>n(`${t}/projects/${E.slug}`)});if(pt({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var E;return(E=d.current)==null?void 0:E.focus()}}),pt({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),a)return r.jsx(at,{label:"Loading projects…"});if(l||!s)return r.jsx(et,{error:l||"Project list is unavailable."});const Q=Array.from(new Set(s.flatMap(E=>E.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(xh,{children:[r.jsx(Uu,{ref:d,value:f,onChange:m,placeholder:"Search by project title or tag"}),r.jsxs("select",{value:g,onChange:E=>x(E.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"active",children:"Active"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"failed",children:"Failed"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"archived",children:"Archived"})]}),r.jsxs("select",{value:y,onChange:E=>v(E.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"active",children:"Hide archived"}),r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"archived",children:"Archived only"})]}),r.jsxs("select",{value:C,onChange:E=>j(E.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All tags"}),Q.map(E=>r.jsx("option",{value:E,children:E},E))]}),r.jsxs("select",{value:w,onChange:E=>S(E.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"updated",children:"Sort: Updated"}),r.jsx("option",{value:"created",children:"Sort: Created"}),r.jsx("option",{value:"title",children:"Sort: Title"}),r.jsx("option",{value:"attention",children:"Sort: Attention"})]}),r.jsx(yh,{value:$,onChange:E=>R(E),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),J.length===0?s.length===0?r.jsxs("div",{className:"rounded-frame border border-border/60 bg-card px-6 py-16 text-center",children:[r.jsx("p",{className:"eyebrow mx-auto justify-center",children:"Start here"}),r.jsx("h2",{className:"mx-auto mt-4 max-w-2xl text-3xl font-semibold tracking-display text-foreground md:text-4xl",children:"The task manager built for agents, by agents"}),r.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm leading-6 text-muted-foreground",children:"A project groups assignments, resources, and memories under one objective. Markdown stays authoritative — the dashboard is just a view."}),r.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[r.jsx(we,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),r.jsx(we,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):r.jsx(ot,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:r.jsx(we,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):$==="cards"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:J.map((E,M)=>r.jsxs(we,{to:`${t}/projects/${E.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...D(M),children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:E.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Kr(E.updated)]})]}),r.jsx(wn,{status:E.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(du,{progress:E.progress,showLegend:!0}),r.jsx("div",{className:"flex flex-wrap gap-2",children:E.tags.map(ee=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:ee},ee))}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Needs attention"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:E.needsAttention.blockedCount+E.needsAttention.failedCount})]}),r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Assignments"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:E.progress.total})]})]})]})]},E.slug))}):$==="table"?r.jsx(Le,{title:`${J.length} project${J.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"pb-3 font-medium",children:"Project"}),r.jsx("th",{className:"pb-3 font-medium",children:"Status"}),r.jsx("th",{className:"pb-3 font-medium",children:"Progress"}),r.jsx("th",{className:"pb-3 font-medium",children:"Attention"}),r.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:J.map((E,M)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...D(M),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(we,{to:`${t}/projects/${E.slug}`,className:"font-semibold text-foreground hover:text-primary",children:E.title}),r.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:E.tags.map(ee=>r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:ee},ee))})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx(wn,{status:E.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(du,{progress:E.progress})})}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:E.needsAttention.blockedCount+E.needsAttention.failedCount}),r.jsx("td",{className:"py-4 text-muted-foreground",children:Kr(E.updated)})]},E.slug))})]})})}):r.jsx(Qj,{columns:BD,items:Y,getItemId:E=>E.slug,getColumnId:E=>E.status,canDrop:({fromColumnId:E,toColumnId:M})=>({allowed:!0,reason:E===M?void 0:"This will set a manual status override on the project."}),onMove:({item:E,fromColumnId:M,toColumnId:ee,fromIndex:L,toIndex:ae})=>{if(M===ee){const ce=O[M]??J.filter(Z=>Z.status===M).map(Z=>Z.slug);I(Z=>({...Z,[M]:MD(ce,L,ae)}));return}fetch(`/api/projects/${E.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:ee})}).then(()=>{window.location.reload()})},getExternalDragData:E=>({type:"project",id:E.slug}),onCardContextMenu:(E,M)=>{M.preventDefault(),X({project:E,anchor:{x:M.clientX,y:M.clientY}})},emptyMessage:E=>`No ${E.title.toLowerCase()} projects.`,renderCard:(E,{dragging:M})=>{const ee=V.get(E.slug)??-1;return r.jsx("div",{...ee>=0?D(ee):{},children:r.jsx(WD,{project:E,dragging:M})})}}),r.jsx(ek,{anchor:(K==null?void 0:K.anchor)??null,items:K?[{key:"edit",label:"Edit",icon:ki,onSelect:()=>n(`${t}/projects/${K.project.slug}`)},{key:"move",label:"Move to workspace…",icon:rl,onSelect:()=>H(K.project)}]:[],onClose:()=>X(null)}),r.jsx(bh,{open:_!==null,onOpenChange:E=>{E||H(null)},currentWorkspace:(_==null?void 0:_.workspace)??null,title:"Move project to workspace",onSubmit:async E=>{if(!_)return;const M=await fetch(`/api/projects/${encodeURIComponent(_.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:E})});if(!M.ok){const ee=await M.json().catch(()=>({}));throw new Error(ee.error||"Failed to move project")}c()}}),r.jsx("div",{className:"rounded-lg border border-border/60 bg-card/80 p-3 text-sm text-muted-foreground",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(Rm,{className:"mt-0.5 h-4 w-4"}),r.jsxs("p",{children:["Project status is derived from assignment state by default.",$==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const zD={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},BD=vh.map(e=>({id:e,title:zD[e],description:hj(e)}));function UD(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return Fv(t)-Fv(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function Fv(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function HD(e){return Object.fromEntries(vh.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function WD({project:e,dragging:t}){const n=Pt();return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(we,{to:`${n}/projects/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Kr(e.updated)]})]}),r.jsx(wn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(du,{progress:e.progress})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.tags.map(s=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:s},s)),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.progress.total," assignments"]}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.needsAttention.blockedCount+e.needsAttention.failedCount," needs attention"]})]}),r.jsx("div",{className:"mt-4 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:t?"Reordering within status":"Derived project lane"})]})}const zv="inline-flex max-w-[14rem] items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-semibold tracking-wide border-border/60 text-muted-foreground",Bv="truncate";function wh({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:ze("flex flex-wrap items-center gap-1.5",t),children:e.map((n,s)=>{const a=`${n.system}:${n.id}`,l=`${n.system}:${n.id}:${s}`;return n.url!=null&&n.url.length>0?r.jsxs("a",{href:n.url??void 0,target:"_blank",rel:"noopener noreferrer",className:ze(zv,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${a} in ${n.system}`,children:[r.jsx("span",{className:Bv,children:a}),r.jsx(Em,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:zv,title:a,children:r.jsx("span",{className:Bv,children:a})},l)})})}const VD={default:"chrome-card",info:"rounded-lg border border-primary/30 bg-primary/5 p-3 dark:border-primary/40 dark:bg-primary/10",warn:"rounded-lg border border-warning-foreground/30 bg-warning p-3",danger:"rounded-lg border border-error-foreground/30 bg-error p-3",success:"rounded-lg border border-success-foreground/30 bg-success p-3"};function mn({label:e,value:t,description:n,icon:s,tone:a="default",to:l}){const c=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:e}),r.jsx("p",{className:"text-2xl font-semibold text-foreground",children:t})]}),s?r.jsx("span",{className:"rounded-md border border-border/60 bg-background/80 p-1.5 text-muted-foreground",children:r.jsx(s,{className:"h-5 w-5"})}):null]}),n?r.jsx("p",{className:"mt-2 text-sm leading-5 text-muted-foreground",children:n}):null]}),d=ze(VD[a],l?"block transition hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40":"");return l?r.jsx(we,{to:l,className:d,children:c}):r.jsx("article",{className:d,children:c})}function Uv(e){const t=qD(e),n=p.forwardRef((s,a)=>{const{children:l,...c}=s,d=p.Children.toArray(l),f=d.find(GD);if(f){const m=f.props.children,g=d.map(x=>x===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:a,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return r.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function qD(e){const t=p.forwardRef((n,s)=>{const{children:a,...l}=n;if(p.isValidElement(a)){const c=JD(a),d=YD(l,a.props);return a.type!==p.Fragment&&(d.ref=s?Tu(s,c):c),p.cloneElement(a,d)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KD=Symbol("radix.slottable");function GD(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KD}function YD(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function JD(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function XD(e){const t=e+"CollectionProvider",[n,s]=bo(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j=>{const{scope:w,children:S}=j,T=Lt.useRef(null),N=Lt.useRef(new Map).current;return r.jsx(a,{scope:w,itemMap:N,collectionRef:T,children:S})};c.displayName=t;const d=e+"CollectionSlot",f=Uv(d),m=Lt.forwardRef((j,w)=>{const{scope:S,children:T}=j,N=l(d,S),A=bn(w,N.collectionRef);return r.jsx(f,{ref:A,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",x="data-radix-collection-item",y=Uv(g),v=Lt.forwardRef((j,w)=>{const{scope:S,children:T,...N}=j,A=Lt.useRef(null),$=bn(w,A),R=l(g,S);return Lt.useEffect(()=>(R.itemMap.set(A,{ref:A,...N}),()=>void R.itemMap.delete(A))),r.jsx(y,{[x]:"",ref:$,children:T})});v.displayName=g;function C(j){const w=l(e+"CollectionConsumer",j);return Lt.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${x}]`));return Array.from(w.itemMap.values()).sort((R,O)=>N.indexOf(R.ref.current)-N.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,s]}var QD=p.createContext(void 0);function tk(e){const t=p.useContext(QD);return e||t||"ltr"}var lp="rovingFocusGroup.onEntryFocus",ZD={bubbles:!1,cancelable:!0},al="RovingFocusGroup",[Jp,nk,e4]=XD(al),[t4,rk]=bo(al,[e4]),[n4,r4]=t4(al),sk=p.forwardRef((e,t)=>r.jsx(Jp.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Jp.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(s4,{...e,ref:t})})}));sk.displayName=al;var s4=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...x}=e,y=p.useRef(null),v=bn(t,y),C=tk(l),[j,w]=Pu({prop:c,defaultProp:d??null,onChange:f,caller:al}),[S,T]=p.useState(!1),N=go(m),A=nk(n),$=p.useRef(!1),[R,O]=p.useState(0);return p.useEffect(()=>{const I=y.current;if(I)return I.addEventListener(lp,N),()=>I.removeEventListener(lp,N)},[N]),r.jsx(n4,{scope:n,orientation:s,dir:C,loop:a,currentTabStopId:j,onItemFocus:p.useCallback(I=>w(I),[w]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>O(I=>I+1),[]),onFocusableItemRemove:p.useCallback(()=>O(I=>I-1),[]),children:r.jsx(Vt.div,{tabIndex:S||R===0?-1:0,"data-orientation":s,...x,ref:v,style:{outline:"none",...e.style},onMouseDown:Et(e.onMouseDown,()=>{$.current=!0}),onFocus:Et(e.onFocus,I=>{const K=!$.current;if(I.target===I.currentTarget&&K&&!S){const X=new CustomEvent(lp,ZD);if(I.currentTarget.dispatchEvent(X),!X.defaultPrevented){const _=A().filter(z=>z.focusable),H=_.find(z=>z.active),J=_.find(z=>z.id===j),Y=[H,J,..._].filter(Boolean).map(z=>z.ref.current);ak(Y,g)}}$.current=!1}),onBlur:Et(e.onBlur,()=>T(!1))})})}),ok="RovingFocusGroupItem",ik=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:l,children:c,...d}=e,f=li(),m=l||f,g=r4(ok,n),x=g.currentTabStopId===m,y=nk(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:j}=g;return p.useEffect(()=>{if(s)return v(),()=>C()},[s,v,C]),r.jsx(Jp.ItemSlot,{scope:n,id:m,focusable:s,active:a,children:r.jsx(Vt.span,{tabIndex:x?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Et(e.onMouseDown,w=>{s?g.onItemFocus(m):w.preventDefault()}),onFocus:Et(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Et(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){g.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=a4(w,g.orientation,g.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=y().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const A=N.indexOf(w.currentTarget);N=g.loop?l4(N,A+1):N.slice(A+1)}setTimeout(()=>ak(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:j!=null}):c})})});ik.displayName=ok;var o4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function i4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function a4(e,t,n){const s=i4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return o4[s]}function ak(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function l4(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var c4=sk,u4=ik,Wu="Tabs",[d4]=bo(Wu,[rk]),lk=rk(),[f4,jh]=d4(Wu),ck=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...m}=e,g=tk(d),[x,y]=Pu({prop:s,onChange:a,defaultProp:l??"",caller:Wu});return r.jsx(f4,{scope:n,baseId:li(),value:x,onValueChange:y,orientation:c,dir:g,activationMode:f,children:r.jsx(Vt.div,{dir:g,"data-orientation":c,...m,ref:t})})});ck.displayName=Wu;var uk="TabsList",dk=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,l=jh(uk,n),c=lk(n);return r.jsx(c4,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(Vt.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:t})})});dk.displayName=uk;var fk="TabsTrigger",pk=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...l}=e,c=jh(fk,n),d=lk(n),f=gk(c.baseId,s),m=xk(c.baseId,s),g=s===c.value;return r.jsx(u4,{asChild:!0,...d,focusable:!a,active:g,children:r.jsx(Vt.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:f,...l,ref:t,onMouseDown:Et(e.onMouseDown,x=>{!a&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:Et(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:Et(e.onFocus,()=>{const x=c.activationMode!=="manual";!g&&!a&&x&&c.onValueChange(s)})})})});pk.displayName=fk;var mk="TabsContent",hk=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:a,children:l,...c}=e,d=jh(mk,n),f=gk(d.baseId,s),m=xk(d.baseId,s),g=s===d.value,x=p.useRef(g);return p.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(wo,{present:a||g,children:({present:y})=>r.jsx(Vt.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&l})})});hk.displayName=mk;function gk(e,t){return`${e}-trigger-${t}`}function xk(e,t){return`${e}-content-${t}`}var yk=ck,vk=dk,Xp=pk,Qp=hk;function kh({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(yk,{value:e,onValueChange:t,className:s,children:[r.jsx(vk,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(a=>r.jsxs(Xp,{value:a.value,className:ze("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:[r.jsx("span",{children:a.label}),typeof a.count=="number"?r.jsx("span",{className:"rounded-full bg-background/20 px-2 py-0.5 text-xs data-[state=active]:bg-background/20",children:a.count}):null]},a.value))}),n.map(a=>r.jsx(Qp,{value:a.value,className:"pt-3",children:a.content},a.value))]})}const p4="modulepreload",m4=function(e){return"/"+e},Hv={},h4=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(m=>{if(m=m4(m),m in Hv)return;Hv[m]=!0;const g=m.endsWith(".css"),x=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":p4,g||(y.as="script"),y.crossOrigin="",y.href=m,f&&y.setAttribute("nonce",f),document.head.appendChild(y),g)return new Promise((v,C)=>{y.addEventListener("load",v),y.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function g4({definition:e,className:t,nodeRoutes:n={}}){const s=p.useRef(null),[a,l]=p.useState(null),[c,d]=p.useState(!0),f=Tt(),m=document.documentElement.classList.contains("dark")?"dark":"default";return p.useEffect(()=>{let g=!1;async function x(){if(s.current)try{const y=(await h4(async()=>{const{default:j}=await import("./mermaid.core-B0Ixd1yP.js").then(w=>w.bF);return{default:j}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:x4(m==="dark")}),g)return;const v=`mermaid-${Date.now()}`,{svg:C}=await y.render(v,e);if(g||!s.current)return;s.current.innerHTML=C,y4(s.current,n,f),d(!1)}catch(y){g||(l(y instanceof Error?y.message:"Failed to render graph"),d(!1))}}return d(!0),l(null),x(),()=>{g=!0}},[e,f,n,m]),a?r.jsxs("div",{className:ze("rounded-lg border border-border bg-card p-4",t),children:[r.jsxs("p",{className:"text-sm text-error-foreground",children:["Failed to render dependency graph: ",a]}),r.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):r.jsxs("div",{className:ze("rounded-lg border border-border bg-card p-4",t),children:[c&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."}),r.jsx("div",{ref:s,className:"overflow-auto"})]})}function x4(e){const t=document.documentElement,n=x=>{const y=getComputedStyle(t).getPropertyValue(x).trim();return y?`oklch(${y})`:""},s=n("--card"),a=n("--card-foreground"),l=n("--border"),c=n("--primary"),d=n("--primary-foreground"),f=n("--muted"),m=n("--muted-foreground"),g=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:a,primaryBorderColor:l,secondaryColor:f,secondaryTextColor:a,secondaryBorderColor:l,tertiaryColor:f,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:a,mainBkg:s,nodeBkg:s,nodeTextColor:a,nodeBorder:l,clusterBkg:f,clusterBorder:l,edgeLabelBackground:s,titleColor:a,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:f,labelColor:a,errorBkgColor:g,errorTextColor:d}}function y4(e,t,n){var s;for(const a of e.querySelectorAll(".node")){const l=((s=a.textContent)==null?void 0:s.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;a.style.cursor="pointer",a.setAttribute("role","link"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`Open ${l}`);const d=()=>n(c);a.addEventListener("click",d),a.addEventListener("keydown",f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),d())})}}function v4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const b4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j4={};function Wv(e,t){return(j4.jsx?w4:b4).test(e)}const k4=/[ \t\n\f\r]/g;function S4(e){return typeof e=="object"?e.type==="text"?Vv(e.value):!1:Vv(e)}function Vv(e){return e.replace(k4,"")===""}class ll{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}ll.prototype.normal={};ll.prototype.property={};ll.prototype.space=void 0;function bk(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new ll(n,s,t)}function Zp(e){return e.toLowerCase()}class Bn{constructor(t,n){this.attribute=n,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let N4=0;const Ke=jo(),Bt=jo(),em=jo(),ye=jo(),xt=jo(),fi=jo(),Yn=jo();function jo(){return 2**++N4}const tm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Bt,commaOrSpaceSeparated:Yn,commaSeparated:fi,number:ye,overloadedBoolean:em,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),cp=Object.keys(tm);class Sh extends Bn{constructor(t,n,s,a){let l=-1;if(super(t,n),qv(this,"space",a),typeof s=="number")for(;++l<cp.length;){const c=cp[l];qv(this,cp[l],(s&tm[c])===tm[c])}}}Sh.prototype.defined=!0;function qv(e,t,n){n&&(e[t]=n)}function Ti(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const l=new Sh(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[Zp(s)]=s,n[Zp(l.attribute)]=s}return new ll(t,n,e.space)}const wk=Ti({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:xt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:ye,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:xt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Bt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function jk(e,t){return t in e?e[t]:t}function kk(e,t){return jk(e,t.toLowerCase())}const C4=Ti({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fi,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:xt,autoFocus:Ke,autoPlay:Ke,blocking:xt,capture:null,charSet:null,checked:Ke,cite:null,className:xt,cols:ye,colSpan:null,content:null,contentEditable:Bt,controls:Ke,controlsList:xt,coords:ye|fi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:em,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:xt,height:ye,hidden:em,high:ye,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ke,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ke,optimum:ye,pattern:null,ping:xt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:xt,required:Ke,reversed:Ke,rows:ye,rowSpan:ye,sandbox:xt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Bt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:kk}),E4=Ti({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Yn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fi,g2:fi,glyphName:fi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:jk}),Sk=Ti({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Nk=Ti({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kk}),Ck=Ti({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),T4={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},P4=/[A-Z]/g,Kv=/-[a-z]/g,R4=/^data[-\w.:]+$/i;function A4(e,t){const n=Zp(t);let s=t,a=Bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&R4.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Kv,O4);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Kv.test(l)){let c=l.replace(P4,D4);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Sh}return new a(s,t)}function D4(e){return"-"+e.toLowerCase()}function O4(e){return e.charAt(1).toUpperCase()}const I4=bk([wk,C4,Sk,Nk,Ck],"html"),Nh=bk([wk,E4,Sk,Nk,Ck],"svg");function L4(e){return e.join(" ").trim()}var Xo={},up,Gv;function $4(){if(Gv)return up;Gv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
481
- `,m="/",g="*",x="",y="comment",v="declaration";function C(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var T=1,N=1;function A(U){var Y=U.match(t);Y&&(T+=Y.length);var z=U.lastIndexOf(f);N=~z?U.length-z:N+U.length}function $(){var U={line:T,column:N};return function(Y){return Y.position=new R(U),K(),Y}}function R(U){this.start=U,this.end={line:T,column:N},this.source=S.source}R.prototype.content=w;function O(U){var Y=new Error(S.source+":"+T+":"+N+": "+U);if(Y.reason=U,Y.filename=S.source,Y.line=T,Y.column=N,Y.source=w,!S.silent)throw Y}function I(U){var Y=U.exec(w);if(Y){var z=Y[0];return A(z),w=w.slice(z.length),Y}}function K(){I(n)}function X(U){var Y;for(U=U||[];Y=_();)Y!==!1&&U.push(Y);return U}function _(){var U=$();if(!(m!=w.charAt(0)||g!=w.charAt(1))){for(var Y=2;x!=w.charAt(Y)&&(g!=w.charAt(Y)||m!=w.charAt(Y+1));)++Y;if(Y+=2,x===w.charAt(Y-1))return O("End of comment missing");var z=w.slice(2,Y-2);return N+=2,A(z),w=w.slice(Y),N+=2,U({type:y,comment:z})}}function H(){var U=$(),Y=I(s);if(Y){if(_(),!I(a))return O("property missing ':'");var z=I(l),V=U({type:v,property:j(Y[0].replace(e,x)),value:z?j(z[0].replace(e,x)):x});return I(c),V}}function J(){var U=[];X(U);for(var Y;Y=H();)Y!==!1&&(U.push(Y),X(U));return U}return K(),J()}function j(w){return w?w.replace(d,x):x}return up=C,up}var Yv;function M4(){if(Yv)return Xo;Yv=1;var e=Xo&&Xo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;const t=e($4());function n(s,a){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),d=typeof a=="function";return c.forEach(f=>{if(f.type!=="declaration")return;const{property:m,value:g}=f;d?a(m,g,f):g&&(l=l||{},l[m]=g)}),l}return Xo}var ba={},Jv;function _4(){if(Jv)return ba;Jv=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},c=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},f=function(m,g){return g===void 0&&(g={}),l(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(a,d):m=m.replace(s,d),m.replace(t,c))};return ba.camelCase=f,ba}var wa,Xv;function F4(){if(Xv)return wa;Xv=1;var e=wa&&wa.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(M4()),n=_4();function s(a,l){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(c[(0,n.camelCase)(d,l)]=f)}),c}return s.default=s,wa=s,wa}var z4=F4();const B4=wu(z4),Ek=Tk("end"),Ch=Tk("start");function Tk(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function U4(e){const t=Ch(e),n=Ek(e);if(t&&n)return{start:t,end:n}}function Da(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qv(e.position):"start"in e||"end"in e?Qv(e):"line"in e||"column"in e?nm(e):""}function nm(e){return Zv(e&&e.line)+":"+Zv(e&&e.column)}function Qv(e){return nm(e&&e.start)+"-"+nm(e&&e.end)}function Zv(e){return e&&typeof e=="number"?e:1}class jn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(c=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const f=s.indexOf(":");f===-1?l.ruleId=s:(l.source=s.slice(0,f),l.ruleId=s.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=Da(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const Eh={}.hasOwnProperty,H4=new Map,W4=/[A-Z]/g,V4=new Set(["table","tbody","thead","tfoot","tr"]),q4=new Set(["td","th"]),Pk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function K4(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=tO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=eO(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Nh:I4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Rk(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function Rk(e,t,n){if(t.type==="element")return G4(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Y4(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return X4(e,t,n);if(t.type==="mdxjsEsm")return J4(e,t);if(t.type==="root")return Q4(e,t,n);if(t.type==="text")return Z4(e,t)}function G4(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=Nh,e.schema=a),e.ancestors.push(t);const l=Dk(e,t.tagName,!1),c=nO(e,t);let d=Ph(e,t);return V4.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!S4(f):!0})),Ak(e,c,l,t),Th(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function Y4(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Ga(e,t.position)}function J4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ga(e,t.position)}function X4(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=Nh,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:Dk(e,t.name,!0),c=rO(e,t),d=Ph(e,t);return Ak(e,c,l,t),Th(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function Q4(e,t,n){const s={};return Th(s,Ph(e,t)),e.create(t,e.Fragment,s,n)}function Z4(e,t){return t.value}function Ak(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Th(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eO(e,t,n){return s;function s(a,l,c,d){const m=Array.isArray(c.children)?n:t;return d?m(l,c,d):m(l,c)}}function tO(e,t){return n;function n(s,a,l,c){const d=Array.isArray(l.children),f=Ch(s);return t(a,l,c,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function nO(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&Eh.call(t.properties,a)){const l=sO(e,a,t.properties[a]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&q4.has(t.tagName)?s=d:n[c]=d}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function rO(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.data.estree.body[0];l.type;const c=l.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Ga(e,t.position);else{const a=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else Ga(e,t.position);else l=s.value===null?!0:s.value;n[a]=l}return n}function Ph(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:H4;for(;++s<t.children.length;){const l=t.children[s];let c;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const m=a.get(f)||0;c=f+"-"+m,a.set(f,m+1)}}const d=Rk(e,l,c);d!==void 0&&n.push(d)}return n}function sO(e,t,n){const s=A4(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?v4(n):L4(n)),s.property==="style"){let a=typeof n=="object"?n:oO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=iO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?T4[s.property]||s.property:s.attribute,n]}}function oO(e,t){try{return B4(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Pk+"#cannot-parse-style-attribute",a}}function Dk(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,c;for(;++l<a.length;){const d=Wv(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}s=c}else s=Wv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return Eh.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ga(e)}function Ga(e,t){const n=new jn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Pk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iO(e){const t={};let n;for(n in e)Eh.call(e,n)&&(t[aO(n)]=e[n]);return t}function aO(e){let t=e.replace(W4,lO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lO(e){return"-"+e.toLowerCase()}const dp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},cO={};function uO(e,t){const n=cO,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ok(e,s,a)}function Ok(e,t,n){if(dO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eb(e.children,t,n)}return Array.isArray(e)?eb(e,t,n):""}function eb(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=Ok(e[a],t,n);return s.join("")}function dO(e){return!!(e&&typeof e=="object")}const tb=document.createElement("i");function Rh(e){const t="&"+e+";";tb.innerHTML=t;const n=tb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yr(e,t,n,s){const a=e.length;let l=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<s.length;)c=s.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function lr(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}const nb={}.hasOwnProperty;function fO(e){const t={};let n=-1;for(;++n<e.length;)pO(t,e[n]);return t}function pO(e,t){let n;for(n in t){const a=(nb.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){nb.call(a,c)||(a[c]=[]);const d=l[c];mO(a[c],Array.isArray(d)?d:d?[d]:[])}}}function mO(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Yr(e,0,0,s)}function Ik(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fr=Xs(/[A-Za-z]/),Qn=Xs(/[\dA-Za-z]/),hO=Xs(/[#-'*+\--9=?A-Z^-~]/);function rm(e){return e!==null&&(e<32||e===127)}const sm=Xs(/\d/),gO=Xs(/[\dA-Fa-f]/),xO=Xs(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Fn(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const yO=Xs(new RegExp("\\p{P}|\\p{S}","u")),vO=Xs(/\s/);function Xs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pi(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&Qn(e.charCodeAt(n+1))&&Qn(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(c=String.fromCharCode(l,d),a=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function yt(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(f){return rt(f)?(e.enter(n),d(f)):t(f)}function d(f){return rt(f)&&l++<a?(e.consume(f),d):(e.exit(n),t(f))}}const bO={tokenize:wO};function wO(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),yt(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),l(d)}function l(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ue(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const jO={tokenize:kO},rb={tokenize:SO};function kO(e){const t=this,n=[];let s=0,a,l,c;return d;function d(N){if(s<n.length){const A=n[s];return t.containerState=A[1],e.attempt(A[0].continuation,f,m)(N)}return m(N)}function f(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&T();const A=t.events.length;let $=A,R;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){R=t.events[$][1].end;break}S(s);let O=A;for(;O<t.events.length;)t.events[O][1].end={...R},O++;return Yr(t.events,$+1,0,t.events.slice(A)),t.events.length=O,m(N)}return d(N)}function m(N){if(s===n.length){if(!a)return y(N);if(a.currentConstruct&&a.currentConstruct.concrete)return C(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rb,g,x)(N)}function g(N){return a&&T(),S(s),y(N)}function x(N){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,C(N)}function y(N){return t.containerState={},e.attempt(rb,v,C)(N)}function v(N){return s++,n.push([t.currentConstruct,t.containerState]),y(N)}function C(N){if(N===null){a&&T(),S(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),j(N)}function j(N){if(N===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Ue(N)?(e.consume(N),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(N),j)}function w(N,A){const $=t.sliceStream(N);if(A&&$.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write($),t.parser.lazy[N.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<c&&(!a.events[R][1].end||a.events[R][1].end.offset>c))return;const O=t.events.length;let I=O,K,X;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(K){X=t.events[I][1].end;break}K=!0}for(S(s),R=O;R<t.events.length;)t.events[R][1].end={...X},R++;Yr(t.events,I+1,0,t.events.slice(O)),t.events.length=R}}function S(N){let A=n.length;for(;A-- >N;){const $=n[A];t.containerState=$[1],$[0].exit.call(t,e)}n.length=N}function T(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function SO(e,t,n){return yt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sb(e){if(e===null||Fn(e)||vO(e))return 1;if(yO(e))return 2}function Ah(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!s.includes(l)&&(t=l(t,n),s.push(l))}return t}const om={name:"attention",resolveAll:NO,tokenize:CO};function NO(e,t){let n=-1,s,a,l,c,d,f,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[s][1].end},y={...e[n][1].start};ob(x,-f),ob(y,f),c={type:f>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:f>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[s][1].end={...c.start},e[n][1].start={...d.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=lr(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=lr(m,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=lr(m,Ah(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=lr(m,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=lr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Yr(e,s-1,n-s+3,m),n=s+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CO(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=sb(s);let l;return c;function c(f){return l=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===l)return e.consume(f),d;const m=e.exit("attentionSequence"),g=sb(f),x=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(s);return m._open=!!(l===42?x:x&&(a||!y)),m._close=!!(l===42?y:y&&(g||!x)),t(f)}}function ob(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const EO={name:"autolink",tokenize:TO};function TO(e,t,n){let s=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Fr(v)?(e.consume(v),c):v===64?n(v):m(v)}function c(v){return v===43||v===45||v===46||Qn(v)?(s=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),s=0,f):(v===43||v===45||v===46||Qn(v))&&s++<32?(e.consume(v),d):(s=0,m(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||rm(v)?n(v):(e.consume(v),f)}function m(v){return v===64?(e.consume(v),g):hO(v)?(e.consume(v),m):n(v)}function g(v){return Qn(v)?x(v):n(v)}function x(v){return v===46?(e.consume(v),s=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Qn(v))&&s++<63){const C=v===45?y:x;return e.consume(v),C}return n(v)}}const Vu={partial:!0,tokenize:PO};function PO(e,t,n){return s;function s(l){return rt(l)?yt(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Ue(l)?t(l):n(l)}}const Lk={continuation:{tokenize:AO},exit:DO,name:"blockQuote",tokenize:RO};function RO(e,t,n){const s=this;return a;function a(c){if(c===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return rt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function AO(e,t,n){const s=this;return a;function a(c){return rt(c)?yt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(Lk,t,n)(c)}}function DO(e){e.exit("blockQuote")}const $k={name:"characterEscape",tokenize:OO};function OO(e,t,n){return s;function s(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return xO(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Mk={name:"characterReference",tokenize:IO};function IO(e,t,n){const s=this;let a=0,l,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),f}function f(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=Qn,g(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=gO,g):(e.enter("characterReferenceValue"),l=7,c=sm,g(x))}function g(x){if(x===59&&a){const y=e.exit("characterReferenceValue");return c===Qn&&!Rh(s.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&a++<l?(e.consume(x),g):n(x)}}const ib={partial:!0,tokenize:$O},ab={concrete:!0,name:"codeFenced",tokenize:LO};function LO(e,t,n){const s=this,a={partial:!0,tokenize:$};let l=0,c=0,d;return f;function f(R){return m(R)}function m(R){const O=s.events[s.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,d=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===d?(c++,e.consume(R),g):c<3?n(R):(e.exit("codeFencedFenceSequence"),rt(R)?yt(e,x,"whitespace")(R):x(R))}function x(R){return R===null||Ue(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(ib,j,A)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Ue(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(R)):rt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yt(e,v,"whitespace")(R)):R===96&&R===d?n(R):(e.consume(R),y)}function v(R){return R===null||Ue(R)?x(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Ue(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(R)):R===96&&R===d?n(R):(e.consume(R),C)}function j(R){return e.attempt(a,A,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return l>0&&rt(R)?yt(e,T,"linePrefix",l+1)(R):T(R)}function T(R){return R===null||Ue(R)?e.check(ib,j,A)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Ue(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),N)}function A(R){return e.exit("codeFenced"),t(R)}function $(R,O,I){let K=0;return X;function X(Y){return R.enter("lineEnding"),R.consume(Y),R.exit("lineEnding"),_}function _(Y){return R.enter("codeFencedFence"),rt(Y)?yt(R,H,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):H(Y)}function H(Y){return Y===d?(R.enter("codeFencedFenceSequence"),J(Y)):I(Y)}function J(Y){return Y===d?(K++,R.consume(Y),J):K>=c?(R.exit("codeFencedFenceSequence"),rt(Y)?yt(R,U,"whitespace")(Y):U(Y)):I(Y)}function U(Y){return Y===null||Ue(Y)?(R.exit("codeFencedFence"),O(Y)):I(Y)}}}function $O(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const fp={name:"codeIndented",tokenize:_O},MO={partial:!0,tokenize:FO};function _O(e,t,n){const s=this;return a;function a(m){return e.enter("codeIndented"),yt(e,l,"linePrefix",5)(m)}function l(m){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?f(m):Ue(m)?e.attempt(MO,c,f)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Ue(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function f(m){return e.exit("codeIndented"),t(m)}}function FO(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):Ue(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):yt(e,l,"linePrefix",5)(c)}function l(c){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ue(c)?a(c):n(c)}}const zO={name:"codeText",previous:UO,resolve:BO,tokenize:HO};function BO(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function UO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function HO(e,t,n){let s=0,a,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),s++,d):(e.exit("codeTextSequence"),f(x))}function f(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),f):x===96?(l=e.enter("codeTextSequence"),a=0,g(x)):Ue(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),f):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Ue(x)?(e.exit("codeTextData"),f(x)):(e.consume(x),m)}function g(x){return x===96?(e.consume(x),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class WO{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&ja(this.left,s),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ja(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ja(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ja(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ja(this.left,n.reverse())}}}function ja(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _k(e){const t={};let n=-1,s,a,l,c,d,f,m;const g=new WO(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(s=g.get(n),n&&s[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=s[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,VO(g,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,a=void 0;l--;)if(c=g.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(s),g.splice(a,n-a+1,d))}}return Yr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function VO(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const l=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,f=[],m={};let g,x,y=-1,v=n,C=0,j=0;const w=[j];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(g=s.sliceStream(v),v.next||g.push(null),x&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(j=y+1,w.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):w.pop(),y=w.length;y--;){const S=d.slice(w[y],w[y+1]),T=l.pop();f.push([T,T+S.length-1]),e.splice(T,2,S)}for(f.reverse(),y=-1;++y<f.length;)m[C+f[y][0]]=C+f[y][1],C+=f[y][1]-f[y][0]-1;return m}const qO={resolve:GO,tokenize:YO},KO={partial:!0,tokenize:JO};function GO(e){return _k(e),e}function YO(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?l(d):Ue(d)?e.check(KO,c,l)(d):(e.consume(d),a)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function JO(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),yt(e,l,"linePrefix")}function l(c){if(c===null||Ue(c))return n(c);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function Fk(e,t,n,s,a,l,c,d,f){const m=f||Number.POSITIVE_INFINITY;let g=0;return x;function x(S){return S===60?(e.enter(s),e.enter(a),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||rm(S)?n(S):(e.enter(s),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),j(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(d),y(S)):S===null||S===60||Ue(S)?n(S):(e.consume(S),S===92?C:v)}function C(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function j(S){return!g&&(S===null||S===41||Fn(S))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(s),t(S)):g<m&&S===40?(e.consume(S),g++,j):S===41?(e.consume(S),g--,j):S===null||S===32||S===40||rm(S)?n(S):(e.consume(S),S===92?w:j)}function w(S){return S===40||S===41||S===92?(e.consume(S),j):j(S)}}function zk(e,t,n,s,a,l){const c=this;let d=0,f;return m;function m(v){return e.enter(s),e.enter(a),e.consume(v),e.exit(a),e.enter(l),g}function g(v){return d>999||v===null||v===91||v===93&&!f||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(s),t):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Ue(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),f||(f=!rt(v)),v===92?y:x)}function y(v){return v===91||v===92||v===93?(e.consume(v),d++,x):x(v)}}function Bk(e,t,n,s,a,l){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(s),e.enter(a),e.consume(y),e.exit(a),c=y===40?41:y,f):n(y)}function f(y){return y===c?(e.enter(a),e.consume(y),e.exit(a),e.exit(s),t):(e.enter(l),m(y))}function m(y){return y===c?(e.exit(l),f(c)):y===null?n(y):Ue(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),yt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===c||y===null||Ue(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?x:g)}function x(y){return y===c||y===92?(e.consume(y),g):g(y)}}function Oa(e,t){let n;return s;function s(a){return Ue(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):rt(a)?yt(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const XO={name:"definition",tokenize:ZO},QO={partial:!0,tokenize:eI};function ZO(e,t,n){const s=this;let a;return l;function l(v){return e.enter("definition"),c(v)}function c(v){return zk.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return a=pi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):n(v)}function f(v){return Fn(v)?Oa(e,m)(v):m(v)}function m(v){return Fk(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(QO,x,x)(v)}function x(v){return rt(v)?yt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ue(v)?(e.exit("definition"),s.parser.defined.push(a),t(v)):n(v)}}function eI(e,t,n){return s;function s(d){return Fn(d)?Oa(e,a)(d):n(d)}function a(d){return Bk(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return rt(d)?yt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ue(d)?t(d):n(d)}}const tI={name:"hardBreakEscape",tokenize:nI};function nI(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Ue(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const rI={name:"headingAtx",resolve:sI,tokenize:oI};function sI(e,t){let n=e.length-2,s=3,a,l;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},l={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Yr(e,s,n-s+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function oI(e,t,n){let s=0;return a;function a(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&s++<6?(e.consume(g),c):g===null||Fn(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||Ue(g)?(e.exit("atxHeading"),t(g)):rt(g)?yt(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||Fn(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const iI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lb=["pre","script","style","textarea"],aI={concrete:!0,name:"htmlFlow",resolveTo:uI,tokenize:dI},lI={partial:!0,tokenize:pI},cI={partial:!0,tokenize:fI};function uI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dI(e,t,n){const s=this;let a,l,c,d,f;return m;function m(L){return g(L)}function g(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),x}function x(L){return L===33?(e.consume(L),y):L===47?(e.consume(L),l=!0,j):L===63?(e.consume(L),a=3,s.interrupt?t:E):Fr(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function y(L){return L===45?(e.consume(L),a=2,v):L===91?(e.consume(L),a=5,d=0,C):Fr(L)?(e.consume(L),a=4,s.interrupt?t:E):n(L)}function v(L){return L===45?(e.consume(L),s.interrupt?t:E):n(L)}function C(L){const ae="CDATA[";return L===ae.charCodeAt(d++)?(e.consume(L),d===ae.length?s.interrupt?t:H:C):n(L)}function j(L){return Fr(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||Fn(L)){const ae=L===47,ce=c.toLowerCase();return!ae&&!l&&lb.includes(ce)?(a=1,s.interrupt?t(L):H(L)):iI.includes(c.toLowerCase())?(a=6,ae?(e.consume(L),S):s.interrupt?t(L):H(L)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(L):l?T(L):N(L))}return L===45||Qn(L)?(e.consume(L),c+=String.fromCharCode(L),w):n(L)}function S(L){return L===62?(e.consume(L),s.interrupt?t:H):n(L)}function T(L){return rt(L)?(e.consume(L),T):X(L)}function N(L){return L===47?(e.consume(L),X):L===58||L===95||Fr(L)?(e.consume(L),A):rt(L)?(e.consume(L),N):X(L)}function A(L){return L===45||L===46||L===58||L===95||Qn(L)?(e.consume(L),A):$(L)}function $(L){return L===61?(e.consume(L),R):rt(L)?(e.consume(L),$):N(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),f=L,O):rt(L)?(e.consume(L),R):I(L)}function O(L){return L===f?(e.consume(L),f=null,K):L===null||Ue(L)?n(L):(e.consume(L),O)}function I(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Fn(L)?$(L):(e.consume(L),I)}function K(L){return L===47||L===62||rt(L)?N(L):n(L)}function X(L){return L===62?(e.consume(L),_):n(L)}function _(L){return L===null||Ue(L)?H(L):rt(L)?(e.consume(L),_):n(L)}function H(L){return L===45&&a===2?(e.consume(L),z):L===60&&a===1?(e.consume(L),V):L===62&&a===4?(e.consume(L),M):L===63&&a===3?(e.consume(L),E):L===93&&a===5?(e.consume(L),Q):Ue(L)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(lI,ee,J)(L)):L===null||Ue(L)?(e.exit("htmlFlowData"),J(L)):(e.consume(L),H)}function J(L){return e.check(cI,U,ee)(L)}function U(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Y}function Y(L){return L===null||Ue(L)?J(L):(e.enter("htmlFlowData"),H(L))}function z(L){return L===45?(e.consume(L),E):H(L)}function V(L){return L===47?(e.consume(L),c="",D):H(L)}function D(L){if(L===62){const ae=c.toLowerCase();return lb.includes(ae)?(e.consume(L),M):H(L)}return Fr(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),D):H(L)}function Q(L){return L===93?(e.consume(L),E):H(L)}function E(L){return L===62?(e.consume(L),M):L===45&&a===2?(e.consume(L),E):H(L)}function M(L){return L===null||Ue(L)?(e.exit("htmlFlowData"),ee(L)):(e.consume(L),M)}function ee(L){return e.exit("htmlFlow"),t(L)}}function fI(e,t,n){const s=this;return a;function a(c){return Ue(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):n(c)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function pI(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Vu,t,n)}}const mI={name:"htmlText",tokenize:hI};function hI(e,t,n){const s=this;let a,l,c;return d;function d(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),m):E===47?(e.consume(E),$):E===63?(e.consume(E),N):Fr(E)?(e.consume(E),I):n(E)}function m(E){return E===45?(e.consume(E),g):E===91?(e.consume(E),l=0,C):Fr(E)?(e.consume(E),T):n(E)}function g(E){return E===45?(e.consume(E),v):n(E)}function x(E){return E===null?n(E):E===45?(e.consume(E),y):Ue(E)?(c=x,V(E)):(e.consume(E),x)}function y(E){return E===45?(e.consume(E),v):x(E)}function v(E){return E===62?z(E):E===45?y(E):x(E)}function C(E){const M="CDATA[";return E===M.charCodeAt(l++)?(e.consume(E),l===M.length?j:C):n(E)}function j(E){return E===null?n(E):E===93?(e.consume(E),w):Ue(E)?(c=j,V(E)):(e.consume(E),j)}function w(E){return E===93?(e.consume(E),S):j(E)}function S(E){return E===62?z(E):E===93?(e.consume(E),S):j(E)}function T(E){return E===null||E===62?z(E):Ue(E)?(c=T,V(E)):(e.consume(E),T)}function N(E){return E===null?n(E):E===63?(e.consume(E),A):Ue(E)?(c=N,V(E)):(e.consume(E),N)}function A(E){return E===62?z(E):N(E)}function $(E){return Fr(E)?(e.consume(E),R):n(E)}function R(E){return E===45||Qn(E)?(e.consume(E),R):O(E)}function O(E){return Ue(E)?(c=O,V(E)):rt(E)?(e.consume(E),O):z(E)}function I(E){return E===45||Qn(E)?(e.consume(E),I):E===47||E===62||Fn(E)?K(E):n(E)}function K(E){return E===47?(e.consume(E),z):E===58||E===95||Fr(E)?(e.consume(E),X):Ue(E)?(c=K,V(E)):rt(E)?(e.consume(E),K):z(E)}function X(E){return E===45||E===46||E===58||E===95||Qn(E)?(e.consume(E),X):_(E)}function _(E){return E===61?(e.consume(E),H):Ue(E)?(c=_,V(E)):rt(E)?(e.consume(E),_):K(E)}function H(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,J):Ue(E)?(c=H,V(E)):rt(E)?(e.consume(E),H):(e.consume(E),U)}function J(E){return E===a?(e.consume(E),a=void 0,Y):E===null?n(E):Ue(E)?(c=J,V(E)):(e.consume(E),J)}function U(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Fn(E)?K(E):(e.consume(E),U)}function Y(E){return E===47||E===62||Fn(E)?K(E):n(E)}function z(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function V(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),D}function D(E){return rt(E)?yt(e,Q,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):Q(E)}function Q(E){return e.enter("htmlTextData"),c(E)}}const Dh={name:"labelEnd",resolveAll:vI,resolveTo:bI,tokenize:wI},gI={tokenize:jI},xI={tokenize:kI},yI={tokenize:SI};function vI(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&Yr(e,0,e.length,n),e}function bI(e,t){let n=e.length,s=0,a,l,c,d;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",f,t],["enter",m,t]],d=lr(d,e.slice(l+1,l+s+3)),d=lr(d,[["enter",g,t]]),d=lr(d,Ah(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),d=lr(d,[["exit",g,t],e[c-2],e[c-1],["exit",m,t]]),d=lr(d,e.slice(c+1)),d=lr(d,[["exit",f,t]]),Yr(e,l,e.length,d),e}function wI(e,t,n){const s=this;let a=s.events.length,l,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){l=s.events[a][1];break}return d;function d(y){return l?l._inactive?x(y):(c=s.parser.defined.includes(pi(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(gI,g,c?g:x)(y):y===91?e.attempt(xI,g,c?m:x)(y):c?g(y):x(y)}function m(y){return e.attempt(yI,g,x)(y)}function g(y){return t(y)}function x(y){return l._balanced=!0,n(y)}}function jI(e,t,n){return s;function s(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),a}function a(x){return Fn(x)?Oa(e,l)(x):l(x)}function l(x){return x===41?g(x):Fk(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return Fn(x)?Oa(e,f)(x):g(x)}function d(x){return n(x)}function f(x){return x===34||x===39||x===40?Bk(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function m(x){return Fn(x)?Oa(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function kI(e,t,n){const s=this;return a;function a(d){return zk.call(s,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return s.parser.defined.includes(pi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function SI(e,t,n){return s;function s(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const NI={name:"labelStartImage",resolveAll:Dh.resolveAll,tokenize:CI};function CI(e,t,n){const s=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):t(d)}}const EI={name:"labelStartLink",resolveAll:Dh.resolveAll,tokenize:TI};function TI(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const pp={name:"lineEnding",tokenize:PI};function PI(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),yt(e,t,"linePrefix")}}const Qc={name:"thematicBreak",tokenize:RI};function RI(e,t,n){let s=0,a;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return a=m,d(m)}function d(m){return m===a?(e.enter("thematicBreakSequence"),f(m)):s>=3&&(m===null||Ue(m))?(e.exit("thematicBreak"),t(m)):n(m)}function f(m){return m===a?(e.consume(m),s++,f):(e.exit("thematicBreakSequence"),rt(m)?yt(e,d,"whitespace")(m):d(m))}}const $n={continuation:{tokenize:II},exit:$I,name:"list",tokenize:OI},AI={partial:!0,tokenize:MI},DI={partial:!0,tokenize:LI};function OI(e,t,n){const s=this,a=s.events[s.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return d;function d(v){const C=s.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||v===s.containerState.marker:sm(v)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Qc,n,m)(v):m(v);if(!s.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return n(v)}function f(v){return sm(v)&&++c<10?(e.consume(v),f):(!s.interrupt||c<2)&&(s.containerState.marker?v===s.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||v,e.check(Vu,s.interrupt?n:g,e.attempt(AI,y,x))}function g(v){return s.containerState.initialBlankLine=!0,l++,y(v)}function x(v){return rt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function II(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Vu,a,l);function a(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,yt(e,t,"listItemIndent",s.containerState.size+1)(d)}function l(d){return s.containerState.furtherBlankLines||!rt(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(DI,t,c)(d))}function c(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,yt(e,e.attempt($n,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function LI(e,t,n){const s=this;return yt(e,a,"listItemIndent",s.containerState.size+1);function a(l){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(l):n(l)}}function $I(e){e.exit(this.containerState.type)}function MI(e,t,n){const s=this;return yt(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const c=s.events[s.events.length-1];return!rt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const cb={name:"setextUnderline",resolveTo:_I,tokenize:FI};function _I(e,t){let n=e.length,s,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",c,t]),e.splice(l+1,0,["exit",e[s][1],t]),e[s][1].end={...e[l][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function FI(e,t,n){const s=this;let a;return l;function l(m){let g=s.events.length,x;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){x=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||x)?(e.enter("setextHeadingLine"),a=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===a?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),rt(m)?yt(e,f,"lineSuffix")(m):f(m))}function f(m){return m===null||Ue(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const zI={tokenize:BI};function BI(e){const t=this,n=e.attempt(Vu,s,e.attempt(this.parser.constructs.flowInitial,a,yt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(qO,a)),"linePrefix")));return n;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const UI={resolveAll:Hk()},HI=Uk("string"),WI=Uk("text");function Uk(e){return{resolveAll:Hk(e==="text"?VI:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],l=n.attempt(a,c,d);return c;function c(g){return m(g)?l(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return m(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function m(g){if(g===null)return!0;const x=a[g];let y=-1;if(x)for(;++y<x.length;){const v=x[y];if(!v.previous||v.previous.call(s,s.previous))return!0}return!1}}}function Hk(e){return t;function t(n,s){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,s):n}}function VI(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],a=t.sliceStream(s);let l=a.length,c=-1,d=0,f;for(;l--;){const m=a[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)f=!0,d++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const qI={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:Lk},KI={91:XO},GI={[-2]:fp,[-1]:fp,32:fp},YI={35:rI,42:Qc,45:[cb,Qc],60:aI,61:cb,95:Qc,96:ab,126:ab},JI={38:Mk,92:$k},XI={[-5]:pp,[-4]:pp,[-3]:pp,33:NI,38:Mk,42:om,60:[EO,mI],91:EI,92:[tI,$k],93:Dh,95:om,96:zO},QI={null:[om,UI]},ZI={null:[42,95]},eL={null:[]},tL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZI,contentInitial:KI,disable:eL,document:qI,flow:YI,flowInitial:GI,insideSpan:QI,string:JI,text:XI},Symbol.toStringTag,{value:"Module"}));function nL(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let c=[],d=[];const f={attempt:O($),check:O(R),consume:T,enter:N,exit:A,interrupt:O(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:C,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:x};let g=t.tokenize.call(m,f);return t.resolveAll&&l.push(t),m;function x(_){return c=lr(c,_),w(),c[c.length-1]!==null?[]:(I(t,0),m.events=Ah(l,m.events,m),m.events)}function y(_,H){return sL(v(_),H)}function v(_){return rL(c,_)}function C(){const{_bufferIndex:_,_index:H,line:J,column:U,offset:Y}=s;return{_bufferIndex:_,_index:H,line:J,column:U,offset:Y}}function j(_){a[_.line]=_.column,X()}function w(){let _;for(;s._index<c.length;){const H=c[s._index];if(typeof H=="string")for(_=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===_&&s._bufferIndex<H.length;)S(H.charCodeAt(s._bufferIndex));else S(H)}}function S(_){g=g(_)}function T(_){Ue(_)?(s.line++,s.column=1,s.offset+=_===-3?2:1,X()):_!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=_}function N(_,H){const J=H||{};return J.type=_,J.start=C(),m.events.push(["enter",J,m]),d.push(J),J}function A(_){const H=d.pop();return H.end=C(),m.events.push(["exit",H,m]),H}function $(_,H){I(_,H.from)}function R(_,H){H.restore()}function O(_,H){return J;function J(U,Y,z){let V,D,Q,E;return Array.isArray(U)?ee(U):"tokenize"in U?ee([U]):M(U);function M(Z){return ge;function ge(je){const Ne=je!==null&&Z[je],ke=je!==null&&Z.null,We=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return ee(We)(je)}}function ee(Z){return V=Z,D=0,Z.length===0?z:L(Z[D])}function L(Z){return ge;function ge(je){return E=K(),Q=Z,Z.partial||(m.currentConstruct=Z),Z.name&&m.parser.constructs.disable.null.includes(Z.name)?ce():Z.tokenize.call(H?Object.assign(Object.create(m),H):m,f,ae,ce)(je)}}function ae(Z){return _(Q,E),Y}function ce(Z){return E.restore(),++D<V.length?L(V[D]):z}}}function I(_,H){_.resolveAll&&!l.includes(_)&&l.push(_),_.resolve&&Yr(m.events,H,m.events.length-H,_.resolve(m.events.slice(H),m)),_.resolveTo&&(m.events=_.resolveTo(m.events,m))}function K(){const _=C(),H=m.previous,J=m.currentConstruct,U=m.events.length,Y=Array.from(d);return{from:U,restore:z};function z(){s=_,m.previous=H,m.currentConstruct=J,m.events.length=U,d=Y,X()}}function X(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function rL(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,l)];else{if(c=e.slice(n,a),s>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(s):c.shift()}l>0&&c.push(e[a].slice(0,l))}return c}function sL(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const l=e[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
482
- `;break}case-3:{c=`\r
483
- `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(l)}a=l===-2,s.push(c)}return s.join("")}function oL(e){const s={constructs:fO([tL,...(e||{}).extensions||[]]),content:a(bO),defined:[],document:a(jO),flow:a(zI),lazy:{},string:a(HI),text:a(WI)};return s;function a(l){return c;function c(d){return nL(s,l,d)}}}function iL(e){for(;!_k(e););return e}const ub=/[\0\t\n\r]/g;function aL(){let e=1,t="",n=!0,s;return a;function a(l,c,d){const f=[];let m,g,x,y,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),x=0,t="",n&&(l.charCodeAt(0)===65279&&x++,n=void 0);x<l.length;){if(ub.lastIndex=x,m=ub.exec(l),y=m&&m.index!==void 0?m.index:l.length,v=l.charCodeAt(y),!m){t=l.slice(x);break}if(v===10&&x===y&&s)f.push(-3),s=void 0;else switch(s&&(f.push(-5),s=void 0),x<y&&(f.push(l.slice(x,y)),e+=y-x),v){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:s=!0,e=1}x=y+1}return d&&(s&&f.push(-5),t&&f.push(t),f.push(null)),f}}const lL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cL(e){return e.replace(lL,uL)}function uL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return Ik(n.slice(l?2:1),l?16:10)}return Rh(n)||e}const Wk={}.hasOwnProperty;function dL(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),fL(n)(iL(oL(n).document().write(aL()(e,t,!0))))}function fL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(_e),autolinkProtocol:K,autolinkEmail:K,atxHeading:l(le),blockQuote:l(ke),characterEscape:K,characterReference:K,codeFenced:l(We),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(We,c),codeText:l(Ye,c),codeTextData:K,data:K,codeFlowValue:K,definition:l(ie),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(ne),hardBreakEscape:l(W),hardBreakTrailing:l(W),htmlFlow:l(pe,c),htmlFlowData:K,htmlText:l(pe,c),htmlTextData:K,image:l(ve),label:c,link:l(_e),listItem:l(st),listItemValue:y,listOrdered:l(Oe,x),listUnordered:l(Oe),paragraph:l(lt),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(le),strong:l(_t),thematicBreak:l(Nt)},exit:{atxHeading:f(),atxHeadingSequence:$,autolink:f(),autolinkEmail:Ne,autolinkProtocol:je,blockQuote:f(),characterEscapeValue:X,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Z,characterReference:ge,codeFenced:f(w),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:C,codeFlowValue:X,codeIndented:f(S),codeText:f(Y),codeTextData:X,data:X,definition:f(),definitionDestinationString:A,definitionLabelString:T,definitionTitleString:N,emphasis:f(),hardBreakEscape:f(H),hardBreakTrailing:f(H),htmlFlow:f(J),htmlFlowData:X,htmlText:f(U),htmlTextData:X,image:f(V),label:Q,labelText:D,lineEnding:_,link:f(z),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ae,resourceDestinationString:E,resourceTitleString:M,resource:ee,setextHeading:f(I),setextHeadingLineSequence:O,setextHeadingText:R,strong:f(),thematicBreak:f()}};Vk(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(se){let me={type:"root",children:[]};const Pe={stack:[me],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:g,data:n},Fe=[];let Ve=-1;for(;++Ve<se.length;)if(se[Ve][1].type==="listOrdered"||se[Ve][1].type==="listUnordered")if(se[Ve][0]==="enter")Fe.push(Ve);else{const tt=Fe.pop();Ve=a(se,tt,Ve)}for(Ve=-1;++Ve<se.length;){const tt=t[se[Ve][0]];Wk.call(tt,se[Ve][1].type)&&tt[se[Ve][1].type].call(Object.assign({sliceSerialize:se[Ve][2].sliceSerialize},Pe),se[Ve][1])}if(Pe.tokenStack.length>0){const tt=Pe.tokenStack[Pe.tokenStack.length-1];(tt[1]||db).call(Pe,void 0,tt[0])}for(me.position={start:_s(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:_s(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)me=t.transforms[Ve](me)||me;return me}function a(se,me,Pe){let Fe=me-1,Ve=-1,tt=!1,cn,ue,Ge,He;for(;++Fe<=Pe;){const mt=se[Fe];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?Ve++:Ve--,He=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(cn&&!He&&!Ve&&!Ge&&(Ge=Fe),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!Ve&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||Ve===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(cn){let Tn=Fe;for(ue=void 0;Tn--;){const Qt=se[Tn];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;ue&&(se[ue][1].type="lineEndingBlank",tt=!0),Qt[1].type="lineEnding",ue=Tn}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}Ge&&(!ue||Ge<ue)&&(cn._spread=!0),cn.end=Object.assign({},ue?se[ue][1].start:mt[1].end),se.splice(ue||Fe,0,["exit",cn,mt[2]]),Fe++,Pe++}if(mt[1].type==="listItemPrefix"){const Tn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};cn=Tn,se.splice(Fe,0,["enter",Tn,mt[2]]),Fe++,Pe++,Ge=void 0,He=!0}}}return se[me][1]._spread=tt,Pe}function l(se,me){return Pe;function Pe(Fe){d.call(this,se(Fe),Fe),me&&me.call(this,Fe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(se,me,Pe){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([me,Pe||void 0]),se.position={start:_s(me.start),end:void 0}}function f(se){return me;function me(Pe){se&&se.call(this,Pe),m.call(this,Pe)}}function m(se,me){const Pe=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==se.type&&(me?me.call(this,se,Fe[0]):(Fe[1]||db).call(this,se,Fe[0]));else throw new Error("Cannot close `"+se.type+"` ("+Da({start:se.start,end:se.end})+"): it’s not open");Pe.position.end=_s(se.end)}function g(){return uO(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(se){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function v(){const se=this.resume(),me=this.stack[this.stack.length-1];me.lang=se}function C(){const se=this.resume(),me=this.stack[this.stack.length-1];me.meta=se}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const se=this.resume(),me=this.stack[this.stack.length-1];me.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const se=this.resume(),me=this.stack[this.stack.length-1];me.value=se.replace(/(\r?\n|\r)$/g,"")}function T(se){const me=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=me,Pe.identifier=pi(this.sliceSerialize(se)).toLowerCase()}function N(){const se=this.resume(),me=this.stack[this.stack.length-1];me.title=se}function A(){const se=this.resume(),me=this.stack[this.stack.length-1];me.url=se}function $(se){const me=this.stack[this.stack.length-1];if(!me.depth){const Pe=this.sliceSerialize(se).length;me.depth=Pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function O(se){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function K(se){const Pe=this.stack[this.stack.length-1].children;let Fe=Pe[Pe.length-1];(!Fe||Fe.type!=="text")&&(Fe=St(),Fe.position={start:_s(se.start),end:void 0},Pe.push(Fe)),this.stack.push(Fe)}function X(se){const me=this.stack.pop();me.value+=this.sliceSerialize(se),me.position.end=_s(se.end)}function _(se){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=me.children[me.children.length-1];Pe.position.end=_s(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(K.call(this,se),X.call(this,se))}function H(){this.data.atHardBreak=!0}function J(){const se=this.resume(),me=this.stack[this.stack.length-1];me.value=se}function U(){const se=this.resume(),me=this.stack[this.stack.length-1];me.value=se}function Y(){const se=this.resume(),me=this.stack[this.stack.length-1];me.value=se}function z(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=me,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function V(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=me,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function D(se){const me=this.sliceSerialize(se),Pe=this.stack[this.stack.length-2];Pe.label=cL(me),Pe.identifier=pi(me).toLowerCase()}function Q(){const se=this.stack[this.stack.length-1],me=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const Fe=se.children;Pe.children=Fe}else Pe.alt=me}function E(){const se=this.resume(),me=this.stack[this.stack.length-1];me.url=se}function M(){const se=this.resume(),me=this.stack[this.stack.length-1];me.title=se}function ee(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ae(se){const me=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=me,Pe.identifier=pi(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ce(se){this.data.characterReferenceType=se.type}function Z(se){const me=this.sliceSerialize(se),Pe=this.data.characterReferenceType;let Fe;Pe?(Fe=Ik(me,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=Rh(me);const Ve=this.stack[this.stack.length-1];Ve.value+=Fe}function ge(se){const me=this.stack.pop();me.position.end=_s(se.end)}function je(se){X.call(this,se);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(se)}function Ne(se){X.call(this,se);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(se)}function ke(){return{type:"blockquote",children:[]}}function We(){return{type:"code",lang:null,meta:null,value:""}}function Ye(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function W(){return{type:"break"}}function pe(){return{type:"html",value:""}}function ve(){return{type:"image",title:null,url:"",alt:null}}function _e(){return{type:"link",title:null,url:"",children:[]}}function Oe(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function st(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function _t(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function Nt(){return{type:"thematicBreak"}}}function _s(e){return{line:e.line,column:e.column,offset:e.offset}}function Vk(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?Vk(e,s):pL(e,s)}}function pL(e,t){let n;for(n in t)if(Wk.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function db(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Da({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Da({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Da({start:t.start,end:t.end})+") is still open")}function mL(e){const t=this;t.parser=n;function n(s){return dL(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hL(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
484
- `}]}function xL(e,t){const n=t.value?t.value+`
485
- `:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function yL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=Pi(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(s,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,f);const m={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,m),e.applyData(t,m)}function wL(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qk(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=s:a.push({type:"text",value:s}),a}function kL(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return qk(e,t);const a={src:Pi(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function SL(e,t){const n={src:Pi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function NL(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function CL(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return qk(e,t);const a={href:Pi(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function EL(e,t){const n={href:Pi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function TL(e,t,n){const s=e.all(t),a=n?PL(n):Kk(t),l={},c=[];if(typeof t.checked=="boolean"){const g=s[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},s.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<s.length;){const g=s[d];(a||d!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
486
- `}),g.type==="element"&&g.tagName==="p"&&!a?c.push(...g.children):c.push(g)}const f=s[s.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&c.push({type:"text",value:`
487
- `});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function PL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=Kk(n[s])}return t}function Kk(e){const t=e.spread;return t??e.children.length>1}function RL(e,t){const n={},s=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<s.length;){const c=s[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function AL(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DL(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function OL(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IL(e,t){const n=e.all(t),s=n.shift(),a=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),a.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Ch(t.children[1]),f=Ek(t.children[t.children.length-1]);d&&f&&(c.position={start:d,end:f}),a.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function LL(e,t,n){const s=n?n.children:void 0,l=(s?s.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let f=-1;const m=[];for(;++f<d;){const x=t.children[f],y={},v=c?c[f]:void 0;v&&(y.align=v);let C={type:"element",tagName:l,properties:y,children:[]};x&&(C.children=e.all(x),e.patch(x,C),C=e.applyData(x,C)),m.push(C)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function $L(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fb=9,pb=32;function ML(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const l=[];for(;s;)l.push(mb(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return l.push(mb(t.slice(a),a>0,!1)),l.join("")}function mb(e,t,n){let s=0,a=e.length;if(t){let l=e.codePointAt(s);for(;l===fb||l===pb;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(a-1);for(;l===fb||l===pb;)a--,l=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function _L(e,t){const n={type:"text",value:ML(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zL={blockquote:hL,break:gL,code:xL,delete:yL,emphasis:vL,footnoteReference:bL,heading:wL,html:jL,imageReference:kL,image:SL,inlineCode:NL,linkReference:CL,link:EL,listItem:TL,list:RL,paragraph:AL,root:DL,strong:OL,table:IL,tableCell:$L,tableRow:LL,text:_L,thematicBreak:FL,toml:Oc,yaml:Oc,definition:Oc,footnoteDefinition:Oc};function Oc(){}const Gk=-1,qu=0,Ia=1,fu=2,Oh=3,Ih=4,Lh=5,$h=6,Yk=7,Jk=8,hb=typeof self=="object"?self:globalThis,BL=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),s=a=>{if(e.has(a))return e.get(a);const[l,c]=t[a];switch(l){case qu:case Gk:return n(c,a);case Ia:{const d=n([],a);for(const f of c)d.push(s(f));return d}case fu:{const d=n({},a);for(const[f,m]of c)d[s(f)]=s(m);return d}case Oh:return n(new Date(c),a);case Ih:{const{source:d,flags:f}=c;return n(new RegExp(d,f),a)}case Lh:{const d=n(new Map,a);for(const[f,m]of c)d.set(s(f),s(m));return d}case $h:{const d=n(new Set,a);for(const f of c)d.add(s(f));return d}case Yk:{const{name:d,message:f}=c;return n(new hb[d](f),a)}case Jk:return n(BigInt(c),a);case"BigInt":return n(Object(BigInt(c)),a);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new hb[l](c),a)};return s},gb=e=>BL(new Map,e)(0),Qo="",{toString:UL}={},{keys:HL}=Object,ka=e=>{const t=typeof e;if(t!=="object"||!e)return[qu,t];const n=UL.call(e).slice(8,-1);switch(n){case"Array":return[Ia,Qo];case"Object":return[fu,Qo];case"Date":return[Oh,Qo];case"RegExp":return[Ih,Qo];case"Map":return[Lh,Qo];case"Set":return[$h,Qo];case"DataView":return[Ia,n]}return n.includes("Array")?[Ia,n]:n.includes("Error")?[Yk,n]:[fu,n]},Ic=([e,t])=>e===qu&&(t==="function"||t==="symbol"),WL=(e,t,n,s)=>{const a=(c,d)=>{const f=s.push(c)-1;return n.set(d,f),f},l=c=>{if(n.has(c))return n.get(c);let[d,f]=ka(c);switch(d){case qu:{let g=c;switch(f){case"bigint":d=Jk,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([Gk],c)}return a([d,g],c)}case Ia:{if(f){let y=c;return f==="DataView"?y=new Uint8Array(c.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(c)),a([f,[...y]],c)}const g=[],x=a([d,g],c);for(const y of c)g.push(l(y));return x}case fu:{if(f)switch(f){case"BigInt":return a([f,c.toString()],c);case"Boolean":case"Number":case"String":return a([f,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const g=[],x=a([d,g],c);for(const y of HL(c))(e||!Ic(ka(c[y])))&&g.push([l(y),l(c[y])]);return x}case Oh:return a([d,c.toISOString()],c);case Ih:{const{source:g,flags:x}=c;return a([d,{source:g,flags:x}],c)}case Lh:{const g=[],x=a([d,g],c);for(const[y,v]of c)(e||!(Ic(ka(y))||Ic(ka(v))))&&g.push([l(y),l(v)]);return x}case $h:{const g=[],x=a([d,g],c);for(const y of c)(e||!Ic(ka(y)))&&g.push(l(y));return x}}const{message:m}=c;return a([d,{name:f,message:m}],c)};return l},xb=(e,{json:t,lossy:n}={})=>{const s=[];return WL(!(t||n),!!t,new Map,s)(e),s},pu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gb(xb(e,t)):structuredClone(e):(e,t)=>gb(xb(e,t));function VL(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function qL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||VL,s=e.options.footnoteBackLabel||qL,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[f]);if(!m)continue;const g=e.all(m),x=String(m.identifier).toUpperCase(),y=Pi(x.toLowerCase());let v=0;const C=[],j=e.footnoteCounts.get(x);for(;j!==void 0&&++v<=j;){C.length>0&&C.push({type:"text",value:" "});let T=typeof n=="string"?n:n(f,v);typeof T=="string"&&(T={type:"text",value:T}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(f,v),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const T=w.children[w.children.length-1];T&&T.type==="text"?T.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...C)}else g.push(...C);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(m,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...pu(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
488
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
489
- `}]}}const Xk=(function(e){if(e==null)return XL;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?GL(e):YL(e);if(typeof e=="string")return JL(e);throw new Error("Expected function, string, or object as test")});function GL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xk(e[n]);return Ku(s);function s(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function YL(e){const t=e;return Ku(n);function n(s){const a=s;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function JL(e){return Ku(t);function t(n){return n&&n.type===e}}function Ku(e){return t;function t(n,s,a){return!!(QL(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function XL(){return!0}function QL(e){return e!==null&&typeof e=="object"&&"type"in e}const Qk=[],ZL=!0,yb=!1,e$="skip";function t$(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const l=Xk(a),c=s?-1:1;d(e,void 0,[])();function d(f,m,g){const x=f&&typeof f=="object"?f:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=Qk,C,j,w;if((!t||l(f,m,g[g.length-1]||void 0))&&(v=n$(n(f,g)),v[0]===yb))return v;if("children"in f&&f.children){const S=f;if(S.children&&v[0]!==e$)for(j=(s?S.children.length:-1)+c,w=g.concat(S);j>-1&&j<S.children.length;){const T=S.children[j];if(C=d(T,j,w)(),C[0]===yb)return C;j=typeof C[1]=="number"?C[1]:j+c}}return v}}}function n$(e){return Array.isArray(e)?e:typeof e=="number"?[ZL,e]:e==null?Qk:[e]}function Zk(e,t,n,s){let a,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,a=n):(l=t,c=n,a=s),t$(e,l,d,a);function d(f,m){const g=m[m.length-1],x=g?g.children.indexOf(f):void 0;return c(f,x,g)}}const im={}.hasOwnProperty,r$={};function s$(e,t){const n=t||r$,s=new Map,a=new Map,l=new Map,c={...zL,...n.handlers},d={all:m,applyData:i$,definitionById:s,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:c,one:f,options:n,patch:o$,wrap:l$};return Zk(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?s:a,y=String(g.identifier).toUpperCase();x.has(y)||x.set(y,g)}}),d;function f(g,x){const y=g.type,v=d.handlers[y];if(im.call(d.handlers,y)&&v)return v(d,g,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in g){const{children:j,...w}=g,S=pu(w);return S.children=d.all(g),S}return pu(g)}return(d.options.unknownHandler||a$)(d,g,x)}function m(g){const x=[];if("children"in g){const y=g.children;let v=-1;for(;++v<y.length;){const C=d.one(y[v],g);if(C){if(v&&y[v-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=vb(C.value)),!Array.isArray(C)&&C.type==="element")){const j=C.children[0];j&&j.type==="text"&&(j.value=vb(j.value))}Array.isArray(C)?x.push(...C):x.push(C)}}}return x}}function o$(e,t){e.position&&(t.position=U4(e))}function i$(e,t){let n=t;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const c="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,pu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function a$(e,t){const n=t.data||{},s="value"in t&&!(im.call(n,"hProperties")||im.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function l$(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
490
- `});++s<e.length;)s&&n.push({type:"text",value:`
491
- `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
492
- `}),n}function vb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bb(e,t){const n=s$(e,t),s=n.one(e,void 0),a=KL(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
493
- `},a),l}function c$(e,t){return e&&"run"in e?async function(n,s){const a=bb(n,{file:s,...t});await e.run(a,s)}:function(n,s){return bb(n,{file:s,...e||t})}}function wb(e){if(e)throw e}var mp,jb;function u$(){if(jb)return mp;jb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!x)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},c=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(s)return s(m,g).value}else return;return m[g]};return mp=function f(){var m,g,x,y,v,C,j=arguments[0],w=1,S=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},w=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});w<S;++w)if(m=arguments[w],m!=null)for(g in m)x=d(j,g),y=d(m,g),j!==y&&(T&&y&&(l(y)||(v=a(y)))?(v?(v=!1,C=x&&a(x)?x:[]):C=x&&l(x)?x:{},c(j,{name:g,newValue:f(T,C,y)})):typeof y<"u"&&c(j,{name:g,newValue:y}));return j},mp}var d$=u$();const hp=wu(d$);function am(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function f$(){const e=[],t={run:n,use:s};return t;function n(...a){let l=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...a);function d(f,...m){const g=e[++l];let x=-1;if(f){c(f);return}for(;++x<a.length;)(m[x]===null||m[x]===void 0)&&(m[x]=a[x]);a=m,g?p$(g,d)(...m):c(null,...m)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function p$(e,t){let n;return s;function s(...c){const d=e.length>c.length;let f;d&&c.push(a);try{f=e.apply(this,c)}catch(m){const g=m;if(d&&n)throw g;return a(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(l,a):f instanceof Error?a(f):l(f))}function a(c,...d){n||(n=!0,t(c,...d))}function l(c){a(null,c)}}const Mr={basename:m$,dirname:h$,extname:g$,join:x$,sep:"/"};function m$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cl(e);let n=0,s=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else s<0&&(l=!0,s=a+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else c<0&&(l=!0,c=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(s=a):(d=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function h$(e){if(cl(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function g$(e){cl(e);let t=e.length,n=-1,s=0,a=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function x$(...e){let t=-1,n;for(;++t<e.length;)cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":y$(n)}function y$(e){cl(e);const t=e.codePointAt(0)===47;let n=v$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function v$(e,t){let n="",s=0,a=-1,l=0,c=-1,d,f;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(a===c-1||l===1))if(a!==c-1&&l===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",s=0):(n=n.slice(0,f),s=n.length-1-n.lastIndexOf("/")),a=c,l=0;continue}}else if(n.length>0){n="",s=0,a=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,c):n=e.slice(a+1,c),s=c-a-1;a=c,l=0}else d===46&&l>-1?l++:l=-1}return n}function cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const b$={cwd:w$};function w$(){return"/"}function lm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function j$(e){if(typeof e=="string")e=new URL(e);else if(!lm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return k$(e)}function k$(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const gp=["history","path","basename","stem","extname","dirname"];class e1{constructor(t){let n;t?lm(t)?n={path:t}:typeof t=="string"||S$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":b$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<gp.length;){const l=gp[s];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)gp.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){yp(t,"basename"),xp(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){kb(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(xp(t,"extname"),kb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){lm(t)&&(t=j$(t)),yp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){yp(t,"stem"),xp(t,"stem"),this.path=Mr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const a=this.message(t,n,s);throw a.fatal=!0,a}info(t,n,s){const a=this.message(t,n,s);return a.fatal=void 0,a}message(t,n,s){const a=new jn(t,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xp(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function yp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function S$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const N$=(function(e){const s=this.constructor.prototype,a=s[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),C$={}.hasOwnProperty;class Mh extends N${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=f$()}copy(){const t=new Mh;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(hp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wp("data",this.frozen),this.namespace[t]=n,this):C$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(t,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Lc(t),s=this.parser||this.Parser;return vp("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),vp("process",this.parser||this.Parser),bp("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,c){const d=Lc(t),f=s.parse(d);s.run(f,d,function(g,x,y){if(g||!x||!y)return m(g);const v=x,C=s.stringify(v,y);P$(C)?y.value=C:y.result=C,m(g,y)});function m(g,x){g||!x?c(g):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,s;return this.freeze(),vp("processSync",this.parser||this.Parser),bp("processSync",this.compiler||this.Compiler),this.process(t,a),Nb("processSync","process",n),s;function a(l,c){n=!0,wb(l),s=c}}run(t,n,s){Sb(t),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?l(void 0,s):new Promise(l);function l(c,d){const f=Lc(n);a.run(t,f,m);function m(g,x,y){const v=x||t;g?d(g):c?c(v):s(void 0,v,y)}}}runSync(t,n){let s=!1,a;return this.run(t,n,l),Nb("runSync","run",s),a;function l(c,d){wb(c),a=d,s=!0}}stringify(t,n){this.freeze();const s=Lc(n),a=this.compiler||this.Compiler;return bp("stringify",a),Sb(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(wp("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")f(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...x]=m;f(g,x)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(a.settings=hp(!0,a.settings,m.settings))}function d(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const x=m[g];l(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function f(m,g){let x=-1,y=-1;for(;++x<s.length;)if(s[x][0]===m){y=x;break}if(y===-1)s.push([m,...g]);else if(g.length>0){let[v,...C]=g;const j=s[y][1];am(j)&&am(v)&&(v=hp(!0,j,v)),s[y]=[m,v,...C]}}}}const E$=new Mh().freeze();function vp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sb(e){if(!am(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Nb(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lc(e){return T$(e)?e:new e1(e)}function T$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function P$(e){return typeof e=="string"||R$(e)}function R$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const A$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cb=[],Eb={allowDangerousHtml:!0},D$=/^(https?|ircs?|mailto|xmpp)$/i,O$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function I$(e){const t=L$(e),n=$$(e);return M$(t.runSync(t.parse(n),n),e)}function L$(e){const t=e.rehypePlugins||Cb,n=e.remarkPlugins||Cb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Eb}:Eb;return E$().use(mL).use(n).use(c$,s).use(t)}function $$(e){const t=e.children||"",n=new e1;return typeof t=="string"&&(n.value=t),n}function M$(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||_$;for(const g of O$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+A$+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Zk(e,m),K4(e,{Fragment:r.Fragment,components:a,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function m(g,x,y){if(g.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in dp)if(Object.hasOwn(dp,v)&&Object.hasOwn(g.properties,v)){const C=g.properties[v],j=dp[v];(j===null||j.includes(g.tagName))&&(g.properties[v]=f(String(C||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!v&&s&&typeof x=="number"&&(v=!s(g,x,y)),v&&y&&typeof x=="number")return d&&g.children?y.children.splice(x,1,...g.children):y.children.splice(x,1),x}}}function _$(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||s!==-1&&t>s||D$.test(e.slice(0,t))?e:""}function Ut({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:ze("prose-syntaur max-w-none",t),children:r.jsx(I$,{children:s})}):r.jsx("div",{className:"rounded-md border border-dashed border-border/80 bg-muted/30 px-3 py-4 text-sm text-muted-foreground",children:n})}function F$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>s=>{t.forEach(a=>a(s))},t)}const Gu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ri(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _h(e){return"nodeType"in e}function Un(e){var t,n;return e?Ri(e)?e:_h(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Fh(e){const{Document:t}=Un(e);return e instanceof t}function ul(e){return Ri(e)?!1:e instanceof Un(e).HTMLElement}function t1(e){return e instanceof Un(e).SVGElement}function Ai(e){return e?Ri(e)?e.document:_h(e)?Fh(e)?e:ul(e)||t1(e)?e.ownerDocument:document:document:document}const Jr=Gu?p.useLayoutEffect:p.useEffect;function zh(e){const t=p.useRef(e);return Jr(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return t.current==null?void 0:t.current(...s)},[])}function z$(){const e=p.useRef(null),t=p.useCallback((s,a)=>{e.current=setInterval(s,a)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ya(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Jr(()=>{n.current!==e&&(n.current=e)},t),n}function dl(e,t){const n=p.useRef();return p.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function mu(e){const t=zh(e),n=p.useRef(null),s=p.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,s]}function cm(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let jp={};function fl(e,t){return p.useMemo(()=>{if(t)return t;const n=jp[e]==null?0:jp[e]+1;return jp[e]=n,e+"-"+n},[e,t])}function n1(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return s.reduce((l,c)=>{const d=Object.entries(c);for(const[f,m]of d){const g=l[f];g!=null&&(l[f]=g+e*m)}return l},{...t})}}const mi=n1(1),hu=n1(-1);function B$(e){return"clientX"in e&&"clientY"in e}function Bh(e){if(!e)return!1;const{KeyboardEvent:t}=Un(e.target);return t&&e instanceof t}function U$(e){if(!e)return!1;const{TouchEvent:t}=Un(e.target);return t&&e instanceof t}function um(e){if(U$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return B$(e)?{x:e.clientX,y:e.clientY}:null}const vo=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[vo.Translate.toString(e),vo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Tb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function H$(e){return e.matches(Tb)?e:e.querySelector(Tb)}const W$={display:"none"};function V$(e){let{id:t,value:n}=e;return Lt.createElement("div",{id:t,style:W$},n)}function q$(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Lt.createElement("div",{id:t,style:a,role:"status","aria-live":s,"aria-atomic":!0},n)}function K$(){const[e,t]=p.useState("");return{announce:p.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const r1=p.createContext(null);function G$(e){const t=p.useContext(r1);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Y$(){const[e]=p.useState(()=>new Set),t=p.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[p.useCallback(s=>{let{type:a,event:l}=s;e.forEach(c=>{var d;return(d=c[a])==null?void 0:d.call(c,l)})},[e]),t]}const J$={draggable:`
494
- To pick up a draggable item, press the space bar.
495
- While dragging, use the arrow keys to move the item.
496
- Press space again to drop the item in its new position, or press escape to cancel.
497
- `},X$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Q$(e){let{announcements:t=X$,container:n,hiddenTextDescribedById:s,screenReaderInstructions:a=J$}=e;const{announce:l,announcement:c}=K$(),d=fl("DndLiveRegion"),[f,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),G$(p.useMemo(()=>({onDragStart(x){let{active:y}=x;l(t.onDragStart({active:y}))},onDragMove(x){let{active:y,over:v}=x;t.onDragMove&&l(t.onDragMove({active:y,over:v}))},onDragOver(x){let{active:y,over:v}=x;l(t.onDragOver({active:y,over:v}))},onDragEnd(x){let{active:y,over:v}=x;l(t.onDragEnd({active:y,over:v}))},onDragCancel(x){let{active:y,over:v}=x;l(t.onDragCancel({active:y,over:v}))}}),[l,t])),!f)return null;const g=Lt.createElement(Lt.Fragment,null,Lt.createElement(V$,{id:s,value:a.draggable}),Lt.createElement(q$,{id:d,announcement:c}));return n?Us.createPortal(g,n):g}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function gu(){}function vi(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Uh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Er=Object.freeze({x:0,y:0});function Z$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function eM(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function tM(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function nM(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Pb(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Hh=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=Pb(t,t.left,t.top),l=[];for(const c of s){const{id:d}=c,f=n.get(d);if(f){const m=Z$(Pb(f),a);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(eM)};function rM(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=a-s,d=l-n;if(s<a&&n<l){const f=t.width*t.height,m=e.width*e.height,g=c*d,x=g/(f+m-g);return Number(x.toFixed(4))}return 0}const sM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=[];for(const l of s){const{id:c}=l,d=n.get(c);if(d){const f=rM(d,t);f>0&&a.push({id:c,data:{droppableContainer:l,value:f}})}}return a.sort(tM)};function oM(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function s1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Er}function iM(e){return function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return a.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const aM=iM(1);function lM(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function cM(e,t,n){const s=lM(t);if(!s)return e;const{scaleX:a,scaleY:l,x:c,y:d}=s,f=e.left-c-(1-a)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=a?e.width/a:e.width,x=l?e.height/l:e.height;return{width:g,height:x,top:m,right:f+g,bottom:m+x,left:f}}const uM={ignoreTransform:!1};function Di(e,t){t===void 0&&(t=uM);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=Un(e).getComputedStyle(e);m&&(n=cM(n,m,g))}const{top:s,left:a,width:l,height:c,bottom:d,right:f}=n;return{top:s,left:a,width:l,height:c,bottom:d,right:f}}function Rb(e){return Di(e,{ignoreTransform:!0})}function dM(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fM(e,t){return t===void 0&&(t=Un(e).getComputedStyle(e)),t.position==="fixed"}function pM(e,t){t===void 0&&(t=Un(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const l=t[a];return typeof l=="string"?n.test(l):!1})}function Wh(e,t){const n=[];function s(a){if(t!=null&&n.length>=t||!a)return n;if(Fh(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!ul(a)||t1(a)||n.includes(a))return n;const l=Un(e).getComputedStyle(a);return a!==e&&pM(a,l)&&n.push(a),fM(a,l)?n:s(a.parentNode)}return e?s(e):n}function o1(e){const[t]=Wh(e,1);return t??null}function kp(e){return!Gu||!e?null:Ri(e)?e:_h(e)?Fh(e)||e===Ai(e).scrollingElement?window:ul(e)?e:null:null}function i1(e){return Ri(e)?e.scrollX:e.scrollLeft}function a1(e){return Ri(e)?e.scrollY:e.scrollTop}function dm(e){return{x:i1(e),y:a1(e)}}var ln;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ln||(ln={}));function l1(e){return!Gu||!e?!1:e===document.scrollingElement}function c1(e){const t={x:0,y:0},n=l1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,d=e.scrollLeft>=s.x;return{isTop:a,isLeft:l,isBottom:c,isRight:d,maxScroll:s,minScroll:t}}const mM={x:.2,y:.2};function hM(e,t,n,s,a){let{top:l,left:c,right:d,bottom:f}=n;s===void 0&&(s=10),a===void 0&&(a=mM);const{isTop:m,isBottom:g,isLeft:x,isRight:y}=c1(e),v={x:0,y:0},C={x:0,y:0},j={height:t.height*a.y,width:t.width*a.x};return!m&&l<=t.top+j.height?(v.y=ln.Backward,C.y=s*Math.abs((t.top+j.height-l)/j.height)):!g&&f>=t.bottom-j.height&&(v.y=ln.Forward,C.y=s*Math.abs((t.bottom-j.height-f)/j.height)),!y&&d>=t.right-j.width?(v.x=ln.Forward,C.x=s*Math.abs((t.right-j.width-d)/j.width)):!x&&c<=t.left+j.width&&(v.x=ln.Backward,C.x=s*Math.abs((t.left+j.width-c)/j.width)),{direction:v,speed:C}}function gM(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:s,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:a,width:e.clientWidth,height:e.clientHeight}}function u1(e){return e.reduce((t,n)=>mi(t,dm(n)),Er)}function xM(e){return e.reduce((t,n)=>t+i1(n),0)}function yM(e){return e.reduce((t,n)=>t+a1(n),0)}function vM(e,t){if(t===void 0&&(t=Di),!e)return;const{top:n,left:s,bottom:a,right:l}=t(e);o1(e)&&(a<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const bM=[["x",["left","right"],xM],["y",["top","bottom"],yM]];class Vh{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Wh(n),a=u1(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of bM)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=d(s),g=a[l]-m;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class La{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var a;(a=this.target)==null||a.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function wM(e){const{EventTarget:t}=Un(e);return e instanceof t?e:Ai(e)}function Sp(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var ar;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ar||(ar={}));function Ab(e){e.preventDefault()}function jM(e){e.stopPropagation()}var nt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(nt||(nt={}));const d1={start:[nt.Space,nt.Enter],cancel:[nt.Esc],end:[nt.Space,nt.Enter,nt.Tab]},kM=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case nt.Right:return{...n,x:n.x+25};case nt.Left:return{...n,x:n.x-25};case nt.Down:return{...n,y:n.y+25};case nt.Up:return{...n,y:n.y-25}}};class pl{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new La(Ai(n)),this.windowListeners=new La(Un(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ar.Resize,this.handleCancel),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ar.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&vM(s),n(Er)}handleKeyDown(t){if(Bh(t)){const{active:n,context:s,options:a}=this.props,{keyboardCodes:l=d1,coordinateGetter:c=kM,scrollBehavior:d="smooth"}=a,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:m}=s.current,g=m?{x:m.left,y:m.top}:Er;this.referenceCoordinates||(this.referenceCoordinates=g);const x=c(t,{active:n,context:s.current,currentCoordinates:g});if(x){const y=hu(x,g),v={x:0,y:0},{scrollableAncestors:C}=s.current;for(const j of C){const w=t.code,{isTop:S,isRight:T,isLeft:N,isBottom:A,maxScroll:$,minScroll:R}=c1(j),O=gM(j),I={x:Math.min(w===nt.Right?O.right-O.width/2:O.right,Math.max(w===nt.Right?O.left:O.left+O.width/2,x.x)),y:Math.min(w===nt.Down?O.bottom-O.height/2:O.bottom,Math.max(w===nt.Down?O.top:O.top+O.height/2,x.y))},K=w===nt.Right&&!T||w===nt.Left&&!N,X=w===nt.Down&&!A||w===nt.Up&&!S;if(K&&I.x!==x.x){const _=j.scrollLeft+y.x,H=w===nt.Right&&_<=$.x||w===nt.Left&&_>=R.x;if(H&&!y.y){j.scrollTo({left:_,behavior:d});return}H?v.x=j.scrollLeft-_:v.x=w===nt.Right?j.scrollLeft-$.x:j.scrollLeft-R.x,v.x&&j.scrollBy({left:-v.x,behavior:d});break}else if(X&&I.y!==x.y){const _=j.scrollTop+y.y,H=w===nt.Down&&_<=$.y||w===nt.Up&&_>=R.y;if(H&&!y.x){j.scrollTo({top:_,behavior:d});return}H?v.y=j.scrollTop-_:v.y=w===nt.Down?j.scrollTop-$.y:j.scrollTop-R.y,v.y&&j.scrollBy({top:-v.y,behavior:d});break}}this.handleMove(t,mi(hu(x,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}pl.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=d1,onActivation:a}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function Db(e){return!!(e&&"distance"in e)}function Ob(e){return!!(e&&"delay"in e)}class qh{constructor(t,n,s){var a;s===void 0&&(s=wM(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=Ai(c),this.documentListeners=new La(this.document),this.listeners=new La(s),this.windowListeners=new La(Un(c)),this.initialCoordinates=(a=um(l))!=null?a:Er,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ar.Resize,this.handleCancel),this.windowListeners.add(ar.DragStart,Ab),this.windowListeners.add(ar.VisibilityChange,this.handleCancel),this.windowListeners.add(ar.ContextMenu,Ab),this.documentListeners.add(ar.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ob(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Db(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:a}=this.props;a(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ar.Click,jM,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ar.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:a,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!a)return;const f=(n=um(t))!=null?n:Er,m=hu(a,f);if(!s&&d){if(Db(d)){if(d.tolerance!=null&&Sp(m,d.tolerance))return this.handleCancel();if(Sp(m,d.distance))return this.handleStart()}if(Ob(d)&&Sp(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===nt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const SM={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ml extends qh{constructor(t){const{event:n}=t,s=Ai(n.target);super(t,SM,s)}}ml.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const NM={move:{name:"mousemove"},end:{name:"mouseup"}};var fm;(function(e){e[e.RightClick=2]="RightClick"})(fm||(fm={}));class CM extends qh{constructor(t){super(t,NM,Ai(t.event.target))}}CM.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===fm.RightClick?!1:(s==null||s({event:n}),!0)}}];const Np={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class EM extends qh{constructor(t){super(t,Np)}static setup(){return window.addEventListener(Np.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Np.move.name,t)};function t(){}}}EM.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:a}=n;return a.length>1?!1:(s==null||s({event:n}),!0)}}];var $a;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($a||($a={}));var xu;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(xu||(xu={}));function TM(e){let{acceleration:t,activator:n=$a.Pointer,canScroll:s,draggingRect:a,enabled:l,interval:c=5,order:d=xu.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:g,delta:x,threshold:y}=e;const v=RM({delta:x,disabled:!l}),[C,j]=z$(),w=p.useRef({x:0,y:0}),S=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case $a.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case $a.DraggableRect:return a}},[n,a,f]),N=p.useRef(null),A=p.useCallback(()=>{const R=N.current;if(!R)return;const O=w.current.x*S.current.x,I=w.current.y*S.current.y;R.scrollBy(O,I)},[]),$=p.useMemo(()=>d===xu.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){j();return}for(const R of $){if((s==null?void 0:s(R))===!1)continue;const O=m.indexOf(R),I=g[O];if(!I)continue;const{direction:K,speed:X}=hM(R,I,T,t,y);for(const _ of["x","y"])v[_][K[_]]||(X[_]=0,K[_]=0);if(X.x>0||X.y>0){j(),N.current=R,C(A,c),w.current=X,S.current=K;return}}w.current={x:0,y:0},S.current={x:0,y:0},j()},[t,A,s,j,l,c,JSON.stringify(T),JSON.stringify(v),C,m,$,g,JSON.stringify(y)])}const PM={x:{[ln.Backward]:!1,[ln.Forward]:!1},y:{[ln.Backward]:!1,[ln.Forward]:!1}};function RM(e){let{delta:t,disabled:n}=e;const s=cm(t);return dl(a=>{if(n||!s||!a)return PM;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[ln.Backward]:a.x[ln.Backward]||l.x===-1,[ln.Forward]:a.x[ln.Forward]||l.x===1},y:{[ln.Backward]:a.y[ln.Backward]||l.y===-1,[ln.Forward]:a.y[ln.Forward]||l.y===1}}},[n,t,s])}function AM(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return dl(a=>{var l;return t==null?null:(l=s??a)!=null?l:null},[s,t])}function DM(e,t){return p.useMemo(()=>e.reduce((n,s)=>{const{sensor:a}=s,l=a.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...l]},[]),[e,t])}var Ja;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ja||(Ja={}));var pm;(function(e){e.Optimized="optimized"})(pm||(pm={}));const Ib=new Map;function OM(e,t){let{dragging:n,dependencies:s,config:a}=t;const[l,c]=p.useState(null),{frequency:d,measure:f,strategy:m}=a,g=p.useRef(e),x=w(),y=Ya(x),v=p.useCallback(function(S){S===void 0&&(S=[]),!y.current&&c(T=>T===null?S:T.concat(S.filter(N=>!T.includes(N))))},[y]),C=p.useRef(null),j=dl(S=>{if(x&&!n)return Ib;if(!S||S===Ib||g.current!==e||l!=null){const T=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){T.set(N.id,N.rect.current);continue}const A=N.node.current,$=A?new Vh(f(A),A):null;N.rect.current=$,$&&T.set(N.id,$)}return T}return S},[e,l,n,x,f]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{x||v()},[n,x]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{x||typeof d!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},d))},[d,x,v,...s]),{droppableRects:j,measureDroppableContainers:v,measuringScheduled:l!=null};function w(){switch(m){case Ja.Always:return!1;case Ja.BeforeDragging:return n;default:return!n}}}function f1(e,t){return dl(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function IM(e,t){return f1(e,t)}function LM(e){let{callback:t,disabled:n}=e;const s=zh(t),a=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return p.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Yu(e){let{callback:t,disabled:n}=e;const s=zh(t),a=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return p.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function $M(e){return new Vh(Di(e),e)}function Lb(e,t,n){t===void 0&&(t=$M);const[s,a]=p.useState(null);function l(){a(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=LM({callback(f){if(e)for(const m of f){const{type:g,target:x}=m;if(g==="childList"&&x instanceof HTMLElement&&x.contains(e)){l();break}}}}),d=Yu({callback:l});return Jr(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),s}function MM(e){const t=f1(e);return s1(e,t)}const $b=[];function _M(e){const t=p.useRef(e),n=dl(s=>e?s&&s!==$b&&e&&t.current&&e.parentNode===t.current.parentNode?s:Wh(e):$b,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function FM(e){const[t,n]=p.useState(null),s=p.useRef(e),a=p.useCallback(l=>{const c=kp(l.target);c&&n(d=>d?(d.set(c,dm(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=s.current;if(e!==l){c(l);const d=e.map(f=>{const m=kp(f);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,dm(m)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),s.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(f=>{const m=kp(f);m==null||m.removeEventListener("scroll",a)})}},[a,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>mi(l,c),Er):u1(e):Er,[e,t])}function Mb(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const s=e!==Er;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?hu(e,n.current):Er}function zM(e){p.useEffect(()=>{if(!Gu)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function BM(e,t){return p.useMemo(()=>e.reduce((n,s)=>{let{eventName:a,handler:l}=s;return n[a]=c=>{l(c,t)},n},{}),[e,t])}function p1(e){return p.useMemo(()=>e?dM(e):null,[e])}const _b=[];function UM(e,t){t===void 0&&(t=Di);const[n]=e,s=p1(n?Un(n):null),[a,l]=p.useState(_b);function c(){l(()=>e.length?e.map(f=>l1(f)?s:new Vh(t(f),f)):_b)}const d=Yu({callback:c});return Jr(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),a}function HM(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ul(t)?t:e}function WM(e){let{measure:t}=e;const[n,s]=p.useState(null),a=p.useCallback(m=>{for(const{target:g}of m)if(ul(g)){s(x=>{const y=t(g);return x?{...x,width:y.width,height:y.height}:y});break}},[t]),l=Yu({callback:a}),c=p.useCallback(m=>{const g=HM(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),s(g?t(g):null)},[t,l]),[d,f]=mu(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const VM=[{sensor:ml,options:{}},{sensor:pl,options:{}}],qM={current:{}},Zc={draggable:{measure:Rb},droppable:{measure:Rb,strategy:Ja.WhileDragging,frequency:pm.Optimized},dragOverlay:{measure:Di}};class Ma extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const KM={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ma,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:gu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Zc,measureDroppableContainers:gu,windowRect:null,measuringScheduled:!1},GM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:gu,draggableNodes:new Map,over:null,measureDroppableContainers:gu},Ju=p.createContext(GM),m1=p.createContext(KM);function YM(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ma}}}function JM(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=t,{id:s}=n,a=new Ma(e.droppable.containers);return a.set(s,n),{...e,droppable:{...e.droppable,containers:a}}}case Yt.SetDroppableDisabled:{const{id:n,key:s,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||s!==l.key)return e;const c=new Ma(e.droppable.containers);return c.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:c}}}case Yt.UnregisterDroppable:{const{id:n,key:s}=t,a=e.droppable.containers.get(n);if(!a||s!==a.key)return e;const l=new Ma(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function XM(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:a}=p.useContext(Ju),l=cm(s),c=cm(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!Bh(l)||document.activeElement===l.target)return;const d=a.get(c);if(!d)return;const{activatorNode:f,node:m}=d;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[f.current,m.current]){if(!g)continue;const x=H$(g);if(x){x.focus();break}}})}},[s,t,a,c,l]),null}function QM(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...s}),n):n}function ZM(e){return p.useMemo(()=>({draggable:{...Zc.draggable,...e==null?void 0:e.draggable},droppable:{...Zc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Zc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function e_(e){let{activeNode:t,measure:n,initialRect:s,config:a=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof a=="boolean"?{x:a,y:a}:a;Jr(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!s)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const g=n(m),x=s1(g,s);if(c||(x.x=0),d||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const y=o1(m);y&&y.scrollBy({top:x.y,left:x.x})}},[t,c,d,s,n])}const h1=p.createContext({...Er,scaleX:1,scaleY:1});var Bs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Bs||(Bs={}));const Kh=p.memo(function(t){var n,s,a,l;let{id:c,accessibility:d,autoScroll:f=!0,children:m,sensors:g=VM,collisionDetection:x=sM,measuring:y,modifiers:v,...C}=t;const j=p.useReducer(JM,void 0,YM),[w,S]=j,[T,N]=Y$(),[A,$]=p.useState(Bs.Uninitialized),R=A===Bs.Initialized,{draggable:{active:O,nodes:I,translate:K},droppable:{containers:X}}=w,_=O!=null?I.get(O):null,H=p.useRef({initial:null,translated:null}),J=p.useMemo(()=>{var ht;return O!=null?{id:O,data:(ht=_==null?void 0:_.data)!=null?ht:qM,rect:H}:null},[O,_]),U=p.useRef(null),[Y,z]=p.useState(null),[V,D]=p.useState(null),Q=Ya(C,Object.values(C)),E=fl("DndDescribedBy",c),M=p.useMemo(()=>X.getEnabled(),[X]),ee=ZM(y),{droppableRects:L,measureDroppableContainers:ae,measuringScheduled:ce}=OM(M,{dragging:R,dependencies:[K.x,K.y],config:ee.droppable}),Z=AM(I,O),ge=p.useMemo(()=>V?um(V):null,[V]),je=Ar(),Ne=IM(Z,ee.draggable.measure);e_({activeNode:O!=null?I.get(O):null,config:je.layoutShiftCompensation,initialRect:Ne,measure:ee.draggable.measure});const ke=Lb(Z,ee.draggable.measure,Ne),We=Lb(Z?Z.parentElement:null),Ye=p.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=X.getNodeFor((n=Ye.current.over)==null?void 0:n.id),ne=WM({measure:ee.dragOverlay.measure}),le=(s=ne.nodeRef.current)!=null?s:Z,W=R?(a=ne.rect)!=null?a:ke:null,pe=!!(ne.nodeRef.current&&ne.rect),ve=MM(pe?null:ke),_e=p1(le?Un(le):null),Oe=_M(R?ie??Z:null),st=UM(Oe),lt=QM(v,{transform:{x:K.x-ve.x,y:K.y-ve.y,scaleX:1,scaleY:1},activatorEvent:V,active:J,activeNodeRect:ke,containerNodeRect:We,draggingNodeRect:W,over:Ye.current.over,overlayNodeRect:ne.rect,scrollableAncestors:Oe,scrollableAncestorRects:st,windowRect:_e}),_t=ge?mi(ge,K):null,St=FM(Oe),Nt=Mb(St),se=Mb(St,[ke]),me=mi(lt,Nt),Pe=W?aM(W,lt):null,Fe=J&&Pe?x({active:J,collisionRect:Pe,droppableRects:L,droppableContainers:M,pointerCoordinates:_t}):null,Ve=nM(Fe,"id"),[tt,cn]=p.useState(null),ue=pe?lt:mi(lt,se),Ge=oM(ue,(l=tt==null?void 0:tt.rect)!=null?l:null,ke),He=p.useRef(null),mt=p.useCallback((ht,Ft)=>{let{sensor:qt,options:kn}=Ft;if(U.current==null)return;const un=I.get(U.current);if(!un)return;const Zt=ht.nativeEvent,ct=new qt({active:U.current,activeNode:un,event:Zt,options:kn,context:Ye,onAbort(ut){if(!I.get(ut))return;const{onDragAbort:en}=Q.current,Wn={id:ut};en==null||en(Wn),T({type:"onDragAbort",event:Wn})},onPending(ut,Pn,en,Wn){if(!I.get(ut))return;const{onDragPending:B}=Q.current,de={id:ut,constraint:Pn,initialCoordinates:en,offset:Wn};B==null||B(de),T({type:"onDragPending",event:de})},onStart(ut){const Pn=U.current;if(Pn==null)return;const en=I.get(Pn);if(!en)return;const{onDragStart:Wn}=Q.current,tn={activatorEvent:Zt,active:{id:Pn,data:en.data,rect:H}};Us.unstable_batchedUpdates(()=>{Wn==null||Wn(tn),$(Bs.Initializing),S({type:Yt.DragStart,initialCoordinates:ut,active:Pn}),T({type:"onDragStart",event:tn}),z(He.current),D(Zt)})},onMove(ut){S({type:Yt.DragMove,coordinates:ut})},onEnd:hr(Yt.DragEnd),onCancel:hr(Yt.DragCancel)});He.current=ct;function hr(ut){return async function(){const{active:en,collisions:Wn,over:tn,scrollAdjustedTranslate:B}=Ye.current;let de=null;if(en&&B){const{cancelDrop:Se}=Q.current;de={activatorEvent:Zt,active:en,collisions:Wn,delta:B,over:tn},ut===Yt.DragEnd&&typeof Se=="function"&&await Promise.resolve(Se(de))&&(ut=Yt.DragCancel)}U.current=null,Us.unstable_batchedUpdates(()=>{S({type:ut}),$(Bs.Uninitialized),cn(null),z(null),D(null),He.current=null;const Se=ut===Yt.DragEnd?"onDragEnd":"onDragCancel";if(de){const Xe=Q.current[Se];Xe==null||Xe(de),T({type:Se,event:de})}})}}},[I]),Tn=p.useCallback((ht,Ft)=>(qt,kn)=>{const un=qt.nativeEvent,Zt=I.get(kn);if(U.current!==null||!Zt||un.dndKit||un.defaultPrevented)return;const ct={active:Zt};ht(qt,Ft.options,ct)===!0&&(un.dndKit={capturedBy:Ft.sensor},U.current=kn,mt(qt,Ft))},[I,mt]),Qt=DM(g,Tn);zM(g),Jr(()=>{ke&&A===Bs.Initializing&&$(Bs.Initialized)},[ke,A]),p.useEffect(()=>{const{onDragMove:ht}=Q.current,{active:Ft,activatorEvent:qt,collisions:kn,over:un}=Ye.current;if(!Ft||!qt)return;const Zt={active:Ft,activatorEvent:qt,collisions:kn,delta:{x:me.x,y:me.y},over:un};Us.unstable_batchedUpdates(()=>{ht==null||ht(Zt),T({type:"onDragMove",event:Zt})})},[me.x,me.y]),p.useEffect(()=>{const{active:ht,activatorEvent:Ft,collisions:qt,droppableContainers:kn,scrollAdjustedTranslate:un}=Ye.current;if(!ht||U.current==null||!Ft||!un)return;const{onDragOver:Zt}=Q.current,ct=kn.get(Ve),hr=ct&&ct.rect.current?{id:ct.id,rect:ct.rect.current,data:ct.data,disabled:ct.disabled}:null,ut={active:ht,activatorEvent:Ft,collisions:qt,delta:{x:un.x,y:un.y},over:hr};Us.unstable_batchedUpdates(()=>{cn(hr),Zt==null||Zt(ut),T({type:"onDragOver",event:ut})})},[Ve]),Jr(()=>{Ye.current={activatorEvent:V,active:J,activeNode:Z,collisionRect:Pe,collisions:Fe,droppableRects:L,draggableNodes:I,draggingNode:le,draggingNodeRect:W,droppableContainers:X,over:tt,scrollableAncestors:Oe,scrollAdjustedTranslate:me},H.current={initial:W,translated:Pe}},[J,Z,Fe,Pe,I,le,W,L,X,tt,Oe,me]),TM({...je,delta:K,draggingRect:Pe,pointerCoordinates:_t,scrollableAncestors:Oe,scrollableAncestorRects:st});const Hn=p.useMemo(()=>({active:J,activeNode:Z,activeNodeRect:ke,activatorEvent:V,collisions:Fe,containerNodeRect:We,dragOverlay:ne,draggableNodes:I,droppableContainers:X,droppableRects:L,over:tt,measureDroppableContainers:ae,scrollableAncestors:Oe,scrollableAncestorRects:st,measuringConfiguration:ee,measuringScheduled:ce,windowRect:_e}),[J,Z,ke,V,Fe,We,ne,I,X,L,tt,ae,Oe,st,ee,ce,_e]),mr=p.useMemo(()=>({activatorEvent:V,activators:Qt,active:J,activeNodeRect:ke,ariaDescribedById:{draggable:E},dispatch:S,draggableNodes:I,over:tt,measureDroppableContainers:ae}),[V,Qt,J,ke,S,E,I,tt,ae]);return Lt.createElement(r1.Provider,{value:N},Lt.createElement(Ju.Provider,{value:mr},Lt.createElement(m1.Provider,{value:Hn},Lt.createElement(h1.Provider,{value:Ge},m)),Lt.createElement(XM,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Lt.createElement(Q$,{...d,hiddenTextDescribedById:E}));function Ar(){const ht=(Y==null?void 0:Y.autoScrollEnabled)===!1,Ft=typeof f=="object"?f.enabled===!1:f===!1,qt=R&&!ht&&!Ft;return typeof f=="object"?{...f,enabled:qt}:{enabled:qt}}}),t_=p.createContext(null),Fb="button",n_="Draggable";function r_(e){let{id:t,data:n,disabled:s=!1,attributes:a}=e;const l=fl(n_),{activators:c,activatorEvent:d,active:f,activeNodeRect:m,ariaDescribedById:g,draggableNodes:x,over:y}=p.useContext(Ju),{role:v=Fb,roleDescription:C="draggable",tabIndex:j=0}=a??{},w=(f==null?void 0:f.id)===t,S=p.useContext(w?h1:t_),[T,N]=mu(),[A,$]=mu(),R=BM(c,t),O=Ya(n);Jr(()=>(x.set(t,{id:t,key:l,node:T,activatorNode:A,data:O}),()=>{const K=x.get(t);K&&K.key===l&&x.delete(t)}),[x,t]);const I=p.useMemo(()=>({role:v,tabIndex:j,"aria-disabled":s,"aria-pressed":w&&v===Fb?!0:void 0,"aria-roledescription":C,"aria-describedby":g.draggable}),[s,v,j,w,C,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:m,attributes:I,isDragging:w,listeners:s?void 0:R,node:T,over:y,setNodeRef:N,setActivatorNodeRef:$,transform:S}}function s_(){return p.useContext(m1)}const o_="Droppable",i_={timeout:25};function a_(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:a}=e;const l=fl(o_),{active:c,dispatch:d,over:f,measureDroppableContainers:m}=p.useContext(Ju),g=p.useRef({disabled:n}),x=p.useRef(!1),y=p.useRef(null),v=p.useRef(null),{disabled:C,updateMeasurementsFor:j,timeout:w}={...i_,...a},S=Ya(j??s),T=p.useCallback(()=>{if(!x.current){x.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),v.current=null},w)},[w]),N=Yu({callback:T,disabled:C||!c}),A=p.useCallback((I,K)=>{N&&(K&&(N.unobserve(K),x.current=!1),I&&N.observe(I))},[N]),[$,R]=mu(A),O=Ya(t);return p.useEffect(()=>{!N||!$.current||(N.disconnect(),x.current=!1,N.observe($.current))},[$,N]),p.useEffect(()=>(d({type:Yt.RegisterDroppable,element:{id:s,key:l,disabled:n,node:$,rect:y,data:O}}),()=>d({type:Yt.UnregisterDroppable,key:l,id:s})),[s]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:Yt.SetDroppableDisabled,id:s,key:l,disabled:n}),g.current.disabled=n)},[s,l,n,d]),{active:c,rect:y,isOver:(f==null?void 0:f.id)===s,node:$,over:f,setNodeRef:R}}function hl(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function l_(e,t){return e.reduce((n,s,a)=>{const l=t.get(s);return l&&(n[a]=l),n},Array(e.length))}function $c(e){return e!==null&&e>=0}function c_(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function u_(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const g1=e=>{let{rects:t,activeIndex:n,overIndex:s,index:a}=e;const l=hl(t,s,n),c=t[a],d=l[a];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Mc={scaleX:1,scaleY:1},Gh=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:a,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:s;if(!d)return null;if(a===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...Mc}:null}const f=d_(l,a,n);return a>n&&a<=c?{x:0,y:-d.height-f,...Mc}:a<n&&a>=c?{x:0,y:d.height+f,...Mc}:{x:0,y:0,...Mc}};function d_(e,t,n){const s=e[t],a=e[t-1],l=e[t+1];return s?n<t?a?s.top-(a.top+a.height):l?l.top-(s.top+s.height):0:l?l.top-(s.top+s.height):a?s.top-(a.top+a.height):0:0}const x1="Sortable",y1=Lt.createContext({activeIndex:-1,containerId:x1,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:g1,disabled:{draggable:!1,droppable:!1}});function Yh(e){let{children:t,id:n,items:s,strategy:a=g1,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:m,measureDroppableContainers:g}=s_(),x=fl(x1,n),y=d.rect!==null,v=p.useMemo(()=>s.map(R=>typeof R=="object"&&"id"in R?R.id:R),[s]),C=c!=null,j=c?v.indexOf(c.id):-1,w=m?v.indexOf(m.id):-1,S=p.useRef(v),T=!c_(v,S.current),N=w!==-1&&j===-1||T,A=u_(l);Jr(()=>{T&&C&&g(v)},[T,v,C,g]),p.useEffect(()=>{S.current=v},[v]);const $=p.useMemo(()=>({activeIndex:j,containerId:x,disabled:A,disableTransforms:N,items:v,overIndex:w,useDragOverlay:y,sortedRects:l_(v,f),strategy:a}),[j,x,A.draggable,A.droppable,N,v,w,f,y,a]);return Lt.createElement(y1.Provider,{value:$},t)}const f_=e=>{let{id:t,items:n,activeIndex:s,overIndex:a}=e;return hl(n,s,a).indexOf(t)},p_=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:a,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:m}=e;return!m||!s||d!==l&&a===c?!1:n?!0:c!==a&&t===f},m_={duration:200,easing:"ease"},v1="transform",h_=vo.Transition.toString({property:v1,duration:0,easing:"linear"}),g_={roleDescription:"sortable"};function x_(e){let{disabled:t,index:n,node:s,rect:a}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Jr(()=>{if(!t&&n!==d.current&&s.current){const f=a.current;if(f){const m=Di(s.current,{ignoreTransform:!0}),g={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,s,a]),p.useEffect(()=>{l&&c(null)},[l]),l}function Jh(e){let{animateLayoutChanges:t=p_,attributes:n,disabled:s,data:a,getNewIndex:l=f_,id:c,strategy:d,resizeObserverConfig:f,transition:m=m_}=e;const{items:g,containerId:x,activeIndex:y,disabled:v,disableTransforms:C,sortedRects:j,overIndex:w,useDragOverlay:S,strategy:T}=p.useContext(y1),N=y_(s,v),A=g.indexOf(c),$=p.useMemo(()=>({sortable:{containerId:x,index:A,items:g},...a}),[x,a,A,g]),R=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:O,node:I,isOver:K,setNodeRef:X}=a_({id:c,data:$,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...f}}),{active:_,activatorEvent:H,activeNodeRect:J,attributes:U,setNodeRef:Y,listeners:z,isDragging:V,over:D,setActivatorNodeRef:Q,transform:E}=r_({id:c,data:$,attributes:{...g_,...n},disabled:N.draggable}),M=F$(X,Y),ee=!!_,L=ee&&!C&&$c(y)&&$c(w),ae=!S&&V,ce=ae&&L?E:null,ge=L?ce??(d??T)({rects:j,activeNodeRect:J,activeIndex:y,overIndex:w,index:A}):null,je=$c(y)&&$c(w)?l({id:c,items:g,activeIndex:y,overIndex:w}):A,Ne=_==null?void 0:_.id,ke=p.useRef({activeId:Ne,items:g,newIndex:je,containerId:x}),We=g!==ke.current.items,Ye=t({active:_,containerId:x,isDragging:V,isSorting:ee,id:c,index:A,items:g,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:m,wasDragging:ke.current.activeId!=null}),ie=x_({disabled:!Ye,index:A,node:I,rect:O});return p.useEffect(()=>{ee&&ke.current.newIndex!==je&&(ke.current.newIndex=je),x!==ke.current.containerId&&(ke.current.containerId=x),g!==ke.current.items&&(ke.current.items=g)},[ee,je,x,g]),p.useEffect(()=>{if(Ne===ke.current.activeId)return;if(Ne!=null&&ke.current.activeId==null){ke.current.activeId=Ne;return}const le=setTimeout(()=>{ke.current.activeId=Ne},50);return()=>clearTimeout(le)},[Ne]),{active:_,activeIndex:y,attributes:U,data:$,rect:O,index:A,newIndex:je,items:g,isOver:K,isSorting:ee,isDragging:V,listeners:z,node:I,overIndex:w,over:D,setNodeRef:M,setActivatorNodeRef:Q,setDroppableNodeRef:X,setDraggableNodeRef:Y,transform:ie??ge,transition:ne()};function ne(){if(ie||We&&ke.current.newIndex===A)return h_;if(!(ae&&!Bh(H)||!m)&&(ee||Ye))return vo.Transition.toString({...m,property:v1})}}function y_(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}nt.Down,nt.Right,nt.Up,nt.Left;function es(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function v_(e){const[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(null),d=p.useCallback(async()=>{if(e)try{const f=await fetch(es(e));if(!f.ok)throw new Error(`HTTP ${f.status}`);n(await f.json()),c(null)}catch(f){c(f instanceof Error?f.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return p.useEffect(()=>{d()},[d]),Nu(f=>{f.type==="todos-updated"&&f.projectSlug===e&&d()}),{data:t,loading:s,error:l,refetch:d}}async function b_(e,t,n){await fetch(es(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function w_(e,t,n){await fetch(`${es(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function j_(e,t,n){await fetch(`${es(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function k_(e,t,n){await fetch(`${es(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function S_(e,t){await fetch(`${es(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function N_(e,t){await fetch(`${es(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function C_(e,t){await fetch(`${es(e)}/${t}`,{method:"DELETE"})}async function b1(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function E_(e,t){return await b1(`${es(e)}/promote`,t)}async function T_(e,t,n){await b1(`${es(e)}/${t}/move`,{to:n})}const zb=[{value:"open",icon:"○",label:"Open",color:"text-muted-foreground"},{value:"in_progress",icon:"◉",label:"In Progress",color:"text-status-in-progress-foreground"},{value:"completed",icon:"✓",label:"Completed",color:"text-status-completed-foreground"},{value:"blocked",icon:"✕",label:"Blocked",color:"text-status-blocked-foreground"}];function Xh({status:e,onChange:t}){const[n,s]=p.useState(!1),a=p.useRef(null);p.useEffect(()=>{if(!n)return;function c(d){a.current&&!a.current.contains(d.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=zb.find(c=>c.value===e);return r.jsxs("div",{className:"relative",ref:a,onClick:c=>c.stopPropagation(),children:[r.jsx("button",{onClick:()=>s(!n),className:`text-lg leading-none ${l.color} hover:opacity-70 transition`,title:l.label,children:l.icon}),n&&r.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:zb.filter(c=>c.value!==e).map(c=>r.jsxs("button",{onClick:()=>{t(c.value),s(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-foreground/5 transition ${c.color}`,children:[r.jsx("span",{className:"text-base leading-none",children:c.icon}),r.jsx("span",{children:c.label})]},c.value))})]})}const w1="__one_off__";function Qh({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a,defaultProject:l,defaultTitle:c,allowOneOff:d=!0}){const[f,m]=p.useState("new"),[g,x]=p.useState(!1),[y,v]=p.useState(null),[C,j]=p.useState(null),[w,S]=p.useState(null),[T,N]=p.useState(""),[A,$]=p.useState(""),[R,O]=p.useState(""),[I,K]=p.useState(""),[X,_]=p.useState(""),[H,J]=p.useState(""),[U,Y]=p.useState(null),[z,V]=p.useState(!1),D=t.length>1;p.useEffect(()=>{if(!e){m("new"),v(null),N(""),$(""),O(""),K(""),_(""),J(""),Y(null);return}N(l??""),$(c??"");let ae=!1;return(async()=>{try{const ce=await fetch("/api/projects");if(!ce.ok)throw new Error(`HTTP ${ce.status}`);const Z=await ce.json();ae||j(Z.filter(ge=>!ge.archived))}catch(ce){ae||S(ce instanceof Error?ce.message:String(ce))}})(),()=>{ae=!0}},[e,l,c]),p.useEffect(()=>{if(!X){Y(null);return}let ae=!1;return V(!0),(async()=>{try{const ce=await fetch(`/api/projects/${encodeURIComponent(X)}/assignments`);if(!ce.ok)throw new Error(`HTTP ${ce.status}`);const Z=await ce.json();ae||Y(Z)}catch{ae||Y([])}finally{ae||V(!1)}})(),()=>{ae=!0}},[X]);const Q=p.useMemo(()=>C??[],[C]);async function E(ae){if(ae.preventDefault(),!T){v('Pick a target project (or "One-off").');return}if(D&&!A.trim()){v("Title is required when promoting multiple todos.");return}const ce=T===w1?{oneOff:!0}:{project:T};if(n.kind==="aggregate"){const ge={groups:n.groups,mode:"new-assignment",target:ce,title:A.trim()||void 0,type:R.trim()||void 0,priority:I||void 0};await L(ge);return}const Z={todoIds:t,mode:"new-assignment",target:ce,title:A.trim()||void 0,type:R.trim()||void 0,priority:I||void 0};await ee(Z)}async function M(ae){if(ae.preventDefault(),n.kind==="aggregate"){v("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!X||!H){v("Pick both project and assignment.");return}const ce={todoIds:t,mode:"to-assignment",target:{assignment:`${X}/${H}`}};await ee(ce)}async function ee(ae){x(!0),v(null);try{let ce;if(n.kind==="workspace")ce=await wT(n.workspace,ae);else if(n.kind==="project")ce=await E_(n.projectId,ae);else throw new Error("Aggregate scope requires runBulkMutation.");a(ce),s(!1)}catch(ce){v(ce instanceof Error?ce.message:String(ce))}finally{x(!1)}}async function L(ae){x(!0),v(null);try{const ce=await jT(ae);a(ce),s(!1)}catch(ce){v(ce instanceof Error?ce.message:String(ce))}finally{x(!1)}}return r.jsx(Rr,{open:e,onOpenChange:ae=>g?void 0:s(ae),children:r.jsxs(dr,{className:"max-w-xl",children:[r.jsxs(Ks,{children:[r.jsxs(fr,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(Qr,{children:["Convert the selected todo",t.length===1?"":"s"," to a new or existing assignment. Source todo",t.length===1?"":"s"," will be marked ",r.jsx("strong",{children:"in progress"})," and linked to the new assignment (auto-completed when the assignment closes)."]})]}),r.jsxs(yk,{value:f,onValueChange:ae=>m(ae),children:[r.jsxs(vk,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(Xp,{value:"new",className:ze("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"New assignment"}),r.jsx(Xp,{value:"existing",className:ze("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"Existing assignment"})]}),r.jsx(Qp,{value:"new",children:r.jsxs("form",{onSubmit:E,className:"space-y-4",children:[r.jsx(Zo,{label:"Target project",children:r.jsx(Bb,{value:T,onChange:N,projects:Q,error:w,disabled:g,allowOneOff:d})}),r.jsx(Zo,{label:D?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:A,onChange:ae=>$(ae.target.value),disabled:g,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(Zo,{label:"Type",children:r.jsx("input",{type:"text",value:R,onChange:ae=>O(ae.target.value),placeholder:"feature",disabled:g,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsx(Zo,{label:"Priority",children:r.jsxs("select",{value:I,onChange:ae=>K(ae.target.value),disabled:g,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"—"}),r.jsx("option",{value:"low",children:"low"}),r.jsx("option",{value:"medium",children:"medium"}),r.jsx("option",{value:"high",children:"high"}),r.jsx("option",{value:"critical",children:"critical"})]})})]}),y?r.jsx(Ub,{message:y}):null,r.jsx(Hb,{onCancel:()=>s(!1),submitting:g,submitLabel:"Promote"})]})}),r.jsx(Qp,{value:"existing",children:r.jsxs("form",{onSubmit:M,className:"space-y-4",children:[r.jsx(Zo,{label:"Project",children:r.jsx(Bb,{value:X,onChange:ae=>{_(ae),J("")},projects:Q,error:w,disabled:g})}),r.jsx(Zo,{label:z?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:H,onChange:ae=>J(ae.target.value),disabled:g||!X||z,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:X?"Select assignment...":"Pick a project first"}),(U??[]).map(ae=>r.jsxs("option",{value:ae.slug,children:[ae.title," (",ae.status,")"]},ae.slug))]})}),y?r.jsx(Ub,{message:y}):null,r.jsx(Hb,{onCancel:()=>s(!1),submitting:g,submitLabel:"Promote"})]})})]})]})})}function Zo({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Bb({value:e,onChange:t,projects:n,error:s,disabled:a,allowOneOff:l}){return s?r.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load projects: ",s]}):r.jsxs("select",{value:e,onChange:c=>t(c.target.value),disabled:a,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),l?r.jsx("option",{value:w1,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function Ub({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function Hb({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:e,disabled:t,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:t,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:t?"Submitting...":n})]})}function j1({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a}){const[l,c]=p.useState("project"),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState(!1),[v,C]=p.useState(null),[j,w]=p.useState(null),[S,T]=p.useState(null);p.useEffect(()=>{if(!e){c("project"),f(""),g(""),C(null),w(null);return}let O=!1;return(async()=>{try{const I=await fetch("/api/projects");if(!I.ok)throw new Error(`HTTP ${I.status}`);const K=await I.json();O||T(K.filter(X=>!X.archived))}catch(I){O||w(I instanceof Error?I.message:String(I))}})(),()=>{O=!0}},[e]);const N=p.useMemo(()=>S?n.kind==="project"?S.filter(O=>O.slug!==n.projectId):S:[],[S,n]);function A(){if(l==="global")return{global:!0};if(l==="workspace"){const O=d.trim();return O?{workspace:O}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function $(O,I){try{return n.kind==="workspace"?await kT(n.workspace,O,I):await T_(n.projectId,O,I),{ok:!0}}catch(K){return{ok:!1,error:K instanceof Error?K.message:String(K)}}}async function R(O){O.preventDefault(),w(null);const I=A();if(typeof I=="string"){w(I);return}y(!0),C(null);const K=[],X=[];for(const _ of t){const H=await $(_,I);H.ok?K.push(_):X.push({id:_,error:H.error})}y(!1),a(),X.length===0?s(!1):C({succeeded:K,failed:X})}return r.jsx(Rr,{open:e,onOpenChange:O=>x?void 0:s(O),children:r.jsx(dr,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:R,className:"space-y-4",children:[r.jsxs(Ks,{children:[r.jsxs(fr,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(Qr,{children:["Move the selected todo",t.length===1?"":"s"," to a different scope. id, tags, branch, timestamps, and plan dir are preserved."]})]}),r.jsxs("fieldset",{className:"space-y-2",disabled:x,children:[r.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),r.jsx(Cp,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(Cp,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(Cp,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Wb,{label:"Target project",children:r.jsxs("select",{value:m,onChange:O=>g(O.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),N.map(O=>r.jsxs("option",{value:O.slug,children:[O.title," (",O.slug,")"]},O.slug))]})}):null,l==="workspace"?r.jsx(Wb,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:d,onChange:O=>f(O.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,j?r.jsx(P_,{message:j}):null,v?r.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground space-y-1",children:[r.jsxs("div",{className:"font-medium",children:["Moved ",v.succeeded.length," of ",t.length,"; ",v.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:v.failed.map(O=>r.jsxs("li",{children:["[t:",O.id,"] ",O.error]},O.id))})]}):null,r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:v?"Close":"Cancel"}),v===null?r.jsx("button",{type:"submit",disabled:x,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:x?"Moving...":"Move"}):null]})]})})})}function Wb({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Cp({kind:e,checked:t,onChange:n,label:s}){return r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx("input",{type:"radio",name:"move-target-kind",value:e,checked:t,onChange:n}),r.jsx("span",{children:s})]})}function P_({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function R_({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:f,disabled:m,hotkeyRowProps:g}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=Jh({id:e.id,disabled:m}),T={transform:vo.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:T,"data-todo-id":e.id,...g??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:C,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(Pm,{className:"h-4 w-4"})}),r.jsx(Xh,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(k1,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(ji,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(Ha,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:r.jsx(rl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>f(N,e.id,e.description),children:r.jsx(zn,{className:"h-3 w-3"})})]})]})}function k1({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:r.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 align-middle",children:[e.branch?r.jsx(ho,{delayDuration:120,children:r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-info-foreground/30 bg-info/30 px-1.5 py-0.5 text-[10px] font-mono text-info-foreground",children:[r.jsx(Tm,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"max-w-[120px] truncate",children:e.branch})]})}),r.jsx(kr,{children:e.branch})]})}):null,e.planDir?r.jsx(ho,{delayDuration:120,children:r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),navigator.clipboard.writeText(e.planDir)},className:"inline-flex items-center rounded-full border border-status-completed-foreground/40 bg-status-completed/30 p-1 text-status-completed-foreground hover:bg-status-completed/50","aria-label":"Copy plan directory path",children:r.jsx(Lw,{className:"h-2.5 w-2.5"})})}),r.jsxs(kr,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(ho,{delayDuration:120,children:r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(kr,{children:r.jsxs("div",{className:"space-y-0.5 text-xs font-mono",children:[e.worktreePath?r.jsxs("div",{children:["worktree: ",e.worktreePath]}):null,e.createdAt?r.jsxs("div",{children:["created: ",e.createdAt]}):null,e.updatedAt?r.jsxs("div",{children:["updated: ",e.updatedAt]}):null]})})]})}):null]})}function A_(){const{workspace:e}=kt(),t=e||"_global",{data:n,loading:s,error:a,refetch:l}=vT(t),[c,d]=p.useState(""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(""),[C,j]=p.useState(null),[w,S]=p.useState(new Set),[T,N]=p.useState(!1),[A,$]=p.useState(!1),[R,O]=p.useState(null),I=p.useRef(null);Js("list:todos");const K=!!(c.trim()||f||g),X=Uh(vi(ml,{activationConstraint:{distance:8}}),vi(pl));function _(ne,le){ne.stopPropagation(),navigator.clipboard.writeText(le),j(le),setTimeout(()=>j(W=>W===le?null:W),1500)}const H=p.useMemo(()=>{if(!(n!=null&&n.items))return[];const ne=new Set;for(const le of n.items)for(const W of le.tags)ne.add(W);return Array.from(ne).sort()},[n]),J=p.useMemo(()=>{if(!(n!=null&&n.items))return[];let ne=n.items;if(c.trim()){const le=c.toLowerCase();ne=ne.filter(W=>W.description.toLowerCase().includes(le)||W.tags.some(pe=>pe.toLowerCase().includes(le))||W.id.includes(le))}return f&&(ne=ne.filter(le=>le.status===f)),g&&(ne=ne.filter(le=>le.tags.includes(g))),ne},[n,c,f,g]);p.useEffect(()=>{S(new Set)},[c,f,g,t]);const U=p.useMemo(()=>J.filter(ne=>w.has(ne.id)).length,[J,w]),Y=J.length>0&&U===J.length,z=U>0&&!Y;function V(ne){S(le=>{const W=new Set(le);return W.has(ne)?W.delete(ne):W.add(ne),W})}function D(){S(ne=>{const le=new Set(ne);if(Y)for(const W of J)le.delete(W.id);else for(const W of J)le.add(W.id);return le})}function Q(){S(new Set)}const E=R?[R]:Array.from(w);function M(){S(new Set),O(null),l()}function ee(){S(new Set),l()}async function L(){y.trim()&&(await Bm(t,y.trim()),v(""),l())}const ae={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ce(ne,le){ge(ne,ae[le]||"open")}async function Z(ne,le,W){ne.stopPropagation(),window.confirm(`Delete "${W}"? This can't be undone.`)&&(await m0(t,le),l())}async function ge(ne,le){switch(le){case"open":await p0(t,ne);break;case"in_progress":await f0(t,ne);break;case"completed":await u0(t,ne);break;case"blocked":await d0(t,ne);break}l()}const{hotkeyRowProps:je}=sl(J,{scope:"list:todos",bindO:!1,onOpen:ne=>ce(ne.id,ne.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ne;return(ne=I.current)==null?void 0:ne.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[Ne,ke]=Xr(),We=Ne.get("focus");p.useEffect(()=>{if(!We)return;const ne=document.querySelector(`[data-todo-id="${window.CSS.escape(We)}"]`);if(!ne)return;ne.scrollIntoView({block:"nearest"}),ne.classList.add("ring-2","ring-primary/60");const le=window.setTimeout(()=>{ne.classList.remove("ring-2","ring-primary/60"),ke(W=>{const pe=new URLSearchParams(W);return pe.delete("focus"),pe})},1500);return()=>window.clearTimeout(le)},[We,J.length,ke]);async function Ye(ne){const{active:le,over:W}=ne;if(!W||le.id===W.id||!(n!=null&&n.items))return;const pe=n.items.findIndex(Oe=>Oe.id===le.id),ve=n.items.findIndex(Oe=>Oe.id===W.id);if(pe===-1||ve===-1)return;const _e=hl(n.items,pe,ve);await bT(t,_e.map(Oe=>Oe.id)),l()}if(s)return r.jsx(at,{label:"Loading todos..."});if(a)return r.jsx(et,{error:a});const ie=(n==null?void 0:n.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(mn,{label:"Open",value:ie.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:ie.in_progress,icon:cr,tone:"info"}),r.jsx(mn,{label:"Blocked",value:ie.blocked,icon:Im,tone:"warn"}),r.jsx(mn,{label:"Total",value:ie.total,icon:cr})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:ne=>v(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&L(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:L,disabled:!y.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(Ht,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:I,type:"text",placeholder:"Search...",value:c,onChange:ne=>d(ne.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:f,onChange:ne=>m(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),H.length>0&&r.jsxs("select",{value:g,onChange:ne=>x(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),H.map(ne=>r.jsxs("option",{value:ne,children:["#",ne]},ne))]})]}),w.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[w.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>N(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{O(null),$(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:Q,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,J.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:Y,ref:ne=>{ne&&(ne.indeterminate=z)},onChange:D,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",J.length,")"]})]}),r.jsx(Kh,{sensors:X,collisionDetection:Hh,onDragEnd:Ye,children:r.jsx(Yh,{items:J.map(ne=>ne.id),strategy:Gh,children:r.jsx("div",{className:"space-y-1",children:J.map((ne,le)=>r.jsx(R_,{item:ne,copiedId:C,selected:w.has(ne.id),onToggleSelected:W=>V(W),onMoveOne:(W,pe)=>{pe.stopPropagation(),O(W),$(!0)},onCycleStatus:ce,onStatusChange:ge,onCopyId:_,onDelete:Z,disabled:K,hotkeyRowProps:je(le)},ne.id))})})})]}),r.jsx(Qh,{open:T,selectedIds:Array.from(w),scope:{kind:"workspace",workspace:t},onOpenChange:N,onDone:ee}),r.jsx(j1,{open:A,selectedIds:E,scope:{kind:"workspace",workspace:t},onOpenChange:ne=>{$(ne),ne||O(null)},onDone:M})]})}function D_({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:f,disabled:m,hotkeyRowProps:g}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=Jh({id:e.id,disabled:m}),T={transform:vo.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:T,"data-todo-id":e.id,...g??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:C,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(Pm,{className:"h-4 w-4"})}),r.jsx(Xh,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(k1,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(ji,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(Ha,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:r.jsx(rl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>f(N,e.id,e.description),children:r.jsx(zn,{className:"h-3 w-3"})})]})]})}function O_({projectId:e}){const{data:t,loading:n,error:s,refetch:a}=v_(e),[l,c]=p.useState(""),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState(""),[v,C]=p.useState(null),[j,w]=p.useState(new Set),[S,T]=p.useState(!1),[N,A]=p.useState(!1),[$,R]=p.useState(null),O=p.useRef(null);Js("list:todos");const I=!!(l.trim()||d||m),K=Uh(vi(ml,{activationConstraint:{distance:8}}),vi(pl));function X(ie,ne){ie.stopPropagation(),navigator.clipboard.writeText(ne),C(ne),setTimeout(()=>C(le=>le===ne?null:le),1500)}const _=p.useMemo(()=>{if(!(t!=null&&t.items))return[];const ie=new Set;for(const ne of t.items)for(const le of ne.tags)ie.add(le);return Array.from(ie).sort()},[t]),H=p.useMemo(()=>{if(!(t!=null&&t.items))return[];let ie=t.items;if(l.trim()){const ne=l.toLowerCase();ie=ie.filter(le=>le.description.toLowerCase().includes(ne)||le.tags.some(W=>W.toLowerCase().includes(ne))||le.id.includes(ne))}return d&&(ie=ie.filter(ne=>ne.status===d)),m&&(ie=ie.filter(ne=>ne.tags.includes(m))),ie},[t,l,d,m]);p.useEffect(()=>{w(new Set)},[l,d,m,e]);const J=p.useMemo(()=>H.filter(ie=>j.has(ie.id)).length,[H,j]),U=H.length>0&&J===H.length,Y=J>0&&!U;function z(ie){w(ne=>{const le=new Set(ne);return le.has(ie)?le.delete(ie):le.add(ie),le})}function V(){w(ie=>{const ne=new Set(ie);if(U)for(const le of H)ne.delete(le.id);else for(const le of H)ne.add(le.id);return ne})}function D(){w(new Set)}const Q=$?[$]:Array.from(j);function E(){w(new Set),R(null),a()}function M(){w(new Set),a()}async function ee(){x.trim()&&(await b_(e,x.trim()),y(""),a())}const L={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ae(ie,ne){Z(ie,L[ne]||"open")}async function ce(ie,ne,le){ie.stopPropagation(),window.confirm(`Delete "${le}"? This can't be undone.`)&&(await C_(e,ne),a())}async function Z(ie,ne){switch(ne){case"open":await S_(e,ie);break;case"in_progress":await k_(e,ie);break;case"completed":await w_(e,ie);break;case"blocked":await j_(e,ie);break}a()}const{hotkeyRowProps:ge}=sl(H,{scope:"list:todos",bindO:!1,onOpen:ie=>ae(ie.id,ie.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ie;return(ie=O.current)==null?void 0:ie.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>a()});const[je,Ne]=Xr(),ke=je.get("focus");p.useEffect(()=>{if(!ke)return;const ie=document.querySelector(`[data-todo-id="${window.CSS.escape(ke)}"]`);if(!ie)return;ie.scrollIntoView({block:"nearest"}),ie.classList.add("ring-2","ring-primary/60");const ne=window.setTimeout(()=>{ie.classList.remove("ring-2","ring-primary/60"),Ne(le=>{const W=new URLSearchParams(le);return W.delete("focus"),W},{replace:!0})},1500);return()=>window.clearTimeout(ne)},[ke,H.length,Ne]);async function We(ie){const{active:ne,over:le}=ie;if(!le||ne.id===le.id||!(t!=null&&t.items))return;const W=t.items.findIndex(_e=>_e.id===ne.id),pe=t.items.findIndex(_e=>_e.id===le.id);if(W===-1||pe===-1)return;const ve=hl(t.items,W,pe);await N_(e,ve.map(_e=>_e.id)),a()}if(n)return r.jsx(at,{label:"Loading todos..."});if(s)return r.jsx(et,{error:s});const Ye=(t==null?void 0:t.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(mn,{label:"Open",value:Ye.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:Ye.in_progress,icon:cr,tone:"info"}),r.jsx(mn,{label:"Blocked",value:Ye.blocked,icon:Im,tone:"warn"}),r.jsx(mn,{label:"Total",value:Ye.total,icon:cr})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:ie=>y(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ee(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:ee,disabled:!x.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(Ht,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:O,type:"text",placeholder:"Search...",value:l,onChange:ie=>c(ie.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:d,onChange:ie=>f(ie.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),_.length>0&&r.jsxs("select",{value:m,onChange:ie=>g(ie.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),_.map(ie=>r.jsxs("option",{value:ie,children:["#",ie]},ie))]})]}),j.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[j.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>T(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{R(null),A(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:D,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,H.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:U,ref:ie=>{ie&&(ie.indeterminate=Y)},onChange:V,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",H.length,")"]})]}),r.jsx(Kh,{sensors:K,collisionDetection:Hh,onDragEnd:We,children:r.jsx(Yh,{items:H.map(ie=>ie.id),strategy:Gh,children:r.jsx("div",{className:"space-y-1",children:H.map((ie,ne)=>r.jsx(D_,{item:ie,copiedId:v,selected:j.has(ie.id),onToggleSelected:le=>z(le),onMoveOne:(le,W)=>{W.stopPropagation(),R(le),A(!0)},onCycleStatus:ae,onStatusChange:Z,onCopyId:X,onDelete:ce,disabled:I,hotkeyRowProps:ge(ne)},ie.id))})})})]}),r.jsx(Qh,{open:S,selectedIds:Array.from(j),scope:{kind:"project",projectId:e},onOpenChange:T,onDone:M}),r.jsx(j1,{open:N,selectedIds:Q,scope:{kind:"project",projectId:e},onOpenChange:ie=>{A(ie),ie||R(null)},onDone:E})]})}const S1=["kanban","list","table"],I_=["title","status","priority","assignee","dependencies","updated"],L_=["asc","desc"],$_=["comfortable","compact"],M_={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Xa={version:1,global:M_,projects:{}};function Vb(e){return e==="table"?"table":"kanban"}function __(e,t){return t?{...e,...t}:{...e}}function N1(e,t){const n=e.global;if(t===null)return n;const s=e.projects[t];return s?{defaultView:s.defaultView??n.defaultView,sortField:s.sortField??n.sortField,sortDirection:s.sortDirection??n.sortDirection,density:n.density,grouping:s.grouping??n.grouping,filters:__(n.filters,s.filters)}:n}const hi={...Xa,custom:!1},C1=`view-prefs.cache.v${Xa.version}`;let Qa=F_(),ei=null;const Za=new Set;let E1=0;function Zh(){return++E1}function eg(e){return e===E1}function F_(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(C1);if(!e)return null;const t=JSON.parse(e);return t.version!==Xa.version?null:t}catch{return null}}function z_(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(C1,JSON.stringify(e))}catch{}}function tg(e){Qa=e,z_(e);for(const t of Za)t(e)}function ng(e){if(!e||typeof e!="object")return hi;const t=e;return t.version!==Xa.version||!t.global||!t.projects?hi:{version:Xa.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function rg(){if(ei)return ei;const e=Zh();return ei=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=ng(t);return eg(e)&&tg(n),ei=null,Qa??n}).catch(()=>(ei=null,Qa??hi)),ei}function T1(e){const[t,n]=p.useState(()=>Qa??hi);return p.useEffect(()=>{let s=!1;return rg().then(a=>{s||n(a)}),Za.add(n),()=>{s=!0,Za.delete(n)}},[]),N1(t,e??null)}function B_(){const[e,t]=p.useState(()=>Qa??hi);return p.useEffect(()=>{let n=!1;return rg().then(s=>{n||t(s)}),Za.add(t),()=>{n=!0,Za.delete(t)}},[]),e}async function P1(e){const t=Zh(),n=await fetch("/api/view-prefs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save view-prefs")}const s=ng(await n.json());return eg(t)&&tg(s),s}function R1(e){return P1({global:e})}function A1(e,t){return P1({projects:{[e]:t}})}async function U_(){const e=Zh(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=ng(await t.json());return eg(e)&&tg(n),n}const H_=new Set(["overview","assignments","todos","dependencies","knowledge"]);function qb(){const{slug:e}=kt(),t=Pt(),n=Tt();Js("project"),pt({keys:"a",scope:"project",description:"Create assignment",handler:()=>n(`${t}/projects/${e}/create/assignment`)}),pt({keys:"e",scope:"project",description:"Edit project",handler:()=>n(`${t}/projects/${e}/edit`)});const{data:s,loading:a,error:l,refetch:c}=o0(e),d=Hu(),{data:f}=Cu(),[m,g]=Xr(),x=m.get("tab"),y=x&&H_.has(x)?x:"overview";function v(D){g(Q=>{const E=new URLSearchParams(Q);return D==="overview"?E.delete("tab"):E.set("tab",D),E},{replace:!0})}const C=e?`p:${e}`:null,j=T1(C),[w,S]=p.useState(()=>Vb(j.defaultView)),[T,N]=p.useState(()=>j.filters.status??"all"),[A,$]=p.useState(()=>j.filters.assignee??"all"),[R,O]=p.useState(()=>j.filters.priority??"all");p.useEffect(()=>{S(Vb(j.defaultView)),N(j.filters.status??"all"),$(j.filters.assignee??"all"),O(j.filters.priority??"all")},[e,j.defaultView,j.filters.status,j.filters.assignee,j.filters.priority]);const I=p.useCallback(D=>{C&&A1(C,D).catch(Q=>{console.warn("Failed to persist project view prefs:",Q)})},[C]),K=p.useCallback(D=>{S(D),I({defaultView:D})},[I]),X=p.useCallback(D=>{N(D),I({filters:{status:D}})},[I]),_=p.useCallback(D=>{$(D),I({filters:{assignee:D}})},[I]),H=p.useCallback(D=>{O(D),I({filters:{priority:D}})},[I]),J=p.useMemo(()=>s?Object.fromEntries(s.assignments.flatMap(D=>{const Q=`${t}/projects/${s.slug}/assignments/${D.slug}`;return[[D.slug,Q],[D.title,Q]]})):{},[s]);async function U(D){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:D})}),c()}async function Y(D){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:D})}),c()}if(a)return r.jsx(at,{label:"Loading project workspace…"});if(l||!s)return r.jsx(et,{error:l||"Project not found."});const z=Array.from(new Set(s.assignments.map(D=>D.assignee).filter(Boolean))).sort(),V=s.assignments.filter(D=>!(T!=="all"&&D.status!==T||A!=="all"&&D.assignee!==A||R!=="all"&&D.priority!==R));return r.jsxs("div",{className:"space-y-5","data-density":j.density,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(wn,{status:s.status}),s.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>U(null),title:"Clear manual status override and return to derived status",children:"Clear Override"}),r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:D=>{D.target.value&&U(D.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),d.statuses.map(D=>r.jsx("option",{value:D.id,children:D.label},D.id)),r.jsx("option",{value:"active",children:"Active"})]}),f&&f.workspaces.length>0&&r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:D=>{D.target.value==="_ungrouped"?Y(null):D.target.value&&Y(D.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),f.workspaces.filter(D=>D!==s.workspace).map(D=>r.jsx("option",{value:D,children:D},D)),s.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(we,{className:"shell-action",to:`${t}/projects/${s.slug}/edit`,children:[r.jsx(Zy,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Project"})]}),r.jsxs(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(wh,{externalIds:s.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",Kr(s.created),". Last source update ",Gr(s.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(mn,{label:"Assignments",value:s.progress.total}),r.jsx(mn,{label:"In Progress",value:s.progress.in_progress??0,tone:"info"}),r.jsx(mn,{label:"Review",value:s.progress.review??0,tone:"info"}),r.jsx(mn,{label:"Blocked",value:s.progress.blocked??0,tone:"warn"}),r.jsx(mn,{label:"Completed",value:s.progress.completed??0,tone:"success"})]}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(kh,{value:y,onValueChange:v,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{title:"Project Overview",children:r.jsx(Ut,{content:s.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:s.assignments.length,content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{title:"Assignment Queue",description:"Board and table views over the source assignment files.",actions:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("select",{value:T,onChange:D=>X(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),d.statuses.map(D=>r.jsx("option",{value:D.id,children:D.label},D.id))]}),r.jsxs("select",{value:A,onChange:D=>_(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),z.map(D=>r.jsx("option",{value:D??"",children:D},D))]}),r.jsxs("select",{value:R,onChange:D=>H(D.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"critical",children:"Critical"})]}),r.jsx(yh,{value:w,onChange:D=>K(D),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]})]}),children:V.length===0?r.jsx(ot,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:r.jsx(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:"Create Assignment"})}):w==="kanban"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:V.map(D=>r.jsx(W_,{projectSlug:s.slug,assignment:D},D.slug))}):r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"pb-3 font-medium",children:"Assignment"}),r.jsx("th",{className:"pb-3 font-medium",children:"Status"}),r.jsx("th",{className:"pb-3 font-medium",children:"Priority"}),r.jsx("th",{className:"pb-3 font-medium",children:"Assignee"}),r.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:V.map(D=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"py-4",children:r.jsx(we,{to:`${t}/projects/${s.slug}/assignments/${D.slug}`,className:"font-semibold text-foreground hover:text-primary",children:D.title})}),r.jsx("td",{className:"py-4",children:r.jsx(wn,{status:D.status})}),r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:D.priority}),r.jsx("td",{className:"py-4 text-muted-foreground",children:D.assignee??"—"}),r.jsx("td",{className:"py-4 text-muted-foreground",children:Kr(D.updated)})]},D.slug))})]})})})})},{value:"todos",label:"Todos",content:r.jsx(O_,{projectId:s.slug})},{value:"dependencies",label:"Dependencies",content:s.dependencyGraph?r.jsx(Le,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(g4,{definition:s.dependencyGraph,nodeRoutes:J})}):r.jsx(ot,{title:"No dependency graph yet",description:"Dependencies appear here once assignments declare dependsOn relationships."})},{value:"knowledge",label:"Knowledge",content:r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsx(Le,{title:"Resources",description:"Shared project references.",actions:r.jsxs(we,{className:"shell-action",to:`/resources/new?project=${s.slug}`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:s.resources.length===0?r.jsx(ot,{title:"No resources yet",description:"Resources live at the project level and stay available to every assignment."}):r.jsx("div",{className:"space-y-3",children:s.resources.map(D=>r.jsxs(we,{to:`/projects/${s.slug}/resources/${D.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:D.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[D.category," · ",D.source]})]},D.slug))})}),r.jsx(Le,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:r.jsxs(we,{className:"shell-action",to:`/memories/new?project=${s.slug}`,children:[r.jsx(Ht,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:s.memories.length===0?r.jsx(ot,{title:"No memories yet",description:"Memories capture patterns discovered during execution so later assignments can reuse them."}):r.jsx("div",{className:"space-y-3",children:s.memories.map(D=>r.jsxs(we,{to:`/projects/${s.slug}/memories/${D.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:D.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[D.scope," · ",D.source]})]},D.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{title:"Progress Summary",children:r.jsx(du,{progress:s.progress,showLegend:!0})}),r.jsx(Le,{title:"Attention",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Blocked"}),r.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.blockedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Failed"}),r.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.failedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Unanswered questions"}),r.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.openQuestions})]})]})}),r.jsx(Le,{title:"Quick Links",children:r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/edit`,children:[r.jsx(Zy,{className:"h-4 w-4"}),"Edit project source"]}),r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/create/assignment`,children:[r.jsx(Ht,{className:"h-4 w-4"}),"Create assignment"]}),r.jsxs(we,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[r.jsx(IE,{className:"h-4 w-4"}),"Review project rules"]}),r.jsxs("button",{type:"button",onClick:()=>v("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[r.jsx(Tm,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),s.archived?r.jsxs(Le,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",s.archivedAt?Gr(s.archivedAt):"with no timestamp recorded","."]}),s.archivedReason?r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:s.archivedReason}):null]}):null]})]})]})}function W_({projectSlug:e,assignment:t}){const n=Pt();return r.jsxs(we,{to:`${n}/projects/${e}/assignments/${t.slug}`,className:"vp-card block rounded-lg border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),r.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:t.id,children:[t.id.slice(0,8),r.jsx("span",{onClick:s=>{s.preventDefault(),s.stopPropagation()},children:r.jsx(qr,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Kr(t.updated)]})]}),r.jsx(wn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:t.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:t.assignee??"Unassigned"}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[t.dependsOn.length," dependencies"]})]})]})}function D1({session:e,onMarkStopped:t}){const n=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=resume`,s=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=fork`,a="size-3.5",l=ze("shell-action","inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");return r.jsx(ho,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.resumeSupported&&(e.isLive?r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Wa,{className:a}),r.jsx("span",{children:"Resume"})]})}),r.jsx(kr,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsxs("a",{href:n,className:l,children:[r.jsx(Wa,{className:a}),r.jsx("span",{children:"Resume"})]})}),r.jsx(kr,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsxs("a",{href:s,className:l,children:[r.jsx(KE,{className:a}),r.jsx("span",{children:"Fork"})]})}),r.jsx(kr,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(Om,{className:a}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(kr,{side:"top",children:"Tell the dashboard this session has ended so Resume re-enables"})]})]})})}async function V_(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function O1({sessions:e,loading:t,error:n}){return t&&!e?null:n&&!e?r.jsx(Le,{title:"Agent Sessions",children:r.jsx(ot,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(Le,{title:"Agent Sessions",children:r.jsx(ot,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(Le,{title:"Agent Sessions",children:r.jsx("div",{className:"space-y-2",children:e.map(s=>r.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Sm,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"font-medium text-foreground",children:s.agent}),r.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:s.sessionId,children:[s.sessionId.slice(0,8),r.jsx(qr,{value:s.sessionId})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(wn,{status:s.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:Gr(s.started)})]}),r.jsx(D1,{session:s,onMarkStopped:V_})]},s.sessionId))})})}function I1({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:a,onOpenChange:l}){const[c,d]=p.useState("");p.useEffect(()=>{e||d("")},[e,t==null?void 0:t.command]);const f=p.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,g=s?"Applying...":t.label,x=c.trim()||void 0;return r.jsx(Rr,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(dr,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),a(x)},children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:m}),r.jsx(Qr,{children:t.description})]}),t.warning?r.jsx("div",{className:"rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:t.warning}):null,r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:f}),r.jsx("textarea",{value:c,onChange:y=>d(y.target.value),autoFocus:!0,rows:4,disabled:s,placeholder:"Optional context for why this assignment is blocked.",className:"editor-textarea min-h-[120px] bg-background/95 font-sans"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave this blank to continue without a written reason."})]}),r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>l(!1),disabled:s,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:s,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:g})]})]})})})}function gl({open:e,title:t,description:n,confirmLabel:s,cancelLabel:a="Cancel",loading:l=!1,destructive:c=!1,onConfirm:d,onOpenChange:f}){return r.jsx(nh,{open:e,onOpenChange:m=>l?void 0:f(m),children:r.jsxs(Du,{children:[r.jsxs(rh,{children:[r.jsx(Ou,{children:t}),r.jsx(Iu,{children:n})]}),r.jsxs(sh,{children:[r.jsx(Lu,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:a}),r.jsx(Va,{disabled:l,className:`shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50 ${c?"border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-foreground text-background hover:opacity-90"}`,onClick:m=>{m.preventDefault(),d()},children:l?"Working...":s})]})]})})}function _c(e,t){const n=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`;return t?`${n}&terminal=${encodeURIComponent(t)}`:n}function L1({target:e,worktreePath:t=null,size:n="default",title:s}){const a=e.kind==="assignment"&&(t==null||t===""),[l,c]=p.useState(null),[d,f]=p.useState(!1),m=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",g="Set a worktree first — see the Workspace Before Code playbook",x=ze("shell-action",n==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");if(a)return r.jsxs("button",{type:"button",disabled:!0,title:g,className:x,"aria-disabled":!0,children:[r.jsx(Wa,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]});async function y(){if(!d){f(!0);try{const C=await fetch("/api/launch/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!C.ok){window.location.href=_c(e);return}const j=await C.json();if(j.ok){window.location.href=_c(e);return}c(j)}catch(C){console.warn("preflight failed, firing without override:",C),window.location.href=_c(e)}finally{f(!1)}}}function v(){l&&(window.location.href=_c(e,l.suggestedFallback),c(null))}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",onClick:y,disabled:d,title:s??m,className:x,children:[r.jsx(Wa,{className:"size-3.5"}),r.jsx("span",{children:e.kind==="session"?"Open":"Open in agent"})]}),r.jsx(nh,{open:l!==null,onOpenChange:C=>!C&&c(null),children:r.jsxs(Du,{children:[r.jsxs(rh,{children:[r.jsxs(Ou,{children:[l==null?void 0:l.terminal," is not installed"]}),r.jsxs(Iu,{children:["Open in ",r.jsx("strong",{children:l==null?void 0:l.suggestedFallback})," instead? You can change the default in"," ",r.jsx(we,{to:"/settings",className:"underline hover:text-foreground",onClick:()=>c(null),children:"Settings"}),"."]})]}),r.jsxs(sh,{children:[r.jsx(Lu,{className:"shell-action mt-0",children:"Cancel"}),r.jsxs(Va,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:C=>{C.preventDefault(),v()},children:["Open in ",l==null?void 0:l.suggestedFallback]})]})]})})]})}const Sa="__other__";function $1({projectSlug:e,assignmentSlug:t,assignmentId:n,defaultBranch:s,defaultParentBranch:a="main",onCreated:l}){const c=e&&t?{kind:"project-nested",projectSlug:e,assignmentSlug:t}:{kind:"standalone",assignmentId:n},[d,f]=p.useState(!1),[m,g]=p.useState(null),[x,y]=p.useState(null),[v,C]=p.useState(""),[j,w]=p.useState(""),[S,T]=p.useState(s),[N,A]=p.useState(a),[$,R]=p.useState(!1),[O,I]=p.useState(null);p.useEffect(()=>{if(!d)return;let U=!1;return g(null),y(null),I(null),C(""),w(""),T(s),A(a),(c.kind==="project-nested"?vD(c.projectSlug):bD(c.assignmentId)).then(z=>{if(U)return;g(z);const V=z.find(Q=>Q.source==="project"),D=z.find(Q=>Q.source==="sibling");C((V==null?void 0:V.path)??(D==null?void 0:D.path)??Sa)}).catch(z=>{U||(y(z.message),g([]),C(Sa))}),()=>{U=!0}},[d,s,a,e,t,n]);const K=v===Sa?j.trim():v,X=p.useMemo(()=>!K||!S?"":`${K.replace(/\/+$/,"")}/.worktrees/${S}`,[K,S]),_=m!==null&&m.length===0,H=$||m===null||!K||!S.trim()||!N.trim(),J=async()=>{R(!0),I(null);try{const U={repository:K,branch:S.trim(),parentBranch:N.trim()};c.kind==="project-nested"?await wD(c.projectSlug,c.assignmentSlug,U):await jD(c.assignmentId,U),f(!1),l()}catch(U){U instanceof Jj?I({message:U.message,stderr:U.stderr}):U instanceof Error?I({message:U.message}):I({message:String(U)})}finally{R(!1)}};return r.jsxs(Rr,{open:d,onOpenChange:U=>$?void 0:f(U),children:[r.jsxs("button",{type:"button",className:"shell-action inline-flex items-center gap-1.5",onClick:()=>f(!0),children:[r.jsx(qE,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Create worktree"})]}),r.jsxs(dr,{children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:"Create worktree"}),r.jsxs(Qr,{children:["Creates a git worktree at ",r.jsx("code",{children:"<repo>/.worktrees/<branch>"})," and records the workspace fields on this assignment's frontmatter."]})]}),r.jsxs("div",{className:"grid gap-4 text-sm",children:[_?r.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:["No repositories configured for this project. Enter a repo path below, or add a"," ",r.jsx("code",{children:"repositories:"})," list to ",r.jsx("code",{children:"project.md"}),"."]}):null,x?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:["Could not load repository candidates: ",x]}):null,r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),r.jsxs("select",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",value:v,onChange:U=>C(U.target.value),disabled:$||m===null,children:[(m??[]).map(U=>r.jsxs("option",{value:U.path,children:[U.path,U.source==="project"?" (project)":U.sourceAssignmentSlug?` (sibling — ${U.sourceAssignmentSlug})`:" (sibling)"]},`${U.source}:${U.path}`)),r.jsx("option",{value:Sa,children:"Other…"})]}),v===Sa?r.jsx("input",{className:"mt-1 w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",placeholder:"/absolute/path/to/repo",value:j,onChange:U=>w(U.target.value),disabled:$}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),r.jsx("input",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",value:S,onChange:U=>T(U.target.value),disabled:$})]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Parent branch"}),r.jsx("input",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",value:N,onChange:U=>A(U.target.value),disabled:$})]}),r.jsxs("div",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Worktree path"}),r.jsx("code",{className:"rounded-md border border-border bg-muted px-2 py-1 text-xs",children:X||r.jsx("span",{className:"opacity-60",children:"— pick a repo & branch —"})})]}),O?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:[r.jsx("div",{className:"font-medium",children:O.message}),O.stderr?r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-[11px] opacity-90",children:O.stderr}):null]}):null]}),r.jsxs(Gs,{children:[r.jsx(hR,{disabled:$,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",disabled:H,onClick:()=>void J(),className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:$?"Working…":"Create worktree"})]})]})]})}function q_(e){const t=e.split(`
498
- `),n=t.findIndex(c=>/^##\s+Acceptance Criteria\s*$/i.test(c.trim()));if(n===-1)return{acceptanceCriteria:[],summaryBody:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).map(c=>c.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.*)$/)).filter(c=>!!c).map(c=>({checked:c[1].toLowerCase()==="x",text:c[2].trim()})),l=[...t.slice(0,n),...t.slice(s)].join(`
499
- `).replace(/\n{3,}/g,`
500
-
501
- `).trim();return{acceptanceCriteria:a,summaryBody:l}}function K_(e){const t=e.split(`
502
- `),n=t.findIndex(c=>/^##\s+Todos\s*$/i.test(c.trim()));if(n===-1)return{hasSection:!1,todosMarkdown:"",remaining:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).join(`
503
- `).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
504
-
505
- `).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
506
- `).replace(/\n{3,}/g,`
507
-
508
- `).trim();return{hasSection:!0,todosMarkdown:a,remaining:l}}function G_({projectSlug:e,dependencies:t,blockedReason:n}){const[s,a]=p.useState(!1);if(t.length===0)return null;const l=t.filter(d=>d.status!=="completed"&&d.status!=="review"),c=l.length===0;return c&&!s?r.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center gap-2 rounded-lg border border-success-foreground/30 bg-success/70 px-4 py-2.5 text-left transition hover:bg-success",children:[r.jsx(Cm,{className:"h-4 w-4 shrink-0 text-success-foreground"}),r.jsxs("span",{className:"text-sm font-medium text-success-foreground",children:["All ",t.length," ",t.length===1?"dependency":"dependencies"," resolved"]}),r.jsx(Ua,{className:"ml-auto h-4 w-4 text-success-foreground"})]}):r.jsxs("div",{className:"space-y-3",children:[l.length>0&&r.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3",children:[r.jsx($p,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning-foreground"}),r.jsxs("div",{className:"text-sm text-warning-foreground",children:[r.jsxs("strong",{children:[l.length," ",l.length===1?"dependency is":"dependencies are"," not yet completed."]}),n&&r.jsxs("p",{className:"mt-1 text-warning-foreground/80",children:["Blocked reason: ",n]})]})]}),r.jsx(Le,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?r.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs text-muted-foreground hover:text-foreground",children:"Collapse"}):void 0,children:r.jsx("div",{className:"divide-y divide-border/40",children:t.map(d=>r.jsxs(we,{to:`/projects/${e}/assignments/${d.slug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(wn,{status:d.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:d.slug})]}),d.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:d.assignee}),r.jsx(tu,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},d.slug))})})]})}function Y_({links:e}){const t=Pt();if(e.length===0)return null;const n=e.filter(a=>!a.isReverse),s=e.filter(a=>a.isReverse);return r.jsx(Le,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:r.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(a=>r.jsxs(we,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(Aw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(wn,{status:a.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),r.jsx(tu,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${a.slug}`)),s.map(a=>r.jsxs(we,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(Rw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(wn,{status:a.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),r.jsx(tu,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${a.slug}`))]})})}function J_(e){const t=new Map;for(const s of e)t.set(s.id,{entry:s,replies:[]});const n=[];for(const s of e){const a=t.get(s.id);s.replyTo&&t.has(s.replyTo)?t.get(s.replyTo).replies.push(a):n.push(a)}return n}function X_(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function M1({projectSlug:e,assignmentSlug:t,entries:n}){const[s,a]=p.useState(n);p.useEffect(()=>{a(n)},[n]);const l=p.useMemo(()=>J_(s),[s]),[c,d]=p.useState(""),[f,m]=p.useState("note"),[g,x]=p.useState(!1),[y,v]=p.useState(null);async function C(w){var N;if(w.preventDefault(),!c.trim())return;x(!0),v(null);const S=`tmp-${Date.now()}`,T={id:S,timestamp:new Date().toISOString(),author:"human",type:f,body:c,resolved:f==="question"?!1:void 0};a(A=>[...A,T]);try{const A=await fetch(X_(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:f})});if(!A.ok){const O=await A.text();throw new Error(O||`HTTP ${A.status}`)}const $=await A.json().catch(()=>null),R=(N=$==null?void 0:$.comment)==null?void 0:N.id;a(O=>O.map(I=>I.id===S?{...I,id:R??I.id}:I)),d(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(A){v(A instanceof Error?A.message:String(A)),a($=>$.filter(R=>R.id!==S))}finally{x(!1)}}async function j(w,S){a(T=>T.map(N=>N.id===w?{...N,resolved:S}:N));try{const T=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`,N=await fetch(T,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:S})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(T){v(T instanceof Error?T.message:String(T)),a(N=>N.map(A=>A.id===w?{...A,resolved:!S}:A))}}return r.jsx(Le,{title:"Comments",description:"Threaded questions, notes, and feedback. Questions can be resolved once answered.",children:r.jsxs("div",{className:"space-y-4",children:[l.map(w=>r.jsx(_1,{node:w,onToggleResolved:j,depth:0},w.entry.id)),r.jsxs("form",{onSubmit:C,className:"mt-6 space-y-2 border-t border-border pt-4",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Add comment"}),r.jsx("textarea",{value:c,onChange:w=>d(w.target.value),className:"w-full rounded border border-border bg-background p-2 text-sm",rows:3,placeholder:"Ask a question, leave a note, or give feedback…"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("select",{value:f,onChange:w=>m(w.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs",children:[r.jsx("option",{value:"note",children:"note"}),r.jsx("option",{value:"question",children:"question"}),r.jsx("option",{value:"feedback",children:"feedback"})]}),r.jsx("button",{type:"submit",disabled:g||!c.trim(),className:"shell-action",children:g?"Posting…":"Post comment"}),y?r.jsx("span",{className:"text-xs text-error-foreground",children:y}):null]})]})]})})}function _1({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:a}=e,l=s.type==="question";return r.jsxs("div",{className:ze("space-y-2",t>0&&"ml-4 border-l border-border pl-4"),children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{className:"font-mono",children:s.id}),r.jsx("span",{children:"·"}),r.jsx("span",{children:s.timestamp}),r.jsx("span",{children:"·"}),r.jsx("span",{className:"font-medium text-foreground",children:s.author}),r.jsx("span",{children:"·"}),r.jsx("span",{className:ze("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase",l&&"bg-warning text-warning-foreground",s.type==="feedback"&&"bg-info text-info-foreground",s.type==="note"&&"bg-muted text-muted-foreground"),children:s.type}),l?r.jsxs("button",{type:"button",onClick:()=>n(s.id,!s.resolved),className:ze("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium",s.resolved?"bg-success text-success-foreground hover:bg-success/80":"bg-muted text-muted-foreground hover:bg-muted/80"),title:s.resolved?"Mark unresolved":"Mark resolved",children:[s.resolved?r.jsx(Cm,{className:"h-3 w-3"}):r.jsx(_E,{className:"h-3 w-3"}),s.resolved?"resolved":"open"]}):null,s.replyTo?r.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[r.jsx(n2,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(Ut,{content:s.body}),a.length>0?r.jsx("div",{className:"space-y-2",children:a.map(c=>r.jsx(_1,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const Q_=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function Kb(){var Nt,se,me,Pe,Fe,Ve,tt,cn;const{slug:e,aslug:t}=kt(),n=Tt(),s=Pt(),[a,l]=Xr(),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(null),[y,v]=p.useState(null),[C,j]=p.useState(null),[w,S]=p.useState(!1),[T,N]=p.useState(!1),[A,$]=p.useState(0),R=a.get("tab")??"summary",O=Hu(),{data:I,loading:K,error:X,refetch:_}=tT(e,t),{data:H}=o0(e),{data:J}=zm(),{data:U,loading:Y,error:z}=oT(e,t),V=p.useMemo(()=>{if(!I||!H)return[];const ue=new Map(H.assignments.map(Ge=>[Ge.slug,Ge]));return I.dependsOn.map(Ge=>{const He=ue.get(Ge);return{slug:Ge,title:(He==null?void 0:He.title)??Ge,status:(He==null?void 0:He.status)??"pending",priority:(He==null?void 0:He.priority)??"medium",assignee:(He==null?void 0:He.assignee)??null}})},[I,H]),D=V.filter(ue=>ue.status!=="completed"&&ue.status!=="review");Js("assignment");const Q=p.useMemo(()=>((H==null?void 0:H.assignments)??[]).map(ue=>ue.slug),[H]),E=t?Q.indexOf(t):-1,M=E>0?Q[E-1]:null,ee=E>=0&&E<Q.length-1?Q[E+1]:null,L=`${s}/projects/${e}/assignments/${t}`;pt({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${L}/edit`)}),pt({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${L}/plan/edit`)}),pt({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${L}/handoff/edit`)}),pt({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${L}/decision-record/edit`)}),pt({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${L}/scratchpad/edit`)}),pt({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!M,handler:()=>M&&n(`${s}/projects/${e}/assignments/${M}`)}),pt({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!ee,handler:()=>ee&&n(`${s}/projects/${e}/assignments/${ee}`)});const ae=p.useMemo(()=>I?q_(I.body):{acceptanceCriteria:[],summaryBody:""},[I]),ce=p.useMemo(()=>K_(ae.summaryBody),[ae.summaryBody]),Z=ae.acceptanceCriteria,ge=Z.filter(ue=>ue.checked).length,je=Z.length>0&&ge===Z.length,Ne=p.useRef(je),ke=p.useRef(!1);if(p.useEffect(()=>{if(I){if(!ke.current){Ne.current=je,ke.current=!0;return}je&&!Ne.current&&$(ue=>ue+1),Ne.current=je}},[je,I]),K)return r.jsx(at,{label:"Loading assignment workspace…"});if(X||!I||!e||!t)return r.jsx(et,{error:X||"Assignment not found."});const We=e,Ye=t,ie=Z.length>0?{checked:ge,total:Z.length}:void 0,ne=I.availableTransitions??[],le=ne.filter(ue=>!ue.disabled&&ue.targetStatus!==I.status),W=Q_.map(ue=>le.find(Ge=>Ge.command===ue)).find(Boolean)??le[0]??null,pe=[];if(J!=null&&J.sessions)for(const ue of J.sessions)for(const Ge of ue.windows)for(const He of Ge.panes)((Nt=He.assignment)==null?void 0:Nt.project)===e&&((se=He.assignment)==null?void 0:se.slug)===t&&pe.push({sessionName:ue.name,command:He.command,urls:He.urls});async function ve(ue){d(null);try{await Gj(We,Ye,ue),_()}catch(Ge){d(Ge.message)}}async function _e(){N(!0);try{await uD(We,Ye),n(`${s}/projects/${We}`)}catch(ue){d(ue.message),N(!1),S(!1)}}async function Oe(ue,Ge){d(null),m(ue.command);try{return await gh(We,Ye,ue,Ge),_(),!0}catch(He){return d(He.message),!1}finally{m(null)}}function st(ue){if(Yj(ue)){x(ue);return}Oe(ue)}async function lt(ue,Ge){v(null),j(ue);try{const He=await fetch(`/api/projects/${We}/assignments/${Ye}/acceptance-criteria/${ue}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Ge})}),mt=await He.json();if(!He.ok)throw new Error(mt.error||`HTTP ${He.status}`);_()}catch(He){v(He.message)}finally{j(null)}}const _t=[...le.filter(ue=>ue!==W).map(ue=>({key:`transition-${ue.command}`,label:ue.label,onSelect:()=>st(ue),disabled:f===ue.command})),...ne.filter(ue=>ue.disabled||ue.targetStatus===I.status).map(ue=>({key:`transition-${ue.command}`,label:ue.label,disabled:!0,disabledReason:ue.targetStatus===I.status?`Already ${I.status.replace(/_/g," ")}`:ue.disabledReason??ue.warning??ue.description})),...O.statuses.map(ue=>({key:`override-${ue.id}`,label:`Override → ${ue.label}`,onSelect:()=>ve(ue.id),disabled:ue.id===I.status,disabledReason:ue.id===I.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:VE,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:s2,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:Vf,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:tu,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:GE,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:zn,destructive:!0,onSelect:()=>S(!0)}],St=(W==null?void 0:W.command)==="review";return r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{className:"sticky top-12 z-20 rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm backdrop-blur",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(wn,{status:I.status,progress:ie}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:I.title}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",Mm(I.updated)]}),D.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",D.length," unmet dep",D.length===1?"":"s"]}),r.jsx(wh,{externalIds:I.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(L1,{target:{kind:"assignment",id:I.id},worktreePath:((me=I.workspace)==null?void 0:me.worktreePath)??null}),!((Pe=I.workspace)!=null&&Pe.worktreePath)&&e&&t&&r.jsx($1,{projectSlug:e,assignmentSlug:t,defaultBranch:`syntaur/${e}/${t}`,onCreated:()=>_()}),W&&r.jsx("button",{type:"button",title:W.warning||W.description,disabled:f===W.command,onClick:()=>st(W),className:ze("shell-action disabled:cursor-not-allowed disabled:opacity-50",W.warning&&"border-warning-foreground/40",St&&A>0&&"send-to-review-glow"),children:r.jsx("span",{children:f===W.command?"Working…":W.label})},St?`review-${A}`:W.command),r.jsx(hh,{items:_t,align:"end"})]})]}),c?r.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:c}):null,I.blockedReason?r.jsxs("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:[r.jsx("strong",{children:"Blocked reason:"})," ",I.blockedReason]}):null]}),V.length>0&&r.jsx(G_,{projectSlug:e,dependencies:V,blockedReason:I.blockedReason}),I.enrichedLinks&&I.enrichedLinks.length>0&&r.jsx(Y_,{links:I.enrichedLinks}),I.referencedBy&&I.referencedBy.length>0&&r.jsx(Le,{title:"Referenced by",description:"Other assignments whose Todos, progress, comments, or handoffs link to this one.",children:r.jsx("ul",{className:"space-y-2",children:I.referencedBy.map(ue=>{const Ge=ue.sourceProjectSlug===null?`/assignments/${ue.sourceId}`:`${s}/projects/${ue.sourceProjectSlug}/assignments/${ue.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(we,{to:Ge,className:"text-foreground hover:text-primary",children:ue.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ue.mentions," mention",ue.mentions===1?"":"s",")"]}),ue.sourceProjectSlug===null?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"}):null]},ue.sourceId)})})}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(kh,{value:R,onValueChange:ue=>l({tab:ue}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[ae.acceptanceCriteria.length>0?r.jsx(Le,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:r.jsxs("div",{className:"space-y-3",children:[y?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:y}):null,ae.acceptanceCriteria.map((ue,Ge)=>{const He=C!==null;return r.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border/60 bg-background/80 px-3 py-3",children:[r.jsx("input",{type:"checkbox",checked:ue.checked,disabled:He,onChange:mt=>lt(Ge,mt.target.checked),className:"mt-1 h-4 w-4 rounded border-border text-primary"}),r.jsx("span",{className:"criterion-label text-sm leading-6","data-checked":ue.checked,children:ue.text})]},`${Ge}-${ue.text}`)})]})}):null,ce.hasSection?r.jsx(Le,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(Ut,{content:ce.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(Le,{title:"Assignment Summary",children:r.jsx(Ut,{content:ce.remaining,emptyState:ae.acceptanceCriteria.length>0||ce.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:I.plan?1:0,content:I.plan?r.jsx("div",{className:"space-y-5",children:r.jsxs(Le,{title:"Plan",description:"Shows plan.md only. Versioned plans (plan-v2.md, ...) linked from the Todos section are not yet rendered here — open them from the filesystem.",actions:r.jsxs(we,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[r.jsx(Vf,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(wn,{status:I.plan.status})}),r.jsx(Ut,{content:I.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(ot,{title:"No plan yet",description:"Plan files are optional and versioned. Run /plan-assignment to create plan.md (or plan-v2.md, ...) and link it from the Todos section."})},{value:"scratchpad",label:"Scratchpad",count:I.scratchpad?1:0,content:I.scratchpad?r.jsx(Le,{title:"Scratchpad",actions:r.jsxs(we,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(Vf,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(Ut,{content:I.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(ot,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((Fe=I.handoff)==null?void 0:Fe.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:I.handoff?r.jsx(Le,{children:r.jsx(Ut,{content:I.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(ot,{title:"No handoff log yet",description:"Handoffs appear here when an agent runs /complete-assignment or you append one manually."})})},{value:"progress",label:"Progress",count:((Ve=I.progress)==null?void 0:Ve.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:I.progress&&I.progress.entries.length>0?r.jsx(Le,{title:"Progress",description:"Reverse-chronological log of work done on this assignment. Agents append entries via progress.md.",children:r.jsx("ol",{className:"space-y-4",children:I.progress.entries.map((ue,Ge)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:ue.timestamp}),r.jsx(Ut,{content:ue.body})]},`${ue.timestamp}-${Ge}`))})}):r.jsx(ot,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((tt=I.comments)==null?void 0:tt.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:I.comments&&I.comments.entries.length>0?r.jsx(M1,{projectSlug:e,assignmentSlug:t,entries:I.comments.entries}):r.jsx(ot,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((cn=I.decisionRecord)==null?void 0:cn.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:I.decisionRecord?r.jsx(Le,{children:r.jsx(Ut,{content:I.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(ot,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Le,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Fs,{label:"ID",value:I.id,copyable:!0}),r.jsx(Fs,{label:"Priority",value:I.priority}),I.assignee&&r.jsx(Fs,{label:"Assignee",value:I.assignee}),r.jsx(Fs,{label:"Updated",value:`${V2(I.updated)} · Created ${W2(I.created)}`}),I.workspace.repository&&r.jsx(Fs,{label:"Repository",value:I.workspace.repository,copyable:!0}),I.workspace.worktreePath&&r.jsx(Fs,{label:"Worktree",value:I.workspace.worktreePath,copyable:!0}),I.workspace.branch&&r.jsx(Fs,{label:"Branch",value:I.workspace.branch,copyable:!0}),I.workspace.parentBranch&&r.jsx(Fs,{label:"Parent branch",value:I.workspace.parentBranch,copyable:!0})]})}),pe.length>0&&r.jsx(Le,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:pe.map((ue,Ge)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:ue.command}),r.jsx("span",{className:"text-xs text-muted-foreground",children:ue.sessionName}),ue.urls.map(He=>r.jsxs("a",{href:He,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[He.replace("http://localhost:",":"),r.jsx(Em,{className:"h-2.5 w-2.5"})]},He))]},Ge))})}),r.jsx(O1,{sessions:U==null?void 0:U.sessions,loading:Y,error:z})]})]}),r.jsx(I1,{open:g!==null,action:g,assignmentTitle:I.title,loading:f===(g==null?void 0:g.command),onOpenChange:ue=>{ue||x(null)},onConfirm:async ue=>{if(!g)return;await Oe(g,ue)&&x(null)}}),r.jsx(gl,{open:w,title:"Delete assignment?",description:`This will permanently delete "${I.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:T,onOpenChange:ue=>{ue||S(!1)},onConfirm:_e})]})}function Fs({label:e,value:t,copyable:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e}),r.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[r.jsx("span",{className:"truncate",title:t,children:t}),n&&t!=="—"&&r.jsx(qr,{value:t})]})]})}function Z_(){var v,C,j,w,S,T,N;const{id:e}=kt(),[t,n]=Xr(),s=t.get("tab")??"summary",{data:a,loading:l,error:c,refetch:d}=nT(e),{data:f,loading:m,error:g}=iT(e),[x,y]=p.useState(!1);return l?r.jsx(at,{}):c?r.jsx(et,{error:c}):a?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(wn,{status:a.status}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:a.id}),r.jsx(wh,{externalIds:a.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(L1,{target:{kind:"assignment",id:a.id},worktreePath:((v=a.workspace)==null?void 0:v.worktreePath)??null,size:"compact"}),!((C=a.workspace)!=null&&C.worktreePath)&&r.jsx($1,{assignmentId:a.id,defaultBranch:`syntaur/${a.slug}`,onCreated:()=>d()}),r.jsxs("button",{type:"button",onClick:()=>y(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:[r.jsx(rl,{className:"h-3 w-3"}),"Move to workspace…"]}),r.jsx(we,{to:`/assignments/${a.id}/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit"})]})]}),r.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:a.title}),a.blockedReason?r.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",a.blockedReason]}):null]}),a.referencedBy&&a.referencedBy.length>0?r.jsx(Le,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:a.referencedBy.map(A=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(we,{to:A.sourceProjectSlug===null?`/assignments/${A.sourceId}`:`/projects/${A.sourceProjectSlug}/assignments/${A.sourceSlug}`,className:"text-foreground hover:text-primary",children:A.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",A.mentions," mention",A.mentions===1?"":"s",")"]})]},A.sourceId))})}):null,r.jsx(O1,{sessions:f==null?void 0:f.sessions,loading:m,error:g}),r.jsx(kh,{value:s,onValueChange:A=>n({tab:A}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Le,{title:"Assignment",children:r.jsx(Ut,{content:a.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((j=a.progress)==null?void 0:j.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.progress&&a.progress.entries.length>0?r.jsx(Le,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:r.jsx("ol",{className:"space-y-4",children:a.progress.entries.map((A,$)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:A.timestamp}),r.jsx(Ut,{content:A.body})]},`${A.timestamp}-${$}`))})}):r.jsx(ot,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((w=a.comments)==null?void 0:w.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(M1,{projectSlug:null,assignmentSlug:a.id,entries:((S=a.comments)==null?void 0:S.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:a.plan?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.plan.body,emptyState:"Plan file exists but is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{to:`/assignments/${a.id}/plan/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit plan"})})]}):r.jsx(ot,{title:"No plan file yet",description:"Create one via the CLI or `/plan-assignment`."})})},{value:"scratchpad",label:"Scratchpad",content:r.jsx("div",{className:"space-y-5",children:a.scratchpad?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.scratchpad.body,emptyState:"Scratchpad is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{to:`/assignments/${a.id}/scratchpad/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit scratchpad"})})]}):r.jsx(ot,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((T=a.handoff)==null?void 0:T.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.handoff?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.handoff.body,emptyState:"No handoff history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{to:`/assignments/${a.id}/handoff/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append handoff"})})]}):r.jsx(ot,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((N=a.decisionRecord)==null?void 0:N.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:a.decisionRecord?r.jsxs(Le,{children:[r.jsx(Ut,{content:a.decisionRecord.body,emptyState:"No decision history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(we,{to:`/assignments/${a.id}/decision-record/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append decision"})})]}):r.jsx(ot,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(bh,{open:x,onOpenChange:y,currentWorkspace:a.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async A=>{const $=await fetch(`/api/assignments/${encodeURIComponent(a.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:A})});if(!$.ok){const R=await $.json().catch(()=>({}));throw new Error(R.error||"Failed to move assignment")}d()}})]}):r.jsx(et,{error:"Assignment not found"})}const Gb=S1,Yb={critical:0,high:1,medium:2,low:3};function Jb(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function e5(e,t){return e.toString()===t.toString()}function Xb(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function t5(e,t,n){return[...e].sort((a,l)=>{let c=0;switch(t){case"title":c=a.title.localeCompare(l.title);break;case"status":c=a.status.localeCompare(l.status);break;case"priority":c=(Yb[a.priority]??99)-(Yb[l.priority]??99);break;case"assignee":c=(a.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=a.dependsOn.length-l.dependsOn.length;break;case"updated":c=a.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function Qb(){const{workspace:e}=kt(),t=Pt(),n=Tt(),s=p.useRef(null);Js("list:assignments");const{data:a,loading:l,error:c,refetch:d}=r0(),f=Hu(),[m,g]=Xr(),x=e?`w:${e}`:null,y=T1(x),v=p.useRef(void 0),C=p.useMemo(()=>$D(f.order),[f]),j=p.useMemo(()=>{const B={};for(const de of C)B[de]=DD(f,de);return B},[C,f]),w=p.useMemo(()=>C.map(B=>({id:B,title:j[B]??B,description:hj(B)})),[C,j]),S=p.useMemo(()=>new Set(["all",...C]),[C]),T=m.get("view"),N=m.get("status"),A=m.get("stale"),$=T&&Gb.includes(T)?T:"kanban";function R(B){return!B||!S.has(B)?"all":B}const O=p.useCallback(B=>{g(de=>{const Se=new URLSearchParams(de);return B==="kanban"?Se.delete("view"):Se.set("view",B),Se})},[g]),[I,K]=p.useState(""),[X,_]=p.useState(()=>R(N)),[H,J]=p.useState(()=>y.filters.priority??"all"),[U,Y]=p.useState(()=>y.filters.assignee??"all"),[z,V]=p.useState(()=>y.filters.project??"all"),[D,Q]=p.useState(()=>Jb(A)),[E,M]=p.useState(()=>y.sortField),[ee,L]=p.useState(()=>y.sortDirection),[ae,ce]=p.useState(()=>new Set(C)),[Z,ge]=p.useState([]),[je,Ne]=p.useState(null),[ke,We]=p.useState(null),[Ye,ie]=p.useState(null),[ne,le]=p.useState(null),[W,pe]=p.useState(null),[ve,_e]=p.useState(null),[Oe,st]=p.useState(null),[lt,_t]=p.useState(null),[St,Nt]=p.useState(null);p.useEffect(()=>{ge((a==null?void 0:a.assignments)??[])},[a]),p.useEffect(()=>{const B=R(N);B!==X&&_(B);const de=Jb(A);de!==D&&Q(de)},[D,A,X,N]),p.useEffect(()=>{v.current===x&&g(B=>{const de=new URLSearchParams(B);return X==="all"?de.delete("status"):de.set("status",X),D==="all"?de.delete("stale"):D==="stale"?de.set("stale","1"):de.set("stale","0"),e5(B,de)?B:de})},[D,x,g,X]),p.useEffect(()=>{J(y.filters.priority??"all"),Y(y.filters.assignee??"all"),V(y.filters.project??"all"),M(y.sortField),L(y.sortDirection)},[y.filters.priority,y.filters.assignee,y.filters.project,y.sortField,y.sortDirection]),p.useEffect(()=>{if(v.current===x)return;let B=!1;return rg().then(de=>{if(B||v.current===x)return;const Se=N1(de,x),Xe=Se.defaultView,er=Se.filters.status??"all",hn=Se.filters.activity??"all",dt=new URLSearchParams(window.location.search);let Rt=!1;const nn=new URLSearchParams(dt);dt.get("view")===null&&Xe!=="kanban"&&Gb.includes(Xe)&&(nn.set("view",Xe),Rt=!0),dt.get("status")===null&&er!=="all"&&(nn.set("status",er),_(er),Rt=!0),dt.get("stale")===null&&hn!=="all"&&(nn.set("stale",hn==="stale"?"1":"0"),Q(hn),Rt=!0),Rt&&g(nn,{replace:!0}),queueMicrotask(()=>{v.current=x})}),()=>{B=!0}},[x]);const se=p.useCallback(B=>{(x===null?R1(B):A1(x,B)).catch(Se=>{console.warn("Failed to persist view prefs:",Se)})},[x]),me=p.useCallback(B=>{O(B),se({defaultView:B})},[O,se]),Pe=p.useCallback(B=>{_(B),se({filters:{status:B}})},[se]),Fe=p.useCallback(B=>{J(B),se({filters:{priority:B}})},[se]),Ve=p.useCallback(B=>{Y(B),se({filters:{assignee:B}})},[se]),tt=p.useCallback(B=>{V(B),se({filters:{project:B}})},[se]),cn=p.useCallback(B=>{Q(B),se({filters:{activity:B}})},[se]),ue=p.useCallback(B=>{M(B),se({sortField:B})},[se]),Ge=p.useCallback(B=>{L(B),se({sortDirection:B})},[se]),He=p.useMemo(()=>Array.from(new Set(Z.map(B=>B.status))).sort(),[Z]),mt=p.useMemo(()=>Array.from(new Set(Z.map(B=>B.priority))).sort(),[Z]),Tn=p.useMemo(()=>Array.from(new Set(Z.map(B=>B.assignee??"__unassigned__"))).sort(),[Z]),Qt=p.useMemo(()=>Array.from(new Map(Z.filter(B=>B.projectSlug!==null).map(B=>[B.projectSlug,B.projectTitle]))).sort(([,B],[,de])=>B.localeCompare(de)),[Z]),Hn=p.useMemo(()=>Z.filter(B=>{if(e){if(e==="_ungrouped"){if(B.projectWorkspace!==null)return!1}else if(B.projectWorkspace!==e)return!1}if(X!=="all"&&B.status!==X||H!=="all"&&B.priority!==H||D==="stale"&&!Xb(B.updated)||D==="fresh"&&Xb(B.updated)||U!=="all"&&(B.assignee??"__unassigned__")!==U)return!1;if(z!=="all"){if(z==="__standalone__"){if(B.projectSlug!==null)return!1}else if(B.projectSlug!==z)return!1}const de=I.trim().toLowerCase();return!(de&&!`${B.title} ${B.slug} ${B.projectTitle??"standalone"} ${B.projectSlug??""}`.toLowerCase().includes(de))}),[D,Z,I,X,H,U,z,e]),mr=p.useMemo(()=>t5(Hn,E,ee),[Hn,E,ee]),{visibleItems:Ar,visibleIndexByKey:ht}=p.useMemo(()=>{const B=$==="table"?mr:C.flatMap(Se=>Hn.filter(Xe=>Xe.status===Se)),de=new Map;return B.forEach((Se,Xe)=>de.set(an(Se),Xe)),{visibleItems:B,visibleIndexByKey:de}},[$,mr,Hn,C]),{hotkeyRowProps:Ft}=sl(Ar,{scope:"list:assignments",onOpen:B=>{if(B.projectSlug===null){n(`/assignments/${B.id}`);return}const de=B.projectWorkspace?`/w/${B.projectWorkspace}`:t;n(`${de}/projects/${B.projectSlug}/assignments/${B.slug}`)}});if(pt({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var B;return(B=s.current)==null?void 0:B.focus()}}),pt({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>d()}),l)return r.jsx(at,{label:"Loading assignments board…"});if(c||!a)return r.jsx(et,{error:c||"Assignments board is unavailable."});async function qt({item:B,toColumnId:de,action:Se,reason:Xe}){Ne(null),We(an(B));const er=Z;ge(hn=>hn.map(dt=>an(dt)===an(B)?{...dt,status:de,blockedReason:de==="blocked"?Xe??dt.blockedReason:null}:dt));try{if(B.projectSlug===null){if(!Se)throw new Error("Standalone assignments require a transition action, not status override.");const dt=await fetch(`/api/assignments/${encodeURIComponent(B.id)}/transitions/${encodeURIComponent(Se.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe?{reason:Xe}:{})});if(!dt.ok)throw new Error((await dt.json()).error??`HTTP ${dt.status}`);const nn=(await dt.json()).assignment;ge(ko=>ko.map(ts=>an(ts)===an(B)?{...ts,status:nn.status,blockedReason:nn.blockedReason,availableTransitions:nn.availableTransitions,updated:nn.updated}:ts));return}const hn=Se?await gh(B.projectSlug,B.slug,Se,Xe):await Gj(B.projectSlug,B.slug,de);return ge(dt=>dt.map(Rt=>an(Rt)===an(B)?{...Rt,status:hn.status,blockedReason:hn.blockedReason,availableTransitions:hn.availableTransitions,updated:hn.updated}:Rt)),d(),!0}catch(hn){return ge(er),Ne(hn.message),!1}finally{We(null)}}async function kn({item:B,toColumnId:de}){if(B.status===de)return;const Se=Na(B,de);if(Se!=null&&Se.disabled){Ne(Se.disabledReason||`Cannot move this assignment to ${de}.`);return}if(Se&&Yj(Se)){pe({item:B,toColumnId:de,action:Se});return}await qt({item:B,toColumnId:de,action:Se})}function un(B){ce(de=>{const Se=new Set(de);return Se.has(B)?Se.delete(B):Se.add(B),Se})}function Zt(B){E===B?Ge(ee==="asc"?"desc":"asc"):(ue(B),Ge("asc"))}const ct=Ye?Z.find(B=>an(B)===Ye)??null:null;function hr(B,de){B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",de),ie(de)}function ut(){ie(null),le(null)}function Pn(B,de){if(!ct)return;const Se=Na(ct,de);ct.status===de||Se!=null&&Se.disabled||(B.preventDefault(),B.dataTransfer.dropEffect="move",le(de))}function en(B,de){ne===de&&!B.currentTarget.contains(B.relatedTarget)&&le(null)}function Wn(B,de){if(B.preventDefault(),!ct||ct.status===de){ut();return}ut(),kn({item:ct,toColumnId:de})}function tn({field:B,children:de}){const Se=E===B;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>Zt(B),className:"inline-flex items-center gap-1 hover:text-foreground",children:[de,Se?ee==="asc"?r.jsx(Ow,{className:"h-3 w-3"}):r.jsx(Ua,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":y.density,children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs(we,{to:`${t}/assignments/new`,className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(xh,{children:[r.jsx(Uu,{ref:s,value:I,onChange:K,placeholder:"Search assignments or projects"}),r.jsxs("select",{value:X,onChange:B=>Pe(R(B.target.value)),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),He.map(B=>r.jsx("option",{value:B,children:j[B]??B},B))]}),r.jsxs("select",{value:H,onChange:B=>Fe(B.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),mt.map(B=>r.jsx("option",{value:B,className:"capitalize",children:B},B))]}),r.jsxs("select",{value:U,onChange:B=>Ve(B.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),Tn.map(B=>r.jsx("option",{value:B,children:B==="__unassigned__"?"Unassigned":B},B))]}),r.jsxs("select",{value:z,onChange:B=>tt(B.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"__standalone__",children:"Standalone"}),Qt.map(([B,de])=>r.jsx("option",{value:B,children:de},B))]}),r.jsxs("select",{value:D,onChange:B=>cn(B.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All activity"}),r.jsx("option",{value:"stale",children:"Stale only"}),r.jsx("option",{value:"fresh",children:"Fresh only"})]}),r.jsx(yh,{value:$,onChange:B=>me(B),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]})]}),je?r.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:je}):null,a.assignments.length===0?r.jsx(ot,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:r.jsxs(we,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[r.jsx($w,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):Hn.length===0?r.jsx(ot,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):$==="table"?r.jsx(Le,{title:`${mr.length} assignment${mr.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx(tn,{field:"title",children:"Assignment"}),r.jsx(tn,{field:"status",children:"Status"}),r.jsx(tn,{field:"priority",children:"Priority"}),r.jsx(tn,{field:"assignee",children:"Assignee"}),r.jsx(tn,{field:"dependencies",children:"Dependencies"}),r.jsx(tn,{field:"updated",children:"Updated"})]})}),r.jsx("tbody",{children:mr.map((B,de)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Ft(de),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(we,{to:B.projectSlug===null?`/assignments/${B.id}`:`${t}/projects/${B.projectSlug}/assignments/${B.slug}`,className:"font-semibold text-foreground hover:text-primary",children:B.title}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:B.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"mt-0.5 inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:B.id,children:[B.id.slice(0,8),r.jsx(qr,{value:B.id})]})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:B.status,disabled:ke===an(B),onChange:Se=>kn({item:B,toColumnId:Se.target.value}),className:ze("appearance-none rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-wide outline-none","cursor-pointer bg-[length:12px] bg-[right_6px_center] bg-no-repeat pr-6",`bg-[url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E")]`,(su[B.status]??su.pending).className,ke===an(B)&&"animate-pulse opacity-60"),children:C.map(Se=>{const Xe=B.status===Se?void 0:Na(B,Se),er=(Xe==null?void 0:Xe.disabled)??!1;return r.jsx("option",{value:Se,disabled:er,title:er?(Xe==null?void 0:Xe.disabledReason)??void 0:void 0,children:j[Se]},Se)})})}),r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:B.priority}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:B.assignee??"Unassigned"}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:B.dependsOn.length}),r.jsx("td",{className:"py-4 text-muted-foreground",children:Kr(B.updated)})]},an(B)))})]})})}):$==="list"?r.jsx("div",{className:"space-y-3",children:C.map(B=>{var dt;const de=Hn.filter(Rt=>Rt.status===B);if(de.length===0&&!ct)return null;const Se=ae.has(B),Xe=ct?ct.status!==B&&!((dt=Na(ct,B))!=null&&dt.disabled):!1,er=ct?ct.status!==B&&!Xe:!1,hn=ne===B;return r.jsxs("div",{className:ze("rounded-lg border border-border/60 bg-card/90 transition",hn&&Xe&&"ring-2 ring-ring/30",er&&"border-dashed opacity-65"),onDragOver:Rt=>Pn(Rt,B),onDragLeave:Rt=>en(Rt,B),onDrop:Rt=>Wn(Rt,B),children:[r.jsxs("button",{type:"button",onClick:()=>un(B),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(Ua,{className:`h-4 w-4 text-muted-foreground transition-transform ${Se?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:j[B]}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:de.length})]}),Se&&de.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:de.map(Rt=>{const nn=an(Rt),ko=Ye===nn,ts=ht.get(nn)??-1;return r.jsx("div",{draggable:!0,onDragStart:xl=>hr(xl,nn),onDragEnd:ut,...ts>=0?Ft(ts):{},className:ze("cursor-grab transition active:cursor-grabbing",ko&&"scale-[0.98] opacity-50"),children:r.jsx(Zb,{assignment:Rt,dragging:ko,transitioning:ke===nn})},nn)})})]},B)})}):r.jsx(Qj,{columns:w,items:Hn,getItemId:an,getColumnId:B=>B.status,canDrop:({item:B,fromColumnId:de,toColumnId:Se})=>{if(de===Se)return{allowed:!0};const Xe=Na(B,Se);return Xe!=null&&Xe.disabled?{allowed:!1,reason:Xe.disabledReason||Xe.description}:{allowed:!0,reason:Xe?Xe.warning||Xe.description:`Move to ${Se} (direct status change).`}},onMove:({item:B,toColumnId:de})=>kn({item:B,toColumnId:de}),getExternalDragData:B=>B.projectSlug===null?{type:"standalone-assignment",id:B.id}:{type:"project-assignment",id:B.id},onCardContextMenu:(B,de)=>{de.preventDefault(),_e({item:B,anchor:{x:de.clientX,y:de.clientY}})},emptyMessage:B=>`No ${B.title.toLowerCase()} assignments.`,renderCard:(B,{dragging:de})=>{const Se=ht.get(an(B))??-1;return r.jsx("div",{...Se>=0?Ft(Se):{},children:r.jsx(Zb,{assignment:B,dragging:de,transitioning:ke===an(B)})})}}),r.jsx(I1,{open:W!==null,action:(W==null?void 0:W.action)??null,assignmentTitle:(W==null?void 0:W.item.title)??"Assignment",loading:ke===(W?an(W.item):null),onOpenChange:B=>{B||pe(null)},onConfirm:async B=>{if(!W)return;const de=W;await qt({item:de.item,toColumnId:de.toColumnId,action:de.action,reason:B})&&pe(null)}}),r.jsx(ek,{anchor:(ve==null?void 0:ve.anchor)??null,items:ve?n5(ve.item,{onEdit:()=>{const B=ve.item,de=B.projectSlug===null?`/assignments/${B.id}`:`${B.projectWorkspace?`/w/${B.projectWorkspace}`:t}/projects/${B.projectSlug}/assignments/${B.slug}`;n(de)},onDelete:()=>st(ve.item),onMove:()=>Nt(ve.item)}):[],onClose:()=>_e(null)}),r.jsx(gl,{open:Oe!==null,title:"Delete assignment?",description:Oe?`"${Oe.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:lt!==null,onOpenChange:B=>{!B&&lt===null&&st(null)},onConfirm:async()=>{if(!Oe||Oe.projectSlug===null){st(null);return}const B=an(Oe);_t(B);try{const de=await fetch(`/api/projects/${encodeURIComponent(Oe.projectSlug)}/assignments/${encodeURIComponent(Oe.slug)}`,{method:"DELETE"});if(!de.ok){const Se=await de.json().catch(()=>({}));throw new Error(Se.error||"Failed to delete assignment")}st(null),d()}catch(de){alert(de instanceof Error?de.message:"Failed to delete assignment")}finally{_t(null)}}}),r.jsx(bh,{open:St!==null,onOpenChange:B=>{B||Nt(null)},currentWorkspace:(St==null?void 0:St.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async B=>{if(!St)return;const de=await fetch(`/api/assignments/${encodeURIComponent(St.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:B})});if(!de.ok){const Se=await de.json().catch(()=>({}));throw new Error(Se.error||"Failed to move assignment")}d()}})]})}function n5(e,t){const n=[{key:"edit",label:"Edit",icon:ki,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:zn,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:rl,onSelect:t.onMove}),n}function Zb({assignment:e,dragging:t,transitioning:n}){var a;const s=Pt();return r.jsxs("div",{className:"vp-card rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(we,{to:e.projectSlug===null?`/assignments/${e.id}`:`${s}/projects/${e.projectSlug}/assignments/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:e.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:e.id??"",children:[(a=e.id)==null?void 0:a.slice(0,8),e.id&&r.jsx(qr,{value:e.id})]})]}),r.jsx(wn,{status:e.status})]}),e.blockedReason?r.jsx("p",{className:"mt-3 rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground",children:e.blockedReason}):null,r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:e.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:e.assignee??"Unassigned"}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.dependsOn.length," dependencies"]})]}),r.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{children:n?"Updating":t?"Dragging":"Source-first"}),r.jsx("span",{children:Kr(e.updated)})]})]})}function Na(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function an(e){return e.id||e.slug||"unknown"}function pr(e){const t=e.match(/^---\n([\s\S]*?)\n---\n?/);if(!t)return{order:[],blocks:new Map,body:e};const n=t[1],s=e.slice(t[0].length),a=n.split(`
509
- `),l=[],c=new Map;let d=null,f=[];const m=()=>{d&&(l.push(d),c.set(d,f))};for(const g of a){const x=g.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!g.startsWith(" ")){m(),d=x[1],f=[g];continue}d&&f.push(g)}return m(),{order:l,blocks:c,body:s}}function Oi(e){return`---
510
- ${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
511
- `)}
512
- ---
513
-
514
- ${e.body.replace(/^\n+/,"")}`}function Jt(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const s=n[0].match(/^[^:]+:\s*(.*)$/);if(!s)return"";const a=s[1].trim();return a==="null"?"":a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?a.slice(1,-1):a}function r5(e,t){return Jt(e,t)==="true"}function _a(e,t){const n=e.blocks.get(t);return n!=null&&n.length?n[0].trim().endsWith("[]")?[]:n.slice(1).map(s=>s.trim()).filter(s=>s.startsWith("- ")).map(s=>s.slice(2).trim()):[]}function s5(e){return typeof e=="boolean"?e?"true":"false":e===null||e===""?"null":/^\d{4}-\d{2}-\d{2}T/.test(e)?`"${e}"`:/[:#{}[\],&*?|>!%@`]/.test(e)||/^\s|\s$/.test(e)?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:e}function Xt(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${s5(n)}`])}function Fa(e,t,n){if(e.blocks.has(t)||e.order.push(t),n.length===0){e.blocks.set(t,[`${t}: []`]);return}e.blocks.set(t,[`${t}:`,...n.map(s=>` - ${s}`)])}function za(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function Xu(e){const t=pr(e);return{title:Jt(t,"title"),slug:Jt(t,"slug"),workspace:Jt(t,"workspace"),archived:r5(t,"archived"),archivedAt:Jt(t,"archivedAt"),archivedReason:Jt(t,"archivedReason"),tags:_a(t,"tags").join(", "),body:t.body}}function o5(e,t){const n=pr(e),s={...Xu(e),...t};return Xt(n,"title",s.title),Xt(n,"slug",s.slug),Xt(n,"workspace",s.workspace||null),Xt(n,"archived",s.archived),Xt(n,"archivedAt",s.archivedAt||null),Xt(n,"archivedReason",s.archivedReason||null),Fa(n,"tags",za(s.tags)),n.body=s.body,Oi(n)}function Qu(e){const t=pr(e);return{title:Jt(t,"title"),slug:Jt(t,"slug"),status:Jt(t,"status"),priority:Jt(t,"priority")||"medium",assignee:Jt(t,"assignee"),dependsOn:_a(t,"dependsOn").join(", "),links:_a(t,"links").join(", "),blockedReason:Jt(t,"blockedReason"),tags:_a(t,"tags").join(", "),body:t.body}}function i5(e,t){const n=pr(e),s={...Qu(e),...t};return Xt(n,"title",s.title),Xt(n,"slug",s.slug),Xt(n,"status",s.status),Xt(n,"priority",s.priority),Xt(n,"assignee",s.assignee||null),Fa(n,"dependsOn",za(s.dependsOn)),Fa(n,"links",za(s.links)),Xt(n,"blockedReason",s.blockedReason||null),Fa(n,"tags",za(s.tags)),n.body=s.body,Oi(n)}function Zu(e){const t=pr(e);return{assignment:Jt(t,"assignment"),status:Jt(t,"status"),body:t.body}}function a5(e,t){const n=pr(e),s={...Zu(e),...t};return Xt(n,"assignment",s.assignment),Xt(n,"status",s.status),n.body=s.body,Oi(n)}function ed(e){const t=pr(e);return{assignment:Jt(t,"assignment"),body:t.body}}function l5(e,t){const n=pr(e),s={...ed(e),...t};return Xt(n,"assignment",s.assignment),n.body=s.body,Oi(n)}function td(e){const t=pr(e);return{name:Jt(t,"name"),slug:Jt(t,"slug"),description:Jt(t,"description"),whenToUse:Jt(t,"when_to_use"),tags:_a(t,"tags").join(", "),body:t.body}}function c5(e,t){const n=pr(e),s={...td(e),...t};return Xt(n,"name",s.name),Xt(n,"slug",s.slug),Xt(n,"description",s.description||null),Xt(n,"when_to_use",s.whenToUse||null),Fa(n,"tags",za(s.tags)),n.body=s.body,Oi(n)}function sg(e){return{body:pr(e).body}}function F1(e){return sg(e)}function z1(e,t){const n=pr(e);return t.body!==void 0&&(n.body=t.body),Oi(n)}function u5(e,t){return z1(e,t)}function jt(e,t,n){switch(e){case"project":return o5(t,n);case"assignment":return i5(t,n);case"plan":return a5(t,n);case"scratchpad":return l5(t,n);case"playbook":return c5(t,n);case"memory":return z1(t,n);case"resource":return u5(t,n);default:return t}}function Ii({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:a,error:l,title:c,description:d,onCancel:f,helpTitle:m,helpBody:g,allowSlugEdit:x=!1}){const[y,v]=p.useState(e),[C,j]=p.useState(!1),[w,S]=p.useState("edit");p.useEffect(()=>{v(e)},[e]);const T=m5(t,y),N=y!==e,A=p5(t,y),$=N?"Unsaved changes":n==="create"?"Draft":"Saved",R=t!=="memory"&&t!=="resource";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-border/70 bg-card/90 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:c}),r.jsx("span",{className:"rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:$})]}),d?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:d}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:f,className:"shell-action",children:[r.jsx(Rw,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),R?r.jsxs("button",{type:"button",onClick:()=>j(O=>!O),className:"shell-action",children:[r.jsx(WE,{className:"h-4 w-4"}),r.jsx("span",{children:C?"Structured":"Raw Markdown"})]}):null,r.jsxs("button",{type:"button",onClick:()=>s(y),disabled:a||T.length>0,className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-semibold text-background transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:[r.jsx(Su,{className:"h-4 w-4"}),r.jsx("span",{children:a?"Saving…":"Save"})]})]})]}),l?r.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:l}):null,T.length>0?r.jsx("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:r.jsx("ul",{className:"space-y-1",children:T.map(O=>r.jsx("li",{children:O},O))})}):null]}),r.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[r.jsx("button",{type:"button",onClick:()=>S("edit"),className:`shell-action ${w==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>S("preview"),className:`shell-action ${w==="preview"?"bg-foreground text-background":""}`,children:[r.jsx(Qy,{className:"h-4 w-4"}),"Preview"]})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]",children:[r.jsx("div",{className:w==="preview"?"hidden md:block":"",children:r.jsx("div",{className:"surface-panel space-y-3",children:C?r.jsx("textarea",{value:y,onChange:O=>v(O.target.value),className:"min-h-[720px] w-full rounded-md border border-border/70 bg-background/90 p-4 font-mono text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30",spellCheck:!1}):r.jsx(d5,{documentType:t,content:y,onChange:v,allowSlugEdit:x})})}),r.jsx("div",{className:w==="edit"?"hidden md:block":"",children:r.jsxs("div",{className:"surface-panel sticky top-16 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Qy,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(Ut,{content:A,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function d5({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=Xu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Ca,{children:[r.jsx(ft,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,f={title:d};s&&(l.slug===Jn(l.title)||!l.slug.trim())&&(f.slug=Jn(d)),n(jt(e,t,f))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(jt(e,t,{slug:Jn(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is the folder name and URL-safe identifier. It is locked after creation so links and file paths stay stable."})]})}),r.jsx(ft,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(jt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(f5,{value:l.workspace,onChange:c=>n(jt(e,t,{workspace:c}))})]}),r.jsx(ft,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(jt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=Qu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Ca,{children:[r.jsx(ft,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,f={title:d};s&&(l.slug===Jn(l.title)||!l.slug.trim())&&(f.slug=Jn(d)),n(jt(e,t,f))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(jt(e,t,{slug:Jn(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the assignment folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is locked after creation because assignment paths and dependency references use it as a stable identifier."})]})}),r.jsx(ft,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(jt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"review",children:"Review"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"failed",children:"Failed"})]})}),r.jsx(ft,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(jt(e,t,{priority:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"critical",children:"Critical"})]})}),r.jsx(ft,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(jt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(ft,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(jt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(ft,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(jt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(ft,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(jt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(ft,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(jt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(ft,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(jt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=Zu(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Ca,{children:[r.jsx(ft,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(ft,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(jt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"draft",children:"Draft"}),r.jsx("option",{value:"approved",children:"Approved"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"})]})})]}),r.jsx(ft,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(jt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=ed(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ca,{children:r.jsx(ft,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(ft,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(jt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?sg(t):F1(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(ft,{label:c,children:r.jsx("textarea",{value:l.body,onChange:d=>n(jt(e,t,{body:d.target.value})),className:"editor-textarea",spellCheck:!1})}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"Frontmatter (name, scope/category, source, related assignments, tags) is preserved server-side on save."})]})}const a=td(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Ca,{children:[r.jsx(ft,{label:"Playbook name",children:r.jsx("input",{value:a.name,onChange:l=>{const c=l.target.value,d={name:c};s&&(a.slug===Jn(a.name)||!a.slug.trim())&&(d.slug=Jn(c)),n(jt(e,t,d))},className:"editor-input"})}),r.jsx(ft,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:a.slug,disabled:!s,onChange:l=>n(jt(e,t,{slug:Jn(l.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"The slug becomes the filename. It is auto-generated from the name until you change it.":"The slug is locked after creation because it is the filename."})]})}),r.jsx(ft,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:a.description,onChange:l=>n(jt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(ft,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:a.tags,onChange:l=>n(jt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(ft,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:a.whenToUse,onChange:l=>n(jt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(ft,{label:"Playbook rules",children:r.jsx("textarea",{value:a.body,onChange:l=>n(jt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function Ca({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function ft({label:e,children:t,className:n}){return r.jsxs("label",{className:`block space-y-2 ${n??""}`,children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e}),t]})}function f5({value:e,onChange:t}){const{data:n}=Cu(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(ft,{label:"Workspace",children:r.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"editor-input",children:[r.jsx("option",{value:"",children:"Ungrouped"}),s.map(a=>r.jsx("option",{value:a,children:a},a))]})})}function p5(e,t){switch(e){case"project":return Xu(t).body;case"assignment":return Qu(t).body;case"plan":return Zu(t).body;case"scratchpad":return ed(t).body;case"playbook":return td(t).body;case"memory":return sg(t).body;case"resource":return F1(t).body}}function m5(e,t){switch(e){case"project":{const n=Xu(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!qc(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=Qu(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!qc(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return Zu(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return ed(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=td(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!qc(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function ew(){const e=Tt(),{workspace:t}=kt(),n=Pt(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let v=y.content;t&&t!=="_ungrouped"&&(v=v.replace(/^(tags: \[\])$/m,`$1
515
- workspace: ${t}`)),a(v),c(!1)}).catch(y=>{g(y.message),c(!1)})},[t]);async function x(y){f(!0),g(null);try{const v=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await v.json();if(!v.ok){g(C.error||`HTTP ${v.status}`),f(!1);return}e(`${n}/projects/${C.slug}`)}catch(v){g(v.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading project template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ii,{initialContent:s||"",documentType:"project",mode:"create",onSave:x,saving:d,error:m,title:"Create Project",description:"Projects hold the high-level objective, shared context, and human-authored overview. Put execution details in assignments instead of overloading project.md.",onCancel:()=>e(`${n}/projects`),helpTitle:"Project editing rules",helpBody:"Use this form for project intent, slug, tags, and overview content. If you ever need less common metadata, raw markdown mode still exposes the full file.",allowSlugEdit:!0})}function tw(){const{slug:e}=kt(),t=Pt(),n=Tt(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{fetch("/api/templates/assignment").then(y=>y.json()).then(y=>{a(y.content),c(!1)}).catch(y=>{g(y.message),c(!1)})},[]);async function x(y){if(!e){g("Project slug is required.");return}f(!0),g(null);try{const v=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await v.json();if(!v.ok){g(C.error||`HTTP ${v.status}`),f(!1);return}n(`${t}/projects/${e}/assignments/${C.slug}`)}catch(v){g(v.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading assignment template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ii,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Assignment",description:"Assignments are the execution unit. Declare dependencies here, keep status pending until work starts, and use blocked later only for runtime obstacles.",onCancel:()=>n(e?`${t}/projects/${e}`:`${t}/projects`),helpTitle:"Assignment editing rules",helpBody:"Use structured fields for priority, assignee, dependencies, and tags. Status can be changed through lifecycle actions, kanban drag, or the status override.",allowSlugEdit:!0})}function nw(){const{workspace:e}=kt(),t=Pt(),n=Tt(),[s,a]=p.useState(null),[l,c]=p.useState(!0),[d,f]=p.useState(!1),[m,g]=p.useState(null);p.useEffect(()=>{const y=new URLSearchParams({standalone:"1"});e&&y.set("workspace",e),fetch(`/api/templates/assignment?${y.toString()}`).then(v=>v.json()).then(v=>{a(v.content),c(!1)}).catch(v=>{g(v.message),c(!1)})},[e]);async function x(y){var v;f(!0),g(null);try{const C=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),j=await C.json();if(!C.ok){g(j.error||`HTTP ${C.status}`),f(!1);return}const w=(v=j==null?void 0:j.assignment)==null?void 0:v.id;if(!w){g("Server did not return the new assignment id."),f(!1);return}n(`/assignments/${w}`)}catch(C){g(C.message),f(!1);return}f(!1)}return l?r.jsx(at,{label:"Loading assignment template…"}):m&&!s?r.jsx(et,{error:m}):r.jsx(Ii,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Standalone Assignment",description:e?`Standalone assignments live outside any project. This one will be tagged with workspaceGroup: ${e} so it appears in this workspace's views.`:"Standalone assignments live outside any project. Add a workspaceGroup to make them appear in workspace-filtered views.",onCancel:()=>n(`${t}/assignments`),helpTitle:"Standalone assignment editing rules",helpBody:"No project field is needed (it must remain null). Use workspaceGroup to group with other workspace work. Status, priority, and tags work the same as project-nested assignments.",allowSlugEdit:!0})}function Li({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,documentType:l,helpTitle:c,helpBody:d}){const f=Tt(),{data:m,loading:g,error:x}=i0(e),[y,v]=p.useState(!1),[C,j]=p.useState(null);async function w(S){v(!0),j(null);try{const T=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),N=await T.json();if(!T.ok){j(N.error||`HTTP ${T.status}`),v(!1);return}f(n)}catch(T){j(T.message),v(!1);return}v(!1)}return g?r.jsx(at,{label:`Loading ${s.toLowerCase()}…`}):x||!m?r.jsx(et,{error:x||`${s} is unavailable.`}):r.jsx(Ii,{initialContent:m.content,documentType:l,onSave:w,saving:y,error:C,title:s,description:a,onCancel:()=>f(n),helpTitle:c,helpBody:d})}function rw(){const{slug:e}=kt(),t=Pt(),n=e??"";return r.jsx(Li,{loadUrl:`/api/projects/${n}/edit`,saveUrl:`/api/projects/${n}`,redirectTo:`${t}/projects/${n}`,title:"Edit Project",description:"Project edits change the human-authored source document. The structured form stays focused on title, slug, tags, and overview content.",documentType:"project",helpTitle:"Editable vs derived project fields",helpBody:"Project status remains derived from assignment state. If you need less common frontmatter fields, switch to raw markdown mode instead of expanding the structured form."})}function Ep(){const{slug:e,aslug:t,id:n}=kt(),s=Pt(),a=!!n,l=a?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=a?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,d=a?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(Li,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Assignment",description:"Edit assignment fields including status, priority, assignee, dependencies, and body.",documentType:"assignment",helpTitle:"Assignment editing",helpBody:"All fields are editable. Status can also be changed through lifecycle actions or kanban drag."})}function Tp(){const{slug:e,aslug:t,id:n}=kt(),s=Pt(),a=!!n,l=a?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=a?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,d=a?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(Li,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Plan",description:"Plans are separate from assignment status, so keep implementation steps here instead of overloading the assignment body.",documentType:"plan",helpTitle:"Plan status is separate",helpBody:"Plan status tracks the plan document itself. It does not replace the assignment lifecycle state."})}function Pp(){const{slug:e,aslug:t,id:n}=kt(),s=Pt(),a=!!n,l=a?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=a?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,d=a?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(Li,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Scratchpad",description:"Scratchpad is the assignment’s working memory surface for notes, experiments, and temporary context.",documentType:"scratchpad",helpTitle:"Scratchpad usage",helpBody:"Scratchpad is for transient notes. Keep canonical objective and lifecycle data in assignment.md and any active plan files (plan.md, plan-v2.md, ...)."})}function B1({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,helpTitle:l,helpBody:c}){const d=Tt(),{data:f,loading:m,error:g}=i0(e),[x,y]=p.useState(""),[v,C]=p.useState(""),[j,w]=p.useState(!1),[S,T]=p.useState(null);async function N(){w(!0),T(null);try{const A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:v})}),$=await A.json();if(!A.ok){T($.error||`HTTP ${A.status}`),w(!1);return}d(n)}catch(A){T(A.message),w(!1);return}w(!1)}return m?r.jsx(at,{label:`Loading ${s.toLowerCase()}…`}):g||!f?r.jsx(et,{error:g||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Le,{title:s,description:a,children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry title"}),r.jsx("input",{value:x,onChange:A=>y(A.target.value),placeholder:"Optional title",className:"editor-input"})]}),r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry body"}),r.jsx("textarea",{value:v,onChange:A=>C(A.target.value),className:"editor-textarea",spellCheck:!1})]}),S?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:S}):null,r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:()=>d(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:j||!v.trim(),className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:j?"Appending…":"Append Entry"})]})]})}),r.jsx(Le,{title:"Current Document",children:r.jsx(Ut,{content:f.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Rp(){const{slug:e,aslug:t,id:n}=kt(),s=Pt(),a=!!n,l=a?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=a?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,d=a?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(B1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Handoff Entry",description:"Add a new handoff without rewriting previous history.",helpTitle:"Append-only handoff history",helpBody:"Handoff log entries preserve the baton-passing trail between sessions and agents. Add a new entry instead of editing older ones."})}function Ap(){const{slug:e,aslug:t,id:n}=kt(),s=Pt(),a=!!n,l=a?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=a?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,d=a?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(B1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Decision Entry",description:"Record a new decision and rationale without editing prior entries.",helpTitle:"Append-only decision history",helpBody:"Decision records should accumulate over time so the implementation rationale remains auditable and reviewable."})}function sw(){const{workspace:e}=kt(),{data:t}=Ni(),{data:n,loading:s,error:a,refetch:l}=zm(),[c,d]=p.useState(!1),[f,m]=p.useState(""),[g,x]=p.useState(!1),y=En();p.useEffect(()=>{const T=y.hash.match(/^#server-(.+)/);if(!T)return;const N=decodeURIComponent(T[1]),A=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!A)return;A.scrollIntoView({block:"nearest"}),A.classList.add("ring-2","ring-primary/60");const $=window.setTimeout(()=>A.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout($)},[y.hash,n]);const v=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const T=new Set(t.filter(N=>e==="_ungrouped"?N.workspace===null:N.workspace===e).map(N=>N.slug));return n.sessions.filter(N=>N.windows.some(A=>A.panes.some($=>$.assignment&&$.assignment.project!==null&&T.has($.assignment.project))))})();async function C(T){if(T.preventDefault(),!!f.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim()})}),m(""),d(!1),l()}catch{}}async function j(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function w(T){await fetch(`/api/servers/${encodeURIComponent(T)}`,{method:"DELETE"}),l()}async function S(T){await fetch(`/api/servers/${encodeURIComponent(T)}/refresh`,{method:"POST"}),l()}return s?r.jsx(at,{label:"Loading servers…"}):a?r.jsx(et,{error:a}):n?n.tmuxAvailable?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c?r.jsxs("form",{onSubmit:C,className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",value:f,onChange:T=>m(T.target.value),placeholder:"tmux session name",className:"editor-input text-sm",autoFocus:!0}),r.jsx("button",{type:"submit",className:"shell-action",children:"Add"}),r.jsx("button",{type:"button",className:"shell-action",onClick:()=>d(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>d(!0),children:[r.jsx(Ht,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:j,disabled:g,children:[r.jsx(Mw,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`}),"Refresh All"]})]}),v.length===0?r.jsx(ot,{title:"No sessions tracked",description:"Register a tmux session to start tracking your dev servers."}):r.jsx("div",{className:"mt-4 space-y-4",children:v.map(T=>r.jsx(h5,{session:T,onRefresh:()=>S(T.name),onRemove:()=>w(T.name),onRefetch:l},T.name))})]}):r.jsx(r.Fragment,{children:r.jsxs("div",{className:"surface-panel mt-4 flex flex-col items-center gap-3 py-12 text-center",children:[r.jsx(Wa,{className:"h-10 w-10 text-muted-foreground/40"}),r.jsx("p",{className:"text-sm font-medium text-foreground",children:"tmux is not installed"}),r.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Server tracking requires tmux. Install it with ",r.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"brew install tmux"})," to get started."]})]})}):null}function h5({session:e,onRefresh:t,onRemove:n,onRefetch:s}){return r.jsxs("div",{className:"surface-panel","data-server-name":e.name,children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Dm,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),r.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.alive?"border border-success-foreground/30 bg-success text-success-foreground":"border border-error-foreground/30 bg-error text-error-foreground"}`,children:e.alive?"alive":"dead"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last refreshed: ",new Date(e.lastRefreshed).toLocaleString()]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{className:"shell-action",onClick:t,title:"Refresh",children:r.jsx(Mw,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})]})]}),e.alive&&e.windows.length>0&&r.jsx("div",{className:"mt-3 space-y-3",children:e.windows.map(a=>r.jsxs("div",{children:[r.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",a.index,": ",a.name]}),r.jsx("div",{className:"space-y-1.5",children:a.panes.map(l=>r.jsx(g5,{pane:l,sessionName:e.name,windowIndex:a.index,onRefetch:s},`${a.index}:${l.index}`))})]},a.index))}),!e.alive&&r.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(o2,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function g5({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const a=Pt(),l=e.cwd.replace(/^\/Users\/[^/]+/,"~");return r.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[r.jsxs("span",{className:"shrink-0 font-mono text-xs text-muted-foreground/60",children:[":",e.index]}),r.jsx("span",{className:"shrink-0 rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:e.command}),r.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("span",{className:"truncate",title:e.cwd,children:l}),r.jsx(qr,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(Tm,{className:"h-3 w-3"}),e.branch,e.worktree&&r.jsx("span",{className:"rounded bg-status-in-progress px-1 py-0.5 text-[10px] font-medium text-status-in-progress-foreground",children:"worktree"})]}),e.ports.length>0&&r.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:e.urls.map(c=>r.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 dark:border-primary/40 dark:bg-primary/10 dark:hover:bg-primary/20",children:[c.replace("http://localhost:",":"),r.jsx(Em,{className:"h-2.5 w-2.5"})]},c))}),r.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?r.jsxs(we,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${a}/projects/${e.assignment.project}/assignments/${e.assignment.slug}`,className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/20",children:[r.jsx(XE,{className:"h-2.5 w-2.5"}),e.assignment.title,e.assignment.project===null?r.jsx("span",{className:"ml-1 rounded bg-muted px-1 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"Standalone"}):null]}):r.jsx("span",{className:"text-xs text-muted-foreground/40",children:"unlinked"})})]})}function U1(e){return e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function x5(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":U1(s)}function y5(e){switch(e){case"idle":return"bg-green-500/15 text-green-400 border-green-500/30";case"leased":return"bg-amber-500/15 text-amber-400 border-amber-500/30";case"retired":return"bg-zinc-500/15 text-zinc-400 border-zinc-500/30"}}function v5(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function ow(){const{data:e,loading:t,error:n,refetch:s}=rT(),[a,l]=p.useState(()=>Date.now()),[c,d]=p.useState(null),[f,m]=p.useState(!1);if(p.useEffect(()=>{const x=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(x)},[]),t)return r.jsx(at,{label:"Loading inventories…"});if(n)return r.jsx(et,{title:"Could not load inventories",error:n,action:r.jsx("button",{type:"button",onClick:s,className:"rounded border px-3 py-1 text-sm",children:"Retry"})});if(!e||e.inventories.length===0)return r.jsx(ot,{title:"No inventories yet",description:"Create one with `syntaur lease create-inventory <slug> --kind <kind>`, then add members with `syntaur lease member add <slug> <id>`."});async function g(){if(c){m(!0);try{const x=await fetch(`/api/leases/${encodeURIComponent(c.slug)}/force-release/${encodeURIComponent(c.lease.lease_id)}`,{method:"POST"});if(!x.ok){const y=await x.json().catch(()=>null);throw new Error((y==null?void 0:y.error)??`HTTP ${x.status}`)}s(),d(null)}catch(x){window.alert(x instanceof Error?`Force release failed: ${x.message}`:"Force release failed")}finally{m(!1)}}}return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-start justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-semibold",children:"Inventories"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Claimable shared resources (dev envs, test DBs, named locks, …). Global in v1 — the same set appears on every workspace."})]})}),r.jsx("div",{className:"grid gap-4",children:e.inventories.map(x=>r.jsx(b5,{detail:x,now:a,onForceRelease:y=>d({slug:x.inventory.slug,lease:y})},x.inventory.slug))}),r.jsx(gl,{open:c!==null,title:"Force release this lease?",description:c?`This will revoke lease ${c.lease.lease_id} and (if it's still the current holder) free member ${c.lease.member_id}. Any agent still using this lease will see a stale-lease error on its next CLI call.`:"",confirmLabel:"Force release",destructive:!0,loading:f,onConfirm:g,onOpenChange:x=>{x||d(null)}})]})}function b5({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:a,active_leases:l}=e,c=a.filter(f=>f.status==="idle").length,d=a.filter(f=>f.status==="leased").length;return r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{children:[r.jsxs("h2",{className:"text-lg font-semibold",children:[r.jsx(Nm,{className:"mr-2 inline h-4 w-4 text-muted-foreground"}),s.display_name??s.slug]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[r.jsx("code",{className:"font-mono",children:s.slug})," · kind=",s.kind," · default TTL=",U1(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",d," leased · ",a.length," total"]})})]}),r.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:a.map(f=>r.jsx(w5,{member:f},f.member_id))}),l.length>0&&r.jsxs("div",{className:"mt-4",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Active leases"}),r.jsx("div",{className:"mt-2 space-y-2",children:l.map(f=>r.jsx(j5,{lease:f,now:t,onForceRelease:()=>n(f)},f.lease_id))})]})]})}function w5({member:e}){const t=v5(e.metadata_json);return r.jsxs("div",{className:"rounded-md border bg-muted/40 px-3 py-2 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"font-mono",children:e.member_id}),r.jsx("span",{className:`rounded border px-1.5 py-0.5 text-xs ${y5(e.status)}`,children:e.status})]}),t&&r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:Object.entries(t).map(([n,s])=>r.jsxs("div",{className:"truncate",children:[r.jsx("span",{className:"font-mono",children:n}),"=",r.jsx("span",{className:"font-mono",children:String(s)})]},n))})]})}function j5({lease:e,now:t,onForceRelease:n}){return r.jsxs("div",{className:"flex items-center justify-between rounded border bg-muted/20 px-3 py-2 text-sm",children:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.lease_id.slice(0,8),"…"]}),r.jsx("span",{className:"font-mono",children:e.member_id}),e.requested_for&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["for ",e.requested_for]})]})}),r.jsxs("div",{className:"ml-3 flex items-center gap-3",children:[r.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(zE,{className:"h-3 w-3"}),x5(e.expires_at,t)]}),r.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 rounded border border-destructive/40 px-2 py-1 text-xs text-destructive hover:bg-destructive/10",children:[r.jsx(a2,{className:"h-3 w-3"}),"Force release"]})]})]})}function iw(){const{workspace:e}=kt(),{data:t}=Ni(),{data:n,loading:s,error:a}=sT(),[l,c]=p.useState(""),[d,f]=p.useState(""),[m,g]=p.useState(""),[x,y]=p.useState("started_desc"),[v,C]=p.useState(0),[j,w]=p.useState(new Set),[S,T]=p.useState(!1),[N,A]=p.useState(null),[$,R]=p.useState(null),O=(n==null?void 0:n.sessions.some(U=>U.status==="active"))??!1;p.useEffect(()=>{if(!O)return;const U=window.setInterval(()=>C(Y=>Y+1),3e4);return()=>window.clearInterval(U)},[O]),p.useEffect(()=>{w(U=>{if(U.size===0)return U;const Y=new Set((n==null?void 0:n.sessions.map(V=>V.sessionId))??[]),z=new Set([...U].filter(V=>Y.has(V)));return z.size===U.size?U:z})},[n]);const I=p.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const U=l.trim().toLowerCase();return[...n.sessions.filter(z=>{var Q;if(e&&t){const E=((Q=t.find(M=>M.slug===z.projectSlug))==null?void 0:Q.workspace)??null;if(e==="_ungrouped"){if(E!==null)return!1}else if(E!==e)return!1}const V=S5(z.started);return d&&(!V||V<d)||m&&(!V||V>m)?!1:U?[z.projectSlug??"",z.assignmentSlug??"",z.agent,z.sessionId,z.path,z.description??"",z.transcriptPath??""].join(" ").toLowerCase().includes(U):!0})].sort((z,V)=>N5(z,V,x))},[n,l,x,d,m,v,e,t]);function K(U){w(Y=>{const z=new Set(Y);return z.has(U)?z.delete(U):z.add(U),z})}function X(){j.size===I.length&&I.length>0?w(new Set):w(new Set(I.map(U=>U.sessionId)))}async function _(U){A(null),T(!0);try{const Y=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:U})}),z=await Y.json().catch(()=>null);if(!Y.ok)throw new Error((z==null?void 0:z.error)||`HTTP ${Y.status}`);w(V=>new Set([...V].filter(D=>!U.includes(D)))),R(null)}catch(Y){A(Y.message)}finally{T(!1)}}async function H(U){try{const Y=await fetch(`/api/agent-sessions/${encodeURIComponent(U)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!Y.ok){const z=await Y.json().catch(()=>null);A((z==null?void 0:z.error)||`Failed to mark session stopped: HTTP ${Y.status}`)}}catch(Y){A(Y.message)}}if(s)return r.jsx(at,{label:"Loading agent sessions..."});if(a)return r.jsx(et,{error:a});if(!n)return null;const J=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(xh,{children:[r.jsx(Uu,{value:l,onChange:c,placeholder:"Search project, assignment, agent, session ID, path, or description"}),r.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started From",r.jsx("input",{type:"date",value:d,onChange:U=>f(U.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started To",r.jsx("input",{type:"date",value:m,onChange:U=>g(U.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("select",{value:x,onChange:U=>y(U.target.value),className:"editor-input max-w-[200px]",children:[r.jsx("option",{value:"started_desc",children:"Newest first"}),r.jsx("option",{value:"started_asc",children:"Oldest first"}),r.jsx("option",{value:"assignment_asc",children:"Assignment A-Z"}),r.jsx("option",{value:"agent_asc",children:"Agent A-Z"})]})]}),N?r.jsx("div",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:N}):null,j.size>0&&r.jsxs("div",{className:"mt-4 flex items-center gap-3 rounded border border-border/40 bg-muted/30 px-4 py-2 text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:[j.size," session",j.size!==1?"s":""," selected"]}),r.jsxs("button",{className:"shell-action text-destructive",onClick:()=>R({sessionIds:[...j],title:`Delete ${j.size} selected session${j.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:j.size===1?"Delete Session":"Delete Sessions"}),disabled:S,children:[r.jsx(zn,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),r.jsx("button",{className:"shell-action",onClick:()=>w(new Set),children:"Clear Selection"})]}),J?I.length===0?r.jsx(ot,{title:"No agent sessions match these filters",description:"Adjust the status, search term, date range, or sorting controls to show sessions again."}):r.jsx("div",{className:"surface-panel mt-4 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1280px] table-fixed text-sm",children:[r.jsxs("colgroup",{children:[r.jsx("col",{style:{width:"32px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"160px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"110px"}}),r.jsx("col",{style:{width:"130px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"40px"}})]}),r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/40 text-left text-xs uppercase tracking-wider text-muted-foreground",children:[r.jsx("th",{className:"pb-2 pr-3",children:r.jsx("button",{onClick:X,className:"text-muted-foreground hover:text-foreground",children:j.size===I.length&&I.length>0?r.jsx(cr,{className:"h-4 w-4"}):r.jsx(Om,{className:"h-4 w-4"})})}),r.jsx("th",{className:"pb-2 pr-3",children:"Project"}),r.jsx("th",{className:"pb-2 pr-3",children:"Assignment"}),r.jsx("th",{className:"pb-2 pr-3",children:"Description"}),r.jsx("th",{className:"pb-2 pr-3",children:"Agent"}),r.jsx("th",{className:"pb-2 pr-3",children:"Session ID"}),r.jsx("th",{className:"pb-2 pr-3",children:"Started"}),r.jsx("th",{className:"pb-2 pr-3",children:"Path"}),r.jsx("th",{className:"pb-2 pr-3",children:"Transcript"}),r.jsx("th",{className:"pb-2"})]})}),r.jsx("tbody",{children:I.map(U=>r.jsx(k5,{session:U,selected:j.has(U.sessionId),onToggle:()=>K(U.sessionId),onDelete:()=>R({sessionIds:[U.sessionId],title:`Delete session ${U.sessionId.slice(0,8)}...?`,description:`Remove this ${U.agent} session record${U.assignmentSlug?` for ${U.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"}),onMarkStopped:H},U.sessionId))})]})}):r.jsx(ot,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(gl,{open:$!==null,title:($==null?void 0:$.title)??"Delete session?",description:($==null?void 0:$.description)??"",confirmLabel:($==null?void 0:$.confirmLabel)??"Delete",destructive:!0,loading:S,onOpenChange:U=>{U||R(null)},onConfirm:async()=>{$&&await _($.sessionIds)}})]})}function k5({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:a}){const l=Pt(),c=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,d=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",f=e.transcriptPath?e.transcriptPath.replace(/^\/Users\/[^/]+/,"~"):"—";return r.jsxs("tr",{className:"border-b border-border/20 last:border-0",children:[r.jsx("td",{className:"py-2 pr-3",children:r.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground",children:t?r.jsx(cr,{className:"h-4 w-4"}):r.jsx(Om,{className:"h-4 w-4"})})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?r.jsx(we,{to:`${l}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:pn(e.projectSlug),children:pn(e.projectSlug)}):e.assignmentSlug?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wide text-muted-foreground",children:"Standalone"}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug&&e.assignmentSlug?r.jsx(we,{to:`${l}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:pn(e.assignmentSlug),children:pn(e.assignmentSlug)}):e.assignmentSlug?r.jsx(we,{to:`/assignments/${e.assignmentSlug}`,className:"block truncate font-mono text-primary hover:underline",title:e.assignmentSlug,children:e.assignmentSlug}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.description?r.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.description,children:e.description}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(Sm,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate",children:e.agent})]})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:c}),r.jsx(qr,{value:e.sessionId})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:Gr(e.started)})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-xs text-muted-foreground",title:e.path,children:d}),e.path&&r.jsx(qr,{value:e.path})]})}),r.jsx("td",{className:"py-2 pr-3",children:e.transcriptPath?r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:f}),r.jsx(qr,{value:e.transcriptPath})]}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(D1,{session:e,onMarkStopped:a}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})]})})]})}function S5(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${a}`}function Fc(e){const t=Date.parse(e.started),n=e.ended?Date.parse(e.ended):Date.now();return Number.isNaN(t)||Number.isNaN(n)?0:Math.max(0,Math.floor((n-t)/6e4))}function N5(e,t,n){switch(n){case"started_asc":return e.started.localeCompare(t.started);case"started_desc":return t.started.localeCompare(e.started);case"duration_asc":return Fc(e)-Fc(t);case"duration_desc":return Fc(t)-Fc(e);case"assignment_asc":return(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"")||(e.projectSlug??"").localeCompare(t.projectSlug??"");case"agent_asc":return e.agent.localeCompare(t.agent)||(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"");default:return 0}}function C5(){const{data:e,loading:t,error:n,refetch:s}=a0(),[a,l]=p.useState(""),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(null),y=p.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!a.trim())return e.playbooks;const j=a.toLowerCase();return e.playbooks.filter(w=>w.name.toLowerCase().includes(j)||w.description.toLowerCase().includes(j)||w.slug.toLowerCase().includes(j)||w.tags.some(S=>S.toLowerCase().includes(j)))},[e,a]);async function v(j,w,S){if(j.preventDefault(),j.stopPropagation(),!c){d(w);try{const T=S?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(w)}/${T}`,{method:"POST"});if(!N.ok){const A=await N.json().catch(()=>({}));throw new Error(A.error||`Failed to ${T} playbook`)}s()}catch(T){console.error(T),alert(T instanceof Error?T.message:"Failed to update playbook")}finally{d(null)}}}async function C(){if(f){x(f.slug);try{const j=await fetch(`/api/playbooks/${encodeURIComponent(f.slug)}`,{method:"DELETE"});if(!j.ok){const w=await j.json().catch(()=>({}));throw new Error(w.error||"Failed to delete playbook")}m(null),s()}catch(j){console.error(j),alert(j instanceof Error?j.message:"Failed to delete playbook")}finally{x(null)}}}return t?r.jsx(at,{label:"Loading playbooks..."}):n?r.jsx(et,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search playbooks...",value:a,onChange:j=>l(j.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs(we,{to:"/playbooks/create",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"Create Playbook"]})]}),r.jsxs(we,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[r.jsx(Lw,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:"Playbook Manifest"}),r.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:"auto-generated"})]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Index of all playbooks with descriptions. Include ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-[11px]",children:"~/.syntaur/playbooks/manifest.md"})," in your CLAUDE.md for agent context."]})]})]}),y.length===0?r.jsx(ot,{title:"No playbooks found",description:(e==null?void 0:e.playbooks.length)===0?"Playbooks define rules and workflows for how agents should operate. Create your first one to get started.":"No playbooks match your search.",actions:(e==null?void 0:e.playbooks.length)===0?r.jsxs(we,{to:"/playbooks/create",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"Create Playbook"]}):void 0}):r.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:y.map(j=>{const w=c===j.slug,S=[{key:"delete",label:"Delete",icon:zn,destructive:!0,onSelect:()=>m({slug:j.slug,name:j.name})}];return r.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${j.enabled?"":"opacity-75"}`,children:[r.jsx("div",{className:"absolute right-3 top-3 z-10",children:r.jsx(hh,{items:S})}),r.jsxs(we,{to:`/playbooks/${j.slug}`,className:"group flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(Dw,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:j.name}),j.description?r.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:j.description}):null]})]}),r.jsx("div",{className:"flex items-center gap-2 pt-1 pr-20",children:r.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.tags.slice(0,3).map(T=>r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:[r.jsx(_w,{className:"h-2.5 w-2.5"}),T]},T)),j.tags.length>3?r.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",j.tags.length-3]}):null]})})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":j.enabled,"aria-label":j.enabled?"Disable playbook":"Enable playbook",onClick:T=>v(T,j.slug,j.enabled),disabled:w,className:`absolute bottom-3 right-3 z-10 inline-flex h-5 w-9 items-center rounded-full border opacity-100 transition disabled:opacity-50 ${j.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:r.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${j.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},j.slug)})}),r.jsx(gl,{open:f!==null,title:"Delete playbook?",description:f?`"${f.name}" will be removed from disk and the playbook manifest will be regenerated. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:g!==null,onConfirm:C,onOpenChange:j=>{j||m(null)}})]})}function E5(){const{slug:e}=kt(),t=Tt(),{data:n,loading:s,error:a,refetch:l}=aT(e),[c,d]=p.useState(!1),[f,m]=p.useState(!1),[g,x]=p.useState(!1),[y,v]=p.useState(!1),[C,j]=p.useState(""),[w,S]=p.useState(!1),[T,N]=p.useState(null),A=e==="manifest";p.useEffect(()=>{y&&(j(e??""),N(null))},[y,e]);const $=Jn(C),R=$.length>0&&qc($)&&$!=="manifest",O=$!==e;async function I(){if(!(!e||!R||!O)){S(!0),N(null);try{const _=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:$})});if(!_.ok){const H=await _.json().catch(()=>({}));throw new Error(H.error||"Failed to rename playbook")}v(!1),t(`/playbooks/${$}`)}catch(_){N(_ instanceof Error?_.message:"Failed to rename playbook")}finally{S(!1)}}}async function K(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function X(){if(!(!e||!n)){x(!0);try{const _=n.enabled?"disable":"enable",H=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${_}`,{method:"POST"});if(!H.ok){const J=await H.json().catch(()=>({}));throw new Error(J.error||`Failed to ${_} playbook`)}l()}catch(_){console.error(_),alert(_ instanceof Error?_.message:"Failed to update playbook")}finally{x(!1)}}}return s?r.jsx(at,{label:"Loading playbook..."}):a?r.jsx(et,{error:a}):n?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:A?"Playbook Manifest":n.name}),A?r.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:"auto-generated"}):null]}),!A&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,A?r.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This file is rebuilt automatically when playbooks are added or removed. Include"," ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.syntaur/playbooks/manifest.md"})," ","in your CLAUDE.md for agent context."]}):null,!A&&n.whenToUse?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground italic",children:["When to use: ",n.whenToUse]}):null,r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Gr(n.created)]}),r.jsxs("span",{children:["Updated ",Gr(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(_=>r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:[r.jsx(_w,{className:"h-3 w-3"}),_]},_))}):null]}),A?null:r.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.enabled?"Enabled":"Disabled"}),r.jsx("button",{type:"button",role:"switch","aria-checked":n.enabled,"aria-label":n.enabled?"Disable playbook":"Enable playbook",onClick:X,disabled:g,className:`inline-flex h-5 w-9 items-center rounded-full border transition disabled:opacity-50 ${n.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:r.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${n.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]}),r.jsxs(we,{to:`/playbooks/${e}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(ki,{className:"h-3 w-3"}),"Edit"]}),r.jsxs("button",{type:"button",onClick:()=>v(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(c2,{className:"h-3 w-3"}),"Rename"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:K,disabled:f,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:f?"Deleting...":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:n.body})}),r.jsx(Rr,{open:y,onOpenChange:_=>w?void 0:v(_),children:r.jsxs(dr,{children:[r.jsxs(Ks,{children:[r.jsx(fr,{children:"Rename playbook"}),r.jsx(Qr,{children:"The slug changes both the file name and the canonical slug stored in frontmatter. The URL will update on save."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"rename-slug-input",className:"block text-xs font-medium text-muted-foreground",children:"New slug"}),r.jsx("input",{id:"rename-slug-input",type:"text",autoFocus:!0,value:C,onChange:_=>j(_.target.value),disabled:w,className:"h-9 w-full rounded-md border border-border/70 bg-background px-3 text-sm text-foreground focus:border-foreground/40 focus:outline-none",placeholder:"my-new-slug"}),C&&$!==C?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Will be normalized to ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:$||"—"})]}):null,C&&!R?r.jsx("p",{className:"text-xs text-destructive",children:'Slugs must be lowercase, hyphen-separated, with no special characters, and cannot be "manifest".'}):null]}),T?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:T}):null,r.jsxs(Gs,{children:[r.jsx("button",{type:"button",onClick:()=>v(!1),disabled:w,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:I,disabled:w||!R||!O,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:w?"Renaming…":"Rename"})]})]})})]}):null}function T5(){const e=Tt(),[t,n]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(!1),[d,f]=p.useState(null);p.useEffect(()=>{fetch("/api/playbooks/template/new").then(g=>g.json()).then(g=>{n(g.content),a(!1)}).catch(g=>{f(g.message),a(!1)})},[]);async function m(g){c(!0),f(null);try{const x=await fetch("/api/playbooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:g})}),y=await x.json();if(!x.ok){f(y.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${y.slug}`)}catch(x){f(x.message),c(!1);return}c(!1)}return s?r.jsx(at,{label:"Loading playbook template..."}):d&&!t?r.jsx(et,{error:d}):r.jsx(Ii,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:d,title:"Create Playbook",description:"Playbooks define rules and workflows for how agents should operate. Keep them short, imperative, and focused on a single concern.",onCancel:()=>e("/playbooks"),allowSlugEdit:!0})}function P5(){const{slug:e}=kt(),t=Tt(),[n,s]=p.useState(null),[a,l]=p.useState(!0),[c,d]=p.useState(!1),[f,m]=p.useState(null);p.useEffect(()=>{e&&fetch(`/api/playbooks/${e}/edit`).then(x=>x.json()).then(x=>{s(x.content),l(!1)}).catch(x=>{m(x.message),l(!1)})},[e]);async function g(x){if(e){d(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),v=await y.json();if(!y.ok){m(v.error||`HTTP ${y.status}`),d(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),d(!1);return}d(!1)}}return a?r.jsx(at,{label:"Loading playbook..."}):f&&!n?r.jsx(et,{error:f}):r.jsx(Ii,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:g,saving:c,error:f,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function R5(){const{data:e,loading:t,error:n}=lT(),[s,a]=p.useState(""),[l,c]=p.useState("all"),[d,f]=p.useState("all"),[m,g]=p.useState("all"),x=(e==null?void 0:e.memories)??[],y=p.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=p.useMemo(()=>Array.from(new Set(x.map(w=>w.scope).filter(Boolean))).sort(),[x]),C=p.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),j=p.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.scope!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(at,{label:"Loading memories…"}):n?r.jsx(et,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search memories…",value:s,onChange:w=>a(w.target.value),className:"h-9 w-64 rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:d,onChange:w=>f(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>g(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),C.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(we,{to:"/memories/new",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"New Memory"]})]}),j.length===0?r.jsx(ot,{title:x.length===0?"No memories yet":"No memories match these filters",description:x.length===0?"Memories capture patterns and learnings discovered while working in a project. Agents create them via /create-memory or you can add one manually.":"Clear the current filters or create a new memory.",actions:x.length===0?r.jsxs(we,{to:"/memories/new",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"New Memory"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Scope"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(we,{to:`/projects/${w.projectSlug}/memories/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(we,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.scope||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Kr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function A5(){const{slug:e,itemSlug:t}=kt(),n=Tt(),{data:s,loading:a,error:l}=cT(e,t),[c,d]=p.useState(!1),[f,m]=p.useState(!1);async function g(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/memories/${t}`,{method:"DELETE"})).ok&&n("/memories")}finally{m(!1)}}}return a?r.jsx(at,{label:"Loading memory…"}):l?r.jsx(et,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(we,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.scope?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Scope: ",s.scope]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,s.sourceAssignment?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["From: ",s.sourceAssignment]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Gr(s.created)]}),r.jsxs("span",{children:["Updated ",Gr(s.updated)]})]}),s.tags&&s.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map(x=>r.jsx("span",{className:"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:x},x))}):null]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(we,{to:`/projects/${e}/memories/${t}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(ki,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:g,disabled:f,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:f?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:s.body})})]}):null}function D5(){const e=Tt(),[t]=Xr(),n=t.get("project"),{data:s,loading:a,error:l}=Ni(),[c,d]=p.useState(n??""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(!1),[C,j]=p.useState(null);p.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!f.trim())){v(!0),j(null);try{const T=await fetch(`/api/projects/${c}/memories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),body:g||void 0})}),N=await T.json();if(!T.ok){j(N.error||`HTTP ${T.status}`),v(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(T){j(T.message),v(!1)}}}return a?r.jsx(at,{label:"Loading projects…"}):l?r.jsx(et,{error:l}):!s||s.length===0?r.jsx(et,{error:"You need at least one project before you can create a memory. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Memory"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Memories capture patterns and learnings discovered during work in a project. They are available to every assignment in that project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:f,onChange:S=>m(S.target.value),placeholder:"e.g. PostgreSQL connection pooling",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:g,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the memory body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!f.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Memory"}),r.jsx("button",{type:"button",onClick:()=>e("/memories"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function O5(){const{slug:e,itemSlug:t}=kt();return r.jsx(Li,{loadUrl:`/api/projects/${e}/memories/${t}/edit`,saveUrl:`/api/projects/${e}/memories/${t}`,redirectTo:`/projects/${e}/memories/${t}`,title:"Edit Memory",description:"Edit the body. The frontmatter (name, scope, source, related assignments) is preserved unchanged on save.",documentType:"memory",helpTitle:"Memory editing",helpBody:"Memory edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function I5(){const{data:e,loading:t,error:n}=uT(),[s,a]=p.useState(""),[l,c]=p.useState("all"),[d,f]=p.useState("all"),[m,g]=p.useState("all"),x=(e==null?void 0:e.resources)??[],y=p.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=p.useMemo(()=>Array.from(new Set(x.map(w=>w.category).filter(Boolean))).sort(),[x]),C=p.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),j=p.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.category!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(at,{label:"Loading resources…"}):n?r.jsx(et,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search resources…",value:s,onChange:w=>a(w.target.value),className:"h-9 w-64 rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:d,onChange:w=>f(w.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>g(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),C.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(we,{to:"/resources/new",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"New Resource"]})]}),j.length===0?r.jsx(ot,{title:x.length===0?"No resources yet":"No resources match these filters",description:x.length===0?"Resources are reference materials shared across a project — specs, requirements, links, or any reference content.":"Clear the current filters or create a new resource.",actions:x.length===0?r.jsxs(we,{to:"/resources/new",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[r.jsx(Ht,{className:"h-4 w-4"}),"New Resource"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Category"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(we,{to:`/projects/${w.projectSlug}/resources/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(we,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.category||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Kr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function L5(){const{slug:e,itemSlug:t}=kt(),n=Tt(),{data:s,loading:a,error:l}=dT(e,t),[c,d]=p.useState(!1),[f,m]=p.useState(!1);async function g(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/resources/${t}`,{method:"DELETE"})).ok&&n("/resources")}finally{m(!1)}}}return a?r.jsx(at,{label:"Loading resource…"}):l?r.jsx(et,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(we,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.category?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Category: ",s.category]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",Gr(s.created)]}),r.jsxs("span",{children:["Updated ",Gr(s.updated)]})]})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(we,{to:`/projects/${e}/resources/${t}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[r.jsx(ki,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:g,disabled:f,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:f?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):r.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[r.jsx(zn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(Ut,{content:s.body})})]}):null}function $5(){const e=Tt(),[t]=Xr(),n=t.get("project"),{data:s,loading:a,error:l}=Ni(),[c,d]=p.useState(n??""),[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(!1),[C,j]=p.useState(null);p.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!f.trim())){v(!0),j(null);try{const T=await fetch(`/api/projects/${c}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f.trim(),body:g||void 0})}),N=await T.json();if(!T.ok){j(N.error||`HTTP ${T.status}`),v(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(T){j(T.message),v(!1)}}}return a?r.jsx(at,{label:"Loading projects…"}):l?r.jsx(et,{error:l}):!s||s.length===0?r.jsx(et,{error:"You need at least one project before you can create a resource. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Resource"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Resources are reference material — specs, requirements, links — shared across every assignment in a project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:f,onChange:S=>m(S.target.value),placeholder:"e.g. Auth Requirements",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:g,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the resource body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!f.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Resource"}),r.jsx("button",{type:"button",onClick:()=>e("/resources"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function M5(){const{slug:e,itemSlug:t}=kt();return r.jsx(Li,{loadUrl:`/api/projects/${e}/resources/${t}/edit`,saveUrl:`/api/projects/${e}/resources/${t}`,redirectTo:`/projects/${e}/resources/${t}`,title:"Edit Resource",description:"Edit the body. The frontmatter (name, category, source, related assignments) is preserved unchanged on save.",documentType:"resource",helpTitle:"Resource editing",helpBody:"Resource edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function _5({value:e,onChange:t}){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"color",value:e||"#64748b",onChange:n=>t(n.target.value),className:"h-7 w-7 shrink-0 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5",title:"Pick a color"}),r.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs"})]})}const mm=["projects","playbooks","todos","servers","config"];function F5(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))mm.includes(n)&&t.add(n);return t}function aw(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function z5(){const[e,t]=p.useState(!0),[n,s]=p.useState(null),[a,l]=p.useState(""),[c,d]=p.useState(new Set(mm)),[f,m]=p.useState(!1),[g,x]=p.useState(!1),[y,v]=p.useState(null),[C,j]=p.useState(null),w=p.useCallback(async()=>{try{const R=await fetch("/api/backup");if(!R.ok)throw new Error(`HTTP ${R.status}`);const O=await R.json();s(O),l(O.repo??""),d(F5(O.categories)),m(!1)}catch(R){j({type:"error",message:`Failed to load backup config: ${R instanceof Error?R.message:String(R)}`})}finally{t(!1)}},[]);p.useEffect(()=>{w()},[w]);function S(R){d(O=>{const I=new Set(O);return I.has(R)?I.delete(R):I.add(R),I}),m(!0)}async function T(){x(!0),j(null);try{const R=Array.from(c),O=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:a.trim()||null,categories:R})}),I=await O.json();if(!O.ok)throw new Error(I.error||`HTTP ${O.status}`);s(I),m(!1),j({type:"success",message:"Backup configuration saved."})}catch(R){j({type:"error",message:`Save failed: ${R instanceof Error?R.message:String(R)}`})}finally{x(!1)}}async function N(){v("push"),j(null);try{const R=await fetch("/api/backup/push",{method:"POST"}),O=await R.json();if(!R.ok||O.success===!1)throw new Error(O.error||O.message||`HTTP ${R.status}`);j({type:"success",message:O.message||"Backup complete."}),await w()}catch(R){j({type:"error",message:`Backup failed: ${R instanceof Error?R.message:String(R)}`})}finally{v(null)}}async function A(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){v("pull"),j(null);try{const O=await fetch("/api/backup/pull",{method:"POST"}),I=await O.json();if(!O.ok||I.success===!1)throw new Error(I.error||I.message||`HTTP ${O.status}`);j({type:"success",message:I.message||"Restore complete."}),await w()}catch(O){j({type:"error",message:`Restore failed: ${O instanceof Error?O.message:String(O)}`})}finally{v(null)}}}if(e)return r.jsx(Le,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})});const $=!!a.trim()&&c.size>0&&!y&&!f;return r.jsx(Le,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository and restore from it",children:r.jsxs("div",{className:"space-y-4",children:[C&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${C.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:C.message}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repository URL"}),r.jsx("input",{type:"text",value:a,onChange:R=>{l(R.target.value),m(!0)},placeholder:"git@github.com:you/syntaur-backup.git",className:"editor-input w-full text-sm"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["SSH or HTTPS URL. Requires ",r.jsx("code",{className:"rounded bg-muted px-1",children:"git"})," installed and credentials configured locally."]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Categories to back up"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:mm.map(R=>{const O=c.has(R);return r.jsxs("button",{type:"button",onClick:()=>S(R),className:`shell-action text-xs ${O?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted/30 text-muted-foreground hover:bg-muted/60"}`,children:[r.jsx("span",{className:`mr-1 inline-block h-2 w-2 rounded-full ${O?"bg-primary":"bg-muted-foreground/40"}`}),R]},R)})})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last backup: "}),aw((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),aw((n==null?void 0:n.lastRestore)??null)]}),(n==null?void 0:n.locked)&&r.jsx("div",{className:"sm:col-span-2 text-warning-foreground",children:"⚠ A backup operation is in progress or the lock file is stale."})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:T,disabled:g||!f,children:[r.jsx(Su,{className:"h-3.5 w-3.5"}),g?"Saving...":"Save Config"]}),r.jsxs("button",{className:"shell-action",onClick:N,disabled:!$,title:$?"Back up now":f?"Save config first":"Set repo and pick categories",children:[r.jsx(u2,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:A,disabled:!$,title:$?"Restore from backup":f?"Save config first":"Set repo and pick categories",children:[r.jsx(UE,{className:"h-3.5 w-3.5"}),y==="pull"?"Restoring...":"Restore"]}),f&&r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]}),r.jsxs("p",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-muted/20 p-3 text-xs text-muted-foreground",children:[r.jsx(BE,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Restore never overwrites ",r.jsx("code",{className:"rounded bg-muted px-1",children:"config.md"})," (would clobber backup settings). The agent sessions database is not backed up — only markdown files."]})]})]})})}function B5(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:a,unbindAction:l}=Ys(),[c,d]=p.useState(null),[f,m]=p.useState(null),[g,x]=p.useState(!1),y=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function v(N,A){m({type:N,message:A}),setTimeout(()=>m(null),2500)}function C(N){d({kind:N,combo:null,conflict:null,saving:!1,error:null})}function j(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),w();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const A=l0(N.nativeEvent);if(!A)return;const $=s(A,c.kind);d({...c,combo:A,conflict:$,error:null})}async function w(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){d({...c,error:`Reserved: ${c.conflict.description}`});return}d({...c,saving:!0,error:null});try{await a(c.kind,c.combo),d(null),v("success",`Bound ${va[c.kind]}`)}catch(A){d({...c,saving:!1,error:A instanceof Error?A.message:"Failed to save"})}}}async function S(N){try{await l(N),v("success",`Cleared ${va[N]} binding`)}catch(A){v("error",A instanceof Error?A.message:"Failed to clear binding")}}async function T(){if(!g){x(!0);try{await AR(),v("success","All hotkey bindings cleared")}catch(N){v("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return r.jsxs(Le,{title:"Hotkey Bindings",description:"Each canonical create action ships with a default hotkey that fires the action without opening the palette. Override any of them below — Clear restores the default.",actions:y?r.jsxs("button",{className:"shell-action text-xs",onClick:()=>void T(),disabled:g,children:[r.jsx(gi,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[f?r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${f.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:f.message}):null,r.jsx("ul",{className:"space-y-2",children:Eu.map(N=>{var I,K;const A=n.find(X=>X.bindableKind===N),$=e[N],R=typeof t[N]=="string"&&!!t[N],O=(c==null?void 0:c.kind)===N;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2",children:[r.jsx(_p,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm text-foreground",children:(A==null?void 0:A.title)??va[N]}),A!=null&&A.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:A.subtitle}):null]}),$?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-foreground",children:Wr($)}),r.jsx("span",{className:`text-[10px] uppercase tracking-wide ${R?"text-primary":"text-muted-foreground"}`,children:R?"custom":"default"})]}):r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"unbound"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"shell-action text-xs",onClick:()=>C(N),children:$?"Rebind":"Bind"}),R?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${va[N]} binding`,children:[r.jsx(Lm,{className:"h-3 w-3"}),"Restore default"]}):null]}),O?r.jsx("div",{className:"mt-2 w-full rounded-md border border-primary/40 bg-primary/5 px-3 py-3 text-center outline-none",tabIndex:0,autoFocus:!0,onKeyDown:j,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&d(null)},children:c!=null&&c.combo?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-base font-semibold tracking-wide text-foreground",children:Wr(c.combo)}),(I=c.conflict)!=null&&I.description?r.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(K=c.conflict)!=null&&K.kind?r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',va[c.conflict.kind],'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press Enter to save, Esc to cancel, any other key to retry."}),c.error?r.jsx("div",{className:"text-xs text-destructive",children:c.error}):null]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press the key combination you want to bind…"})}):null]},N)})})]})}const U5={kanban:"Kanban",list:"List",table:"Table"},H5={comfortable:"Comfortable",compact:"Compact"},W5={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},V5={asc:"Ascending",desc:"Descending"};function q5(){const e=B_(),t=e.global,[n,s]=p.useState(!1),[a,l]=p.useState(null);function c(m,g){l({type:m,message:g}),setTimeout(()=>l(null),2e3)}async function d(m,g){if(t[m]!==g){s(!0);try{await R1({[m]:g}),c("success","Saved")}catch(x){c("error",x instanceof Error?x.message:"Failed to save")}finally{s(!1)}}}async function f(){if(e.custom){s(!0);try{await U_(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(Le,{title:"View defaults",description:"Defaults for the assignments board, list, and table views. Per-project overrides are saved automatically as you use them.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:f,disabled:n,children:[r.jsx(gi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[a&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${a.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:a.message}),r.jsxs("dl",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Default view"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:S1.map(m=>r.jsx("button",{type:"button",onClick:()=>d("defaultView",m),disabled:n,"aria-pressed":t.defaultView===m,className:`px-3 py-1 text-xs ${t.defaultView===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:U5[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Density"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:$_.map(m=>r.jsx("button",{type:"button",onClick:()=>d("density",m),disabled:n,"aria-pressed":t.density===m,className:`px-3 py-1 text-xs ${t.density===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:H5[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Sort by"}),r.jsx("dd",{className:"mt-1.5",children:r.jsx("select",{value:t.sortField,onChange:m=>d("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:I_.map(m=>r.jsx("option",{value:m,children:W5[m]},m))})})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Direction"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:L_.map(m=>r.jsx("button",{type:"button",onClick:()=>d("sortDirection",m),disabled:n,"aria-pressed":t.sortDirection===m,className:`px-3 py-1 text-xs ${t.sortDirection===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:V5[m]},m))})]})]})]})}const K5=/^[a-z0-9][a-z0-9_-]*$/,H1=["first","last","none"];class W1 extends Error{constructor(n,s){super(n);Ly(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const og={agents:[],custom:!1};let si=null,ti=null,yu=0;const hm=new Set;function V1(e){si=e;for(const t of hm)t(e)}function G5(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.id!="string"||t.id.length===0||typeof t.label!="string"||typeof t.command!="string")return null;const n={id:t.id,label:t.label,command:t.command};return Array.isArray(t.args)&&t.args.every(s=>typeof s=="string")&&(n.args=t.args),typeof t.promptArgPosition=="string"&&H1.includes(t.promptArgPosition)&&(n.promptArgPosition=t.promptArgPosition),typeof t.resolveFromShellAliases=="boolean"&&(n.resolveFromShellAliases=t.resolveFromShellAliases),typeof t.default=="boolean"&&(n.default=t.default),n}function ig(e){if(!e||typeof e!="object")return og;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const a of n){const l=G5(a);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function Y5(){if(si)return Promise.resolve(si);if(ti)return ti;const e=++yu;return ti=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{ti=null;const n=ig(t);return e!==yu?si??n:(si=n,n)}).catch(()=>(ti=null,og)),ti}function J5(){const[e,t]=p.useState(()=>si??og);return p.useEffect(()=>{let n=!1;return Y5().then(s=>{n||t(s)}),hm.add(t),()=>{n=!0,hm.delete(t)}},[]),e}async function q1(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new W1(n,t==null?void 0:t.fieldErrors)}async function X5(e){++yu;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await q1(t);const n=ig(await t.json());return V1(n),n}async function Q5(){++yu;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await q1(e);const t=ig(await e.json());return V1(t),t}const Z5={first:"first",last:"last",none:"none"};function K1(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Ea(e){return e.map(t=>({rowKey:K1(),id:t.id,originalId:t.id,isNew:!1,idEditable:!1,autoSlugFromLabel:!1,label:t.label,command:t.command,argsText:t.args?t.args.join(" "):"",promptArgPosition:t.promptArgPosition??"first",resolveFromShellAliases:t.resolveFromShellAliases??!1,default:t.default??!1,fieldErrors:{}}))}function eF(e){return e.map(t=>{const n={id:t.id,label:t.label,command:t.command},s=t.argsText.split(/[,\s]+/).filter(Boolean);return s.length>0&&(n.args=s),t.promptArgPosition!=="first"&&(n.promptArgPosition=t.promptArgPosition),t.resolveFromShellAliases&&(n.resolveFromShellAliases=!0),t.default&&(n.default=!0),n})}function tF(e){if(e.length===0)return e;let t=-1;for(let n=0;n<e.length;n++)if(e[n].default){t=n;break}return e.map((n,s)=>({...n,default:t===-1?s===0:s===t}))}function nF(e,t){return!t||t.length===0?e:e.map((n,s)=>{const a={};for(const l of t){if(l.index!==void 0){l.index===s&&(a[l.field]=l.message);continue}if(l.id!==void 0){l.id===n.id&&(a[l.field]=l.message);continue}a[l.field]=l.message}return{...n,fieldErrors:a}})}function rF(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function sF(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const s=e[n],a=t[n];if(s.id!==a.id||s.label!==a.label||s.command!==a.command||s.argsText!==a.argsText||s.promptArgPosition!==a.promptArgPosition||s.resolveFromShellAliases!==a.resolveFromShellAliases||s.default!==a.default)return!1}return!0}function oF({row:e,index:t,canRemove:n,onPatch:s,onSetDefault:a,onRemove:l}){const{attributes:c,listeners:d,setNodeRef:f,setActivatorNodeRef:m,transform:g,transition:x,isDragging:y}=Jh({id:e.rowKey}),v={transform:vo.Transform.toString(g),transition:x,zIndex:y?50:void 0,position:y?"relative":void 0};function C(S){const T={label:S};if(e.autoSlugFromLabel){const N=Jn(S);N&&K5.test(N)?T.id=N:T.id=`agent-${t+1}`}s(T)}function j(S){s({id:S,autoSlugFromLabel:!1})}const w=S=>e.fieldErrors[S]?"border-error-foreground/60":"";return r.jsxs("div",{ref:f,style:v,className:`surface-panel space-y-2 px-3 py-2 ${y?"opacity-60 shadow-lg":""}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{ref:m,...c,...d,type:"button","aria-label":"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",children:r.jsx(Pm,{className:"h-4 w-4"})}),r.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"radio",name:"agents-default",checked:e.default,onChange:a,className:"h-3 w-3 cursor-pointer accent-foreground"}),"Default"]}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wide text-muted-foreground/70",children:"id"}),e.idEditable?r.jsx("input",{type:"text",value:e.id,onChange:S=>j(S.target.value),className:`editor-input w-32 font-mono text-xs ${w("id")}`,"aria-label":"Agent id"}):r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),r.jsx("button",{type:"button",onClick:l,disabled:!n,"aria-label":"Remove agent",className:"rounded p-1 text-muted-foreground/60 transition hover:bg-foreground/[0.04] hover:text-foreground disabled:cursor-not-allowed disabled:opacity-30",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})]})]}),e.fieldErrors.id&&r.jsx("p",{className:"ml-7 text-[11px] text-error-foreground",children:e.fieldErrors.id}),r.jsxs("div",{className:"ml-7 grid grid-cols-1 gap-2 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Label"}),r.jsx("input",{type:"text",value:e.label,onChange:S=>C(S.target.value),className:`editor-input mt-0.5 w-full ${w("label")}`}),e.fieldErrors.label&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.label})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Command"}),r.jsx("input",{type:"text",value:e.command,placeholder:"claude or /usr/local/bin/claude",onChange:S=>s({command:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("command")}`}),e.fieldErrors.command&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.command})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Args (comma- or space-separated)"}),r.jsx("input",{type:"text",value:e.argsText,placeholder:"--dangerously-skip-permissions",onChange:S=>s({argsText:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("args")}`}),e.fieldErrors.args&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.args})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Prompt arg position"}),r.jsx("select",{value:e.promptArgPosition,onChange:S=>s({promptArgPosition:S.target.value}),className:`editor-input mt-0.5 w-full ${w("promptArgPosition")}`,children:H1.map(S=>r.jsx("option",{value:S,children:Z5[S]},S))}),e.fieldErrors.promptArgPosition&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.promptArgPosition})]}),r.jsxs("label",{className:"col-span-full inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox",checked:e.resolveFromShellAliases,onChange:S=>s({resolveFromShellAliases:S.target.checked}),className:"h-3.5 w-3.5 cursor-pointer accent-foreground"}),"Resolve from shell aliases (look up ",r.jsx("code",{className:"font-mono",children:"command"})," in your interactive shell before launching)"]})]})]})}function iF(){const e=J5(),[t,n]=p.useState(()=>Ea(e.agents)),[s,a]=p.useState(()=>Ea(e.agents)),[l,c]=p.useState(!1),[d,f]=p.useState(null),[m,g]=p.useState(null);p.useEffect(()=>{const R=Ea(e.agents);n(R),a(R),f(null)},[e.agents]);const x=p.useMemo(()=>!sF(t,s),[t,s]),y=Uh(vi(ml,{activationConstraint:{distance:8}}),vi(pl));function v(R,O){g({type:R,message:O}),setTimeout(()=>g(null),2500)}function C(R,O){n(I=>I.map(K=>K.rowKey===R?{...K,...O,fieldErrors:aF(K.fieldErrors,O)}:K))}function j(R){n(O=>O.map(I=>({...I,default:I.rowKey===R})))}function w(){n(R=>{const O=new Set(R.map(J=>J.id)),I="new-agent";let K=I,X=1;for(;O.has(K);)X+=1,K=`${I}-${X}`;const _=X===1?"New Agent":`New Agent ${X}`,H={rowKey:K1(),id:K,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:_,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!0,default:!1,fieldErrors:{}};return[...R,H]})}function S(R){n(O=>O.filter(I=>I.rowKey!==R))}async function T(){c(!0),f(null);try{const R=tF(t),O=eF(R),I=await X5(O),K=Ea(I.agents);n(K),a(K),v("success","Agents saved")}catch(R){if(R instanceof W1)f(R.message),n(O=>nF(rF(O),R.fieldErrors)),v("error",R.message);else{const O=R instanceof Error?R.message:"Failed to save";f(O),v("error",O)}}finally{c(!1)}}function N(){n(s),f(null)}async function A(){if(e.custom&&window.confirm("Reset agents to built-in defaults? Any custom agents will be deleted from your config.")){c(!0),f(null);try{const R=await Q5(),O=Ea(R.agents);n(O),a(O),v("success","Reset to defaults")}catch(R){const O=R instanceof Error?R.message:"Failed to reset";f(O),v("error",O)}finally{c(!1)}}}function $(R){const{active:O,over:I}=R;!I||O.id===I.id||n(K=>{const X=K.findIndex(H=>H.rowKey===O.id),_=K.findIndex(H=>H.rowKey===I.id);return X===-1||_===-1?K:hl(K,X,_)})}return r.jsxs(Le,{title:"Agents",description:"Configure which agents the dashboard and 'Open in agent' actions can launch. The default agent is used when no other one is specified.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:A,disabled:l,children:[r.jsx(gi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[!e.custom&&r.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/60 bg-foreground/[0.02] px-3 py-2 text-xs text-muted-foreground",children:[r.jsx(Rm,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Using built-in defaults — first save will write your own list to"," ",r.jsx("code",{className:"font-mono",children:"~/.syntaur/config.md"}),"."]})]}),m&&r.jsx("div",{className:`rounded-md border px-3 py-1.5 text-xs ${m.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:m.message}),d&&(!m||m.type!=="error")&&r.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-1.5 text-xs text-error-foreground",children:d}),r.jsx(Kh,{sensors:y,collisionDetection:Hh,onDragEnd:$,children:r.jsx(Yh,{items:t.map(R=>R.rowKey),strategy:Gh,children:r.jsx("div",{className:"space-y-2",children:t.map((R,O)=>r.jsx(oF,{row:R,index:O,canRemove:t.length>1,onPatch:I=>C(R.rowKey,I),onSetDefault:()=>j(R.rowKey),onRemove:()=>S(R.rowKey)},R.rowKey))})})}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("button",{type:"button",onClick:w,disabled:l,className:"shell-action text-xs",children:[r.jsx(Ht,{className:"h-3 w-3"}),"Add agent"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:N,disabled:!x||l,className:"shell-action text-xs",children:"Discard"}),r.jsxs("button",{type:"button",onClick:T,disabled:!x||l,className:"shell-action text-xs",children:[r.jsx(Su,{className:"h-3 w-3"}),"Save"]})]})]})]})}function aF(e,t){if(Object.keys(e).length===0)return e;const n={...e};return"id"in t&&delete n.id,"label"in t&&delete n.label,"command"in t&&delete n.command,"argsText"in t&&delete n.args,"promptArgPosition"in t&&delete n.promptArgPosition,"resolveFromShellAliases"in t&&delete n.resolveFromShellAliases,"default"in t&&delete n.default,n}const G1=["terminal-app","iterm","ghostty","alacritty","warp","kitty"],vu={terminal:"terminal-app",custom:!1};let oi=null,ni=null,bu=0;const gm=new Set;function Y1(e){oi=e;for(const t of gm)t(e)}function ag(e){if(!e||typeof e!="object")return vu;const t=e;return{terminal:typeof t.terminal=="string"&&G1.includes(t.terminal)?t.terminal:vu.terminal,custom:t.custom===!0}}function lF(){if(oi)return Promise.resolve(oi);if(ni)return ni;const e=++bu;return ni=fetch("/api/config/terminal").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{ni=null;const n=ag(t);return e!==bu?oi??n:(oi=n,n)}).catch(()=>(ni=null,vu)),ni}function cF(){const[e,t]=p.useState(()=>oi??vu);return p.useEffect(()=>{let n=!1;return lF().then(s=>{n||t(s)}),gm.add(t),()=>{n=!0,gm.delete(t)}},[]),e}async function uF(e){++bu;const t=await fetch("/api/config/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({terminal:e})});if(!t.ok){const s=await t.json().catch(()=>null);throw new Error((s==null?void 0:s.error)??`HTTP ${t.status}`)}const n=ag(await t.json());return Y1(n),n}async function dF(){++bu;const e=await fetch("/api/config/terminal",{method:"DELETE"});if(!e.ok){const n=await e.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`HTTP ${e.status}`)}const t=ag(await e.json());return Y1(t),t}const zc={"terminal-app":"Terminal (macOS built-in)",iterm:"iTerm2",ghostty:"Ghostty",alacritty:"Alacritty",warp:"Warp",kitty:"kitty"};function fF(){const{terminal:e,custom:t}=cF(),[n,s]=p.useState(!1),[a,l]=p.useState(null);function c(m){l(m),setTimeout(()=>l(null),2500)}async function d(m){if(!(m===e&&t)){s(!0);try{await uF(m),c({type:"success",message:`Terminal set to ${zc[m]}.`})}catch(g){c({type:"error",message:g instanceof Error?g.message:"Save failed."})}finally{s(!1)}}}async function f(){s(!0);try{const m=await dF();c({type:"success",message:`Reset to OS default (${zc[m.terminal]}).`})}catch(m){c({type:"error",message:m instanceof Error?m.message:"Reset failed."})}finally{s(!1)}}return r.jsxs(Le,{title:"Terminal",description:`Which terminal "Open in agent" launches. Defaults to the OS choice (currently ${zc[e]}) when unset.`,actions:t?r.jsxs("button",{className:"shell-action text-xs",onClick:f,disabled:n,type:"button",children:[r.jsx(gi,{className:"h-3 w-3"}),"Reset to OS default"]}):void 0,children:[a&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${a.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:a.message}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Launch in"}),r.jsx("select",{value:e,onChange:m=>d(m.target.value),disabled:n,className:"w-full max-w-sm rounded-md border border-border/60 bg-background px-3 py-1.5 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:opacity-60",children:G1.map(m=>r.jsx("option",{value:m,children:zc[m]},m))})]})]})}function Dp(e){return{statuses:e.statuses.map(t=>({id:t.id,label:t.label,description:t.description??"",color:t.color??"",terminal:t.terminal??!1})),order:[...e.order]}}function pF(){const[e,t]=p.useState(!0),[n,s]=p.useState(null),[a,l]=p.useState(!1),[c,d]=p.useState([]),[f,m]=p.useState([]),[g,x]=p.useState(!1),[y,v]=p.useState(null),[C,j]=p.useState(!1),{preset:w,setPreset:S,resetPreset:T}=Fm(),[N,A]=p.useState(!1),[$,R]=p.useState(null);async function O(V){if(!(V===w||N)){A(!0),R(null);try{await S(V),R({type:"success",message:"Theme updated"}),setTimeout(()=>R(null),2e3)}catch(D){R({type:"error",message:D instanceof Error?D.message:"Failed to save theme"})}finally{A(!1)}}}async function I(){A(!0),R(null);try{await T(),R({type:"success",message:"Theme reset to default"}),setTimeout(()=>R(null),2e3)}catch(V){R({type:"error",message:V instanceof Error?V.message:"Failed to reset theme"})}finally{A(!1)}}const K=p.useCallback(async()=>{try{const V=await fetch("/api/config/statuses");if(!V.ok)throw new Error(`HTTP ${V.status}`);const D=await V.json(),Q=Dp(D);d(Q.statuses),m(Q.order),l(D.custom),j(!1),s(null)}catch(V){s(V instanceof Error?V.message:"Failed to load config")}finally{t(!1)}},[]);p.useEffect(()=>{K()},[K]);function X(){setTimeout(()=>v(null),3e3)}async function _(){x(!0),v(null);try{const V={statuses:c.map(M=>({id:M.id,label:M.label,...M.description?{description:M.description}:{},...M.color?{color:M.color}:{},...M.terminal?{terminal:!0}:{}})),order:f,transitions:[]},D=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!D.ok){const M=await D.json().catch(()=>({error:"Unknown error"}));throw new Error(M.error??"Save failed")}const Q=await D.json(),E=Dp(Q);d(E.statuses),m(E.order),l(Q.custom),j(!1),$v(),v({type:"success",message:"Status config saved"}),X()}catch(V){v({type:"error",message:V instanceof Error?V.message:"Save failed"})}finally{x(!1)}}async function H(){x(!0),v(null);try{const V=await fetch("/api/config/statuses",{method:"DELETE"});if(!V.ok)throw new Error("Reset failed");const D=await V.json(),Q=Dp(D);d(Q.statuses),m(Q.order),l(D.custom),j(!1),$v(),v({type:"success",message:"Reset to defaults"}),X()}catch(V){v({type:"error",message:V instanceof Error?V.message:"Reset failed"})}finally{x(!1)}}function J(V,D,Q){d(E=>{const M=[...E];if(M[V]={...M[V],[D]:Q},D==="id"&&typeof Q=="string"){const ee=E[V].id;m(L=>L.map(ae=>ae===ee?Q:ae))}return M}),j(!0)}function U(){const V=`status_${c.length+1}`;d(D=>[...D,{id:V,label:"New Status",description:"",color:"",terminal:!1}]),m(D=>[...D,V]),j(!0)}function Y(V){const D=c[V].id;d(Q=>Q.filter((E,M)=>M!==V)),m(Q=>Q.filter(E=>E!==D)),j(!0)}function z(V,D){const Q=V+D;Q<0||Q>=f.length||(m(E=>{const M=[...E];return[M[V],M[Q]]=[M[Q],M[V]],M}),j(!0))}return e?r.jsx(at,{label:"Loading settings..."}):n?r.jsx(et,{error:n}):r.jsx(ho,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Le,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:w!=="default"?r.jsxs("button",{className:"shell-action text-xs",onClick:I,disabled:N,children:[r.jsx(gi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[$&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${$.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:$.message}),r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Gw.map(V=>{const D=V.slug===w;return r.jsxs("button",{type:"button",onClick:()=>O(V.slug),disabled:N,"aria-pressed":D,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${D?"border-primary ring-2 ring-primary/40":"border-border/60 hover:border-primary/40"}`,children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.primary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.secondary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.coral}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.teal}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:V.swatches.amber}}),D&&r.jsx("span",{className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:r.jsx(ji,{className:"h-3 w-3"})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:V.label}),r.jsx("div",{className:"text-xs text-muted-foreground",children:V.description})]})]},V.slug)})})]}),r.jsx(B5,{}),r.jsx(fF,{}),r.jsx(iF,{}),r.jsx(q5,{}),r.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${a?"border-primary/30 bg-primary/5 text-primary":"border-border/60 bg-muted/30 text-muted-foreground"}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rm,{className:"h-4 w-4"}),a?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),r.jsxs("button",{className:"shell-action text-xs",onClick:H,disabled:g||!a&&!C,children:[r.jsx(gi,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),y&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${y.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:y.message}),r.jsx(Le,{title:"Status Definitions",description:"Define the statuses assignments can have",actions:r.jsxs("button",{className:"shell-action text-xs",onClick:U,children:[r.jsx(Ht,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/50 text-left text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[r.jsx("th",{className:"pb-2 pr-3",children:"ID"}),r.jsx("th",{className:"pb-2 pr-3",children:"Label"}),r.jsx("th",{className:"pb-2 pr-3",children:"Color"}),r.jsx("th",{className:"pb-2 pr-3",children:r.jsxs(Br,{children:[r.jsx(Ur,{asChild:!0,children:r.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-4",children:"Done State"})}),r.jsx(kr,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:'When enabled, assignments in this status count as finished — they fill the "done" portion of progress bars and satisfy dependency requirements.'})]})}),r.jsx("th",{className:"pb-2 w-10"})]})}),r.jsx("tbody",{className:"divide-y divide-border/30",children:c.map((V,D)=>r.jsxs("tr",{children:[r.jsx("td",{className:"py-2 pr-3",children:r.jsx("input",{type:"text",value:V.id,onChange:Q=>J(D,"id",Q.target.value),className:"editor-input w-full text-sm"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx("input",{type:"text",value:V.label,onChange:Q=>J(D,"label",Q.target.value),className:"editor-input w-full text-sm"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx(_5,{value:V.color,onChange:Q=>J(D,"color",Q)})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsx("button",{type:"button",role:"switch","aria-checked":V.terminal,onClick:()=>J(D,"terminal",!V.terminal),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background ${V.terminal?"bg-primary":"bg-muted"}`,children:r.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${V.terminal?"translate-x-4":"translate-x-0"}`})})}),r.jsx("td",{className:"py-2",children:r.jsx("button",{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>Y(D),title:"Remove status",children:r.jsx(zn,{className:"h-3.5 w-3.5"})})})]},D))})]})})}),r.jsx(Le,{title:"Status Order",description:"Controls display order in the dashboard (Kanban columns, progress bars, dropdowns)",children:r.jsx("div",{className:"space-y-1",children:f.map((V,D)=>{var E;const Q=((E=c.find(M=>M.id===V))==null?void 0:E.label)??V;return r.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[r.jsx("span",{className:"mr-1 font-mono text-xs text-muted-foreground/60",children:D+1}),r.jsx("span",{className:"flex-1 font-medium",children:Q}),r.jsx("span",{className:"text-xs text-muted-foreground",children:V}),r.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>z(D,-1),disabled:D===0,title:"Move up",children:r.jsx(Ow,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>z(D,1),disabled:D===f.length-1,title:"Move down",children:r.jsx(Ua,{className:"h-3.5 w-3.5"})})]},D)})})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:_,disabled:g||!C,children:[r.jsx(Su,{className:"h-3.5 w-3.5"}),g?"Saving...":"Save Configuration"]}),C&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),K()},disabled:g,children:"Discard Changes"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),r.jsx(z5,{})]})})}const ri=e=>`${e.workspace}::${e.id}`;function lw(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function mF(){var le;const{data:e,loading:t,error:n,refetch:s}=c0(),a=Tt(),[l,c]=p.useState(""),d=p.useRef(null);Js("list:todos");const[f,m]=p.useState(""),[g,x]=p.useState(""),[y,v]=p.useState(""),[C,j]=p.useState("_global"),[w,S]=p.useState(null),[T,N]=p.useState(new Set),[A,$]=p.useState(!1),R=p.useRef(null),[O,I]=p.useState(null);p.useEffect(()=>{let W=!1;return(async()=>{try{const pe=await fetch("/api/projects");if(!pe.ok)return;const ve=await pe.json();W||I(ve.filter(_e=>!_e.archived))}catch{}})(),()=>{W=!0}},[]);function K(W,pe){W.stopPropagation(),navigator.clipboard.writeText(pe),S(pe),setTimeout(()=>S(ve=>ve===pe?null:ve),1500)}const X=p.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const W=[];for(const pe of e.workspaces)for(const ve of pe.items)W.push({...ve,workspace:pe.workspace});return W},[e]),_=p.useMemo(()=>{const W=new Set;for(const pe of X)for(const ve of pe.tags)W.add(ve);return Array.from(W).sort()},[X]),H=p.useMemo(()=>{let W=X;if(l.trim()){const pe=l.toLowerCase();W=W.filter(ve=>ve.description.toLowerCase().includes(pe)||ve.tags.some(_e=>_e.toLowerCase().includes(pe))||ve.id.includes(pe))}return f&&(W=W.filter(pe=>pe.status===f)),g&&(W=W.filter(pe=>pe.tags.includes(g))),W},[X,l,f,g]);p.useEffect(()=>{N(new Set),R.current=null},[l,f,g]);const J=p.useMemo(()=>H.filter(W=>T.has(ri(W))),[H,T]),U=H.length>0&&J.length===H.length,Y=J.length>0&&!U,z=p.useMemo(()=>{if(J.length===0)return null;const W=new Set(J.map(pe=>pe.workspace));return W.size===1?[...W][0]:null},[J]),V=p.useMemo(()=>{if(!z||!O)return;const W=O.filter(pe=>pe.workspace===z);return W.length===1?W[0].slug:void 0},[z,O]),D=((le=J[0])==null?void 0:le.description)??"",Q=p.useMemo(()=>{if(z)return null;const W=new Map;for(const pe of J)W.has(pe.workspace)||W.set(pe.workspace,[]),W.get(pe.workspace).push(pe.id);return Array.from(W,([pe,ve])=>({workspace:pe,todoIds:ve}))},[J,z]),E=z?{kind:"workspace",workspace:z}:{kind:"aggregate",groups:Q??[]};function M(W,pe,ve){const _e=ri(W);if(!!(ve&&"shiftKey"in ve&&ve.shiftKey)&&R.current!=null){const st=Math.min(R.current,pe),lt=Math.max(R.current,pe);N(_t=>{const St=new Set(_t);for(let Nt=st;Nt<=lt;Nt++){const se=H[Nt];se&&St.add(ri(se))}return St})}else N(st=>{const lt=new Set(st);return lt.has(_e)?lt.delete(_e):lt.add(_e),lt});R.current=pe}function ee(){N(W=>{const pe=new Set(W);if(U)for(const ve of H)pe.delete(ri(ve));else for(const ve of H)pe.add(ri(ve));return pe})}function L(){N(new Set),R.current=null}function ae(W){L(),s(),W!=null&&W.assignmentRef&&a(lw(W.assignmentRef))}const ce=p.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const W={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const pe of e.workspaces)W.open+=pe.counts.open,W.in_progress+=pe.counts.in_progress,W.completed+=pe.counts.completed,W.blocked+=pe.counts.blocked,W.total+=pe.counts.total;return W},[e]);async function Z(){y.trim()&&(await Bm(C,y.trim()),v(""),s())}const ge={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function je(W,pe,ve){Ne(W,pe,ge[ve]||"open")}async function Ne(W,pe,ve){switch(ve){case"open":await p0(W,pe);break;case"in_progress":await f0(W,pe);break;case"completed":await u0(W,pe);break;case"blocked":await d0(W,pe);break}s()}async function ke(W,pe){await m0(W,pe),s()}const{hotkeyRowProps:We}=sl(H,{scope:"list:todos",bindO:!1,onOpen:W=>je(W.workspace,W.id,W.status)});pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var W;return(W=d.current)==null?void 0:W.focus()}}),pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[Ye,ie]=Xr(),ne=Ye.get("focus");return p.useEffect(()=>{if(!ne)return;const W=document.querySelector(`[data-todo-id="${CSS.escape(ne)}"]`);if(!W)return;W.scrollIntoView({block:"nearest"}),W.classList.add("ring-2","ring-primary/60");const pe=window.setTimeout(()=>{W.classList.remove("ring-2","ring-primary/60"),ie(ve=>{const _e=new URLSearchParams(ve);return _e.delete("focus"),_e})},1500);return()=>window.clearTimeout(pe)},[ne,H.length,ie]),t?r.jsx(at,{label:"Loading todos..."}):n?r.jsx(et,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(mn,{label:"Open",value:ce.open,icon:cr}),r.jsx(mn,{label:"In Progress",value:ce.in_progress,icon:Am,tone:"info"}),r.jsx(mn,{label:"Blocked",value:ce.blocked,icon:Im,tone:"warn"}),r.jsx(mn,{label:"Completed",value:ce.completed,icon:cr,tone:"default"})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("select",{value:C,onChange:W=>j(W.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(W=>W.workspace!=="_global").map(W=>r.jsx("option",{value:W.workspace,children:W.workspace},W.workspace))]}),r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:W=>v(W.target.value),onKeyDown:W=>W.key==="Enter"&&Z(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),r.jsxs("button",{onClick:Z,disabled:!y.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[r.jsx(Ht,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(qs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:d,type:"text",placeholder:"Search todos...",value:l,onChange:W=>c(W.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:f,onChange:W=>m(W.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),_.length>0&&r.jsxs("select",{value:g,onChange:W=>x(W.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),_.map(W=>r.jsxs("option",{value:W,children:["#",W]},W))]})]}),J.length>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[J.length," selected",z?r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(from ",r.jsx("strong",{children:z}),")"]}):r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["across ",new Set(J.map(W=>W.workspace)).size," workspaces"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>$(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote to assignment"}),r.jsx("button",{type:"button",onClick:L,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,H.length===0?r.jsx(ot,{title:"No todos",description:"Add your first todo above or use the CLI: syntaur todo add"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:U,ref:W=>{W&&(W.indeterminate=Y)},onChange:ee,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",H.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-1",children:H.map((W,pe)=>{const ve=ri(W),_e=T.has(ve);return r.jsxs("div",{"data-todo-id":W.id,...We(pe),className:`surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition ${_e?"ring-1 ring-foreground/20":""}`,onClick:()=>je(W.workspace,W.id,W.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${W.id}`,checked:_e,onChange:()=>{},onClick:Oe=>{Oe.stopPropagation(),M(W,pe,Oe)},className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsx(Xh,{status:W.status,onChange:Oe=>Ne(W.workspace,W.id,Oe)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${W.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:W.description}),W.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:W.tags.map(Oe=>`#${Oe}`).join(" ")}),W.linkedAssignmentRef?r.jsxs(we,{to:lw(W.linkedAssignmentRef),className:"ml-2 inline-flex items-center gap-0.5 rounded-full border border-status-completed-foreground/40 bg-status-completed/30 px-1.5 py-0.5 text-[10px] font-mono text-status-completed-foreground hover:bg-status-completed/50",onClick:Oe=>Oe.stopPropagation(),children:[r.jsx(Aw,{className:"h-2.5 w-2.5"}),W.linkedAssignmentRef.includes("/")?W.linkedAssignmentRef:`oneoff:${W.linkedAssignmentRef.slice(0,8)}`]}):null]}),r.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:W.workspace!=="_global"&&r.jsx(we,{to:`/w/${W.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:Oe=>Oe.stopPropagation(),children:W.workspace})}),w===W.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(ji,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:Oe=>K(Oe,W.id),children:["t:",W.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:Oe=>K(Oe,W.id),children:r.jsx(Ha,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:Oe=>{Oe.stopPropagation(),ke(W.workspace,W.id)},className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${W.workspace}-${W.id}`)})})]}),r.jsx(Qh,{open:A,selectedIds:J.map(W=>W.id),scope:E,onOpenChange:$,onDone:ae,defaultProject:V,defaultTitle:D,allowOneOff:!0})]})}function hF(){return r.jsx(bE,{children:r.jsx(OR,{children:r.jsx(YC,{children:r.jsxs(Ie,{element:r.jsx(eA,{}),children:[r.jsx(Ie,{path:"/",element:r.jsx(CD,{})}),r.jsx(Ie,{path:"/projects",element:r.jsx(_v,{})}),r.jsx(Ie,{path:"/assignments",element:r.jsx(Qb,{})}),r.jsx(Ie,{path:"/assignments/new",element:r.jsx(nw,{})}),r.jsx(Ie,{path:"/assignments/:id",element:r.jsx(Z_,{})}),r.jsx(Ie,{path:"/assignments/:id/edit",element:r.jsx(Ep,{})}),r.jsx(Ie,{path:"/assignments/:id/plan/edit",element:r.jsx(Tp,{})}),r.jsx(Ie,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(Pp,{})}),r.jsx(Ie,{path:"/assignments/:id/handoff/edit",element:r.jsx(Rp,{})}),r.jsx(Ie,{path:"/assignments/:id/decision-record/edit",element:r.jsx(Ap,{})}),r.jsx(Ie,{path:"/servers",element:r.jsx(sw,{})}),r.jsx(Ie,{path:"/inventories",element:r.jsx(ow,{})}),r.jsx(Ie,{path:"/agent-sessions",element:r.jsx(iw,{})}),r.jsx(Ie,{path:"/playbooks",element:r.jsx(C5,{})}),r.jsx(Ie,{path:"/playbooks/create",element:r.jsx(T5,{})}),r.jsx(Ie,{path:"/playbooks/:slug",element:r.jsx(E5,{})}),r.jsx(Ie,{path:"/playbooks/:slug/edit",element:r.jsx(P5,{})}),r.jsx(Ie,{path:"/memories",element:r.jsx(R5,{})}),r.jsx(Ie,{path:"/memories/new",element:r.jsx(D5,{})}),r.jsx(Ie,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(A5,{})}),r.jsx(Ie,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(O5,{})}),r.jsx(Ie,{path:"/resources",element:r.jsx(I5,{})}),r.jsx(Ie,{path:"/resources/new",element:r.jsx($5,{})}),r.jsx(Ie,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(L5,{})}),r.jsx(Ie,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(M5,{})}),r.jsx(Ie,{path:"/todos",element:r.jsx(mF,{})}),r.jsx(Ie,{path:"/help",element:r.jsx(PD,{})}),r.jsx(Ie,{path:"/settings",element:r.jsx(pF,{})}),r.jsx(Ie,{path:"/create/project",element:r.jsx(ew,{})}),r.jsx(Ie,{path:"/projects/:slug",element:r.jsx(qb,{})}),r.jsx(Ie,{path:"/projects/:slug/edit",element:r.jsx(rw,{})}),r.jsx(Ie,{path:"/projects/:slug/create/assignment",element:r.jsx(tw,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(Kb,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(Ep,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Tp,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Pp,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Rp,{})}),r.jsx(Ie,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Ap,{})}),r.jsx(Ie,{path:"/w/:workspace/projects",element:r.jsx(_v,{})}),r.jsx(Ie,{path:"/w/:workspace/assignments",element:r.jsx(Qb,{})}),r.jsx(Ie,{path:"/w/:workspace/assignments/new",element:r.jsx(nw,{})}),r.jsx(Ie,{path:"/w/:workspace/servers",element:r.jsx(sw,{})}),r.jsx(Ie,{path:"/w/:workspace/inventories",element:r.jsx(ow,{})}),r.jsx(Ie,{path:"/w/:workspace/agent-sessions",element:r.jsx(iw,{})}),r.jsx(Ie,{path:"/w/:workspace/todos",element:r.jsx(A_,{})}),r.jsx(Ie,{path:"/w/:workspace/create/project",element:r.jsx(ew,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug",element:r.jsx(qb,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(rw,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(tw,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(Kb,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(Ep,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Tp,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Pp,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Rp,{})}),r.jsx(Ie,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Ap,{})})]})})})})}X2();YN.createRoot(document.getElementById("root")).render(r.jsx(p.StrictMode,{children:r.jsx(Q2,{children:r.jsx(hF,{})})}));export{h4 as _,xF as a,wu as g};