syntaur 0.18.0 → 0.19.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.
- package/dashboard/dist/assets/{_basePickBy-Cx0q44iE.js → _basePickBy-DrNORS8h.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-CfFbkKif.js → _baseUniq-RInHmI4C.js} +1 -1
- package/dashboard/dist/assets/{arc-XluBomWz.js → arc-ZLNwEqiw.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-CihGybG6.js → architectureDiagram-2XIMDMQ5-81xqt-YE.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-BPUKO5fj.js → blockDiagram-WCTKOSBZ-C0T3bGEC.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-DKVq_j1f.js → c4Diagram-IC4MRINW-D6JkWDCF.js} +1 -1
- package/dashboard/dist/assets/channel-DAVF4AVE.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-DAaE8oN2.js → chunk-4BX2VUAB-BFlcnMn_.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-BZoVpy5G.js → chunk-55IACEB6-SiEMIuH5.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-Cuo9M0jI.js → chunk-FMBD7UC4-DwbWPvlU.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-DGzypY5S.js → chunk-JSJVCQXG-D5ubYq9C.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-DfxYbrKI.js → chunk-KX2RTZJC-DobzPF1w.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-BEbwpe5N.js → chunk-NQ4KR5QH-C4xbnEoG.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-DDjrkJqg.js → chunk-QZHKN3VN-DO86GQpk.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-BSMHQ3p4.js → chunk-WL4C6EOR-BV-F_A8L.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-BO72S4T6.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-BO72S4T6.js +1 -0
- package/dashboard/dist/assets/clone-CQlgPUpj.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-BgUyyImN.js → cose-bilkent-S5V4N54A-DQAja4Py.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-zAe7pq6F.js → dagre-KLK3FWXG-Baxii2KI.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-B1bVb4ll.js → diagram-E7M64L7V-AxHf4koi.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-DZCxJIkJ.js → diagram-IFDJBPK2-DBUqOZ86.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-BuPgL5q1.js → diagram-P4PSJMXO-DGarhMgg.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-l3YvnHT9.js → erDiagram-INFDFZHY-D3Q7j9Qd.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-CLOLQLdW.js → flowDiagram-PKNHOUZH-B2mOtpxH.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-D1yLx2Ap.js → ganttDiagram-A5KZAMGK-Qvs4ixi2.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-uC4rY3UQ.js → gitGraphDiagram-K3NZZRJ6-aMmp6RuS.js} +1 -1
- package/dashboard/dist/assets/{graph-DvUnLFOz.js → graph-Vqh8eQjQ.js} +1 -1
- package/dashboard/dist/assets/index-CbF7LCq5.js +550 -0
- package/dashboard/dist/assets/index-CsyJIOqR.css +1 -0
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-B6jLLOUk.js → infoDiagram-LFFYTUFH-CdkoRKAF.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-CDvhubqL.js → ishikawaDiagram-PHBUUO56-CFksIkYK.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-BOtMcoBj.js → journeyDiagram-4ABVD52K-DESaPBAF.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-DC05q9p4.js → kanban-definition-K7BYSVSG-BLYr6XAd.js} +1 -1
- package/dashboard/dist/assets/{layout-B4jiZlj6.js → layout-CJuIx0Qy.js} +1 -1
- package/dashboard/dist/assets/{linear-DpQXVSyZ.js → linear-J_YxHsW1.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-aNcWKq-4.js → mermaid.core-DUdss5Q8.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-Dv4qo7wQ.js → mindmap-definition-YRQLILUH-BwBcvdzv.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-ByRY4ahm.js → pieDiagram-SKSYHLDU-BMUn7Z46.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-Dt5_Xjwp.js → quadrantDiagram-337W2JSQ-ChNYv-9v.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-CSRV6VcE.js → requirementDiagram-Z7DCOOCP-C4zwb-Wb.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-DA8gxGEq.js → sankeyDiagram-WA2Y5GQK-BXkXJ_0p.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-CVZr9aKv.js → sequenceDiagram-2WXFIKYE-C6kZ1-Xh.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-yIU4X0e8.js → stateDiagram-RAJIS63D-DLpIcYXq.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-CFsGhULL.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-DnfvRVEJ.js → timeline-definition-YZTLITO2-Czf2QTmJ.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-p5sbmBwK.js → treemap-KZPCXAKY-CmNTGdDO.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-Do2Vp3nv.js → vennDiagram-LZ73GAT5-DcnKEyP9.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-BrfAGQWt.js → xychartDiagram-JWTSCODW-3_wSmsZk.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/dashboard/server.js +328 -123
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +795 -488
- package/dist/index.js.map +1 -1
- package/dist/launch/index.js +75 -10
- package/dist/launch/index.js.map +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/channel-mNClnLVi.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-Dv6vdcHm.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-Dv6vdcHm.js +0 -1
- package/dashboard/dist/assets/clone-CRLXHkrd.js +0 -1
- package/dashboard/dist/assets/index-BoVXMp5e.js +0 -535
- package/dashboard/dist/assets/index-XappA8I7.css +0 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-DMBx3hAg.js +0 -1
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
var yE=Object.defineProperty;var bE=(e,t,n)=>t in e?yE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fb=(e,t,n)=>bE(e,typeof t!="symbol"?t+"":t,n);function vE(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(s,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>s[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const l of i)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(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kz(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),n}var Jp={exports:{}},ol={},Xp={exports:{}},ot={};/**
|
|
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 zb;function wE(){if(zb)return ot;zb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),x=Symbol.iterator;function y(z){return z===null||typeof z!="object"?null:(z=x&&z[x]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function v(z,Q,I){this.props=z,this.context=Q,this.refs=k,this.updater=I||b}v.prototype.isReactComponent={},v.prototype.setState=function(z,Q){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Q,"setState")},v.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function j(){}j.prototype=v.prototype;function C(z,Q,I){this.props=z,this.context=Q,this.refs=k,this.updater=I||b}var N=C.prototype=new j;N.constructor=C,E(N,v.prototype),N.isPureReactComponent=!0;var T=Array.isArray,L=Object.prototype.hasOwnProperty,P={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function D(z,Q,I){var ue,me={},V=null,ne=null;if(Q!=null)for(ue in Q.ref!==void 0&&(ne=Q.ref),Q.key!==void 0&&(V=""+Q.key),Q)L.call(Q,ue)&&!$.hasOwnProperty(ue)&&(me[ue]=Q[ue]);var de=arguments.length-2;if(de===1)me.children=I;else if(1<de){for(var ye=Array(de),ke=0;ke<de;ke++)ye[ke]=arguments[ke+2];me.children=ye}if(z&&z.defaultProps)for(ue in de=z.defaultProps,de)me[ue]===void 0&&(me[ue]=de[ue]);return{$$typeof:e,type:z,key:V,ref:ne,props:me,_owner:P.current}}function J(z,Q){return{$$typeof:e,type:z.type,key:Q,ref:z.ref,props:z.props,_owner:z._owner}}function ee(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function M(z){var Q={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(I){return Q[I]})}var U=/\/+/g;function X(z,Q){return typeof z=="object"&&z!==null&&z.key!=null?M(""+z.key):Q.toString(36)}function B(z,Q,I,ue,me){var V=typeof z;(V==="undefined"||V==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(V){case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case e:case t:ne=!0}}if(ne)return ne=z,me=me(ne),z=ue===""?"."+X(ne,0):ue,T(me)?(I="",z!=null&&(I=z.replace(U,"$&/")+"/"),B(me,Q,I,"",function(ke){return ke})):me!=null&&(ee(me)&&(me=J(me,I+(!me.key||ne&&ne.key===me.key?"":(""+me.key).replace(U,"$&/")+"/")+z)),Q.push(me)),1;if(ne=0,ue=ue===""?".":ue+":",T(z))for(var de=0;de<z.length;de++){V=z[de];var ye=ue+X(V,de);ne+=B(V,Q,I,ye,me)}else if(ye=y(z),typeof ye=="function")for(z=ye.call(z),de=0;!(V=z.next()).done;)V=V.value,ye=ue+X(V,de++),ne+=B(V,Q,I,ye,me);else if(V==="object")throw Q=String(z),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return ne}function q(z,Q,I){if(z==null)return z;var ue=[],me=0;return B(z,ue,"","",function(V){return Q.call(I,V,me++)}),ue}function Z(z){if(z._status===-1){var Q=z._result;Q=Q(),Q.then(function(I){(z._status===0||z._status===-1)&&(z._status=1,z._result=I)},function(I){(z._status===0||z._status===-1)&&(z._status=2,z._result=I)}),z._status===-1&&(z._status=0,z._result=Q)}if(z._status===1)return z._result.default;throw z._result}var le={current:null},_={transition:null},G={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:_,ReactCurrentOwner:P};function A(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:q,forEach:function(z,Q,I){q(z,function(){Q.apply(this,arguments)},I)},count:function(z){var Q=0;return q(z,function(){Q++}),Q},toArray:function(z){return q(z,function(Q){return Q})||[]},only:function(z){if(!ee(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},ot.Component=v,ot.Fragment=n,ot.Profiler=i,ot.PureComponent=C,ot.StrictMode=s,ot.Suspense=p,ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,ot.act=A,ot.cloneElement=function(z,Q,I){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var ue=E({},z.props),me=z.key,V=z.ref,ne=z._owner;if(Q!=null){if(Q.ref!==void 0&&(V=Q.ref,ne=P.current),Q.key!==void 0&&(me=""+Q.key),z.type&&z.type.defaultProps)var de=z.type.defaultProps;for(ye in Q)L.call(Q,ye)&&!$.hasOwnProperty(ye)&&(ue[ye]=Q[ye]===void 0&&de!==void 0?de[ye]:Q[ye])}var ye=arguments.length-2;if(ye===1)ue.children=I;else if(1<ye){de=Array(ye);for(var ke=0;ke<ye;ke++)de[ke]=arguments[ke+2];ue.children=de}return{$$typeof:e,type:z.type,key:me,ref:V,props:ue,_owner:ne}},ot.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:l,_context:z},z.Consumer=z},ot.createElement=D,ot.createFactory=function(z){var Q=D.bind(null,z);return Q.type=z,Q},ot.createRef=function(){return{current:null}},ot.forwardRef=function(z){return{$$typeof:u,render:z}},ot.isValidElement=ee,ot.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:Z}},ot.memo=function(z,Q){return{$$typeof:m,type:z,compare:Q===void 0?null:Q}},ot.startTransition=function(z){var Q=_.transition;_.transition={};try{z()}finally{_.transition=Q}},ot.unstable_act=A,ot.useCallback=function(z,Q){return le.current.useCallback(z,Q)},ot.useContext=function(z){return le.current.useContext(z)},ot.useDebugValue=function(){},ot.useDeferredValue=function(z){return le.current.useDeferredValue(z)},ot.useEffect=function(z,Q){return le.current.useEffect(z,Q)},ot.useId=function(){return le.current.useId()},ot.useImperativeHandle=function(z,Q,I){return le.current.useImperativeHandle(z,Q,I)},ot.useInsertionEffect=function(z,Q){return le.current.useInsertionEffect(z,Q)},ot.useLayoutEffect=function(z,Q){return le.current.useLayoutEffect(z,Q)},ot.useMemo=function(z,Q){return le.current.useMemo(z,Q)},ot.useReducer=function(z,Q,I){return le.current.useReducer(z,Q,I)},ot.useRef=function(z){return le.current.useRef(z)},ot.useState=function(z){return le.current.useState(z)},ot.useSyncExternalStore=function(z,Q,I){return le.current.useSyncExternalStore(z,Q,I)},ot.useTransition=function(){return le.current.useTransition()},ot.version="18.3.1",ot}var Bb;function Fh(){return Bb||(Bb=1,Xp.exports=wE()),Xp.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 Ub;function jE(){if(Ub)return ol;Ub=1;var e=Fh(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(u,p,m){var h,x={},y=null,b=null;m!==void 0&&(y=""+m),p.key!==void 0&&(y=""+p.key),p.ref!==void 0&&(b=p.ref);for(h in p)s.call(p,h)&&!l.hasOwnProperty(h)&&(x[h]=p[h]);if(u&&u.defaultProps)for(h in p=u.defaultProps,p)x[h]===void 0&&(x[h]=p[h]);return{$$typeof:t,type:u,key:y,ref:b,props:x,_owner:i.current}}return ol.Fragment=n,ol.jsx=c,ol.jsxs=c,ol}var Vb;function kE(){return Vb||(Vb=1,Jp.exports=jE()),Jp.exports}var r=kE(),f=Fh();const Zt=yd(f),Nj=vE({__proto__:null,default:Zt},[f]);var fu={},Qp={exports:{}},tr={},Zp={exports:{}},em={};/**
|
|
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 Hb;function SE(){return Hb||(Hb=1,(function(e){function t(_,G){var A=_.length;_.push(G);e:for(;0<A;){var z=A-1>>>1,Q=_[z];if(0<i(Q,G))_[z]=G,_[A]=Q,A=z;else break e}}function n(_){return _.length===0?null:_[0]}function s(_){if(_.length===0)return null;var G=_[0],A=_.pop();if(A!==G){_[0]=A;e:for(var z=0,Q=_.length,I=Q>>>1;z<I;){var ue=2*(z+1)-1,me=_[ue],V=ue+1,ne=_[V];if(0>i(me,A))V<Q&&0>i(ne,me)?(_[z]=ne,_[V]=A,z=V):(_[z]=me,_[ue]=A,z=ue);else if(V<Q&&0>i(ne,A))_[z]=ne,_[V]=A,z=V;else break e}}return G}function i(_,G){var A=_.sortIndex-G.sortIndex;return A!==0?A:_.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var p=[],m=[],h=1,x=null,y=3,b=!1,E=!1,k=!1,v=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,C=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(_){for(var G=n(m);G!==null;){if(G.callback===null)s(m);else if(G.startTime<=_)s(m),G.sortIndex=G.expirationTime,t(p,G);else break;G=n(m)}}function T(_){if(k=!1,N(_),!E)if(n(p)!==null)E=!0,Z(L);else{var G=n(m);G!==null&&le(T,G.startTime-_)}}function L(_,G){E=!1,k&&(k=!1,j(D),D=-1),b=!0;var A=y;try{for(N(G),x=n(p);x!==null&&(!(x.expirationTime>G)||_&&!M());){var z=x.callback;if(typeof z=="function"){x.callback=null,y=x.priorityLevel;var Q=z(x.expirationTime<=G);G=e.unstable_now(),typeof Q=="function"?x.callback=Q:x===n(p)&&s(p),N(G)}else s(p);x=n(p)}if(x!==null)var I=!0;else{var ue=n(m);ue!==null&&le(T,ue.startTime-G),I=!1}return I}finally{x=null,y=A,b=!1}}var P=!1,$=null,D=-1,J=5,ee=-1;function M(){return!(e.unstable_now()-ee<J)}function U(){if($!==null){var _=e.unstable_now();ee=_;var G=!0;try{G=$(!0,_)}finally{G?X():(P=!1,$=null)}}else P=!1}var X;if(typeof C=="function")X=function(){C(U)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,q=B.port2;B.port1.onmessage=U,X=function(){q.postMessage(null)}}else X=function(){v(U,0)};function Z(_){$=_,P||(P=!0,X())}function le(_,G){D=v(function(){_(e.unstable_now())},G)}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(_){_.callback=null},e.unstable_continueExecution=function(){E||b||(E=!0,Z(L))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(_){switch(y){case 1:case 2:case 3:var G=3;break;default:G=y}var A=y;y=G;try{return _()}finally{y=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,G){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var A=y;y=_;try{return G()}finally{y=A}},e.unstable_scheduleCallback=function(_,G,A){var z=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?z+A:z):A=z,_){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=A+Q,_={id:h++,callback:G,priorityLevel:_,startTime:A,expirationTime:Q,sortIndex:-1},A>z?(_.sortIndex=A,t(m,_),n(p)===null&&_===n(m)&&(k?(j(D),D=-1):k=!0,le(T,A-z))):(_.sortIndex=Q,t(p,_),E||b||(E=!0,Z(L))),_},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(_){var G=y;return function(){var A=y;y=G;try{return _.apply(this,arguments)}finally{y=A}}}})(em)),em}var Wb;function NE(){return Wb||(Wb=1,Zp.exports=SE()),Zp.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 Kb;function CE(){if(Kb)return tr;Kb=1;var e=Fh(),t=NE();function n(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,i={};function l(o,a){c(o,a),c(o+"Capture",a)}function c(o,a){for(i[o]=a,o=0;o<a.length;o++)s.add(a[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=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]*$/,h={},x={};function y(o){return p.call(x,o)?!0:p.call(h,o)?!1:m.test(o)?x[o]=!0:(h[o]=!0,!1)}function b(o,a,d,g){if(d!==null&&d.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function E(o,a,d,g){if(a===null||typeof a>"u"||b(o,a,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function k(o,a,d,g,w,S,R){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=g,this.attributeNamespace=w,this.mustUseProperty=d,this.propertyName=o,this.type=a,this.sanitizeURL=S,this.removeEmptyString=R}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){v[o]=new k(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var a=o[0];v[a]=new k(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){v[o]=new k(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){v[o]=new k(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){v[o]=new k(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){v[o]=new k(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){v[o]=new k(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){v[o]=new k(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){v[o]=new k(o,5,!1,o.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function C(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 a=o.replace(j,C);v[a]=new k(a,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var a=o.replace(j,C);v[a]=new k(a,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var a=o.replace(j,C);v[a]=new k(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){v[o]=new k(o,1,!1,o.toLowerCase(),null,!1,!1)}),v.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){v[o]=new k(o,1,!1,o.toLowerCase(),null,!0,!0)});function N(o,a,d,g){var w=v.hasOwnProperty(a)?v[a]:null;(w!==null?w.type!==0:g||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(E(a,d,w,g)&&(d=null),g||w===null?y(a)&&(d===null?o.removeAttribute(a):o.setAttribute(a,""+d)):w.mustUseProperty?o[w.propertyName]=d===null?w.type===3?!1:"":d:(a=w.attributeName,g=w.attributeNamespace,d===null?o.removeAttribute(a):(w=w.type,d=w===3||w===4&&d===!0?"":""+d,g?o.setAttributeNS(g,a,d):o.setAttribute(a,d))))}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),P=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),M=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),_=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=_&&o[_]||o["@@iterator"],typeof o=="function"?o:null)}var A=Object.assign,z;function Q(o){if(z===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);z=a&&a[1]||""}return`
|
|
34
|
+
`+z+o}var I=!1;function ue(o,a){if(!o||I)return"";I=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ce){var g=ce}Reflect.construct(o,[],a)}else{try{a.call()}catch(ce){g=ce}o.call(a.prototype)}else{try{throw Error()}catch(ce){g=ce}o()}}catch(ce){if(ce&&g&&typeof ce.stack=="string"){for(var w=ce.stack.split(`
|
|
35
|
+
`),S=g.stack.split(`
|
|
36
|
+
`),R=w.length-1,H=S.length-1;1<=R&&0<=H&&w[R]!==S[H];)H--;for(;1<=R&&0<=H;R--,H--)if(w[R]!==S[H]){if(R!==1||H!==1)do if(R--,H--,0>H||w[R]!==S[H]){var K=`
|
|
37
|
+
`+w[R].replace(" at new "," at ");return o.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",o.displayName)),K}while(1<=R&&0<=H);break}}}finally{I=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Q(o):""}function me(o){switch(o.tag){case 5:return Q(o.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return o=ue(o.type,!1),o;case 11:return o=ue(o.type.render,!1),o;case 1:return o=ue(o.type,!0),o;default:return""}}function V(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 $:return"Fragment";case P:return"Portal";case J:return"Profiler";case D:return"StrictMode";case X:return"Suspense";case B:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case M:return(o.displayName||"Context")+".Consumer";case ee:return(o._context.displayName||"Context")+".Provider";case U:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case q:return a=o.displayName||null,a!==null?a:V(o.type)||"Memo";case Z:a=o._payload,o=o._init;try{return V(o(a))}catch{}}return null}function ne(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(a);case 8:return a===D?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function de(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ye(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ke(o){var a=ye(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),g=""+o[a];if(!o.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var w=d.get,S=d.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return w.call(this)},set:function(R){g=""+R,S.call(this,R)}}),Object.defineProperty(o,a,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(R){g=""+R},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function fe(o){o._valueTracker||(o._valueTracker=ke(o))}function Ve(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var d=a.getValue(),g="";return o&&(g=ye(o)?o.checked?"true":"false":o.value),o=g,o!==d?(a.setValue(o),!0):!1}function pe(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 Re(o,a){var d=a.checked;return A({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function O(o,a){var d=a.defaultValue==null?"":a.defaultValue,g=a.checked!=null?a.checked:a.defaultChecked;d=de(a.value!=null?a.value:d),o._wrapperState={initialChecked:g,initialValue:d,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function W(o,a){a=a.checked,a!=null&&N(o,"checked",a,!1)}function te(o,a){W(o,a);var d=de(a.value),g=a.type;if(d!=null)g==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?Ae(o,a.type,d):a.hasOwnProperty("defaultValue")&&Ae(o,a.type,de(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function xe(o,a,d){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var g=a.type;if(!(g!=="submit"&&g!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+o._wrapperState.initialValue,d||a===o.value||(o.value=a),o.defaultValue=a}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function Ae(o,a,d){(a!=="number"||pe(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Ee=Array.isArray;function et(o,a,d,g){if(o=o.options,a){a={};for(var w=0;w<d.length;w++)a["$"+d[w]]=!0;for(d=0;d<o.length;d++)w=a.hasOwnProperty("$"+o[d].value),o[d].selected!==w&&(o[d].selected=w),w&&g&&(o[d].defaultSelected=!0)}else{for(d=""+de(d),a=null,w=0;w<o.length;w++){if(o[w].value===d){o[w].selected=!0,g&&(o[w].defaultSelected=!0);return}a!==null||o[w].disabled||(a=o[w])}a!==null&&(a.selected=!0)}}function Ye(o,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return A({},a,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function St(o,a){var d=a.value;if(d==null){if(d=a.children,a=a.defaultValue,d!=null){if(a!=null)throw Error(n(92));if(Ee(d)){if(1<d.length)throw Error(n(93));d=d[0]}a=d}a==null&&(a=""),d=a}o._wrapperState={initialValue:de(d)}}function Bt(o,a){var d=de(a.value),g=de(a.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),a.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),g!=null&&(o.defaultValue=""+g)}function st(o){var a=o.textContent;a===o._wrapperState.initialValue&&a!==""&&a!==null&&(o.value=a)}function ae(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 be(o,a){return o==null||o==="http://www.w3.org/1999/xhtml"?ae(a):o==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Le,Be=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,d,g,w){MSApp.execUnsafeLocalFunction(function(){return o(a,d,g,w)})}:o})(function(o,a){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=a;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Le.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function Ge(o,a){if(a){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=a;return}}o.textContent=a}var it={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},Kt=["Webkit","ms","Moz","O"];Object.keys(it).forEach(function(o){Kt.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),it[a]=it[o]})});function xt(o,a,d){return a==null||typeof a=="boolean"||a===""?"":d||typeof a!="number"||a===0||it.hasOwnProperty(o)&&it[o]?(""+a).trim():a+"px"}function tn(o,a){o=o.style;for(var d in a)if(a.hasOwnProperty(d)){var g=d.indexOf("--")===0,w=xt(d,a[d],g);d==="float"&&(d="cssFloat"),g?o.setProperty(d,w):o[d]=w}}var Nt=A({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 yt(o,a){if(a){if(Nt[o]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function kt(o,a){if(o.indexOf("-")===-1)return typeof a.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 he=null;function Ze(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Je=null,nn=null,Ct=null;function jt(o){if(o=Ha(o)){if(typeof Je!="function")throw Error(n(280));var a=o.stateNode;a&&(a=Ec(a),Je(o.stateNode,o.type,a))}}function Ut(o){nn?Ct?Ct.push(o):Ct=[o]:nn=o}function An(){if(nn){var o=nn,a=Ct;if(Ct=nn=null,jt(o),a)for(o=0;o<a.length;o++)jt(a[o])}}function qt(o,a){return o(a)}function rn(){}var Vt=!1;function Yn(o,a,d){if(Vt)return o(a,d);Vt=!0;try{return qt(o,a,d)}finally{Vt=!1,(nn!==null||Ct!==null)&&(rn(),An())}}function ut(o,a){var d=o.stateNode;if(d===null)return null;var g=Ec(d);if(g===null)return null;d=g[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,a,typeof d));return d}var wn=!1;if(u)try{var Et={};Object.defineProperty(Et,"passive",{get:function(){wn=!0}}),window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch{wn=!1}function re(o,a,d,g,w,S,R,H,K){var ce=Array.prototype.slice.call(arguments,3);try{a.apply(d,ce)}catch(we){this.onError(we)}}var Pe=!1,He=null,It=!1,mn=null,bt={onError:function(o){Pe=!0,He=o}};function hf(o,a,d,g,w,S,R,H,K){Pe=!1,He=null,re.apply(bt,arguments)}function Sa(o,a,d,g,w,S,R,H,K){if(hf.apply(this,arguments),Pe){if(Pe){var ce=He;Pe=!1,He=null}else throw Error(n(198));It||(It=!0,mn=ce)}}function Ir(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function Go(o){if(o.tag===13){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function Yo(o){if(Ir(o)!==o)throw Error(n(188))}function Na(o){var a=o.alternate;if(!a){if(a=Ir(o),a===null)throw Error(n(188));return a!==o?null:o}for(var d=o,g=a;;){var w=d.return;if(w===null)break;var S=w.alternate;if(S===null){if(g=w.return,g!==null){d=g;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===d)return Yo(w),o;if(S===g)return Yo(w),a;S=S.sibling}throw Error(n(188))}if(d.return!==g.return)d=w,g=S;else{for(var R=!1,H=w.child;H;){if(H===d){R=!0,d=w,g=S;break}if(H===g){R=!0,g=w,d=S;break}H=H.sibling}if(!R){for(H=S.child;H;){if(H===d){R=!0,d=S,g=w;break}if(H===g){R=!0,g=S,d=w;break}H=H.sibling}if(!R)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:a}function Jo(o){return o=Na(o),o!==null?Xo(o):null}function Xo(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=Xo(o);if(a!==null)return a;o=o.sibling}return null}var Qo=t.unstable_scheduleCallback,po=t.unstable_cancelCallback,gf=t.unstable_shouldYield,Zo=t.unstable_requestPaint,Pt=t.unstable_now,xf=t.unstable_getCurrentPriorityLevel,Ca=t.unstable_ImmediatePriority,lc=t.unstable_UserBlockingPriority,Bn=t.unstable_NormalPriority,yf=t.unstable_LowPriority,cc=t.unstable_IdlePriority,ei=null,br=null;function bf(o){if(br&&typeof br.onCommitFiberRoot=="function")try{br.onCommitFiberRoot(ei,o,void 0,(o.current.flags&128)===128)}catch{}}var ht=Math.clz32?Math.clz32:vf,mo=Math.log,Ea=Math.LN2;function vf(o){return o>>>=0,o===0?32:31-(mo(o)/Ea|0)|0}var ti=64,ho=4194304;function gs(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 go(o,a){var d=o.pendingLanes;if(d===0)return 0;var g=0,w=o.suspendedLanes,S=o.pingedLanes,R=d&268435455;if(R!==0){var H=R&~w;H!==0?g=gs(H):(S&=R,S!==0&&(g=gs(S)))}else R=d&~w,R!==0?g=gs(R):S!==0&&(g=gs(S));if(g===0)return 0;if(a!==0&&a!==g&&(a&w)===0&&(w=g&-g,S=a&-a,w>=S||w===16&&(S&4194240)!==0))return a;if((g&4)!==0&&(g|=d&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=g;0<a;)d=31-ht(a),w=1<<d,g|=o[d],a&=~w;return g}function ni(o,a){switch(o){case 1:case 2:case 4:return a+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 a+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 wf(o,a){for(var d=o.suspendedLanes,g=o.pingedLanes,w=o.expirationTimes,S=o.pendingLanes;0<S;){var R=31-ht(S),H=1<<R,K=w[R];K===-1?((H&d)===0||(H&g)!==0)&&(w[R]=ni(H,a)):K<=a&&(o.expiredLanes|=H),S&=~H}}function Ta(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function uc(){var o=ti;return ti<<=1,(ti&4194240)===0&&(ti=64),o}function Dn(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function xo(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-ht(a),o[a]=d}function Pa(o,a){var d=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var g=o.eventTimes;for(o=o.expirationTimes;0<d;){var w=31-ht(d),S=1<<w;a[w]=0,g[w]=-1,o[w]=-1,d&=~S}}function Ra(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var g=31-ht(d),w=1<<g;w&a|o[g]&a&&(o[g]|=a),d&=~w}}var vt=0;function dc(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Jr,F,oe,ge,De,tt=!1,at=[],dt=null,cn=null,sn=null,$n=new Map,Un=new Map,Or=[],fc="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 yo(o,a){switch(o){case"focusin":case"focusout":dt=null;break;case"dragenter":case"dragleave":cn=null;break;case"mouseover":case"mouseout":sn=null;break;case"pointerover":case"pointerout":$n.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Un.delete(a.pointerId)}}function bo(o,a,d,g,w,S){return o===null||o.nativeEvent!==S?(o={blockedOn:a,domEventName:d,eventSystemFlags:g,nativeEvent:S,targetContainers:[w]},a!==null&&(a=Ha(a),a!==null&&F(a)),o):(o.eventSystemFlags|=g,a=o.targetContainers,w!==null&&a.indexOf(w)===-1&&a.push(w),o)}function BN(o,a,d,g,w){switch(a){case"focusin":return dt=bo(dt,o,a,d,g,w),!0;case"dragenter":return cn=bo(cn,o,a,d,g,w),!0;case"mouseover":return sn=bo(sn,o,a,d,g,w),!0;case"pointerover":var S=w.pointerId;return $n.set(S,bo($n.get(S)||null,o,a,d,g,w)),!0;case"gotpointercapture":return S=w.pointerId,Un.set(S,bo(Un.get(S)||null,o,a,d,g,w)),!0}return!1}function kx(o){var a=vo(o.target);if(a!==null){var d=Ir(a);if(d!==null){if(a=d.tag,a===13){if(a=Go(d),a!==null){o.blockedOn=a,De(o.priority,function(){oe(d)});return}}else if(a===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function pc(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var d=kf(o.domEventName,o.eventSystemFlags,a[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var g=new d.constructor(d.type,d);he=g,d.target.dispatchEvent(g),he=null}else return a=Ha(d),a!==null&&F(a),o.blockedOn=d,!1;a.shift()}return!0}function Sx(o,a,d){pc(o)&&d.delete(a)}function UN(){tt=!1,dt!==null&&pc(dt)&&(dt=null),cn!==null&&pc(cn)&&(cn=null),sn!==null&&pc(sn)&&(sn=null),$n.forEach(Sx),Un.forEach(Sx)}function Aa(o,a){o.blockedOn===a&&(o.blockedOn=null,tt||(tt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,UN)))}function Da(o){function a(w){return Aa(w,o)}if(0<at.length){Aa(at[0],o);for(var d=1;d<at.length;d++){var g=at[d];g.blockedOn===o&&(g.blockedOn=null)}}for(dt!==null&&Aa(dt,o),cn!==null&&Aa(cn,o),sn!==null&&Aa(sn,o),$n.forEach(a),Un.forEach(a),d=0;d<Or.length;d++)g=Or[d],g.blockedOn===o&&(g.blockedOn=null);for(;0<Or.length&&(d=Or[0],d.blockedOn===null);)kx(d),d.blockedOn===null&&Or.shift()}var ri=T.ReactCurrentBatchConfig,mc=!0;function VN(o,a,d,g){var w=vt,S=ri.transition;ri.transition=null;try{vt=1,jf(o,a,d,g)}finally{vt=w,ri.transition=S}}function HN(o,a,d,g){var w=vt,S=ri.transition;ri.transition=null;try{vt=4,jf(o,a,d,g)}finally{vt=w,ri.transition=S}}function jf(o,a,d,g){if(mc){var w=kf(o,a,d,g);if(w===null)zf(o,a,g,hc,d),yo(o,g);else if(BN(w,o,a,d,g))g.stopPropagation();else if(yo(o,g),a&4&&-1<fc.indexOf(o)){for(;w!==null;){var S=Ha(w);if(S!==null&&Jr(S),S=kf(o,a,d,g),S===null&&zf(o,a,g,hc,d),S===w)break;w=S}w!==null&&g.stopPropagation()}else zf(o,a,g,null,d)}}var hc=null;function kf(o,a,d,g){if(hc=null,o=Ze(g),o=vo(o),o!==null)if(a=Ir(o),a===null)o=null;else if(d=a.tag,d===13){if(o=Go(a),o!==null)return o;o=null}else if(d===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null);return hc=o,null}function Nx(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(xf()){case Ca:return 1;case lc:return 4;case Bn:case yf:return 16;case cc:return 536870912;default:return 16}default:return 16}}var Ls=null,Sf=null,gc=null;function Cx(){if(gc)return gc;var o,a=Sf,d=a.length,g,w="value"in Ls?Ls.value:Ls.textContent,S=w.length;for(o=0;o<d&&a[o]===w[o];o++);var R=d-o;for(g=1;g<=R&&a[d-g]===w[S-g];g++);return gc=w.slice(o,1<g?1-g:void 0)}function xc(o){var a=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&a===13&&(o=13)):o=a,o===10&&(o=13),32<=o||o===13?o:0}function yc(){return!0}function Ex(){return!1}function cr(o){function a(d,g,w,S,R){this._reactName=d,this._targetInst=w,this.type=g,this.nativeEvent=S,this.target=R,this.currentTarget=null;for(var H in o)o.hasOwnProperty(H)&&(d=o[H],this[H]=d?d(S):S[H]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?yc:Ex,this.isPropagationStopped=Ex,this}return A(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=yc)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=yc)},persist:function(){},isPersistent:yc}),a}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nf=cr(si),$a=A({},si,{view:0,detail:0}),WN=cr($a),Cf,Ef,La,bc=A({},$a,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pf,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!==La&&(La&&o.type==="mousemove"?(Cf=o.screenX-La.screenX,Ef=o.screenY-La.screenY):Ef=Cf=0,La=o),Cf)},movementY:function(o){return"movementY"in o?o.movementY:Ef}}),Tx=cr(bc),KN=A({},bc,{dataTransfer:0}),qN=cr(KN),GN=A({},$a,{relatedTarget:0}),Tf=cr(GN),YN=A({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),JN=cr(YN),XN=A({},si,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),QN=cr(XN),ZN=A({},si,{data:0}),Px=cr(ZN),eC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tC={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"},nC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rC(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=nC[o])?!!a[o]:!1}function Pf(){return rC}var sC=A({},$a,{key:function(o){if(o.key){var a=eC[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=xc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?tC[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pf,charCode:function(o){return o.type==="keypress"?xc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?xc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),oC=cr(sC),iC=A({},bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rx=cr(iC),aC=A({},$a,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pf}),lC=cr(aC),cC=A({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),uC=cr(cC),dC=A({},bc,{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}),fC=cr(dC),pC=[9,13,27,32],Rf=u&&"CompositionEvent"in window,Ia=null;u&&"documentMode"in document&&(Ia=document.documentMode);var mC=u&&"TextEvent"in window&&!Ia,Ax=u&&(!Rf||Ia&&8<Ia&&11>=Ia),Dx=" ",$x=!1;function Lx(o,a){switch(o){case"keyup":return pC.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ix(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var oi=!1;function hC(o,a){switch(o){case"compositionend":return Ix(a);case"keypress":return a.which!==32?null:($x=!0,Dx);case"textInput":return o=a.data,o===Dx&&$x?null:o;default:return null}}function gC(o,a){if(oi)return o==="compositionend"||!Rf&&Lx(o,a)?(o=Cx(),gc=Sf=Ls=null,oi=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ax&&a.locale!=="ko"?null:a.data;default:return null}}var xC={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 Ox(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!xC[o.type]:a==="textarea"}function _x(o,a,d,g){Ut(g),a=Sc(a,"onChange"),0<a.length&&(d=new Nf("onChange","change",null,d,g),o.push({event:d,listeners:a}))}var Oa=null,_a=null;function yC(o){ty(o,0)}function vc(o){var a=ui(o);if(Ve(a))return o}function bC(o,a){if(o==="change")return a}var Mx=!1;if(u){var Af;if(u){var Df="oninput"in document;if(!Df){var Fx=document.createElement("div");Fx.setAttribute("oninput","return;"),Df=typeof Fx.oninput=="function"}Af=Df}else Af=!1;Mx=Af&&(!document.documentMode||9<document.documentMode)}function zx(){Oa&&(Oa.detachEvent("onpropertychange",Bx),_a=Oa=null)}function Bx(o){if(o.propertyName==="value"&&vc(_a)){var a=[];_x(a,_a,o,Ze(o)),Yn(yC,a)}}function vC(o,a,d){o==="focusin"?(zx(),Oa=a,_a=d,Oa.attachEvent("onpropertychange",Bx)):o==="focusout"&&zx()}function wC(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return vc(_a)}function jC(o,a){if(o==="click")return vc(a)}function kC(o,a){if(o==="input"||o==="change")return vc(a)}function SC(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var _r=typeof Object.is=="function"?Object.is:SC;function Ma(o,a){if(_r(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var d=Object.keys(o),g=Object.keys(a);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var w=d[g];if(!p.call(a,w)||!_r(o[w],a[w]))return!1}return!0}function Ux(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Vx(o,a){var d=Ux(o);o=0;for(var g;d;){if(d.nodeType===3){if(g=o+d.textContent.length,o<=a&&g>=a)return{node:d,offset:a-o};o=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Ux(d)}}function Hx(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Hx(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Wx(){for(var o=window,a=pe();a instanceof o.HTMLIFrameElement;){try{var d=typeof a.contentWindow.location.href=="string"}catch{d=!1}if(d)o=a.contentWindow;else break;a=pe(o.document)}return a}function $f(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}function NC(o){var a=Wx(),d=o.focusedElem,g=o.selectionRange;if(a!==d&&d&&d.ownerDocument&&Hx(d.ownerDocument.documentElement,d)){if(g!==null&&$f(d)){if(a=g.start,o=g.end,o===void 0&&(o=a),"selectionStart"in d)d.selectionStart=a,d.selectionEnd=Math.min(o,d.value.length);else if(o=(a=d.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var w=d.textContent.length,S=Math.min(g.start,w);g=g.end===void 0?S:Math.min(g.end,w),!o.extend&&S>g&&(w=g,g=S,S=w),w=Vx(d,S);var R=Vx(d,g);w&&R&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==R.node||o.focusOffset!==R.offset)&&(a=a.createRange(),a.setStart(w.node,w.offset),o.removeAllRanges(),S>g?(o.addRange(a),o.extend(R.node,R.offset)):(a.setEnd(R.node,R.offset),o.addRange(a)))}}for(a=[],o=d;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<a.length;d++)o=a[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var CC=u&&"documentMode"in document&&11>=document.documentMode,ii=null,Lf=null,Fa=null,If=!1;function Kx(o,a,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;If||ii==null||ii!==pe(g)||(g=ii,"selectionStart"in g&&$f(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Fa&&Ma(Fa,g)||(Fa=g,g=Sc(Lf,"onSelect"),0<g.length&&(a=new Nf("onSelect","select",null,a,d),o.push({event:a,listeners:g}),a.target=ii)))}function wc(o,a){var d={};return d[o.toLowerCase()]=a.toLowerCase(),d["Webkit"+o]="webkit"+a,d["Moz"+o]="moz"+a,d}var ai={animationend:wc("Animation","AnimationEnd"),animationiteration:wc("Animation","AnimationIteration"),animationstart:wc("Animation","AnimationStart"),transitionend:wc("Transition","TransitionEnd")},Of={},qx={};u&&(qx=document.createElement("div").style,"AnimationEvent"in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),"TransitionEvent"in window||delete ai.transitionend.transition);function jc(o){if(Of[o])return Of[o];if(!ai[o])return o;var a=ai[o],d;for(d in a)if(a.hasOwnProperty(d)&&d in qx)return Of[o]=a[d];return o}var Gx=jc("animationend"),Yx=jc("animationiteration"),Jx=jc("animationstart"),Xx=jc("transitionend"),Qx=new Map,Zx="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 Is(o,a){Qx.set(o,a),l(a,[o])}for(var _f=0;_f<Zx.length;_f++){var Mf=Zx[_f],EC=Mf.toLowerCase(),TC=Mf[0].toUpperCase()+Mf.slice(1);Is(EC,"on"+TC)}Is(Gx,"onAnimationEnd"),Is(Yx,"onAnimationIteration"),Is(Jx,"onAnimationStart"),Is("dblclick","onDoubleClick"),Is("focusin","onFocus"),Is("focusout","onBlur"),Is(Xx,"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 za="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(" "),PC=new Set("cancel close invalid load scroll toggle".split(" ").concat(za));function ey(o,a,d){var g=o.type||"unknown-event";o.currentTarget=d,Sa(g,a,void 0,o),o.currentTarget=null}function ty(o,a){a=(a&4)!==0;for(var d=0;d<o.length;d++){var g=o[d],w=g.event;g=g.listeners;e:{var S=void 0;if(a)for(var R=g.length-1;0<=R;R--){var H=g[R],K=H.instance,ce=H.currentTarget;if(H=H.listener,K!==S&&w.isPropagationStopped())break e;ey(w,H,ce),S=K}else for(R=0;R<g.length;R++){if(H=g[R],K=H.instance,ce=H.currentTarget,H=H.listener,K!==S&&w.isPropagationStopped())break e;ey(w,H,ce),S=K}}}if(It)throw o=mn,It=!1,mn=null,o}function Ot(o,a){var d=a[Kf];d===void 0&&(d=a[Kf]=new Set);var g=o+"__bubble";d.has(g)||(ny(a,o,2,!1),d.add(g))}function Ff(o,a,d){var g=0;a&&(g|=4),ny(d,o,g,a)}var kc="_reactListening"+Math.random().toString(36).slice(2);function Ba(o){if(!o[kc]){o[kc]=!0,s.forEach(function(d){d!=="selectionchange"&&(PC.has(d)||Ff(d,!1,o),Ff(d,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[kc]||(a[kc]=!0,Ff("selectionchange",!1,a))}}function ny(o,a,d,g){switch(Nx(a)){case 1:var w=VN;break;case 4:w=HN;break;default:w=jf}d=w.bind(null,a,d,o),w=void 0,!wn||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(w=!0),g?w!==void 0?o.addEventListener(a,d,{capture:!0,passive:w}):o.addEventListener(a,d,!0):w!==void 0?o.addEventListener(a,d,{passive:w}):o.addEventListener(a,d,!1)}function zf(o,a,d,g,w){var S=g;if((a&1)===0&&(a&2)===0&&g!==null)e:for(;;){if(g===null)return;var R=g.tag;if(R===3||R===4){var H=g.stateNode.containerInfo;if(H===w||H.nodeType===8&&H.parentNode===w)break;if(R===4)for(R=g.return;R!==null;){var K=R.tag;if((K===3||K===4)&&(K=R.stateNode.containerInfo,K===w||K.nodeType===8&&K.parentNode===w))return;R=R.return}for(;H!==null;){if(R=vo(H),R===null)return;if(K=R.tag,K===5||K===6){g=S=R;continue e}H=H.parentNode}}g=g.return}Yn(function(){var ce=S,we=Ze(d),je=[];e:{var ve=Qx.get(o);if(ve!==void 0){var Ie=Nf,_e=o;switch(o){case"keypress":if(xc(d)===0)break e;case"keydown":case"keyup":Ie=oC;break;case"focusin":_e="focus",Ie=Tf;break;case"focusout":_e="blur",Ie=Tf;break;case"beforeblur":case"afterblur":Ie=Tf;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=Tx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=qN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=lC;break;case Gx:case Yx:case Jx:Ie=JN;break;case Xx:Ie=uC;break;case"scroll":Ie=WN;break;case"wheel":Ie=fC;break;case"copy":case"cut":case"paste":Ie=QN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=Rx}var Fe=(a&4)!==0,on=!Fe&&o==="scroll",se=Fe?ve!==null?ve+"Capture":null:ve;Fe=[];for(var Y=ce,ie;Y!==null;){ie=Y;var Ce=ie.stateNode;if(ie.tag===5&&Ce!==null&&(ie=Ce,se!==null&&(Ce=ut(Y,se),Ce!=null&&Fe.push(Ua(Y,Ce,ie)))),on)break;Y=Y.return}0<Fe.length&&(ve=new Ie(ve,_e,null,d,we),je.push({event:ve,listeners:Fe}))}}if((a&7)===0){e:{if(ve=o==="mouseover"||o==="pointerover",Ie=o==="mouseout"||o==="pointerout",ve&&d!==he&&(_e=d.relatedTarget||d.fromElement)&&(vo(_e)||_e[xs]))break e;if((Ie||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,Ie?(_e=d.relatedTarget||d.toElement,Ie=ce,_e=_e?vo(_e):null,_e!==null&&(on=Ir(_e),_e!==on||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(Ie=null,_e=ce),Ie!==_e)){if(Fe=Tx,Ce="onMouseLeave",se="onMouseEnter",Y="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=Rx,Ce="onPointerLeave",se="onPointerEnter",Y="pointer"),on=Ie==null?ve:ui(Ie),ie=_e==null?ve:ui(_e),ve=new Fe(Ce,Y+"leave",Ie,d,we),ve.target=on,ve.relatedTarget=ie,Ce=null,vo(we)===ce&&(Fe=new Fe(se,Y+"enter",_e,d,we),Fe.target=ie,Fe.relatedTarget=on,Ce=Fe),on=Ce,Ie&&_e)t:{for(Fe=Ie,se=_e,Y=0,ie=Fe;ie;ie=li(ie))Y++;for(ie=0,Ce=se;Ce;Ce=li(Ce))ie++;for(;0<Y-ie;)Fe=li(Fe),Y--;for(;0<ie-Y;)se=li(se),ie--;for(;Y--;){if(Fe===se||se!==null&&Fe===se.alternate)break t;Fe=li(Fe),se=li(se)}Fe=null}else Fe=null;Ie!==null&&ry(je,ve,Ie,Fe,!1),_e!==null&&on!==null&&ry(je,on,_e,Fe,!0)}}e:{if(ve=ce?ui(ce):window,Ie=ve.nodeName&&ve.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&ve.type==="file")var Ue=bC;else if(Ox(ve))if(Mx)Ue=kC;else{Ue=wC;var We=vC}else(Ie=ve.nodeName)&&Ie.toLowerCase()==="input"&&(ve.type==="checkbox"||ve.type==="radio")&&(Ue=jC);if(Ue&&(Ue=Ue(o,ce))){_x(je,Ue,d,we);break e}We&&We(o,ve,ce),o==="focusout"&&(We=ve._wrapperState)&&We.controlled&&ve.type==="number"&&Ae(ve,"number",ve.value)}switch(We=ce?ui(ce):window,o){case"focusin":(Ox(We)||We.contentEditable==="true")&&(ii=We,Lf=ce,Fa=null);break;case"focusout":Fa=Lf=ii=null;break;case"mousedown":If=!0;break;case"contextmenu":case"mouseup":case"dragend":If=!1,Kx(je,d,we);break;case"selectionchange":if(CC)break;case"keydown":case"keyup":Kx(je,d,we)}var Ke;if(Rf)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else oi?Lx(o,d)&&(Xe="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ax&&d.locale!=="ko"&&(oi||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&oi&&(Ke=Cx()):(Ls=we,Sf="value"in Ls?Ls.value:Ls.textContent,oi=!0)),We=Sc(ce,Xe),0<We.length&&(Xe=new Px(Xe,o,null,d,we),je.push({event:Xe,listeners:We}),Ke?Xe.data=Ke:(Ke=Ix(d),Ke!==null&&(Xe.data=Ke)))),(Ke=mC?hC(o,d):gC(o,d))&&(ce=Sc(ce,"onBeforeInput"),0<ce.length&&(we=new Px("onBeforeInput","beforeinput",null,d,we),je.push({event:we,listeners:ce}),we.data=Ke))}ty(je,a)})}function Ua(o,a,d){return{instance:o,listener:a,currentTarget:d}}function Sc(o,a){for(var d=a+"Capture",g=[];o!==null;){var w=o,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=ut(o,d),S!=null&&g.unshift(Ua(o,S,w)),S=ut(o,a),S!=null&&g.push(Ua(o,S,w))),o=o.return}return g}function li(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function ry(o,a,d,g,w){for(var S=a._reactName,R=[];d!==null&&d!==g;){var H=d,K=H.alternate,ce=H.stateNode;if(K!==null&&K===g)break;H.tag===5&&ce!==null&&(H=ce,w?(K=ut(d,S),K!=null&&R.unshift(Ua(d,K,H))):w||(K=ut(d,S),K!=null&&R.push(Ua(d,K,H)))),d=d.return}R.length!==0&&o.push({event:a,listeners:R})}var RC=/\r\n?/g,AC=/\u0000|\uFFFD/g;function sy(o){return(typeof o=="string"?o:""+o).replace(RC,`
|
|
38
|
+
`).replace(AC,"")}function Nc(o,a,d){if(a=sy(a),sy(o)!==a&&d)throw Error(n(425))}function Cc(){}var Bf=null,Uf=null;function Vf(o,a){return o==="textarea"||o==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Hf=typeof setTimeout=="function"?setTimeout:void 0,DC=typeof clearTimeout=="function"?clearTimeout:void 0,oy=typeof Promise=="function"?Promise:void 0,$C=typeof queueMicrotask=="function"?queueMicrotask:typeof oy<"u"?function(o){return oy.resolve(null).then(o).catch(LC)}:Hf;function LC(o){setTimeout(function(){throw o})}function Wf(o,a){var d=a,g=0;do{var w=d.nextSibling;if(o.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(g===0){o.removeChild(w),Da(a);return}g--}else d!=="$"&&d!=="$?"&&d!=="$!"||g++;d=w}while(d);Da(a)}function Os(o){for(;o!=null;o=o.nextSibling){var a=o.nodeType;if(a===1||a===3)break;if(a===8){if(a=o.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return o}function iy(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(a===0)return o;a--}else d==="/$"&&a++}o=o.previousSibling}return null}var ci=Math.random().toString(36).slice(2),Xr="__reactFiber$"+ci,Va="__reactProps$"+ci,xs="__reactContainer$"+ci,Kf="__reactEvents$"+ci,IC="__reactListeners$"+ci,OC="__reactHandles$"+ci;function vo(o){var a=o[Xr];if(a)return a;for(var d=o.parentNode;d;){if(a=d[xs]||d[Xr]){if(d=a.alternate,a.child!==null||d!==null&&d.child!==null)for(o=iy(o);o!==null;){if(d=o[Xr])return d;o=iy(o)}return a}o=d,d=o.parentNode}return null}function Ha(o){return o=o[Xr]||o[xs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ui(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Ec(o){return o[Va]||null}var qf=[],di=-1;function _s(o){return{current:o}}function _t(o){0>di||(o.current=qf[di],qf[di]=null,di--)}function Rt(o,a){di++,qf[di]=o.current,o.current=a}var Ms={},Ln=_s(Ms),Jn=_s(!1),wo=Ms;function fi(o,a){var d=o.type.contextTypes;if(!d)return Ms;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===a)return g.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in d)w[S]=a[S];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=w),w}function Xn(o){return o=o.childContextTypes,o!=null}function Tc(){_t(Jn),_t(Ln)}function ay(o,a,d){if(Ln.current!==Ms)throw Error(n(168));Rt(Ln,a),Rt(Jn,d)}function ly(o,a,d){var g=o.stateNode;if(a=a.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var w in g)if(!(w in a))throw Error(n(108,ne(o)||"Unknown",w));return A({},d,g)}function Pc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ms,wo=Ln.current,Rt(Ln,o),Rt(Jn,Jn.current),!0}function cy(o,a,d){var g=o.stateNode;if(!g)throw Error(n(169));d?(o=ly(o,a,wo),g.__reactInternalMemoizedMergedChildContext=o,_t(Jn),_t(Ln),Rt(Ln,o)):_t(Jn),Rt(Jn,d)}var ys=null,Rc=!1,Gf=!1;function uy(o){ys===null?ys=[o]:ys.push(o)}function _C(o){Rc=!0,uy(o)}function Fs(){if(!Gf&&ys!==null){Gf=!0;var o=0,a=vt;try{var d=ys;for(vt=1;o<d.length;o++){var g=d[o];do g=g(!0);while(g!==null)}ys=null,Rc=!1}catch(w){throw ys!==null&&(ys=ys.slice(o+1)),Qo(Ca,Fs),w}finally{vt=a,Gf=!1}}return null}var pi=[],mi=0,Ac=null,Dc=0,vr=[],wr=0,jo=null,bs=1,vs="";function ko(o,a){pi[mi++]=Dc,pi[mi++]=Ac,Ac=o,Dc=a}function dy(o,a,d){vr[wr++]=bs,vr[wr++]=vs,vr[wr++]=jo,jo=o;var g=bs;o=vs;var w=32-ht(g)-1;g&=~(1<<w),d+=1;var S=32-ht(a)+w;if(30<S){var R=w-w%5;S=(g&(1<<R)-1).toString(32),g>>=R,w-=R,bs=1<<32-ht(a)+w|d<<w|g,vs=S+o}else bs=1<<S|d<<w|g,vs=o}function Yf(o){o.return!==null&&(ko(o,1),dy(o,1,0))}function Jf(o){for(;o===Ac;)Ac=pi[--mi],pi[mi]=null,Dc=pi[--mi],pi[mi]=null;for(;o===jo;)jo=vr[--wr],vr[wr]=null,vs=vr[--wr],vr[wr]=null,bs=vr[--wr],vr[wr]=null}var ur=null,dr=null,Ht=!1,Mr=null;function fy(o,a){var d=Nr(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=o,a=o.deletions,a===null?(o.deletions=[d],o.flags|=16):a.push(d)}function py(o,a){switch(o.tag){case 5:var d=o.type;return a=a.nodeType!==1||d.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(o.stateNode=a,ur=o,dr=Os(a.firstChild),!0):!1;case 6:return a=o.pendingProps===""||a.nodeType!==3?null:a,a!==null?(o.stateNode=a,ur=o,dr=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(d=jo!==null?{id:bs,overflow:vs}:null,o.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Nr(18,null,null,0),d.stateNode=a,d.return=o,o.child=d,ur=o,dr=null,!0):!1;default:return!1}}function Xf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Qf(o){if(Ht){var a=dr;if(a){var d=a;if(!py(o,a)){if(Xf(o))throw Error(n(418));a=Os(d.nextSibling);var g=ur;a&&py(o,a)?fy(g,d):(o.flags=o.flags&-4097|2,Ht=!1,ur=o)}}else{if(Xf(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ht=!1,ur=o}}}function my(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;ur=o}function $c(o){if(o!==ur)return!1;if(!Ht)return my(o),Ht=!0,!1;var a;if((a=o.tag!==3)&&!(a=o.tag!==5)&&(a=o.type,a=a!=="head"&&a!=="body"&&!Vf(o.type,o.memoizedProps)),a&&(a=dr)){if(Xf(o))throw hy(),Error(n(418));for(;a;)fy(o,a),a=Os(a.nextSibling)}if(my(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,a=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(a===0){dr=Os(o.nextSibling);break e}a--}else d!=="$"&&d!=="$!"&&d!=="$?"||a++}o=o.nextSibling}dr=null}}else dr=ur?Os(o.stateNode.nextSibling):null;return!0}function hy(){for(var o=dr;o;)o=Os(o.nextSibling)}function hi(){dr=ur=null,Ht=!1}function Zf(o){Mr===null?Mr=[o]:Mr.push(o)}var MC=T.ReactCurrentBatchConfig;function Wa(o,a,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var g=d.stateNode}if(!g)throw Error(n(147,o));var w=g,S=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===S?a.ref:(a=function(R){var H=w.refs;R===null?delete H[S]:H[S]=R},a._stringRef=S,a)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Lc(o,a){throw o=Object.prototype.toString.call(a),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function gy(o){var a=o._init;return a(o._payload)}function xy(o){function a(se,Y){if(o){var ie=se.deletions;ie===null?(se.deletions=[Y],se.flags|=16):ie.push(Y)}}function d(se,Y){if(!o)return null;for(;Y!==null;)a(se,Y),Y=Y.sibling;return null}function g(se,Y){for(se=new Map;Y!==null;)Y.key!==null?se.set(Y.key,Y):se.set(Y.index,Y),Y=Y.sibling;return se}function w(se,Y){return se=qs(se,Y),se.index=0,se.sibling=null,se}function S(se,Y,ie){return se.index=ie,o?(ie=se.alternate,ie!==null?(ie=ie.index,ie<Y?(se.flags|=2,Y):ie):(se.flags|=2,Y)):(se.flags|=1048576,Y)}function R(se){return o&&se.alternate===null&&(se.flags|=2),se}function H(se,Y,ie,Ce){return Y===null||Y.tag!==6?(Y=Hp(ie,se.mode,Ce),Y.return=se,Y):(Y=w(Y,ie),Y.return=se,Y)}function K(se,Y,ie,Ce){var Ue=ie.type;return Ue===$?we(se,Y,ie.props.children,Ce,ie.key):Y!==null&&(Y.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&gy(Ue)===Y.type)?(Ce=w(Y,ie.props),Ce.ref=Wa(se,Y,ie),Ce.return=se,Ce):(Ce=su(ie.type,ie.key,ie.props,null,se.mode,Ce),Ce.ref=Wa(se,Y,ie),Ce.return=se,Ce)}function ce(se,Y,ie,Ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ie.containerInfo||Y.stateNode.implementation!==ie.implementation?(Y=Wp(ie,se.mode,Ce),Y.return=se,Y):(Y=w(Y,ie.children||[]),Y.return=se,Y)}function we(se,Y,ie,Ce,Ue){return Y===null||Y.tag!==7?(Y=Ao(ie,se.mode,Ce,Ue),Y.return=se,Y):(Y=w(Y,ie),Y.return=se,Y)}function je(se,Y,ie){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=Hp(""+Y,se.mode,ie),Y.return=se,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case L:return ie=su(Y.type,Y.key,Y.props,null,se.mode,ie),ie.ref=Wa(se,null,Y),ie.return=se,ie;case P:return Y=Wp(Y,se.mode,ie),Y.return=se,Y;case Z:var Ce=Y._init;return je(se,Ce(Y._payload),ie)}if(Ee(Y)||G(Y))return Y=Ao(Y,se.mode,ie,null),Y.return=se,Y;Lc(se,Y)}return null}function ve(se,Y,ie,Ce){var Ue=Y!==null?Y.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number")return Ue!==null?null:H(se,Y,""+ie,Ce);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:return ie.key===Ue?K(se,Y,ie,Ce):null;case P:return ie.key===Ue?ce(se,Y,ie,Ce):null;case Z:return Ue=ie._init,ve(se,Y,Ue(ie._payload),Ce)}if(Ee(ie)||G(ie))return Ue!==null?null:we(se,Y,ie,Ce,null);Lc(se,ie)}return null}function Ie(se,Y,ie,Ce,Ue){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return se=se.get(ie)||null,H(Y,se,""+Ce,Ue);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case L:return se=se.get(Ce.key===null?ie:Ce.key)||null,K(Y,se,Ce,Ue);case P:return se=se.get(Ce.key===null?ie:Ce.key)||null,ce(Y,se,Ce,Ue);case Z:var We=Ce._init;return Ie(se,Y,ie,We(Ce._payload),Ue)}if(Ee(Ce)||G(Ce))return se=se.get(ie)||null,we(Y,se,Ce,Ue,null);Lc(Y,Ce)}return null}function _e(se,Y,ie,Ce){for(var Ue=null,We=null,Ke=Y,Xe=Y=0,Sn=null;Ke!==null&&Xe<ie.length;Xe++){Ke.index>Xe?(Sn=Ke,Ke=null):Sn=Ke.sibling;var gt=ve(se,Ke,ie[Xe],Ce);if(gt===null){Ke===null&&(Ke=Sn);break}o&&Ke&>.alternate===null&&a(se,Ke),Y=S(gt,Y,Xe),We===null?Ue=gt:We.sibling=gt,We=gt,Ke=Sn}if(Xe===ie.length)return d(se,Ke),Ht&&ko(se,Xe),Ue;if(Ke===null){for(;Xe<ie.length;Xe++)Ke=je(se,ie[Xe],Ce),Ke!==null&&(Y=S(Ke,Y,Xe),We===null?Ue=Ke:We.sibling=Ke,We=Ke);return Ht&&ko(se,Xe),Ue}for(Ke=g(se,Ke);Xe<ie.length;Xe++)Sn=Ie(Ke,se,Xe,ie[Xe],Ce),Sn!==null&&(o&&Sn.alternate!==null&&Ke.delete(Sn.key===null?Xe:Sn.key),Y=S(Sn,Y,Xe),We===null?Ue=Sn:We.sibling=Sn,We=Sn);return o&&Ke.forEach(function(Gs){return a(se,Gs)}),Ht&&ko(se,Xe),Ue}function Fe(se,Y,ie,Ce){var Ue=G(ie);if(typeof Ue!="function")throw Error(n(150));if(ie=Ue.call(ie),ie==null)throw Error(n(151));for(var We=Ue=null,Ke=Y,Xe=Y=0,Sn=null,gt=ie.next();Ke!==null&&!gt.done;Xe++,gt=ie.next()){Ke.index>Xe?(Sn=Ke,Ke=null):Sn=Ke.sibling;var Gs=ve(se,Ke,gt.value,Ce);if(Gs===null){Ke===null&&(Ke=Sn);break}o&&Ke&&Gs.alternate===null&&a(se,Ke),Y=S(Gs,Y,Xe),We===null?Ue=Gs:We.sibling=Gs,We=Gs,Ke=Sn}if(gt.done)return d(se,Ke),Ht&&ko(se,Xe),Ue;if(Ke===null){for(;!gt.done;Xe++,gt=ie.next())gt=je(se,gt.value,Ce),gt!==null&&(Y=S(gt,Y,Xe),We===null?Ue=gt:We.sibling=gt,We=gt);return Ht&&ko(se,Xe),Ue}for(Ke=g(se,Ke);!gt.done;Xe++,gt=ie.next())gt=Ie(Ke,se,Xe,gt.value,Ce),gt!==null&&(o&>.alternate!==null&&Ke.delete(gt.key===null?Xe:gt.key),Y=S(gt,Y,Xe),We===null?Ue=gt:We.sibling=gt,We=gt);return o&&Ke.forEach(function(xE){return a(se,xE)}),Ht&&ko(se,Xe),Ue}function on(se,Y,ie,Ce){if(typeof ie=="object"&&ie!==null&&ie.type===$&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:e:{for(var Ue=ie.key,We=Y;We!==null;){if(We.key===Ue){if(Ue=ie.type,Ue===$){if(We.tag===7){d(se,We.sibling),Y=w(We,ie.props.children),Y.return=se,se=Y;break e}}else if(We.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&gy(Ue)===We.type){d(se,We.sibling),Y=w(We,ie.props),Y.ref=Wa(se,We,ie),Y.return=se,se=Y;break e}d(se,We);break}else a(se,We);We=We.sibling}ie.type===$?(Y=Ao(ie.props.children,se.mode,Ce,ie.key),Y.return=se,se=Y):(Ce=su(ie.type,ie.key,ie.props,null,se.mode,Ce),Ce.ref=Wa(se,Y,ie),Ce.return=se,se=Ce)}return R(se);case P:e:{for(We=ie.key;Y!==null;){if(Y.key===We)if(Y.tag===4&&Y.stateNode.containerInfo===ie.containerInfo&&Y.stateNode.implementation===ie.implementation){d(se,Y.sibling),Y=w(Y,ie.children||[]),Y.return=se,se=Y;break e}else{d(se,Y);break}else a(se,Y);Y=Y.sibling}Y=Wp(ie,se.mode,Ce),Y.return=se,se=Y}return R(se);case Z:return We=ie._init,on(se,Y,We(ie._payload),Ce)}if(Ee(ie))return _e(se,Y,ie,Ce);if(G(ie))return Fe(se,Y,ie,Ce);Lc(se,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,Y!==null&&Y.tag===6?(d(se,Y.sibling),Y=w(Y,ie),Y.return=se,se=Y):(d(se,Y),Y=Hp(ie,se.mode,Ce),Y.return=se,se=Y),R(se)):d(se,Y)}return on}var gi=xy(!0),yy=xy(!1),Ic=_s(null),Oc=null,xi=null,ep=null;function tp(){ep=xi=Oc=null}function np(o){var a=Ic.current;_t(Ic),o._currentValue=a}function rp(o,a,d){for(;o!==null;){var g=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,g!==null&&(g.childLanes|=a)):g!==null&&(g.childLanes&a)!==a&&(g.childLanes|=a),o===d)break;o=o.return}}function yi(o,a){Oc=o,ep=xi=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(Qn=!0),o.firstContext=null)}function jr(o){var a=o._currentValue;if(ep!==o)if(o={context:o,memoizedValue:a,next:null},xi===null){if(Oc===null)throw Error(n(308));xi=o,Oc.dependencies={lanes:0,firstContext:o}}else xi=xi.next=o;return a}var So=null;function sp(o){So===null?So=[o]:So.push(o)}function by(o,a,d,g){var w=a.interleaved;return w===null?(d.next=d,sp(a)):(d.next=w.next,w.next=d),a.interleaved=d,ws(o,g)}function ws(o,a){o.lanes|=a;var d=o.alternate;for(d!==null&&(d.lanes|=a),d=o,o=o.return;o!==null;)o.childLanes|=a,d=o.alternate,d!==null&&(d.childLanes|=a),d=o,o=o.return;return d.tag===3?d.stateNode:null}var zs=!1;function op(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vy(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function js(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function Bs(o,a,d){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(pt&2)!==0){var w=g.pending;return w===null?a.next=a:(a.next=w.next,w.next=a),g.pending=a,ws(o,d)}return w=g.interleaved,w===null?(a.next=a,sp(g)):(a.next=w.next,w.next=a),g.interleaved=a,ws(o,d)}function _c(o,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var g=a.lanes;g&=o.pendingLanes,d|=g,a.lanes=d,Ra(o,d)}}function wy(o,a){var d=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var w=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var R={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?w=S=R:S=S.next=R,d=d.next}while(d!==null);S===null?w=S=a:S=S.next=a}else w=S=a;d={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:g.shared,effects:g.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=a:o.next=a,d.lastBaseUpdate=a}function Mc(o,a,d,g){var w=o.updateQueue;zs=!1;var S=w.firstBaseUpdate,R=w.lastBaseUpdate,H=w.shared.pending;if(H!==null){w.shared.pending=null;var K=H,ce=K.next;K.next=null,R===null?S=ce:R.next=ce,R=K;var we=o.alternate;we!==null&&(we=we.updateQueue,H=we.lastBaseUpdate,H!==R&&(H===null?we.firstBaseUpdate=ce:H.next=ce,we.lastBaseUpdate=K))}if(S!==null){var je=w.baseState;R=0,we=ce=K=null,H=S;do{var ve=H.lane,Ie=H.eventTime;if((g&ve)===ve){we!==null&&(we=we.next={eventTime:Ie,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var _e=o,Fe=H;switch(ve=a,Ie=d,Fe.tag){case 1:if(_e=Fe.payload,typeof _e=="function"){je=_e.call(Ie,je,ve);break e}je=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Fe.payload,ve=typeof _e=="function"?_e.call(Ie,je,ve):_e,ve==null)break e;je=A({},je,ve);break e;case 2:zs=!0}}H.callback!==null&&H.lane!==0&&(o.flags|=64,ve=w.effects,ve===null?w.effects=[H]:ve.push(H))}else Ie={eventTime:Ie,lane:ve,tag:H.tag,payload:H.payload,callback:H.callback,next:null},we===null?(ce=we=Ie,K=je):we=we.next=Ie,R|=ve;if(H=H.next,H===null){if(H=w.shared.pending,H===null)break;ve=H,H=ve.next,ve.next=null,w.lastBaseUpdate=ve,w.shared.pending=null}}while(!0);if(we===null&&(K=je),w.baseState=K,w.firstBaseUpdate=ce,w.lastBaseUpdate=we,a=w.shared.interleaved,a!==null){w=a;do R|=w.lane,w=w.next;while(w!==a)}else S===null&&(w.shared.lanes=0);Eo|=R,o.lanes=R,o.memoizedState=je}}function jy(o,a,d){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var g=o[a],w=g.callback;if(w!==null){if(g.callback=null,g=d,typeof w!="function")throw Error(n(191,w));w.call(g)}}}var Ka={},Qr=_s(Ka),qa=_s(Ka),Ga=_s(Ka);function No(o){if(o===Ka)throw Error(n(174));return o}function ip(o,a){switch(Rt(Ga,a),Rt(qa,o),Rt(Qr,Ka),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:be(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=be(a,o)}_t(Qr),Rt(Qr,a)}function bi(){_t(Qr),_t(qa),_t(Ga)}function ky(o){No(Ga.current);var a=No(Qr.current),d=be(a,o.type);a!==d&&(Rt(qa,o),Rt(Qr,d))}function ap(o){qa.current===o&&(_t(Qr),_t(qa))}var Gt=_s(0);function Fc(o){for(var a=o;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var lp=[];function cp(){for(var o=0;o<lp.length;o++)lp[o]._workInProgressVersionPrimary=null;lp.length=0}var zc=T.ReactCurrentDispatcher,up=T.ReactCurrentBatchConfig,Co=0,Yt=null,hn=null,jn=null,Bc=!1,Ya=!1,Ja=0,FC=0;function In(){throw Error(n(321))}function dp(o,a){if(a===null)return!1;for(var d=0;d<a.length&&d<o.length;d++)if(!_r(o[d],a[d]))return!1;return!0}function fp(o,a,d,g,w,S){if(Co=S,Yt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,zc.current=o===null||o.memoizedState===null?VC:HC,o=d(g,w),Ya){S=0;do{if(Ya=!1,Ja=0,25<=S)throw Error(n(301));S+=1,jn=hn=null,a.updateQueue=null,zc.current=WC,o=d(g,w)}while(Ya)}if(zc.current=Hc,a=hn!==null&&hn.next!==null,Co=0,jn=hn=Yt=null,Bc=!1,a)throw Error(n(300));return o}function pp(){var o=Ja!==0;return Ja=0,o}function Zr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Yt.memoizedState=jn=o:jn=jn.next=o,jn}function kr(){if(hn===null){var o=Yt.alternate;o=o!==null?o.memoizedState:null}else o=hn.next;var a=jn===null?Yt.memoizedState:jn.next;if(a!==null)jn=a,hn=o;else{if(o===null)throw Error(n(310));hn=o,o={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},jn===null?Yt.memoizedState=jn=o:jn=jn.next=o}return jn}function Xa(o,a){return typeof a=="function"?a(o):a}function mp(o){var a=kr(),d=a.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=hn,w=g.baseQueue,S=d.pending;if(S!==null){if(w!==null){var R=w.next;w.next=S.next,S.next=R}g.baseQueue=w=S,d.pending=null}if(w!==null){S=w.next,g=g.baseState;var H=R=null,K=null,ce=S;do{var we=ce.lane;if((Co&we)===we)K!==null&&(K=K.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),g=ce.hasEagerState?ce.eagerState:o(g,ce.action);else{var je={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};K===null?(H=K=je,R=g):K=K.next=je,Yt.lanes|=we,Eo|=we}ce=ce.next}while(ce!==null&&ce!==S);K===null?R=g:K.next=H,_r(g,a.memoizedState)||(Qn=!0),a.memoizedState=g,a.baseState=R,a.baseQueue=K,d.lastRenderedState=g}if(o=d.interleaved,o!==null){w=o;do S=w.lane,Yt.lanes|=S,Eo|=S,w=w.next;while(w!==o)}else w===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function hp(o){var a=kr(),d=a.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=d.dispatch,w=d.pending,S=a.memoizedState;if(w!==null){d.pending=null;var R=w=w.next;do S=o(S,R.action),R=R.next;while(R!==w);_r(S,a.memoizedState)||(Qn=!0),a.memoizedState=S,a.baseQueue===null&&(a.baseState=S),d.lastRenderedState=S}return[S,g]}function Sy(){}function Ny(o,a){var d=Yt,g=kr(),w=a(),S=!_r(g.memoizedState,w);if(S&&(g.memoizedState=w,Qn=!0),g=g.queue,gp(Ty.bind(null,d,g,o),[o]),g.getSnapshot!==a||S||jn!==null&&jn.memoizedState.tag&1){if(d.flags|=2048,Qa(9,Ey.bind(null,d,g,w,a),void 0,null),kn===null)throw Error(n(349));(Co&30)!==0||Cy(d,a,w)}return w}function Cy(o,a,d){o.flags|=16384,o={getSnapshot:a,value:d},a=Yt.updateQueue,a===null?(a={lastEffect:null,stores:null},Yt.updateQueue=a,a.stores=[o]):(d=a.stores,d===null?a.stores=[o]:d.push(o))}function Ey(o,a,d,g){a.value=d,a.getSnapshot=g,Py(a)&&Ry(o)}function Ty(o,a,d){return d(function(){Py(a)&&Ry(o)})}function Py(o){var a=o.getSnapshot;o=o.value;try{var d=a();return!_r(o,d)}catch{return!0}}function Ry(o){var a=ws(o,1);a!==null&&Ur(a,o,1,-1)}function Ay(o){var a=Zr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:o},a.queue=o,o=o.dispatch=UC.bind(null,Yt,o),[a.memoizedState,o]}function Qa(o,a,d,g){return o={tag:o,create:a,destroy:d,deps:g,next:null},a=Yt.updateQueue,a===null?(a={lastEffect:null,stores:null},Yt.updateQueue=a,a.lastEffect=o.next=o):(d=a.lastEffect,d===null?a.lastEffect=o.next=o:(g=d.next,d.next=o,o.next=g,a.lastEffect=o)),o}function Dy(){return kr().memoizedState}function Uc(o,a,d,g){var w=Zr();Yt.flags|=o,w.memoizedState=Qa(1|a,d,void 0,g===void 0?null:g)}function Vc(o,a,d,g){var w=kr();g=g===void 0?null:g;var S=void 0;if(hn!==null){var R=hn.memoizedState;if(S=R.destroy,g!==null&&dp(g,R.deps)){w.memoizedState=Qa(a,d,S,g);return}}Yt.flags|=o,w.memoizedState=Qa(1|a,d,S,g)}function $y(o,a){return Uc(8390656,8,o,a)}function gp(o,a){return Vc(2048,8,o,a)}function Ly(o,a){return Vc(4,2,o,a)}function Iy(o,a){return Vc(4,4,o,a)}function Oy(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function _y(o,a,d){return d=d!=null?d.concat([o]):null,Vc(4,4,Oy.bind(null,a,o),d)}function xp(){}function My(o,a){var d=kr();a=a===void 0?null:a;var g=d.memoizedState;return g!==null&&a!==null&&dp(a,g[1])?g[0]:(d.memoizedState=[o,a],o)}function Fy(o,a){var d=kr();a=a===void 0?null:a;var g=d.memoizedState;return g!==null&&a!==null&&dp(a,g[1])?g[0]:(o=o(),d.memoizedState=[o,a],o)}function zy(o,a,d){return(Co&21)===0?(o.baseState&&(o.baseState=!1,Qn=!0),o.memoizedState=d):(_r(d,a)||(d=uc(),Yt.lanes|=d,Eo|=d,o.baseState=!0),a)}function zC(o,a){var d=vt;vt=d!==0&&4>d?d:4,o(!0);var g=up.transition;up.transition={};try{o(!1),a()}finally{vt=d,up.transition=g}}function By(){return kr().memoizedState}function BC(o,a,d){var g=Ws(o);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},Uy(o))Vy(a,d);else if(d=by(o,a,d,g),d!==null){var w=Hn();Ur(d,o,g,w),Hy(d,a,g)}}function UC(o,a,d){var g=Ws(o),w={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(Uy(o))Vy(a,w);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=a.lastRenderedReducer,S!==null))try{var R=a.lastRenderedState,H=S(R,d);if(w.hasEagerState=!0,w.eagerState=H,_r(H,R)){var K=a.interleaved;K===null?(w.next=w,sp(a)):(w.next=K.next,K.next=w),a.interleaved=w;return}}catch{}finally{}d=by(o,a,w,g),d!==null&&(w=Hn(),Ur(d,o,g,w),Hy(d,a,g))}}function Uy(o){var a=o.alternate;return o===Yt||a!==null&&a===Yt}function Vy(o,a){Ya=Bc=!0;var d=o.pending;d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a}function Hy(o,a,d){if((d&4194240)!==0){var g=a.lanes;g&=o.pendingLanes,d|=g,a.lanes=d,Ra(o,d)}}var Hc={readContext:jr,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},VC={readContext:jr,useCallback:function(o,a){return Zr().memoizedState=[o,a===void 0?null:a],o},useContext:jr,useEffect:$y,useImperativeHandle:function(o,a,d){return d=d!=null?d.concat([o]):null,Uc(4194308,4,Oy.bind(null,a,o),d)},useLayoutEffect:function(o,a){return Uc(4194308,4,o,a)},useInsertionEffect:function(o,a){return Uc(4,2,o,a)},useMemo:function(o,a){var d=Zr();return a=a===void 0?null:a,o=o(),d.memoizedState=[o,a],o},useReducer:function(o,a,d){var g=Zr();return a=d!==void 0?d(a):a,g.memoizedState=g.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},g.queue=o,o=o.dispatch=BC.bind(null,Yt,o),[g.memoizedState,o]},useRef:function(o){var a=Zr();return o={current:o},a.memoizedState=o},useState:Ay,useDebugValue:xp,useDeferredValue:function(o){return Zr().memoizedState=o},useTransition:function(){var o=Ay(!1),a=o[0];return o=zC.bind(null,o[1]),Zr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,d){var g=Yt,w=Zr();if(Ht){if(d===void 0)throw Error(n(407));d=d()}else{if(d=a(),kn===null)throw Error(n(349));(Co&30)!==0||Cy(g,a,d)}w.memoizedState=d;var S={value:d,getSnapshot:a};return w.queue=S,$y(Ty.bind(null,g,S,o),[o]),g.flags|=2048,Qa(9,Ey.bind(null,g,S,d,a),void 0,null),d},useId:function(){var o=Zr(),a=kn.identifierPrefix;if(Ht){var d=vs,g=bs;d=(g&~(1<<32-ht(g)-1)).toString(32)+d,a=":"+a+"R"+d,d=Ja++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=FC++,a=":"+a+"r"+d.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},HC={readContext:jr,useCallback:My,useContext:jr,useEffect:gp,useImperativeHandle:_y,useInsertionEffect:Ly,useLayoutEffect:Iy,useMemo:Fy,useReducer:mp,useRef:Dy,useState:function(){return mp(Xa)},useDebugValue:xp,useDeferredValue:function(o){var a=kr();return zy(a,hn.memoizedState,o)},useTransition:function(){var o=mp(Xa)[0],a=kr().memoizedState;return[o,a]},useMutableSource:Sy,useSyncExternalStore:Ny,useId:By,unstable_isNewReconciler:!1},WC={readContext:jr,useCallback:My,useContext:jr,useEffect:gp,useImperativeHandle:_y,useInsertionEffect:Ly,useLayoutEffect:Iy,useMemo:Fy,useReducer:hp,useRef:Dy,useState:function(){return hp(Xa)},useDebugValue:xp,useDeferredValue:function(o){var a=kr();return hn===null?a.memoizedState=o:zy(a,hn.memoizedState,o)},useTransition:function(){var o=hp(Xa)[0],a=kr().memoizedState;return[o,a]},useMutableSource:Sy,useSyncExternalStore:Ny,useId:By,unstable_isNewReconciler:!1};function Fr(o,a){if(o&&o.defaultProps){a=A({},a),o=o.defaultProps;for(var d in o)a[d]===void 0&&(a[d]=o[d]);return a}return a}function yp(o,a,d,g){a=o.memoizedState,d=d(g,a),d=d==null?a:A({},a,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var Wc={isMounted:function(o){return(o=o._reactInternals)?Ir(o)===o:!1},enqueueSetState:function(o,a,d){o=o._reactInternals;var g=Hn(),w=Ws(o),S=js(g,w);S.payload=a,d!=null&&(S.callback=d),a=Bs(o,S,w),a!==null&&(Ur(a,o,w,g),_c(a,o,w))},enqueueReplaceState:function(o,a,d){o=o._reactInternals;var g=Hn(),w=Ws(o),S=js(g,w);S.tag=1,S.payload=a,d!=null&&(S.callback=d),a=Bs(o,S,w),a!==null&&(Ur(a,o,w,g),_c(a,o,w))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var d=Hn(),g=Ws(o),w=js(d,g);w.tag=2,a!=null&&(w.callback=a),a=Bs(o,w,g),a!==null&&(Ur(a,o,g,d),_c(a,o,g))}};function Wy(o,a,d,g,w,S,R){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,S,R):a.prototype&&a.prototype.isPureReactComponent?!Ma(d,g)||!Ma(w,S):!0}function Ky(o,a,d){var g=!1,w=Ms,S=a.contextType;return typeof S=="object"&&S!==null?S=jr(S):(w=Xn(a)?wo:Ln.current,g=a.contextTypes,S=(g=g!=null)?fi(o,w):Ms),a=new a(d,S),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Wc,o.stateNode=a,a._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=w,o.__reactInternalMemoizedMaskedChildContext=S),a}function qy(o,a,d,g){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,g),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,g),a.state!==o&&Wc.enqueueReplaceState(a,a.state,null)}function bp(o,a,d,g){var w=o.stateNode;w.props=d,w.state=o.memoizedState,w.refs={},op(o);var S=a.contextType;typeof S=="object"&&S!==null?w.context=jr(S):(S=Xn(a)?wo:Ln.current,w.context=fi(o,S)),w.state=o.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(yp(o,a,S,d),w.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(a=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),a!==w.state&&Wc.enqueueReplaceState(w,w.state,null),Mc(o,d,w,g),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308)}function vi(o,a){try{var d="",g=a;do d+=me(g),g=g.return;while(g);var w=d}catch(S){w=`
|
|
39
|
+
Error generating stack: `+S.message+`
|
|
40
|
+
`+S.stack}return{value:o,source:a,stack:w,digest:null}}function vp(o,a,d){return{value:o,source:null,stack:d??null,digest:a??null}}function wp(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var KC=typeof WeakMap=="function"?WeakMap:Map;function Gy(o,a,d){d=js(-1,d),d.tag=3,d.payload={element:null};var g=a.value;return d.callback=function(){Qc||(Qc=!0,Op=g),wp(o,a)},d}function Yy(o,a,d){d=js(-1,d),d.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var w=a.value;d.payload=function(){return g(w)},d.callback=function(){wp(o,a)}}var S=o.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(d.callback=function(){wp(o,a),typeof g!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var R=a.stack;this.componentDidCatch(a.value,{componentStack:R!==null?R:""})}),d}function Jy(o,a,d){var g=o.pingCache;if(g===null){g=o.pingCache=new KC;var w=new Set;g.set(a,w)}else w=g.get(a),w===void 0&&(w=new Set,g.set(a,w));w.has(d)||(w.add(d),o=iE.bind(null,o,a,d),a.then(o,o))}function Xy(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function Qy(o,a,d,g,w){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=js(-1,1),a.tag=2,Bs(d,a,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=w,o)}var qC=T.ReactCurrentOwner,Qn=!1;function Vn(o,a,d,g){a.child=o===null?yy(a,null,d,g):gi(a,o.child,d,g)}function Zy(o,a,d,g,w){d=d.render;var S=a.ref;return yi(a,w),g=fp(o,a,d,g,S,w),d=pp(),o!==null&&!Qn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~w,ks(o,a,w)):(Ht&&d&&Yf(a),a.flags|=1,Vn(o,a,g,w),a.child)}function eb(o,a,d,g,w){if(o===null){var S=d.type;return typeof S=="function"&&!Vp(S)&&S.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=S,tb(o,a,S,g,w)):(o=su(d.type,null,g,a,a.mode,w),o.ref=a.ref,o.return=a,a.child=o)}if(S=o.child,(o.lanes&w)===0){var R=S.memoizedProps;if(d=d.compare,d=d!==null?d:Ma,d(R,g)&&o.ref===a.ref)return ks(o,a,w)}return a.flags|=1,o=qs(S,g),o.ref=a.ref,o.return=a,a.child=o}function tb(o,a,d,g,w){if(o!==null){var S=o.memoizedProps;if(Ma(S,g)&&o.ref===a.ref)if(Qn=!1,a.pendingProps=g=S,(o.lanes&w)!==0)(o.flags&131072)!==0&&(Qn=!0);else return a.lanes=o.lanes,ks(o,a,w)}return jp(o,a,d,g,w)}function nb(o,a,d){var g=a.pendingProps,w=g.children,S=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(ji,fr),fr|=d;else{if((d&1073741824)===0)return o=S!==null?S.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,Rt(ji,fr),fr|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=S!==null?S.baseLanes:d,Rt(ji,fr),fr|=g}else S!==null?(g=S.baseLanes|d,a.memoizedState=null):g=d,Rt(ji,fr),fr|=g;return Vn(o,a,w,d),a.child}function rb(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function jp(o,a,d,g,w){var S=Xn(d)?wo:Ln.current;return S=fi(a,S),yi(a,w),d=fp(o,a,d,g,S,w),g=pp(),o!==null&&!Qn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~w,ks(o,a,w)):(Ht&&g&&Yf(a),a.flags|=1,Vn(o,a,d,w),a.child)}function sb(o,a,d,g,w){if(Xn(d)){var S=!0;Pc(a)}else S=!1;if(yi(a,w),a.stateNode===null)qc(o,a),Ky(a,d,g),bp(a,d,g,w),g=!0;else if(o===null){var R=a.stateNode,H=a.memoizedProps;R.props=H;var K=R.context,ce=d.contextType;typeof ce=="object"&&ce!==null?ce=jr(ce):(ce=Xn(d)?wo:Ln.current,ce=fi(a,ce));var we=d.getDerivedStateFromProps,je=typeof we=="function"||typeof R.getSnapshotBeforeUpdate=="function";je||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(H!==g||K!==ce)&&qy(a,R,g,ce),zs=!1;var ve=a.memoizedState;R.state=ve,Mc(a,g,R,w),K=a.memoizedState,H!==g||ve!==K||Jn.current||zs?(typeof we=="function"&&(yp(a,d,we,g),K=a.memoizedState),(H=zs||Wy(a,d,H,g,ve,K,ce))?(je||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(a.flags|=4194308)):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=g,a.memoizedState=K),R.props=g,R.state=K,R.context=ce,g=H):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),g=!1)}else{R=a.stateNode,vy(o,a),H=a.memoizedProps,ce=a.type===a.elementType?H:Fr(a.type,H),R.props=ce,je=a.pendingProps,ve=R.context,K=d.contextType,typeof K=="object"&&K!==null?K=jr(K):(K=Xn(d)?wo:Ln.current,K=fi(a,K));var Ie=d.getDerivedStateFromProps;(we=typeof Ie=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(H!==je||ve!==K)&&qy(a,R,g,K),zs=!1,ve=a.memoizedState,R.state=ve,Mc(a,g,R,w);var _e=a.memoizedState;H!==je||ve!==_e||Jn.current||zs?(typeof Ie=="function"&&(yp(a,d,Ie,g),_e=a.memoizedState),(ce=zs||Wy(a,d,ce,g,ve,_e,K)||!1)?(we||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(g,_e,K),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(g,_e,K)),typeof R.componentDidUpdate=="function"&&(a.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof R.componentDidUpdate!="function"||H===o.memoizedProps&&ve===o.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||H===o.memoizedProps&&ve===o.memoizedState||(a.flags|=1024),a.memoizedProps=g,a.memoizedState=_e),R.props=g,R.state=_e,R.context=K,g=ce):(typeof R.componentDidUpdate!="function"||H===o.memoizedProps&&ve===o.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||H===o.memoizedProps&&ve===o.memoizedState||(a.flags|=1024),g=!1)}return kp(o,a,d,g,S,w)}function kp(o,a,d,g,w,S){rb(o,a);var R=(a.flags&128)!==0;if(!g&&!R)return w&&cy(a,d,!1),ks(o,a,S);g=a.stateNode,qC.current=a;var H=R&&typeof d.getDerivedStateFromError!="function"?null:g.render();return a.flags|=1,o!==null&&R?(a.child=gi(a,o.child,null,S),a.child=gi(a,null,H,S)):Vn(o,a,H,S),a.memoizedState=g.state,w&&cy(a,d,!0),a.child}function ob(o){var a=o.stateNode;a.pendingContext?ay(o,a.pendingContext,a.pendingContext!==a.context):a.context&&ay(o,a.context,!1),ip(o,a.containerInfo)}function ib(o,a,d,g,w){return hi(),Zf(w),a.flags|=256,Vn(o,a,d,g),a.child}var Sp={dehydrated:null,treeContext:null,retryLane:0};function Np(o){return{baseLanes:o,cachePool:null,transitions:null}}function ab(o,a,d){var g=a.pendingProps,w=Gt.current,S=!1,R=(a.flags&128)!==0,H;if((H=R)||(H=o!==null&&o.memoizedState===null?!1:(w&2)!==0),H?(S=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(w|=1),Rt(Gt,w&1),o===null)return Qf(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((a.mode&1)===0?a.lanes=1:o.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(R=g.children,o=g.fallback,S?(g=a.mode,S=a.child,R={mode:"hidden",children:R},(g&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=R):S=ou(R,g,0,null),o=Ao(o,g,d,null),S.return=a,o.return=a,S.sibling=o,a.child=S,a.child.memoizedState=Np(d),a.memoizedState=Sp,o):Cp(a,R));if(w=o.memoizedState,w!==null&&(H=w.dehydrated,H!==null))return GC(o,a,R,g,H,w,d);if(S){S=g.fallback,R=a.mode,w=o.child,H=w.sibling;var K={mode:"hidden",children:g.children};return(R&1)===0&&a.child!==w?(g=a.child,g.childLanes=0,g.pendingProps=K,a.deletions=null):(g=qs(w,K),g.subtreeFlags=w.subtreeFlags&14680064),H!==null?S=qs(H,S):(S=Ao(S,R,d,null),S.flags|=2),S.return=a,g.return=a,g.sibling=S,a.child=g,g=S,S=a.child,R=o.child.memoizedState,R=R===null?Np(d):{baseLanes:R.baseLanes|d,cachePool:null,transitions:R.transitions},S.memoizedState=R,S.childLanes=o.childLanes&~d,a.memoizedState=Sp,g}return S=o.child,o=S.sibling,g=qs(S,{mode:"visible",children:g.children}),(a.mode&1)===0&&(g.lanes=d),g.return=a,g.sibling=null,o!==null&&(d=a.deletions,d===null?(a.deletions=[o],a.flags|=16):d.push(o)),a.child=g,a.memoizedState=null,g}function Cp(o,a){return a=ou({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function Kc(o,a,d,g){return g!==null&&Zf(g),gi(a,o.child,null,d),o=Cp(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function GC(o,a,d,g,w,S,R){if(d)return a.flags&256?(a.flags&=-257,g=vp(Error(n(422))),Kc(o,a,R,g)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(S=g.fallback,w=a.mode,g=ou({mode:"visible",children:g.children},w,0,null),S=Ao(S,w,R,null),S.flags|=2,g.return=a,S.return=a,g.sibling=S,a.child=g,(a.mode&1)!==0&&gi(a,o.child,null,R),a.child.memoizedState=Np(R),a.memoizedState=Sp,S);if((a.mode&1)===0)return Kc(o,a,R,null);if(w.data==="$!"){if(g=w.nextSibling&&w.nextSibling.dataset,g)var H=g.dgst;return g=H,S=Error(n(419)),g=vp(S,g,void 0),Kc(o,a,R,g)}if(H=(R&o.childLanes)!==0,Qn||H){if(g=kn,g!==null){switch(R&-R){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(g.suspendedLanes|R))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,ws(o,w),Ur(g,o,w,-1))}return Up(),g=vp(Error(n(421))),Kc(o,a,R,g)}return w.data==="$?"?(a.flags|=128,a.child=o.child,a=aE.bind(null,o),w._reactRetry=a,null):(o=S.treeContext,dr=Os(w.nextSibling),ur=a,Ht=!0,Mr=null,o!==null&&(vr[wr++]=bs,vr[wr++]=vs,vr[wr++]=jo,bs=o.id,vs=o.overflow,jo=a),a=Cp(a,g.children),a.flags|=4096,a)}function lb(o,a,d){o.lanes|=a;var g=o.alternate;g!==null&&(g.lanes|=a),rp(o.return,a,d)}function Ep(o,a,d,g,w){var S=o.memoizedState;S===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:w}:(S.isBackwards=a,S.rendering=null,S.renderingStartTime=0,S.last=g,S.tail=d,S.tailMode=w)}function cb(o,a,d){var g=a.pendingProps,w=g.revealOrder,S=g.tail;if(Vn(o,a,g.children,d),g=Gt.current,(g&2)!==0)g=g&1|2,a.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&lb(o,d,a);else if(o.tag===19)lb(o,d,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}g&=1}if(Rt(Gt,g),(a.mode&1)===0)a.memoizedState=null;else switch(w){case"forwards":for(d=a.child,w=null;d!==null;)o=d.alternate,o!==null&&Fc(o)===null&&(w=d),d=d.sibling;d=w,d===null?(w=a.child,a.child=null):(w=d.sibling,d.sibling=null),Ep(a,!1,w,d,S);break;case"backwards":for(d=null,w=a.child,a.child=null;w!==null;){if(o=w.alternate,o!==null&&Fc(o)===null){a.child=w;break}o=w.sibling,w.sibling=d,d=w,w=o}Ep(a,!0,d,null,S);break;case"together":Ep(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function qc(o,a){(a.mode&1)===0&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function ks(o,a,d){if(o!==null&&(a.dependencies=o.dependencies),Eo|=a.lanes,(d&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(n(153));if(a.child!==null){for(o=a.child,d=qs(o,o.pendingProps),a.child=d,d.return=a;o.sibling!==null;)o=o.sibling,d=d.sibling=qs(o,o.pendingProps),d.return=a;d.sibling=null}return a.child}function YC(o,a,d){switch(a.tag){case 3:ob(a),hi();break;case 5:ky(a);break;case 1:Xn(a.type)&&Pc(a);break;case 4:ip(a,a.stateNode.containerInfo);break;case 10:var g=a.type._context,w=a.memoizedProps.value;Rt(Ic,g._currentValue),g._currentValue=w;break;case 13:if(g=a.memoizedState,g!==null)return g.dehydrated!==null?(Rt(Gt,Gt.current&1),a.flags|=128,null):(d&a.child.childLanes)!==0?ab(o,a,d):(Rt(Gt,Gt.current&1),o=ks(o,a,d),o!==null?o.sibling:null);Rt(Gt,Gt.current&1);break;case 19:if(g=(d&a.childLanes)!==0,(o.flags&128)!==0){if(g)return cb(o,a,d);a.flags|=128}if(w=a.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Rt(Gt,Gt.current),g)break;return null;case 22:case 23:return a.lanes=0,nb(o,a,d)}return ks(o,a,d)}var ub,Tp,db,fb;ub=function(o,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Tp=function(){},db=function(o,a,d,g){var w=o.memoizedProps;if(w!==g){o=a.stateNode,No(Qr.current);var S=null;switch(d){case"input":w=Re(o,w),g=Re(o,g),S=[];break;case"select":w=A({},w,{value:void 0}),g=A({},g,{value:void 0}),S=[];break;case"textarea":w=Ye(o,w),g=Ye(o,g),S=[];break;default:typeof w.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=Cc)}yt(d,g);var R;d=null;for(ce in w)if(!g.hasOwnProperty(ce)&&w.hasOwnProperty(ce)&&w[ce]!=null)if(ce==="style"){var H=w[ce];for(R in H)H.hasOwnProperty(R)&&(d||(d={}),d[R]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?S||(S=[]):(S=S||[]).push(ce,null));for(ce in g){var K=g[ce];if(H=w!=null?w[ce]:void 0,g.hasOwnProperty(ce)&&K!==H&&(K!=null||H!=null))if(ce==="style")if(H){for(R in H)!H.hasOwnProperty(R)||K&&K.hasOwnProperty(R)||(d||(d={}),d[R]="");for(R in K)K.hasOwnProperty(R)&&H[R]!==K[R]&&(d||(d={}),d[R]=K[R])}else d||(S||(S=[]),S.push(ce,d)),d=K;else ce==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,H=H?H.__html:void 0,K!=null&&H!==K&&(S=S||[]).push(ce,K)):ce==="children"?typeof K!="string"&&typeof K!="number"||(S=S||[]).push(ce,""+K):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(K!=null&&ce==="onScroll"&&Ot("scroll",o),S||H===K||(S=[])):(S=S||[]).push(ce,K))}d&&(S=S||[]).push("style",d);var ce=S;(a.updateQueue=ce)&&(a.flags|=4)}},fb=function(o,a,d,g){d!==g&&(a.flags|=4)};function Za(o,a){if(!Ht)switch(o.tailMode){case"hidden":a=o.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function On(o){var a=o.alternate!==null&&o.alternate.child===o.child,d=0,g=0;if(a)for(var w=o.child;w!==null;)d|=w.lanes|w.childLanes,g|=w.subtreeFlags&14680064,g|=w.flags&14680064,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)d|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=g,o.childLanes=d,a}function JC(o,a,d){var g=a.pendingProps;switch(Jf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return On(a),null;case 1:return Xn(a.type)&&Tc(),On(a),null;case 3:return g=a.stateNode,bi(),_t(Jn),_t(Ln),cp(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&($c(a)?a.flags|=4:o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Mr!==null&&(Fp(Mr),Mr=null))),Tp(o,a),On(a),null;case 5:ap(a);var w=No(Ga.current);if(d=a.type,o!==null&&a.stateNode!=null)db(o,a,d,g,w),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!g){if(a.stateNode===null)throw Error(n(166));return On(a),null}if(o=No(Qr.current),$c(a)){g=a.stateNode,d=a.type;var S=a.memoizedProps;switch(g[Xr]=a,g[Va]=S,o=(a.mode&1)!==0,d){case"dialog":Ot("cancel",g),Ot("close",g);break;case"iframe":case"object":case"embed":Ot("load",g);break;case"video":case"audio":for(w=0;w<za.length;w++)Ot(za[w],g);break;case"source":Ot("error",g);break;case"img":case"image":case"link":Ot("error",g),Ot("load",g);break;case"details":Ot("toggle",g);break;case"input":O(g,S),Ot("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!S.multiple},Ot("invalid",g);break;case"textarea":St(g,S),Ot("invalid",g)}yt(d,S),w=null;for(var R in S)if(S.hasOwnProperty(R)){var H=S[R];R==="children"?typeof H=="string"?g.textContent!==H&&(S.suppressHydrationWarning!==!0&&Nc(g.textContent,H,o),w=["children",H]):typeof H=="number"&&g.textContent!==""+H&&(S.suppressHydrationWarning!==!0&&Nc(g.textContent,H,o),w=["children",""+H]):i.hasOwnProperty(R)&&H!=null&&R==="onScroll"&&Ot("scroll",g)}switch(d){case"input":fe(g),xe(g,S,!0);break;case"textarea":fe(g),st(g);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(g.onclick=Cc)}g=w,a.updateQueue=g,g!==null&&(a.flags|=4)}else{R=w.nodeType===9?w:w.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ae(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=R.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=R.createElement(d,{is:g.is}):(o=R.createElement(d),d==="select"&&(R=o,g.multiple?R.multiple=!0:g.size&&(R.size=g.size))):o=R.createElementNS(o,d),o[Xr]=a,o[Va]=g,ub(o,a,!1,!1),a.stateNode=o;e:{switch(R=kt(d,g),d){case"dialog":Ot("cancel",o),Ot("close",o),w=g;break;case"iframe":case"object":case"embed":Ot("load",o),w=g;break;case"video":case"audio":for(w=0;w<za.length;w++)Ot(za[w],o);w=g;break;case"source":Ot("error",o),w=g;break;case"img":case"image":case"link":Ot("error",o),Ot("load",o),w=g;break;case"details":Ot("toggle",o),w=g;break;case"input":O(o,g),w=Re(o,g),Ot("invalid",o);break;case"option":w=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},w=A({},g,{value:void 0}),Ot("invalid",o);break;case"textarea":St(o,g),w=Ye(o,g),Ot("invalid",o);break;default:w=g}yt(d,w),H=w;for(S in H)if(H.hasOwnProperty(S)){var K=H[S];S==="style"?tn(o,K):S==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Be(o,K)):S==="children"?typeof K=="string"?(d!=="textarea"||K!=="")&&Ge(o,K):typeof K=="number"&&Ge(o,""+K):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?K!=null&&S==="onScroll"&&Ot("scroll",o):K!=null&&N(o,S,K,R))}switch(d){case"input":fe(o),xe(o,g,!1);break;case"textarea":fe(o),st(o);break;case"option":g.value!=null&&o.setAttribute("value",""+de(g.value));break;case"select":o.multiple=!!g.multiple,S=g.value,S!=null?et(o,!!g.multiple,S,!1):g.defaultValue!=null&&et(o,!!g.multiple,g.defaultValue,!0);break;default:typeof w.onClick=="function"&&(o.onclick=Cc)}switch(d){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return On(a),null;case 6:if(o&&a.stateNode!=null)fb(o,a,o.memoizedProps,g);else{if(typeof g!="string"&&a.stateNode===null)throw Error(n(166));if(d=No(Ga.current),No(Qr.current),$c(a)){if(g=a.stateNode,d=a.memoizedProps,g[Xr]=a,(S=g.nodeValue!==d)&&(o=ur,o!==null))switch(o.tag){case 3:Nc(g.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Nc(g.nodeValue,d,(o.mode&1)!==0)}S&&(a.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Xr]=a,a.stateNode=g}return On(a),null;case 13:if(_t(Gt),g=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ht&&dr!==null&&(a.mode&1)!==0&&(a.flags&128)===0)hy(),hi(),a.flags|=98560,S=!1;else if(S=$c(a),g!==null&&g.dehydrated!==null){if(o===null){if(!S)throw Error(n(318));if(S=a.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[Xr]=a}else hi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;On(a),S=!1}else Mr!==null&&(Fp(Mr),Mr=null),S=!0;if(!S)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=d,a):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(Gt.current&1)!==0?gn===0&&(gn=3):Up())),a.updateQueue!==null&&(a.flags|=4),On(a),null);case 4:return bi(),Tp(o,a),o===null&&Ba(a.stateNode.containerInfo),On(a),null;case 10:return np(a.type._context),On(a),null;case 17:return Xn(a.type)&&Tc(),On(a),null;case 19:if(_t(Gt),S=a.memoizedState,S===null)return On(a),null;if(g=(a.flags&128)!==0,R=S.rendering,R===null)if(g)Za(S,!1);else{if(gn!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(R=Fc(o),R!==null){for(a.flags|=128,Za(S,!1),g=R.updateQueue,g!==null&&(a.updateQueue=g,a.flags|=4),a.subtreeFlags=0,g=d,d=a.child;d!==null;)S=d,o=g,S.flags&=14680066,R=S.alternate,R===null?(S.childLanes=0,S.lanes=o,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=R.childLanes,S.lanes=R.lanes,S.child=R.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=R.memoizedProps,S.memoizedState=R.memoizedState,S.updateQueue=R.updateQueue,S.type=R.type,o=R.dependencies,S.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Rt(Gt,Gt.current&1|2),a.child}o=o.sibling}S.tail!==null&&Pt()>ki&&(a.flags|=128,g=!0,Za(S,!1),a.lanes=4194304)}else{if(!g)if(o=Fc(R),o!==null){if(a.flags|=128,g=!0,d=o.updateQueue,d!==null&&(a.updateQueue=d,a.flags|=4),Za(S,!0),S.tail===null&&S.tailMode==="hidden"&&!R.alternate&&!Ht)return On(a),null}else 2*Pt()-S.renderingStartTime>ki&&d!==1073741824&&(a.flags|=128,g=!0,Za(S,!1),a.lanes=4194304);S.isBackwards?(R.sibling=a.child,a.child=R):(d=S.last,d!==null?d.sibling=R:a.child=R,S.last=R)}return S.tail!==null?(a=S.tail,S.rendering=a,S.tail=a.sibling,S.renderingStartTime=Pt(),a.sibling=null,d=Gt.current,Rt(Gt,g?d&1|2:d&1),a):(On(a),null);case 22:case 23:return Bp(),g=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(a.flags|=8192),g&&(a.mode&1)!==0?(fr&1073741824)!==0&&(On(a),a.subtreeFlags&6&&(a.flags|=8192)):On(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function XC(o,a){switch(Jf(a),a.tag){case 1:return Xn(a.type)&&Tc(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return bi(),_t(Jn),_t(Ln),cp(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return ap(a),null;case 13:if(_t(Gt),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(n(340));hi()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return _t(Gt),null;case 4:return bi(),null;case 10:return np(a.type._context),null;case 22:case 23:return Bp(),null;case 24:return null;default:return null}}var Gc=!1,_n=!1,QC=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function wi(o,a){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){Qt(o,a,g)}else d.current=null}function Pp(o,a,d){try{d()}catch(g){Qt(o,a,g)}}var pb=!1;function ZC(o,a){if(Bf=mc,o=Wx(),$f(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var w=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var R=0,H=-1,K=-1,ce=0,we=0,je=o,ve=null;t:for(;;){for(var Ie;je!==d||w!==0&&je.nodeType!==3||(H=R+w),je!==S||g!==0&&je.nodeType!==3||(K=R+g),je.nodeType===3&&(R+=je.nodeValue.length),(Ie=je.firstChild)!==null;)ve=je,je=Ie;for(;;){if(je===o)break t;if(ve===d&&++ce===w&&(H=R),ve===S&&++we===g&&(K=R),(Ie=je.nextSibling)!==null)break;je=ve,ve=je.parentNode}je=Ie}d=H===-1||K===-1?null:{start:H,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(Uf={focusedElem:o,selectionRange:d},mc=!1,Oe=a;Oe!==null;)if(a=Oe,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Oe=o;else for(;Oe!==null;){a=Oe;try{var _e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Fe=_e.memoizedProps,on=_e.memoizedState,se=a.stateNode,Y=se.getSnapshotBeforeUpdate(a.elementType===a.type?Fe:Fr(a.type,Fe),on);se.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var ie=a.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Qt(a,a.return,Ce)}if(o=a.sibling,o!==null){o.return=a.return,Oe=o;break}Oe=a.return}return _e=pb,pb=!1,_e}function el(o,a,d){var g=a.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var w=g=g.next;do{if((w.tag&o)===o){var S=w.destroy;w.destroy=void 0,S!==void 0&&Pp(a,d,S)}w=w.next}while(w!==g)}}function Yc(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&o)===o){var g=d.create;d.destroy=g()}d=d.next}while(d!==a)}}function Rp(o){var a=o.ref;if(a!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof a=="function"?a(o):a.current=o}}function mb(o){var a=o.alternate;a!==null&&(o.alternate=null,mb(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Xr],delete a[Va],delete a[Kf],delete a[IC],delete a[OC])),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 hb(o){return o.tag===5||o.tag===3||o.tag===4}function gb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||hb(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 Ap(o,a,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?d.nodeType===8?d.parentNode.insertBefore(o,a):d.insertBefore(o,a):(d.nodeType===8?(a=d.parentNode,a.insertBefore(o,d)):(a=d,a.appendChild(o)),d=d._reactRootContainer,d!=null||a.onclick!==null||(a.onclick=Cc));else if(g!==4&&(o=o.child,o!==null))for(Ap(o,a,d),o=o.sibling;o!==null;)Ap(o,a,d),o=o.sibling}function Dp(o,a,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?d.insertBefore(o,a):d.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(Dp(o,a,d),o=o.sibling;o!==null;)Dp(o,a,d),o=o.sibling}var En=null,zr=!1;function Us(o,a,d){for(d=d.child;d!==null;)xb(o,a,d),d=d.sibling}function xb(o,a,d){if(br&&typeof br.onCommitFiberUnmount=="function")try{br.onCommitFiberUnmount(ei,d)}catch{}switch(d.tag){case 5:_n||wi(d,a);case 6:var g=En,w=zr;En=null,Us(o,a,d),En=g,zr=w,En!==null&&(zr?(o=En,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):En.removeChild(d.stateNode));break;case 18:En!==null&&(zr?(o=En,d=d.stateNode,o.nodeType===8?Wf(o.parentNode,d):o.nodeType===1&&Wf(o,d),Da(o)):Wf(En,d.stateNode));break;case 4:g=En,w=zr,En=d.stateNode.containerInfo,zr=!0,Us(o,a,d),En=g,zr=w;break;case 0:case 11:case 14:case 15:if(!_n&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){w=g=g.next;do{var S=w,R=S.destroy;S=S.tag,R!==void 0&&((S&2)!==0||(S&4)!==0)&&Pp(d,a,R),w=w.next}while(w!==g)}Us(o,a,d);break;case 1:if(!_n&&(wi(d,a),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(H){Qt(d,a,H)}Us(o,a,d);break;case 21:Us(o,a,d);break;case 22:d.mode&1?(_n=(g=_n)||d.memoizedState!==null,Us(o,a,d),_n=g):Us(o,a,d);break;default:Us(o,a,d)}}function yb(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new QC),a.forEach(function(g){var w=lE.bind(null,o,g);d.has(g)||(d.add(g),g.then(w,w))})}}function Br(o,a){var d=a.deletions;if(d!==null)for(var g=0;g<d.length;g++){var w=d[g];try{var S=o,R=a,H=R;e:for(;H!==null;){switch(H.tag){case 5:En=H.stateNode,zr=!1;break e;case 3:En=H.stateNode.containerInfo,zr=!0;break e;case 4:En=H.stateNode.containerInfo,zr=!0;break e}H=H.return}if(En===null)throw Error(n(160));xb(S,R,w),En=null,zr=!1;var K=w.alternate;K!==null&&(K.return=null),w.return=null}catch(ce){Qt(w,a,ce)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)bb(a,o),a=a.sibling}function bb(o,a){var d=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Br(a,o),es(o),g&4){try{el(3,o,o.return),Yc(3,o)}catch(Fe){Qt(o,o.return,Fe)}try{el(5,o,o.return)}catch(Fe){Qt(o,o.return,Fe)}}break;case 1:Br(a,o),es(o),g&512&&d!==null&&wi(d,d.return);break;case 5:if(Br(a,o),es(o),g&512&&d!==null&&wi(d,d.return),o.flags&32){var w=o.stateNode;try{Ge(w,"")}catch(Fe){Qt(o,o.return,Fe)}}if(g&4&&(w=o.stateNode,w!=null)){var S=o.memoizedProps,R=d!==null?d.memoizedProps:S,H=o.type,K=o.updateQueue;if(o.updateQueue=null,K!==null)try{H==="input"&&S.type==="radio"&&S.name!=null&&W(w,S),kt(H,R);var ce=kt(H,S);for(R=0;R<K.length;R+=2){var we=K[R],je=K[R+1];we==="style"?tn(w,je):we==="dangerouslySetInnerHTML"?Be(w,je):we==="children"?Ge(w,je):N(w,we,je,ce)}switch(H){case"input":te(w,S);break;case"textarea":Bt(w,S);break;case"select":var ve=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var Ie=S.value;Ie!=null?et(w,!!S.multiple,Ie,!1):ve!==!!S.multiple&&(S.defaultValue!=null?et(w,!!S.multiple,S.defaultValue,!0):et(w,!!S.multiple,S.multiple?[]:"",!1))}w[Va]=S}catch(Fe){Qt(o,o.return,Fe)}}break;case 6:if(Br(a,o),es(o),g&4){if(o.stateNode===null)throw Error(n(162));w=o.stateNode,S=o.memoizedProps;try{w.nodeValue=S}catch(Fe){Qt(o,o.return,Fe)}}break;case 3:if(Br(a,o),es(o),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Da(a.containerInfo)}catch(Fe){Qt(o,o.return,Fe)}break;case 4:Br(a,o),es(o);break;case 13:Br(a,o),es(o),w=o.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(Ip=Pt())),g&4&&yb(o);break;case 22:if(we=d!==null&&d.memoizedState!==null,o.mode&1?(_n=(ce=_n)||we,Br(a,o),_n=ce):Br(a,o),es(o),g&8192){if(ce=o.memoizedState!==null,(o.stateNode.isHidden=ce)&&!we&&(o.mode&1)!==0)for(Oe=o,we=o.child;we!==null;){for(je=Oe=we;Oe!==null;){switch(ve=Oe,Ie=ve.child,ve.tag){case 0:case 11:case 14:case 15:el(4,ve,ve.return);break;case 1:wi(ve,ve.return);var _e=ve.stateNode;if(typeof _e.componentWillUnmount=="function"){g=ve,d=ve.return;try{a=g,_e.props=a.memoizedProps,_e.state=a.memoizedState,_e.componentWillUnmount()}catch(Fe){Qt(g,d,Fe)}}break;case 5:wi(ve,ve.return);break;case 22:if(ve.memoizedState!==null){jb(je);continue}}Ie!==null?(Ie.return=ve,Oe=Ie):jb(je)}we=we.sibling}e:for(we=null,je=o;;){if(je.tag===5){if(we===null){we=je;try{w=je.stateNode,ce?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(H=je.stateNode,K=je.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null,H.style.display=xt("display",R))}catch(Fe){Qt(o,o.return,Fe)}}}else if(je.tag===6){if(we===null)try{je.stateNode.nodeValue=ce?"":je.memoizedProps}catch(Fe){Qt(o,o.return,Fe)}}else if((je.tag!==22&&je.tag!==23||je.memoizedState===null||je===o)&&je.child!==null){je.child.return=je,je=je.child;continue}if(je===o)break e;for(;je.sibling===null;){if(je.return===null||je.return===o)break e;we===je&&(we=null),je=je.return}we===je&&(we=null),je.sibling.return=je.return,je=je.sibling}}break;case 19:Br(a,o),es(o),g&4&&yb(o);break;case 21:break;default:Br(a,o),es(o)}}function es(o){var a=o.flags;if(a&2){try{e:{for(var d=o.return;d!==null;){if(hb(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var w=g.stateNode;g.flags&32&&(Ge(w,""),g.flags&=-33);var S=gb(o);Dp(o,S,w);break;case 3:case 4:var R=g.stateNode.containerInfo,H=gb(o);Ap(o,H,R);break;default:throw Error(n(161))}}catch(K){Qt(o,o.return,K)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function eE(o,a,d){Oe=o,vb(o)}function vb(o,a,d){for(var g=(o.mode&1)!==0;Oe!==null;){var w=Oe,S=w.child;if(w.tag===22&&g){var R=w.memoizedState!==null||Gc;if(!R){var H=w.alternate,K=H!==null&&H.memoizedState!==null||_n;H=Gc;var ce=_n;if(Gc=R,(_n=K)&&!ce)for(Oe=w;Oe!==null;)R=Oe,K=R.child,R.tag===22&&R.memoizedState!==null?kb(w):K!==null?(K.return=R,Oe=K):kb(w);for(;S!==null;)Oe=S,vb(S),S=S.sibling;Oe=w,Gc=H,_n=ce}wb(o)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,Oe=S):wb(o)}}function wb(o){for(;Oe!==null;){var a=Oe;if((a.flags&8772)!==0){var d=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:_n||Yc(5,a);break;case 1:var g=a.stateNode;if(a.flags&4&&!_n)if(d===null)g.componentDidMount();else{var w=a.elementType===a.type?d.memoizedProps:Fr(a.type,d.memoizedProps);g.componentDidUpdate(w,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var S=a.updateQueue;S!==null&&jy(a,S,g);break;case 3:var R=a.updateQueue;if(R!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=a.child.stateNode;break;case 1:d=a.child.stateNode}jy(a,R,d)}break;case 5:var H=a.stateNode;if(d===null&&a.flags&4){d=H;var K=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&d.focus();break;case"img":K.src&&(d.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var ce=a.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var je=we.dehydrated;je!==null&&Da(je)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||a.flags&512&&Rp(a)}catch(ve){Qt(a,a.return,ve)}}if(a===o){Oe=null;break}if(d=a.sibling,d!==null){d.return=a.return,Oe=d;break}Oe=a.return}}function jb(o){for(;Oe!==null;){var a=Oe;if(a===o){Oe=null;break}var d=a.sibling;if(d!==null){d.return=a.return,Oe=d;break}Oe=a.return}}function kb(o){for(;Oe!==null;){var a=Oe;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Yc(4,a)}catch(K){Qt(a,d,K)}break;case 1:var g=a.stateNode;if(typeof g.componentDidMount=="function"){var w=a.return;try{g.componentDidMount()}catch(K){Qt(a,w,K)}}var S=a.return;try{Rp(a)}catch(K){Qt(a,S,K)}break;case 5:var R=a.return;try{Rp(a)}catch(K){Qt(a,R,K)}}}catch(K){Qt(a,a.return,K)}if(a===o){Oe=null;break}var H=a.sibling;if(H!==null){H.return=a.return,Oe=H;break}Oe=a.return}}var tE=Math.ceil,Jc=T.ReactCurrentDispatcher,$p=T.ReactCurrentOwner,Sr=T.ReactCurrentBatchConfig,pt=0,kn=null,un=null,Tn=0,fr=0,ji=_s(0),gn=0,tl=null,Eo=0,Xc=0,Lp=0,nl=null,Zn=null,Ip=0,ki=1/0,Ss=null,Qc=!1,Op=null,Vs=null,Zc=!1,Hs=null,eu=0,rl=0,_p=null,tu=-1,nu=0;function Hn(){return(pt&6)!==0?Pt():tu!==-1?tu:tu=Pt()}function Ws(o){return(o.mode&1)===0?1:(pt&2)!==0&&Tn!==0?Tn&-Tn:MC.transition!==null?(nu===0&&(nu=uc()),nu):(o=vt,o!==0||(o=window.event,o=o===void 0?16:Nx(o.type)),o)}function Ur(o,a,d,g){if(50<rl)throw rl=0,_p=null,Error(n(185));xo(o,d,g),((pt&2)===0||o!==kn)&&(o===kn&&((pt&2)===0&&(Xc|=d),gn===4&&Ks(o,Tn)),er(o,g),d===1&&pt===0&&(a.mode&1)===0&&(ki=Pt()+500,Rc&&Fs()))}function er(o,a){var d=o.callbackNode;wf(o,a);var g=go(o,o===kn?Tn:0);if(g===0)d!==null&&po(d),o.callbackNode=null,o.callbackPriority=0;else if(a=g&-g,o.callbackPriority!==a){if(d!=null&&po(d),a===1)o.tag===0?_C(Nb.bind(null,o)):uy(Nb.bind(null,o)),$C(function(){(pt&6)===0&&Fs()}),d=null;else{switch(dc(g)){case 1:d=Ca;break;case 4:d=lc;break;case 16:d=Bn;break;case 536870912:d=cc;break;default:d=Bn}d=$b(d,Sb.bind(null,o))}o.callbackPriority=a,o.callbackNode=d}}function Sb(o,a){if(tu=-1,nu=0,(pt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(Si()&&o.callbackNode!==d)return null;var g=go(o,o===kn?Tn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||a)a=ru(o,g);else{a=g;var w=pt;pt|=2;var S=Eb();(kn!==o||Tn!==a)&&(Ss=null,ki=Pt()+500,Po(o,a));do try{sE();break}catch(H){Cb(o,H)}while(!0);tp(),Jc.current=S,pt=w,un!==null?a=0:(kn=null,Tn=0,a=gn)}if(a!==0){if(a===2&&(w=Ta(o),w!==0&&(g=w,a=Mp(o,w))),a===1)throw d=tl,Po(o,0),Ks(o,g),er(o,Pt()),d;if(a===6)Ks(o,g);else{if(w=o.current.alternate,(g&30)===0&&!nE(w)&&(a=ru(o,g),a===2&&(S=Ta(o),S!==0&&(g=S,a=Mp(o,S))),a===1))throw d=tl,Po(o,0),Ks(o,g),er(o,Pt()),d;switch(o.finishedWork=w,o.finishedLanes=g,a){case 0:case 1:throw Error(n(345));case 2:Ro(o,Zn,Ss);break;case 3:if(Ks(o,g),(g&130023424)===g&&(a=Ip+500-Pt(),10<a)){if(go(o,0)!==0)break;if(w=o.suspendedLanes,(w&g)!==g){Hn(),o.pingedLanes|=o.suspendedLanes&w;break}o.timeoutHandle=Hf(Ro.bind(null,o,Zn,Ss),a);break}Ro(o,Zn,Ss);break;case 4:if(Ks(o,g),(g&4194240)===g)break;for(a=o.eventTimes,w=-1;0<g;){var R=31-ht(g);S=1<<R,R=a[R],R>w&&(w=R),g&=~S}if(g=w,g=Pt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*tE(g/1960))-g,10<g){o.timeoutHandle=Hf(Ro.bind(null,o,Zn,Ss),g);break}Ro(o,Zn,Ss);break;case 5:Ro(o,Zn,Ss);break;default:throw Error(n(329))}}}return er(o,Pt()),o.callbackNode===d?Sb.bind(null,o):null}function Mp(o,a){var d=nl;return o.current.memoizedState.isDehydrated&&(Po(o,a).flags|=256),o=ru(o,a),o!==2&&(a=Zn,Zn=d,a!==null&&Fp(a)),o}function Fp(o){Zn===null?Zn=o:Zn.push.apply(Zn,o)}function nE(o){for(var a=o;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var w=d[g],S=w.getSnapshot;w=w.value;try{if(!_r(S(),w))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ks(o,a){for(a&=~Lp,a&=~Xc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var d=31-ht(a),g=1<<d;o[d]=-1,a&=~g}}function Nb(o){if((pt&6)!==0)throw Error(n(327));Si();var a=go(o,0);if((a&1)===0)return er(o,Pt()),null;var d=ru(o,a);if(o.tag!==0&&d===2){var g=Ta(o);g!==0&&(a=g,d=Mp(o,g))}if(d===1)throw d=tl,Po(o,0),Ks(o,a),er(o,Pt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Ro(o,Zn,Ss),er(o,Pt()),null}function zp(o,a){var d=pt;pt|=1;try{return o(a)}finally{pt=d,pt===0&&(ki=Pt()+500,Rc&&Fs())}}function To(o){Hs!==null&&Hs.tag===0&&(pt&6)===0&&Si();var a=pt;pt|=1;var d=Sr.transition,g=vt;try{if(Sr.transition=null,vt=1,o)return o()}finally{vt=g,Sr.transition=d,pt=a,(pt&6)===0&&Fs()}}function Bp(){fr=ji.current,_t(ji)}function Po(o,a){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,DC(d)),un!==null)for(d=un.return;d!==null;){var g=d;switch(Jf(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Tc();break;case 3:bi(),_t(Jn),_t(Ln),cp();break;case 5:ap(g);break;case 4:bi();break;case 13:_t(Gt);break;case 19:_t(Gt);break;case 10:np(g.type._context);break;case 22:case 23:Bp()}d=d.return}if(kn=o,un=o=qs(o.current,null),Tn=fr=a,gn=0,tl=null,Lp=Xc=Eo=0,Zn=nl=null,So!==null){for(a=0;a<So.length;a++)if(d=So[a],g=d.interleaved,g!==null){d.interleaved=null;var w=g.next,S=d.pending;if(S!==null){var R=S.next;S.next=w,g.next=R}d.pending=g}So=null}return o}function Cb(o,a){do{var d=un;try{if(tp(),zc.current=Hc,Bc){for(var g=Yt.memoizedState;g!==null;){var w=g.queue;w!==null&&(w.pending=null),g=g.next}Bc=!1}if(Co=0,jn=hn=Yt=null,Ya=!1,Ja=0,$p.current=null,d===null||d.return===null){gn=1,tl=a,un=null;break}e:{var S=o,R=d.return,H=d,K=a;if(a=Tn,H.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ce=K,we=H,je=we.tag;if((we.mode&1)===0&&(je===0||je===11||je===15)){var ve=we.alternate;ve?(we.updateQueue=ve.updateQueue,we.memoizedState=ve.memoizedState,we.lanes=ve.lanes):(we.updateQueue=null,we.memoizedState=null)}var Ie=Xy(R);if(Ie!==null){Ie.flags&=-257,Qy(Ie,R,H,S,a),Ie.mode&1&&Jy(S,ce,a),a=Ie,K=ce;var _e=a.updateQueue;if(_e===null){var Fe=new Set;Fe.add(K),a.updateQueue=Fe}else _e.add(K);break e}else{if((a&1)===0){Jy(S,ce,a),Up();break e}K=Error(n(426))}}else if(Ht&&H.mode&1){var on=Xy(R);if(on!==null){(on.flags&65536)===0&&(on.flags|=256),Qy(on,R,H,S,a),Zf(vi(K,H));break e}}S=K=vi(K,H),gn!==4&&(gn=2),nl===null?nl=[S]:nl.push(S),S=R;do{switch(S.tag){case 3:S.flags|=65536,a&=-a,S.lanes|=a;var se=Gy(S,K,a);wy(S,se);break e;case 1:H=K;var Y=S.type,ie=S.stateNode;if((S.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||ie!==null&&typeof ie.componentDidCatch=="function"&&(Vs===null||!Vs.has(ie)))){S.flags|=65536,a&=-a,S.lanes|=a;var Ce=Yy(S,H,a);wy(S,Ce);break e}}S=S.return}while(S!==null)}Pb(d)}catch(Ue){a=Ue,un===d&&d!==null&&(un=d=d.return);continue}break}while(!0)}function Eb(){var o=Jc.current;return Jc.current=Hc,o===null?Hc:o}function Up(){(gn===0||gn===3||gn===2)&&(gn=4),kn===null||(Eo&268435455)===0&&(Xc&268435455)===0||Ks(kn,Tn)}function ru(o,a){var d=pt;pt|=2;var g=Eb();(kn!==o||Tn!==a)&&(Ss=null,Po(o,a));do try{rE();break}catch(w){Cb(o,w)}while(!0);if(tp(),pt=d,Jc.current=g,un!==null)throw Error(n(261));return kn=null,Tn=0,gn}function rE(){for(;un!==null;)Tb(un)}function sE(){for(;un!==null&&!gf();)Tb(un)}function Tb(o){var a=Db(o.alternate,o,fr);o.memoizedProps=o.pendingProps,a===null?Pb(o):un=a,$p.current=null}function Pb(o){var a=o;do{var d=a.alternate;if(o=a.return,(a.flags&32768)===0){if(d=JC(d,a,fr),d!==null){un=d;return}}else{if(d=XC(d,a),d!==null){d.flags&=32767,un=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{gn=6,un=null;return}}if(a=a.sibling,a!==null){un=a;return}un=a=o}while(a!==null);gn===0&&(gn=5)}function Ro(o,a,d){var g=vt,w=Sr.transition;try{Sr.transition=null,vt=1,oE(o,a,d,g)}finally{Sr.transition=w,vt=g}return null}function oE(o,a,d,g){do Si();while(Hs!==null);if((pt&6)!==0)throw Error(n(327));d=o.finishedWork;var w=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var S=d.lanes|d.childLanes;if(Pa(o,S),o===kn&&(un=kn=null,Tn=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Zc||(Zc=!0,$b(Bn,function(){return Si(),null})),S=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||S){S=Sr.transition,Sr.transition=null;var R=vt;vt=1;var H=pt;pt|=4,$p.current=null,ZC(o,d),bb(d,o),NC(Uf),mc=!!Bf,Uf=Bf=null,o.current=d,eE(d),Zo(),pt=H,vt=R,Sr.transition=S}else o.current=d;if(Zc&&(Zc=!1,Hs=o,eu=w),S=o.pendingLanes,S===0&&(Vs=null),bf(d.stateNode),er(o,Pt()),a!==null)for(g=o.onRecoverableError,d=0;d<a.length;d++)w=a[d],g(w.value,{componentStack:w.stack,digest:w.digest});if(Qc)throw Qc=!1,o=Op,Op=null,o;return(eu&1)!==0&&o.tag!==0&&Si(),S=o.pendingLanes,(S&1)!==0?o===_p?rl++:(rl=0,_p=o):rl=0,Fs(),null}function Si(){if(Hs!==null){var o=dc(eu),a=Sr.transition,d=vt;try{if(Sr.transition=null,vt=16>o?16:o,Hs===null)var g=!1;else{if(o=Hs,Hs=null,eu=0,(pt&6)!==0)throw Error(n(331));var w=pt;for(pt|=4,Oe=o.current;Oe!==null;){var S=Oe,R=S.child;if((Oe.flags&16)!==0){var H=S.deletions;if(H!==null){for(var K=0;K<H.length;K++){var ce=H[K];for(Oe=ce;Oe!==null;){var we=Oe;switch(we.tag){case 0:case 11:case 15:el(8,we,S)}var je=we.child;if(je!==null)je.return=we,Oe=je;else for(;Oe!==null;){we=Oe;var ve=we.sibling,Ie=we.return;if(mb(we),we===ce){Oe=null;break}if(ve!==null){ve.return=Ie,Oe=ve;break}Oe=Ie}}}var _e=S.alternate;if(_e!==null){var Fe=_e.child;if(Fe!==null){_e.child=null;do{var on=Fe.sibling;Fe.sibling=null,Fe=on}while(Fe!==null)}}Oe=S}}if((S.subtreeFlags&2064)!==0&&R!==null)R.return=S,Oe=R;else e:for(;Oe!==null;){if(S=Oe,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:el(9,S,S.return)}var se=S.sibling;if(se!==null){se.return=S.return,Oe=se;break e}Oe=S.return}}var Y=o.current;for(Oe=Y;Oe!==null;){R=Oe;var ie=R.child;if((R.subtreeFlags&2064)!==0&&ie!==null)ie.return=R,Oe=ie;else e:for(R=Y;Oe!==null;){if(H=Oe,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:Yc(9,H)}}catch(Ue){Qt(H,H.return,Ue)}if(H===R){Oe=null;break e}var Ce=H.sibling;if(Ce!==null){Ce.return=H.return,Oe=Ce;break e}Oe=H.return}}if(pt=w,Fs(),br&&typeof br.onPostCommitFiberRoot=="function")try{br.onPostCommitFiberRoot(ei,o)}catch{}g=!0}return g}finally{vt=d,Sr.transition=a}}return!1}function Rb(o,a,d){a=vi(d,a),a=Gy(o,a,1),o=Bs(o,a,1),a=Hn(),o!==null&&(xo(o,1,a),er(o,a))}function Qt(o,a,d){if(o.tag===3)Rb(o,o,d);else for(;a!==null;){if(a.tag===3){Rb(a,o,d);break}else if(a.tag===1){var g=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Vs===null||!Vs.has(g))){o=vi(d,o),o=Yy(a,o,1),a=Bs(a,o,1),o=Hn(),a!==null&&(xo(a,1,o),er(a,o));break}}a=a.return}}function iE(o,a,d){var g=o.pingCache;g!==null&&g.delete(a),a=Hn(),o.pingedLanes|=o.suspendedLanes&d,kn===o&&(Tn&d)===d&&(gn===4||gn===3&&(Tn&130023424)===Tn&&500>Pt()-Ip?Po(o,0):Lp|=d),er(o,a)}function Ab(o,a){a===0&&((o.mode&1)===0?a=1:(a=ho,ho<<=1,(ho&130023424)===0&&(ho=4194304)));var d=Hn();o=ws(o,a),o!==null&&(xo(o,a,d),er(o,d))}function aE(o){var a=o.memoizedState,d=0;a!==null&&(d=a.retryLane),Ab(o,d)}function lE(o,a){var d=0;switch(o.tag){case 13:var g=o.stateNode,w=o.memoizedState;w!==null&&(d=w.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(a),Ab(o,d)}var Db;Db=function(o,a,d){if(o!==null)if(o.memoizedProps!==a.pendingProps||Jn.current)Qn=!0;else{if((o.lanes&d)===0&&(a.flags&128)===0)return Qn=!1,YC(o,a,d);Qn=(o.flags&131072)!==0}else Qn=!1,Ht&&(a.flags&1048576)!==0&&dy(a,Dc,a.index);switch(a.lanes=0,a.tag){case 2:var g=a.type;qc(o,a),o=a.pendingProps;var w=fi(a,Ln.current);yi(a,d),w=fp(null,a,g,o,w,d);var S=pp();return a.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Xn(g)?(S=!0,Pc(a)):S=!1,a.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,op(a),w.updater=Wc,a.stateNode=w,w._reactInternals=a,bp(a,g,o,d),a=kp(null,a,g,!0,S,d)):(a.tag=0,Ht&&S&&Yf(a),Vn(null,a,w,d),a=a.child),a;case 16:g=a.elementType;e:{switch(qc(o,a),o=a.pendingProps,w=g._init,g=w(g._payload),a.type=g,w=a.tag=uE(g),o=Fr(g,o),w){case 0:a=jp(null,a,g,o,d);break e;case 1:a=sb(null,a,g,o,d);break e;case 11:a=Zy(null,a,g,o,d);break e;case 14:a=eb(null,a,g,Fr(g.type,o),d);break e}throw Error(n(306,g,""))}return a;case 0:return g=a.type,w=a.pendingProps,w=a.elementType===g?w:Fr(g,w),jp(o,a,g,w,d);case 1:return g=a.type,w=a.pendingProps,w=a.elementType===g?w:Fr(g,w),sb(o,a,g,w,d);case 3:e:{if(ob(a),o===null)throw Error(n(387));g=a.pendingProps,S=a.memoizedState,w=S.element,vy(o,a),Mc(a,g,null,d);var R=a.memoizedState;if(g=R.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},a.updateQueue.baseState=S,a.memoizedState=S,a.flags&256){w=vi(Error(n(423)),a),a=ib(o,a,g,d,w);break e}else if(g!==w){w=vi(Error(n(424)),a),a=ib(o,a,g,d,w);break e}else for(dr=Os(a.stateNode.containerInfo.firstChild),ur=a,Ht=!0,Mr=null,d=yy(a,null,g,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(hi(),g===w){a=ks(o,a,d);break e}Vn(o,a,g,d)}a=a.child}return a;case 5:return ky(a),o===null&&Qf(a),g=a.type,w=a.pendingProps,S=o!==null?o.memoizedProps:null,R=w.children,Vf(g,w)?R=null:S!==null&&Vf(g,S)&&(a.flags|=32),rb(o,a),Vn(o,a,R,d),a.child;case 6:return o===null&&Qf(a),null;case 13:return ab(o,a,d);case 4:return ip(a,a.stateNode.containerInfo),g=a.pendingProps,o===null?a.child=gi(a,null,g,d):Vn(o,a,g,d),a.child;case 11:return g=a.type,w=a.pendingProps,w=a.elementType===g?w:Fr(g,w),Zy(o,a,g,w,d);case 7:return Vn(o,a,a.pendingProps,d),a.child;case 8:return Vn(o,a,a.pendingProps.children,d),a.child;case 12:return Vn(o,a,a.pendingProps.children,d),a.child;case 10:e:{if(g=a.type._context,w=a.pendingProps,S=a.memoizedProps,R=w.value,Rt(Ic,g._currentValue),g._currentValue=R,S!==null)if(_r(S.value,R)){if(S.children===w.children&&!Jn.current){a=ks(o,a,d);break e}}else for(S=a.child,S!==null&&(S.return=a);S!==null;){var H=S.dependencies;if(H!==null){R=S.child;for(var K=H.firstContext;K!==null;){if(K.context===g){if(S.tag===1){K=js(-1,d&-d),K.tag=2;var ce=S.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?K.next=K:(K.next=we.next,we.next=K),ce.pending=K}}S.lanes|=d,K=S.alternate,K!==null&&(K.lanes|=d),rp(S.return,d,a),H.lanes|=d;break}K=K.next}}else if(S.tag===10)R=S.type===a.type?null:S.child;else if(S.tag===18){if(R=S.return,R===null)throw Error(n(341));R.lanes|=d,H=R.alternate,H!==null&&(H.lanes|=d),rp(R,d,a),R=S.sibling}else R=S.child;if(R!==null)R.return=S;else for(R=S;R!==null;){if(R===a){R=null;break}if(S=R.sibling,S!==null){S.return=R.return,R=S;break}R=R.return}S=R}Vn(o,a,w.children,d),a=a.child}return a;case 9:return w=a.type,g=a.pendingProps.children,yi(a,d),w=jr(w),g=g(w),a.flags|=1,Vn(o,a,g,d),a.child;case 14:return g=a.type,w=Fr(g,a.pendingProps),w=Fr(g.type,w),eb(o,a,g,w,d);case 15:return tb(o,a,a.type,a.pendingProps,d);case 17:return g=a.type,w=a.pendingProps,w=a.elementType===g?w:Fr(g,w),qc(o,a),a.tag=1,Xn(g)?(o=!0,Pc(a)):o=!1,yi(a,d),Ky(a,g,w),bp(a,g,w,d),kp(null,a,g,!0,o,d);case 19:return cb(o,a,d);case 22:return nb(o,a,d)}throw Error(n(156,a.tag))};function $b(o,a){return Qo(o,a)}function cE(o,a,d,g){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(o,a,d,g){return new cE(o,a,d,g)}function Vp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function uE(o){if(typeof o=="function")return Vp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===q)return 14}return 2}function qs(o,a){var d=o.alternate;return d===null?(d=Nr(o.tag,a,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=a,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,a=o.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function su(o,a,d,g,w,S){var R=2;if(g=o,typeof o=="function")Vp(o)&&(R=1);else if(typeof o=="string")R=5;else e:switch(o){case $:return Ao(d.children,w,S,a);case D:R=8,w|=8;break;case J:return o=Nr(12,d,a,w|2),o.elementType=J,o.lanes=S,o;case X:return o=Nr(13,d,a,w),o.elementType=X,o.lanes=S,o;case B:return o=Nr(19,d,a,w),o.elementType=B,o.lanes=S,o;case le:return ou(d,w,S,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case ee:R=10;break e;case M:R=9;break e;case U:R=11;break e;case q:R=14;break e;case Z:R=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return a=Nr(R,d,a,w),a.elementType=o,a.type=g,a.lanes=S,a}function Ao(o,a,d,g){return o=Nr(7,o,g,a),o.lanes=d,o}function ou(o,a,d,g){return o=Nr(22,o,g,a),o.elementType=le,o.lanes=d,o.stateNode={isHidden:!1},o}function Hp(o,a,d){return o=Nr(6,o,null,a),o.lanes=d,o}function Wp(o,a,d){return a=Nr(4,o.children!==null?o.children:[],o.key,a),a.lanes=d,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function dE(o,a,d,g,w){this.tag=a,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=Dn(0),this.expirationTimes=Dn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dn(0),this.identifierPrefix=g,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Kp(o,a,d,g,w,S,R,H,K){return o=new dE(o,a,d,H,K),a===1?(a=1,S===!0&&(a|=8)):a=0,S=Nr(3,null,null,a),o.current=S,S.stateNode=o,S.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},op(S),o}function fE(o,a,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:g==null?null:""+g,children:o,containerInfo:a,implementation:d}}function Lb(o){if(!o)return Ms;o=o._reactInternals;e:{if(Ir(o)!==o||o.tag!==1)throw Error(n(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Xn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(Xn(d))return ly(o,d,a)}return a}function Ib(o,a,d,g,w,S,R,H,K){return o=Kp(d,g,!0,o,w,S,R,H,K),o.context=Lb(null),d=o.current,g=Hn(),w=Ws(d),S=js(g,w),S.callback=a??null,Bs(d,S,w),o.current.lanes=w,xo(o,w,g),er(o,g),o}function iu(o,a,d,g){var w=a.current,S=Hn(),R=Ws(w);return d=Lb(d),a.context===null?a.context=d:a.pendingContext=d,a=js(S,R),a.payload={element:o},g=g===void 0?null:g,g!==null&&(a.callback=g),o=Bs(w,a,R),o!==null&&(Ur(o,w,R,S),_c(o,w,R)),R}function au(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 Ob(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<a?d:a}}function qp(o,a){Ob(o,a),(o=o.alternate)&&Ob(o,a)}function pE(){return null}var _b=typeof reportError=="function"?reportError:function(o){console.error(o)};function Gp(o){this._internalRoot=o}lu.prototype.render=Gp.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(n(409));iu(o,a,null,null)},lu.prototype.unmount=Gp.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;To(function(){iu(null,o,null,null)}),a[xs]=null}};function lu(o){this._internalRoot=o}lu.prototype.unstable_scheduleHydration=function(o){if(o){var a=ge();o={blockedOn:null,target:o,priority:a};for(var d=0;d<Or.length&&a!==0&&a<Or[d].priority;d++);Or.splice(d,0,o),d===0&&kx(o)}};function Yp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function cu(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Mb(){}function mE(o,a,d,g,w){if(w){if(typeof g=="function"){var S=g;g=function(){var ce=au(R);S.call(ce)}}var R=Ib(a,g,o,0,null,!1,!1,"",Mb);return o._reactRootContainer=R,o[xs]=R.current,Ba(o.nodeType===8?o.parentNode:o),To(),R}for(;w=o.lastChild;)o.removeChild(w);if(typeof g=="function"){var H=g;g=function(){var ce=au(K);H.call(ce)}}var K=Kp(o,0,!1,null,null,!1,!1,"",Mb);return o._reactRootContainer=K,o[xs]=K.current,Ba(o.nodeType===8?o.parentNode:o),To(function(){iu(a,K,d,g)}),K}function uu(o,a,d,g,w){var S=d._reactRootContainer;if(S){var R=S;if(typeof w=="function"){var H=w;w=function(){var K=au(R);H.call(K)}}iu(a,R,o,w)}else R=mE(d,a,o,w,g);return au(R)}Jr=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var d=gs(a.pendingLanes);d!==0&&(Ra(a,d|1),er(a,Pt()),(pt&6)===0&&(ki=Pt()+500,Fs()))}break;case 13:To(function(){var g=ws(o,1);if(g!==null){var w=Hn();Ur(g,o,1,w)}}),qp(o,1)}},F=function(o){if(o.tag===13){var a=ws(o,134217728);if(a!==null){var d=Hn();Ur(a,o,134217728,d)}qp(o,134217728)}},oe=function(o){if(o.tag===13){var a=Ws(o),d=ws(o,a);if(d!==null){var g=Hn();Ur(d,o,a,g)}qp(o,a)}},ge=function(){return vt},De=function(o,a){var d=vt;try{return vt=o,a()}finally{vt=d}},Je=function(o,a,d){switch(a){case"input":if(te(o,d),a=d.name,d.type==="radio"&&a!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<d.length;a++){var g=d[a];if(g!==o&&g.form===o.form){var w=Ec(g);if(!w)throw Error(n(90));Ve(g),te(g,w)}}}break;case"textarea":Bt(o,d);break;case"select":a=d.value,a!=null&&et(o,!!d.multiple,a,!1)}},qt=zp,rn=To;var hE={usingClientEntryPoint:!1,Events:[Ha,ui,Ec,Ut,An,zp]},sl={findFiberByHostInstance:vo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gE={bundleType:sl.bundleType,version:sl.version,rendererPackageName:sl.rendererPackageName,rendererConfig:sl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Jo(o),o===null?null:o.stateNode},findFiberByHostInstance:sl.findFiberByHostInstance||pE,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 du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!du.isDisabled&&du.supportsFiber)try{ei=du.inject(gE),br=du}catch{}}return tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hE,tr.createPortal=function(o,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yp(a))throw Error(n(200));return fE(o,a,null,d)},tr.createRoot=function(o,a){if(!Yp(o))throw Error(n(299));var d=!1,g="",w=_b;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(g=a.identifierPrefix),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=Kp(o,1,!1,null,null,d,!1,g,w),o[xs]=a.current,Ba(o.nodeType===8?o.parentNode:o),new Gp(a)},tr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=Jo(a),o=o===null?null:o.stateNode,o},tr.flushSync=function(o){return To(o)},tr.hydrate=function(o,a,d){if(!cu(a))throw Error(n(200));return uu(null,o,a,!0,d)},tr.hydrateRoot=function(o,a,d){if(!Yp(o))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,w=!1,S="",R=_b;if(d!=null&&(d.unstable_strictMode===!0&&(w=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onRecoverableError!==void 0&&(R=d.onRecoverableError)),a=Ib(a,null,o,1,d??null,w,!1,S,R),o[xs]=a.current,Ba(o),g)for(o=0;o<g.length;o++)d=g[o],w=d._getVersion,w=w(d._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[d,w]:a.mutableSourceEagerHydrationData.push(d,w);return new lu(a)},tr.render=function(o,a,d){if(!cu(a))throw Error(n(200));return uu(null,o,a,!1,d)},tr.unmountComponentAtNode=function(o){if(!cu(o))throw Error(n(40));return o._reactRootContainer?(To(function(){uu(null,null,o,!1,function(){o._reactRootContainer=null,o[xs]=null})}),!0):!1},tr.unstable_batchedUpdates=zp,tr.unstable_renderSubtreeIntoContainer=function(o,a,d,g){if(!cu(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return uu(o,a,d,!1,g)},tr.version="18.3.1-next-f1338f8080-20240426",tr}var qb;function Cj(){if(qb)return Qp.exports;qb=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(),Qp.exports=CE(),Qp.exports}var Gb;function EE(){if(Gb)return fu;Gb=1;var e=Cj();return fu.createRoot=e.createRoot,fu.hydrateRoot=e.hydrateRoot,fu}var TE=EE();/**
|
|
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 Yb="popstate";function Jb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function PE(e={}){function t(s,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:c,search:u,hash:p}=l||s.location;return Qm("",{pathname:c,search:u,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,i){return typeof i=="string"?i:Rl(i)}return AE(t,n,null,e)}function Jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Vr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RE(){return Math.random().toString(36).substring(2,10)}function Xb(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 Qm(e,t,n=null,s,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?oa(t):t,state:n,key:t&&t.key||s||RE(),unstable_mask:i}}function Rl({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 oa(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 AE(e,t,n,s={}){let{window:i=document.defaultView,v5Compat:l=!1}=s,c=i.history,u="POP",p=null,m=h();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function h(){return(c.state||{idx:null}).idx}function x(){u="POP";let v=h(),j=v==null?null:v-m;m=v,p&&p({action:u,location:k.location,delta:j})}function y(v,j){u="PUSH";let C=Jb(v)?v:Qm(k.location,v,j);m=h()+1;let N=Xb(C,m),T=k.createHref(C.unstable_mask||C);try{c.pushState(N,"",T)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(T)}l&&p&&p({action:u,location:k.location,delta:1})}function b(v,j){u="REPLACE";let C=Jb(v)?v:Qm(k.location,v,j);m=h();let N=Xb(C,m),T=k.createHref(C.unstable_mask||C);c.replaceState(N,"",T),l&&p&&p({action:u,location:k.location,delta:0})}function E(v){return DE(v)}let k={get action(){return u},get location(){return e(i,c)},listen(v){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(Yb,x),p=v,()=>{i.removeEventListener(Yb,x),p=null}},createHref(v){return t(i,v)},createURL:E,encodeLocation(v){let j=E(v);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:b,go(v){return c.go(v)}};return k}function DE(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Jt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Rl(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Ej(e,t,n="/"){return $E(e,t,n,!1)}function $E(e,t,n,s){let i=typeof t=="string"?oa(t):t,l=Es(i.pathname||"/",n);if(l==null)return null;let c=Tj(e);LE(c);let u=null;for(let p=0;u==null&&p<c.length;++p){let m=WE(l);u=VE(c[p],m,s)}return u}function Tj(e,t=[],n=[],s="",i=!1){let l=(c,u,p=i,m)=>{let h={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(s)&&p)return;Jt(h.relativePath.startsWith(s),`Absolute route path "${h.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(s.length)}let x=is([s,h.relativePath]),y=n.concat(h);c.children&&c.children.length>0&&(Jt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Tj(c.children,t,y,x,p)),!(c.path==null&&!c.index)&&t.push({path:x,score:BE(x,c.index),routesMeta:y})};return e.forEach((c,u)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,u);else for(let m of Pj(c.path))l(c,u,!0,m)}),t}function Pj(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return i?[l,""]:[l];let c=Pj(s.join("/")),u=[];return u.push(...c.map(p=>p===""?l:[l,p].join("/"))),i&&u.push(...c),u.map(p=>e.startsWith("/")&&p===""?"/":p)}function LE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:UE(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var IE=/^:[\w-]+$/,OE=3,_E=2,ME=1,FE=10,zE=-2,Qb=e=>e==="*";function BE(e,t){let n=e.split("/"),s=n.length;return n.some(Qb)&&(s+=zE),t&&(s+=_E),n.filter(i=>!Qb(i)).reduce((i,l)=>i+(IE.test(l)?OE:l===""?ME:FE),s)}function UE(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function VE(e,t,n=!1){let{routesMeta:s}=e,i={},l="/",c=[];for(let u=0;u<s.length;++u){let p=s[u],m=u===s.length-1,h=l==="/"?t:t.slice(l.length)||"/",x=Hu({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),y=p.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=Hu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(i,x.params),c.push({params:i,pathname:is([l,x.pathname]),pathnameBase:YE(is([l,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(l=is([l,x.pathnameBase]))}return c}function Hu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=HE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],c=l.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:s.reduce((m,{paramName:h,isOptional:x},y)=>{if(h==="*"){let E=u[y]||"";c=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const b=u[y];return x&&!b?m[h]=void 0:m[h]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function HE(e,t=!1,n=!0){Vr(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,p,m,h)=>{if(s.push({paramName:u,isOptional:p!=null}),p){let x=h.charAt(m+c.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function WE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vr(!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 Es(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 KE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qE(e,t="/"){let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?oa(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Zb(n.substring(1),"/"):l=Zb(n,t)):l=t,{pathname:l,search:JE(s),hash:XE(i)}}function Zb(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function tm(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 GE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Rj(e){let t=GE(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function zh(e,t,n,s=!1){let i;typeof e=="string"?i=oa(e):(i={...e},Jt(!i.pathname||!i.pathname.includes("?"),tm("?","pathname","search",i)),Jt(!i.pathname||!i.pathname.includes("#"),tm("#","pathname","hash",i)),Jt(!i.search||!i.search.includes("#"),tm("#","search","hash",i)));let l=e===""||i.pathname==="",c=l?"/":i.pathname,u;if(c==null)u=n;else{let x=t.length-1;if(!s&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),x-=1;i.pathname=y.join("/")}u=x>=0?t[x]:"/"}let p=qE(i,u),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var is=e=>e.join("/").replace(/\/\/+/g,"/"),YE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),JE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,XE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,QE=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 ZE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function e2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Aj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dj(e,t){let n=e;if(typeof n!="string"||!KE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(Aj)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=Es(c.pathname,t);c.origin===l.origin&&u!=null?n=u+c.search+c.hash:i=!0}catch{Vr(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $j=["POST","PUT","PATCH","DELETE"];new Set($j);var t2=["GET",...$j];new Set(t2);var ia=f.createContext(null);ia.displayName="DataRouter";var bd=f.createContext(null);bd.displayName="DataRouterState";var n2=f.createContext(!1),Lj=f.createContext({isTransitioning:!1});Lj.displayName="ViewTransition";var r2=f.createContext(new Map);r2.displayName="Fetchers";var s2=f.createContext(null);s2.displayName="Await";var $r=f.createContext(null);$r.displayName="Navigation";var Kl=f.createContext(null);Kl.displayName="Location";var qr=f.createContext({outlet:null,matches:[],isDataRoute:!1});qr.displayName="Route";var Bh=f.createContext(null);Bh.displayName="RouteError";var Ij="REACT_ROUTER_ERROR",o2="REDIRECT",i2="ROUTE_ERROR_RESPONSE";function a2(e){if(e.startsWith(`${Ij}:${o2}:{`))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 l2(e){if(e.startsWith(`${Ij}:${i2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new QE(t.status,t.statusText,t.data)}catch{}}function c2(e,{relative:t}={}){Jt(ql(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=f.useContext($r),{hash:i,pathname:l,search:c}=Gl(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:is([n,l])),s.createHref({pathname:u,search:c,hash:i})}function ql(){return f.useContext(Kl)!=null}function Wn(){return Jt(ql(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Kl).location}var Oj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _j(e){f.useContext($r).static||f.useLayoutEffect(e)}function $t(){let{isDataRoute:e}=f.useContext(qr);return e?S2():u2()}function u2(){Jt(ql(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(ia),{basename:t,navigator:n}=f.useContext($r),{matches:s}=f.useContext(qr),{pathname:i}=Wn(),l=JSON.stringify(Rj(s)),c=f.useRef(!1);return _j(()=>{c.current=!0}),f.useCallback((p,m={})=>{if(Vr(c.current,Oj),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=zh(p,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:is([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,i,e])}var d2=f.createContext(null);function f2(e){let t=f.useContext(qr).outlet;return f.useMemo(()=>t&&f.createElement(d2.Provider,{value:e},t),[t,e])}function Lt(){let{matches:e}=f.useContext(qr),t=e[e.length-1];return t?t.params:{}}function Gl(e,{relative:t}={}){let{matches:n}=f.useContext(qr),{pathname:s}=Wn(),i=JSON.stringify(Rj(n));return f.useMemo(()=>zh(e,JSON.parse(i),s,t==="path"),[e,i,s,t])}function p2(e,t){return Mj(e,t)}function Mj(e,t,n){var v;Jt(ql(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=f.useContext($r),{matches:i}=f.useContext(qr),l=i[i.length-1],c=l?l.params:{},u=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let j=m&&m.path||"";zj(u,!m||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let h=Wn(),x;if(t){let j=typeof t=="string"?oa(t):t;Jt(p==="/"||((v=j.pathname)==null?void 0:v.startsWith(p)),`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 "${p}" but pathname "${j.pathname}" was given in the \`location\` prop.`),x=j}else x=h;let y=x.pathname||"/",b=y;if(p!=="/"){let j=p.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(j.length).join("/")}let E=Ej(e,{pathname:b});Vr(m||E!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Vr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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 k=y2(E&&E.map(j=>Object.assign({},j,{params:Object.assign({},c,j.params),pathname:is([p,s.encodeLocation?s.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:is([p,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&k?f.createElement(Kl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},k):k}function m2(){let e=k2(),t=ZE(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)",i={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=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,c)}var h2=f.createElement(m2,null),Fj=class extends f.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=l2(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(qr.Provider,{value:this.props.routeContext},f.createElement(Bh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(g2,{error:e},t):t}};Fj.contextType=n2;var nm=new WeakMap;function g2({children:e,error:t}){let{basename:n}=f.useContext($r);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=a2(t.digest);if(s){let i=nm.get(t);if(i)throw i;let l=Dj(s.location,n);if(Aj&&!nm.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 nm.set(t,c),c}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function x2({routeContext:e,match:t,children:n}){let s=f.useContext(ia);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(qr.Provider,{value:e},n)}function y2(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 i=e,l=s==null?void 0:s.errors;if(l!=null){let h=i.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);Jt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let c=!1,u=-1;if(n&&s){c=s.renderFallback;for(let h=0;h<i.length;h++){let x=i[h];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(u=h),x.route.id){let{loaderData:y,errors:b}=s,E=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!b||b[x.route.id]===void 0);if(x.route.lazy||E){n.isStatic&&(c=!0),u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}}let p=n==null?void 0:n.onError,m=s&&p?(h,x)=>{var y,b;p(h,{location:s.location,params:((b=(y=s.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:e2(s.matches),errorInfo:x})}:void 0;return i.reduceRight((h,x,y)=>{let b,E=!1,k=null,v=null;s&&(b=l&&x.route.id?l[x.route.id]:void 0,k=x.route.errorElement||h2,c&&(u<0&&y===0?(zj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,v=null):u===y&&(E=!0,v=x.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,y+1)),C=()=>{let N;return b?N=k:E?N=v:x.route.Component?N=f.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=h,f.createElement(x2,{match:x,routeContext:{outlet:h,matches:j,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?f.createElement(Fj,{location:s.location,revalidation:s.revalidation,component:k,error:b,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:m}):C()},null)}function Uh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function b2(e){let t=f.useContext(ia);return Jt(t,Uh(e)),t}function v2(e){let t=f.useContext(bd);return Jt(t,Uh(e)),t}function w2(e){let t=f.useContext(qr);return Jt(t,Uh(e)),t}function Vh(e){let t=w2(e),n=t.matches[t.matches.length-1];return Jt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function j2(){return Vh("useRouteId")}function k2(){var s;let e=f.useContext(Bh),t=v2("useRouteError"),n=Vh("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function S2(){let{router:e}=b2("useNavigate"),t=Vh("useNavigate"),n=f.useRef(!1);return _j(()=>{n.current=!0}),f.useCallback(async(i,l={})=>{Vr(n.current,Oj),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var ev={};function zj(e,t,n){!t&&!ev[e]&&(ev[e]=!0,Vr(!1,n))}f.memo(N2);function N2({routes:e,future:t,state:n,isStatic:s,onError:i}){return Mj(e,void 0,{state:n,isStatic:s,onError:i})}function C2(e){return f2(e.context)}function ze(e){Jt(!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 E2({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:i,static:l=!1,unstable_useTransitions:c}){Jt(!ql(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:u,navigator:i,static:l,unstable_useTransitions:c,future:{}}),[u,i,l,c]);typeof n=="string"&&(n=oa(n));let{pathname:m="/",search:h="",hash:x="",state:y=null,key:b="default",unstable_mask:E}=n,k=f.useMemo(()=>{let v=Es(m,u);return v==null?null:{location:{pathname:v,search:h,hash:x,state:y,key:b,unstable_mask:E},navigationType:s}},[u,m,h,x,y,b,s,E]);return Vr(k!=null,`<Router basename="${u}"> is not able to match the URL "${m}${h}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:f.createElement($r.Provider,{value:p},f.createElement(Kl.Provider,{children:t,value:k}))}function T2({children:e,location:t}){return p2(Zm(e),t)}function Zm(e,t=[]){let n=[];return f.Children.forEach(e,(s,i)=>{if(!f.isValidElement(s))return;let l=[...t,i];if(s.type===f.Fragment){n.push.apply(n,Zm(s.props.children,l));return}Jt(s.type===ze,`[${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>`),Jt(!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=Zm(s.props.children,l)),n.push(c)}),n}var Au="get",Du="application/x-www-form-urlencoded";function vd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function P2(e){return vd(e)&&e.tagName.toLowerCase()==="button"}function R2(e){return vd(e)&&e.tagName.toLowerCase()==="form"}function A2(e){return vd(e)&&e.tagName.toLowerCase()==="input"}function D2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $2(e,t){return e.button===0&&(!t||t==="_self")&&!D2(e)}function eh(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(i=>[n,i]):[[n,s]])},[]))}function L2(e,t){let n=eh(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var pu=null;function I2(){if(pu===null)try{new FormData(document.createElement("form"),0),pu=!1}catch{pu=!0}return pu}var O2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rm(e){return e!=null&&!O2.has(e)?(Vr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Du}"`),null):e}function _2(e,t){let n,s,i,l,c;if(R2(e)){let u=e.getAttribute("action");s=u?Es(u,t):null,n=e.getAttribute("method")||Au,i=rm(e.getAttribute("enctype"))||Du,l=new FormData(e)}else if(P2(e)||A2(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||u.getAttribute("action");if(s=p?Es(p,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Au,i=rm(e.getAttribute("formenctype"))||rm(u.getAttribute("enctype"))||Du,l=new FormData(u,e),!I2()){let{name:m,type:h,value:x}=e;if(h==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,x)}}else{if(vd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Au,s=null,i=Du,c=e}return l&&i==="text/plain"&&(c=l,l=void 0),{action:s,method:n.toLowerCase(),encType:i,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function M2(e,t,n,s){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:t&&Es(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function F2(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 z2(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 B2(e,t,n){let s=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let c=await F2(l,n);return c.links?c.links():[]}return[]}));return W2(s.flat(1).filter(z2).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function tv(e,t,n,s,i,l){let c=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,u=(p,m)=>{var h;return n[m].pathname!==p.pathname||((h=n[m].route.path)==null?void 0:h.endsWith("*"))&&n[m].params["*"]!==p.params["*"]};return l==="assets"?t.filter((p,m)=>c(p,m)||u(p,m)):l==="data"?t.filter((p,m)=>{var x;let h=s.routes[p.route.id];if(!h||!h.hasLoader)return!1;if(c(p,m)||u(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function U2(e,t,{includeHydrateFallback:n}={}){return V2(e.map(s=>{let i=t.routes[s.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function V2(e){return[...new Set(e)]}function H2(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function W2(e,t){let n=new Set;return new Set(t),e.reduce((s,i)=>{let l=JSON.stringify(H2(i));return n.has(l)||(n.add(l),s.push({key:l,link:i})),s},[])}function Bj(){let e=f.useContext(ia);return Hh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function K2(){let e=f.useContext(bd);return Hh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wh=f.createContext(void 0);Wh.displayName="FrameworkContext";function Uj(){let e=f.useContext(Wh);return Hh(e,"You must render this element inside a <HydratedRouter> element"),e}function q2(e,t){let n=f.useContext(Wh),[s,i]=f.useState(!1),[l,c]=f.useState(!1),{onFocus:u,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:x}=t,y=f.useRef(null);f.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let k=j=>{j.forEach(C=>{c(C.isIntersecting)})},v=new IntersectionObserver(k,{threshold:.5});return y.current&&v.observe(y.current),()=>{v.disconnect()}}},[e]),f.useEffect(()=>{if(s){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[s]);let b=()=>{i(!0)},E=()=>{i(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:il(u,b),onBlur:il(p,E),onMouseEnter:il(m,b),onMouseLeave:il(h,E),onTouchStart:il(x,b)}]:[!1,y,{}]}function il(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function G2({page:e,...t}){let{router:n}=Bj(),s=f.useMemo(()=>Ej(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?f.createElement(J2,{page:e,matches:s,...t}):null}function Y2(e){let{manifest:t,routeModules:n}=Uj(),[s,i]=f.useState([]);return f.useEffect(()=>{let l=!1;return B2(e,t,n).then(c=>{l||i(c)}),()=>{l=!0}},[e,t,n]),s}function J2({page:e,matches:t,...n}){let s=Wn(),{future:i,manifest:l,routeModules:c}=Uj(),{basename:u}=Bj(),{loaderData:p,matches:m}=K2(),h=f.useMemo(()=>tv(e,t,m,l,s,"data"),[e,t,m,l,s]),x=f.useMemo(()=>tv(e,t,m,l,s,"assets"),[e,t,m,l,s]),y=f.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let k=new Set,v=!1;if(t.forEach(C=>{var T;let N=l.routes[C.route.id];!N||!N.hasLoader||(!h.some(L=>L.route.id===C.route.id)&&C.route.id in p&&((T=c[C.route.id])!=null&&T.shouldRevalidate)||N.hasClientLoader?v=!0:k.add(C.route.id))}),k.size===0)return[];let j=M2(e,u,i.unstable_trailingSlashAwareDataRequests,"data");return v&&k.size>0&&j.searchParams.set("_routes",t.filter(C=>k.has(C.route.id)).map(C=>C.route.id).join(",")),[j.pathname+j.search]},[u,i.unstable_trailingSlashAwareDataRequests,p,s,l,h,t,e,c]),b=f.useMemo(()=>U2(x,l),[x,l]),E=Y2(x);return f.createElement(f.Fragment,null,y.map(k=>f.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),b.map(k=>f.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),E.map(({key:k,link:v})=>f.createElement("link",{key:k,nonce:n.nonce,...v,crossOrigin:v.crossOrigin??n.crossOrigin})))}function X2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Q2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Q2&&(window.__reactRouterVersion="7.13.1")}catch{}function Z2({basename:e,children:t,unstable_useTransitions:n,window:s}){let i=f.useRef();i.current==null&&(i.current=PE({window:s,v5Compat:!0}));let l=i.current,[c,u]=f.useState({action:l.action,location:l.location}),p=f.useCallback(m=>{n===!1?u(m):f.startTransition(()=>u(m))},[n]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(E2,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var Vj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=f.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:i,reloadDocument:l,replace:c,unstable_mask:u,state:p,target:m,to:h,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:b,...E},k){let{basename:v,navigator:j,unstable_useTransitions:C}=f.useContext($r),N=typeof h=="string"&&Vj.test(h),T=Dj(h,v);h=T.to;let L=c2(h,{relative:i}),P=Wn(),$=null;if(u){let q=zh(u,[],P.unstable_mask?P.unstable_mask.pathname:"/",!0);v!=="/"&&(q.pathname=q.pathname==="/"?v:is([v,q.pathname])),$=j.createHref(q)}let[D,J,ee]=q2(s,E),M=rT(h,{replace:c,unstable_mask:u,state:p,target:m,preventScrollReset:x,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function U(q){t&&t(q),q.defaultPrevented||M(q)}let X=!(T.isExternal||l),B=f.createElement("a",{...E,...ee,href:(X?$:void 0)||T.absoluteURL||L,onClick:X?U:t,ref:X2(k,J),target:m,"data-discover":!N&&n==="render"?"true":void 0});return D&&!N?f.createElement(f.Fragment,null,B,f.createElement(G2,{page:L})):B});Ne.displayName="Link";var eT=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:i=!1,style:l,to:c,viewTransition:u,children:p,...m},h){let x=Gl(c,{relative:m.relative}),y=Wn(),b=f.useContext(bd),{navigator:E,basename:k}=f.useContext($r),v=b!=null&&lT(x)&&u===!0,j=E.encodeLocation?E.encodeLocation(x).pathname:x.pathname,C=y.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),N=N?N.toLowerCase():null,j=j.toLowerCase()),N&&k&&(N=Es(N,k)||N);const T=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let L=C===j||!i&&C.startsWith(j)&&C.charAt(T)==="/",P=N!=null&&(N===j||!i&&N.startsWith(j)&&N.charAt(j.length)==="/"),$={isActive:L,isPending:P,isTransitioning:v},D=L?t:void 0,J;typeof s=="function"?J=s($):J=[s,L?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let ee=typeof l=="function"?l($):l;return f.createElement(Ne,{...m,"aria-current":D,className:J,ref:h,style:ee,to:c,viewTransition:u},typeof p=="function"?p($):p)});eT.displayName="NavLink";var tT=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:i,state:l,method:c=Au,action:u,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:y,...b},E)=>{let{unstable_useTransitions:k}=f.useContext($r),v=iT(),j=aT(u,{relative:m}),C=c.toLowerCase()==="get"?"get":"post",N=typeof u=="string"&&Vj.test(u),T=L=>{if(p&&p(L),L.defaultPrevented)return;L.preventDefault();let P=L.nativeEvent.submitter,$=(P==null?void 0:P.getAttribute("formmethod"))||c,D=()=>v(P||L.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:i,state:l,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:y});k&&n!==!1?f.startTransition(()=>D()):D()};return f.createElement("form",{ref:E,method:C,action:j,onSubmit:s?p:T,...b,"data-discover":!N&&e==="render"?"true":void 0})});tT.displayName="Form";function nT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hj(e){let t=f.useContext(ia);return Jt(t,nT(e)),t}function rT(e,{target:t,replace:n,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=$t(),x=Wn(),y=Gl(e,{relative:c});return f.useCallback(b=>{if($2(b,t)){b.preventDefault();let E=n!==void 0?n:Rl(x)===Rl(y),k=()=>h(e,{replace:E,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p});m?f.startTransition(()=>k()):k()}},[x,h,y,n,s,i,t,e,l,c,u,p,m])}function fs(e){Vr(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=f.useRef(eh(e)),n=f.useRef(!1),s=Wn(),i=f.useMemo(()=>L2(s.search,n.current?null:t.current),[s.search]),l=$t(),c=f.useCallback((u,p)=>{const m=eh(typeof u=="function"?u(new URLSearchParams(i)):u);n.current=!0,l("?"+m,p)},[l,i]);return[i,c]}var sT=0,oT=()=>`__${String(++sT)}__`;function iT(){let{router:e}=Hj("useSubmit"),{basename:t}=f.useContext($r),n=j2(),s=e.fetch,i=e.navigate;return f.useCallback(async(l,c={})=>{let{action:u,method:p,encType:m,formData:h,body:x}=_2(l,t);if(c.navigate===!1){let y=c.fetcherKey||oT();await s(y,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:x,formMethod:c.method||p,formEncType:c.encType||m,flushSync:c.flushSync})}else await i(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:x,formMethod:c.method||p,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[s,i,t,n])}function aT(e,{relative:t}={}){let{basename:n}=f.useContext($r),s=f.useContext(qr);Jt(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),l={...Gl(e||".",{relative:t})},c=Wn();if(e==null){l.search=c.search;let u=new URLSearchParams(l.search),p=u.getAll("index");if(p.some(h=>h==="")){u.delete("index"),p.filter(x=>x).forEach(x=>u.append("index",x));let h=u.toString();l.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:is([n,l.pathname])),Rl(l)}function lT(e,{relative:t}={}){let n=f.useContext(Lj);Jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Hj("useViewTransitionState"),i=Gl(e,{relative:t});if(!n.isTransitioning)return!1;let l=Es(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=Es(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Hu(i.pathname,c)!=null||Hu(i.pathname,l)!=null}var Cs=Cj();const cT=yd(Cs);/**
|
|
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 uT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wj=(...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 dT={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 fT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:c,...u},p)=>f.createElement("svg",{ref:p,...dT,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Wj("lucide",i),...u},[...c.map(([m,h])=>f.createElement(m,h)),...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 $e=(e,t)=>{const n=f.forwardRef(({className:s,...i},l)=>f.createElement(fT,{ref:l,iconNode:t,className:Wj(`lucide-${uT(e)}`,s),...i}));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 wd=$e("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 Wu=$e("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
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 jd=$e("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
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 Kj=$e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
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 Yl=$e("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"}]]);/**
|
|
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 qj=$e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
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 Ku=$e("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
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 pT=$e("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"}]]);/**
|
|
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 Gj=$e("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"}]]);/**
|
|
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 kd=$e("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"}]]);/**
|
|
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 mT=$e("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"}]]);/**
|
|
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 Rs=$e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 cs=$e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 hT=$e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 gT=$e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 Yj=$e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 th=$e("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"}]]);/**
|
|
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 Kh=$e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 nh=$e("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
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 xT=$e("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
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 yT=$e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 bT=$e("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
|
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 vT=$e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 wT=$e("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 Sd=$e("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
|
|
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 jT=$e("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 Jj=$e("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"}]]);/**
|
|
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 Al=$e("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"}]]);/**
|
|
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 kT=$e("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"}]]);/**
|
|
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 ST=$e("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"}]]);/**
|
|
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 aa=$e("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"}]]);/**
|
|
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 nv=$e("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"}]]);/**
|
|
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 NT=$e("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"}]]);/**
|
|
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 CT=$e("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"}]]);/**
|
|
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 Xj=$e("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"}]]);/**
|
|
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 qh=$e("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"}]]);/**
|
|
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 ET=$e("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"}]]);/**
|
|
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 Gh=$e("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"}]]);/**
|
|
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 TT=$e("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"}]]);/**
|
|
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 Nd=$e("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"}]]);/**
|
|
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 PT=$e("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"}]]);/**
|
|
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 Yh=$e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 rh=$e("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"}]]);/**
|
|
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 Qj=$e("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
|
|
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 RT=$e("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"}]]);/**
|
|
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 AT=$e("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"}]]);/**
|
|
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 DT=$e("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"}]]);/**
|
|
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 $T=$e("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"}]]);/**
|
|
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 Jh=$e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 LT=$e("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"}]]);/**
|
|
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 Xh=$e("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"}]]);/**
|
|
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 IT=$e("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"}]]);/**
|
|
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 sm=$e("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"}]]);/**
|
|
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 Uo=$e("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"}]]);/**
|
|
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 OT=$e("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 en=$e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Zj=$e("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"}]]);/**
|
|
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 _T=$e("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
|
|
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 MT=$e("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
|
|
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 ea=$e("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"}]]);/**
|
|
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 Cd=$e("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"}]]);/**
|
|
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 FT=$e("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"}]]);/**
|
|
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 lo=$e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 zT=$e("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"}]]);/**
|
|
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 BT=$e("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"}]]);/**
|
|
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 UT=$e("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"}]]);/**
|
|
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 VT=$e("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"}]]);/**
|
|
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 Rr=$e("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"}]]);/**
|
|
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 rv=$e("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"}]]);/**
|
|
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 Qh=$e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 HT=$e("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"}]]);/**
|
|
427
|
+
* @license lucide-react v0.460.0 - ISC
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the ISC license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/const e0=$e("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"}]]);/**
|
|
432
|
+
* @license lucide-react v0.460.0 - ISC
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the ISC license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/const Bi=$e("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
437
|
+
* @license lucide-react v0.460.0 - ISC
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the ISC license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/const Kn=$e("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"}]]);/**
|
|
442
|
+
* @license lucide-react v0.460.0 - ISC
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the ISC license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/const Zh=$e("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"}]]);/**
|
|
447
|
+
* @license lucide-react v0.460.0 - ISC
|
|
448
|
+
*
|
|
449
|
+
* This source code is licensed under the ISC license.
|
|
450
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
+
*/const WT=$e("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"}]]);/**
|
|
452
|
+
* @license lucide-react v0.460.0 - ISC
|
|
453
|
+
*
|
|
454
|
+
* This source code is licensed under the ISC license.
|
|
455
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
+
*/const KT=$e("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"}]]);/**
|
|
457
|
+
* @license lucide-react v0.460.0 - ISC
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the ISC license.
|
|
460
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/const eg=$e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function t0(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=t0(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function qT(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=t0(e))&&(s&&(s+=" "),s+=t);return s}const tg="-",GT=e=>{const t=JT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const u=c.split(tg);return u[0]===""&&u.length!==1&&u.shift(),n0(u,t)||YT(c)},getConflictingClassGroupIds:(c,u)=>{const p=n[c]||[];return u&&s[c]?[...p,...s[c]]:p}}},n0=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),i=s?n0(e.slice(1),s):void 0;if(i)return i;if(t.validators.length===0)return;const l=e.join(tg);return(c=t.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},sv=/^\[(.+)\]$/,YT=e=>{if(sv.test(e)){const t=sv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},JT=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return QT(Object.entries(e.classGroups),n).forEach(([l,c])=>{sh(c,s,l,t)}),s},sh=(e,t,n,s)=>{e.forEach(i=>{if(typeof i=="string"){const l=i===""?t:ov(t,i);l.classGroupId=n;return}if(typeof i=="function"){if(XT(i)){sh(i(s),t,n,s);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([l,c])=>{sh(c,ov(t,l),n,s)})})},ov=(e,t)=>{let n=e;return t.split(tg).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},XT=e=>e.isThemeGetter,QT=(e,t)=>t?e.map(([n,s])=>{const i=s.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,u])=>[t+c,u])):l);return[n,i]}):e,ZT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const i=(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 i(l,c),c},set(l,c){n.has(l)?n.set(l,c):i(l,c)}}},r0="!",eP=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,i=t[0],l=t.length,c=u=>{const p=[];let m=0,h=0,x;for(let v=0;v<u.length;v++){let j=u[v];if(m===0){if(j===i&&(s||u.slice(v,v+l)===t)){p.push(u.slice(h,v)),h=v+l;continue}if(j==="/"){x=v;continue}}j==="["?m++:j==="]"&&m--}const y=p.length===0?u:u.substring(h),b=y.startsWith(r0),E=b?y.substring(1):y,k=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:k}};return n?u=>n({className:u,parseClassName:c}):c},tP=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},nP=e=>({cache:ZT(e.cacheSize),parseClassName:eP(e),...GT(e)}),rP=/\s+/,sP=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i}=t,l=[],c=e.trim().split(rP);let u="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}=n(m);let E=!!b,k=s(E?y.substring(0,b):y);if(!k){if(!E){u=m+(u.length>0?" "+u:u);continue}if(k=s(y),!k){u=m+(u.length>0?" "+u:u);continue}E=!1}const v=tP(h).join(":"),j=x?v+r0:v,C=j+k;if(l.includes(C))continue;l.push(C);const N=i(k,E);for(let T=0;T<N.length;++T){const L=N[T];l.push(j+L)}u=m+(u.length>0?" "+u:u)}return u};function oP(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=s0(t))&&(s&&(s+=" "),s+=n);return s}const s0=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=s0(e[s]))&&(n&&(n+=" "),n+=t);return n};function iP(e,...t){let n,s,i,l=c;function c(p){const m=t.reduce((h,x)=>x(h),e());return n=nP(m),s=n.cache.get,i=n.cache.set,l=u,u(p)}function u(p){const m=s(p);if(m)return m;const h=sP(p,n);return i(p,h),h}return function(){return l(oP.apply(null,arguments))}}const Mt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},o0=/^\[(?:([a-z-]+):)?(.+)\]$/i,aP=/^\d+\/\d+$/,lP=new Set(["px","full","screen"]),cP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uP=/\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$/,dP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=e=>Ui(e)||lP.has(e)||aP.test(e),Ys=e=>la(e,"length",wP),Ui=e=>!!e&&!Number.isNaN(Number(e)),om=e=>la(e,"number",Ui),al=e=>!!e&&Number.isInteger(Number(e)),mP=e=>e.endsWith("%")&&Ui(e.slice(0,-1)),nt=e=>o0.test(e),Js=e=>cP.test(e),hP=new Set(["length","size","percentage"]),gP=e=>la(e,hP,i0),xP=e=>la(e,"position",i0),yP=new Set(["image","url"]),bP=e=>la(e,yP,kP),vP=e=>la(e,"",jP),ll=()=>!0,la=(e,t,n)=>{const s=o0.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},wP=e=>uP.test(e)&&!dP.test(e),i0=()=>!1,jP=e=>fP.test(e),kP=e=>pP.test(e),SP=()=>{const e=Mt("colors"),t=Mt("spacing"),n=Mt("blur"),s=Mt("brightness"),i=Mt("borderColor"),l=Mt("borderRadius"),c=Mt("borderSpacing"),u=Mt("borderWidth"),p=Mt("contrast"),m=Mt("grayscale"),h=Mt("hueRotate"),x=Mt("invert"),y=Mt("gap"),b=Mt("gradientColorStops"),E=Mt("gradientColorStopPositions"),k=Mt("inset"),v=Mt("margin"),j=Mt("opacity"),C=Mt("padding"),N=Mt("saturate"),T=Mt("scale"),L=Mt("sepia"),P=Mt("skew"),$=Mt("space"),D=Mt("translate"),J=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",nt,t],U=()=>[nt,t],X=()=>["",Ns,Ys],B=()=>["auto",Ui,nt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",nt],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Ui,nt];return{cacheSize:500,separator:":",theme:{colors:[ll],spacing:[Ns,Ys],blur:["none","",Js,nt],brightness:z(),borderColor:[e],borderRadius:["none","","full",Js,nt],borderSpacing:U(),borderWidth:X(),contrast:z(),grayscale:G(),hueRotate:z(),invert:G(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[mP,Ys],inset:M(),margin:M(),opacity:z(),padding:U(),saturate:z(),scale:z(),sepia:G(),skew:z(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",nt]}],container:["container"],columns:[{columns:[Js]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...q(),nt]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",al,nt]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",nt]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",al,nt]}],"grid-cols":[{"grid-cols":[ll]}],"col-start-end":[{col:["auto",{span:["full",al,nt]},nt]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[ll]}],"row-start-end":[{row:["auto",{span:[al,nt]},nt]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",nt]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",nt,t]}],"min-w":[{"min-w":[nt,t,"min","max","fit"]}],"max-w":[{"max-w":[nt,t,"none","full","min","max","fit","prose",{screen:[Js]},Js]}],h:[{h:[nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Js,Ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",om]}],"font-family":[{font:[ll]}],"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",nt]}],"line-clamp":[{"line-clamp":["none",Ui,om]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ns,nt]}],"list-image":[{"list-image":["none",nt]}],"list-style-type":[{list:["none","disc","decimal",nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ns,Ys]}],"underline-offset":[{"underline-offset":["auto",Ns,nt]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt]}],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",nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),xP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],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:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[j]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[j]}],"divide-style":[{divide:Z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Ns,nt]}],"outline-w":[{outline:[Ns,Ys]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[Ns,Ys]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Js,vP]}],"shadow-color":[{shadow:[ll]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Js,nt]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[j]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"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",nt]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",nt]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[al,nt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",nt]}],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",nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ns,Ys,om]}],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"]}}},NP=iP(SP);function Te(...e){return NP(qT(e))}function Mn(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 Dr(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 a0(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function l0(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 c0(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 i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function qu(e){return e.toLocaleString("en-US")}function Gu(e){return`$${e.toFixed(4)}`}function CP(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return e;const[,n,s,i]=t,l=new Date(Number(n),Number(s)-1,Number(i));return Number.isNaN(l.getTime())?e:l.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Nn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function u0(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function EP(e){let t=u0(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/archive")?"/archive":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/inventories")?"/inventories":t.startsWith("/usage")?"/usage":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/views")?"/views":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function d0(e,t){return EP(e)===t}function f0(e){let n=u0(e).split("/").filter(Boolean);const s=[];let i="Overview",l=null,c="";if(n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,s.push({label:Nn(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0)return{title:i,breadcrumbs:s,projectSlug:l};if(n[0]==="projects"){if(s.push({label:"Projects",path:`${c}/projects`}),i="Projects",n[1]&&(l=n[1],s.push({label:Nn(n[1]),path:`${c}/projects/${n[1]}`}),i=Nn(n[1])),n[2]==="edit")i="Edit Project";else if(n[2]==="create"&&n[3]==="assignment")i="Create Assignment";else if(n[2]==="assignments"&&n[3])s.push({label:Nn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),i=Nn(n[3]),n[4]==="edit"?i="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?i="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?i="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?i="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(i="Append Decision");else if((n[2]==="memories"||n[2]==="resources")&&n[3]){const u=n[2]==="memories"?"Memories":"Resources",p=n[2]==="memories"?"/memories":"/resources";s.push({label:u,path:p}),s.push({label:Nn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),i=Nn(n[3]),n[4]==="edit"&&(i=n[2]==="memories"?"Edit Memory":"Edit Resource")}}else n[0]==="servers"?(i="Servers",s.push({label:"Servers",path:`${c}/servers`})):n[0]==="inventories"?(i="Inventories",s.push({label:"Inventories",path:`${c}/inventories`})):n[0]==="usage"?(i="Usage",s.push({label:"Usage",path:`${c}/usage`})):n[0]==="agent-sessions"?(i="Agent Sessions",s.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="assignments"?(i="Assignments",s.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="archive"?(i="Archive",s.push({label:"Archive",path:"/archive"})):n[0]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),i="Playbooks",n[1]==="create"?i="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:Nn(n[1]),path:`/playbooks/${n[1]}`}),i="Edit Playbook"):n[1]&&(s.push({label:Nn(n[1]),path:`/playbooks/${n[1]}`}),i=Nn(n[1]))):n[0]==="memories"?(s.push({label:"Memories",path:"/memories"}),i="Memories",n[1]==="new"&&(i="New Memory")):n[0]==="resources"?(s.push({label:"Resources",path:"/resources"}),i="Resources",n[1]==="new"&&(i="New Resource")):n[0]==="todos"?(i="Todos",s.push({label:"Todos",path:`${c}/todos`})):n[0]==="views"?(i="Saved Views",s.push({label:"Saved Views",path:`${c}/views`})):n[0]==="help"?(i="Help",s.push({label:"Help",path:"/help"})):n[0]==="settings"?(i="Settings",s.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(i="Create Project",s.push({label:"Create Project",path:`${c}/create/project`}));return{title:i,breadcrumbs:s,projectSlug:l}}function iv({items:e,onNavigate:t}){const n=Wn();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const i=s.icon,l=d0(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(Ne,{to:s.to,onClick:t,className:Te("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(i,{className:"h-4 w-4"}),r.jsx("span",{children:s.label})]},s.to)})})}const p0=[{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)"}}],TP=p0.map(e=>e.slug),Yu="default";function m0(e){return typeof e=="string"&&TP.includes(e)}const h0={preset:Yu,custom:!1};let yl=null,Ni=null;function ng(e){if(!e||typeof e!="object")return h0;const t=e;return{preset:m0(t.preset)?t.preset:Yu,custom:t.custom===!0}}function PP(){return yl?Promise.resolve(yl):Ni||(Ni=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=ng(e);return yl=t,Ni=null,t}).catch(()=>(Ni=null,h0)),Ni)}async function RP(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=ng(await t.json());return yl=n,n}async function AP(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=ng(await e.json());return yl=t,t}const oh="syntaur-theme",$u="syntaur-preset",g0=f.createContext(null);function ih(){try{const e=window.localStorage.getItem(oh);return e==="light"||e==="dark"?e:null}catch{return null}}function x0(){try{const e=window.localStorage.getItem($u);return m0(e)?e:Yu}catch{return Yu}}function y0(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function b0(e){document.documentElement.classList.toggle("dark",e==="dark")}function v0(e){document.documentElement.dataset.theme=e}function DP(){typeof document>"u"||(b0(ih()??y0()),v0(x0()))}function $P({children:e}){const[t,n]=f.useState(()=>ih()),[s,i]=f.useState(()=>ih()??y0()),[l,c]=f.useState(()=>x0());f.useEffect(()=>{b0(s)},[s]),f.useEffect(()=>{v0(l)},[l]),f.useEffect(()=>{let h=!1;return PP().then(x=>{if(!h&&x.preset!==l){c(x.preset);try{window.localStorage.setItem($u,x.preset)}catch{}}}),()=>{h=!0}},[]),f.useEffect(()=>{if(!window.matchMedia)return;const h=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||i(h.matches?"dark":"light")};return x(),h.addEventListener("change",x),()=>{h.removeEventListener("change",x)}},[t]);async function u(h){c(h);try{window.localStorage.setItem($u,h)}catch{}await RP(h)}async function p(){const h=await AP();c(h.preset);try{window.localStorage.setItem($u,h.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(oh,h),n(h),i(h)},toggleTheme:()=>{const h=s==="dark"?"light":"dark";window.localStorage.setItem(oh,h),n(h),i(h)},preset:l,setPreset:u,resetPreset:p};return r.jsx(g0.Provider,{value:m,children:e})}function rg(){const e=f.useContext(g0);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Lu=new Set;let rr=null,Vi=null;function LP(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function w0(){rr&&(rr.readyState===WebSocket.OPEN||rr.readyState===WebSocket.CONNECTING)||(rr=new WebSocket(LP()),rr.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of Lu)n(t)}catch{}},rr.onclose=()=>{rr=null,Vi&&clearTimeout(Vi),Vi=setTimeout(w0,2e3)},rr.onerror=()=>{rr==null||rr.close()})}function Jl(e){const t=f.useRef(e);t.current=e,f.useEffect(()=>{const n=s=>t.current(s);return Lu.add(n),w0(),()=>{Lu.delete(n),Lu.size===0&&rr&&(Vi&&clearTimeout(Vi),Vi=null,rr.close(),rr=null)}},[])}function Xt(e,t,n=!0,s=!1){const[i,l]=f.useState(null),[c,u]=f.useState(!0),[p,m]=f.useState(null),[h,x]=f.useState(0),y=n?e:null,b=f.useCallback(()=>{x(k=>k+1)},[]),E=f.useRef(y);return s&&E.current!==y&&(E.current=y,l(null),m(null)),f.useEffect(()=>{if(!y){u(!1),l(null);return}let k=!1;return u(!0),m(null),fetch(y).then(async v=>{if(!v.ok){const j=await v.json().catch(()=>null);throw new Error((j==null?void 0:j.error)||`HTTP ${v.status}`)}return v.json()}).then(v=>{k||(l(v),u(!1))}).catch(v=>{k||(m(v.message),u(!1))}),()=>{k=!0}},[y,h]),Jl(k=>{!t||!y||((k.type==="project-updated"||k.type==="assignment-updated")&&b(),k.type==="servers-updated"&&t==="servers"&&b(),k.type==="agent-sessions-updated"&&(t==="agent-sessions"||t==="overview")&&b(),k.type==="playbooks-updated"&&t==="playbooks"&&b(),k.type==="leases-updated"&&t==="inventories"&&b())}),{data:i,loading:c,error:p,refetch:b}}function Vo(e=!0){return Xt("/api/projects","projects",e)}function Ed(){return Xt("/api/workspaces","projects")}function ln(){const{workspace:e}=Lt();return e?`/w/${e}`:""}function IP(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 Xt(s,"overview")}function Td(e=!0){return Xt("/api/assignments","assignments",e)}function OP(e=!0){return Xt("/api/archived","assignments",e)}function j0(){return Xt("/api/help")}function k0(e){const t=e?`/api/projects/${e}`:null;return Xt(t,"project")}function _P(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return Xt(n,"assignment")}function MP(e){const t=e?`/api/assignments/${e}`:null;return Xt(t,"assignment")}function S0(e){return Xt(e)}function sg(e=!0){return Xt("/api/servers","servers",e)}function N0(){return Xt("/api/leases","inventories")}function C0(){return Xt("/api/agent-sessions","agent-sessions")}function FP(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return Xt(n,"agent-sessions")}function zP(e){const t=e?`/api/assignments/${e}/sessions`:null;return Xt(t,"agent-sessions")}function BP(e,t){const n=e&&t?`/api/usage/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}`:null;return Xt(n,void 0,!0,!0)}function UP(e){const t=e?`/api/usage/standalone/${encodeURIComponent(e)}`:null;return Xt(t,void 0,!0,!0)}function E0(e=!0){return Xt("/api/playbooks","playbooks",e)}function VP(e){const t=e?`/api/playbooks/${e}`:null;return Xt(t,"playbooks")}function HP(){return Xt("/api/memories","project")}function WP(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return Xt(n,"project")}function KP(){return Xt("/api/resources","project")}function qP(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return Xt(n,"project")}const Pd=["new-workspace","new-project","new-todo","new-assignment"];function GP(e){return typeof e=="string"&&Pd.includes(e)}const YP=["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","[","]"],JP=["mod","ctrl","alt","shift"];function sr(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(sr).filter(u=>u.length>0).join(" ");const n=t.split("+").map(u=>u.trim()).filter(u=>u.length>0);if(n.length===0)return"";if(n.length===1)return n[0].toLowerCase();const s=n[n.length-1].toLowerCase(),i=n.slice(0,-1).map(u=>u.toLowerCase()),l=new Set,c=[];for(const u of JP)i.includes(u)&&!l.has(u)&&(c.push(u),l.add(u));for(const u of i)l.has(u)||(c.push(u),l.add(u));return[...c,s].join("+")}function XP(e){const t=sr(e);return t?YP.includes(t):!1}const QP={"new-workspace":sr("Mod+Shift+Alt+w"),"new-project":sr("Mod+Shift+Alt+p"),"new-todo":sr("Mod+Shift+Alt+t"),"new-assignment":sr("Mod+Shift+Alt+a")};function ZP(e){const t={...QP};for(const n of Pd){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function Oo(){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 eR(e){const t=e.split("+").map(i=>i.trim()),n=t[t.length-1]??"",s=new Set(t.slice(0,-1).map(i=>i.toLowerCase()));return{key:n.toLowerCase(),mod:s.has("mod"),shift:s.has("shift"),alt:s.has("alt"),ctrl:s.has("ctrl")}}function mu(e,t){const n=eR(t);if(e.key.toLowerCase()!==n.key)return!1;const i=Oo()?e.metaKey:e.ctrlKey;return!(n.mod&&!i||!n.mod&&!n.ctrl&&i||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 T0(e){const t=[],n=Oo()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const s=e.key;let i;s===" "||s==="Spacebar"?i="space":(s.length,i=s.toLowerCase());const l=i.length===1&&/^[a-z0-9]$/.test(i);e.shiftKey&&l&&t.push("shift");const c=[...t,i].join("+");return sr(c)}function as(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?Oo()?"⌘":"Ctrl":s==="shift"?Oo()?"⇧":"Shift":s==="alt"?Oo()?"⌥":"Alt":s==="ctrl"?Oo()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(Oo()?"":"+")}function tR(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch(`/api/todos/${encodeURIComponent(e)}`);if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{i(!1)}},[e]);return f.useEffect(()=>{u()},[u]),Jl(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function P0(e=!0){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch("/api/todos");if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{i(!1)}},[]);return f.useEffect(()=>{if(!e){i(!1);return}u()},[u,e]),Jl(p=>{e&&p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}async function og(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 R0(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 A0(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 D0(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 $0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function nR(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function L0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function ig(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 i=null;try{i=s?JSON.parse(s):null}catch{}const l=(i==null?void 0:i.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function rR(e,t){return await ig(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function sR(e){return await ig("/api/todos/promote-bulk",e)}async function oR(e,t,n){await ig(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const iR=new Set(["/projects","/assignments","/servers","/todos"]);function Iu(e,t){return iR.has(e)?`${t}${e}`:e}const aR=[{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 lR(e){const t=[];for(const n of aR)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:Iu(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(i=>!!i),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:`${Iu("/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,i=Iu("/todos",s);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${i}?focus=${encodeURIComponent(n.id)}`})}return t}function mr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Ou(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function cR(e,t,n){const s=t?"disable":"enable",i=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${s}`,{method:"POST"});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.error||`Failed to ${s} playbook`)}n()}async function im(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 av(){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 lv(){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 am(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 Do(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
|
|
462
|
+
${t}: ${JSON.stringify(n)}
|
|
463
|
+
---
|
|
464
|
+
${e}`;const i=s[1],l=s[2],c=s[3],u=e.slice(s[0].length),p=JSON.stringify(n),m=new RegExp(`^${t}:\\s*.*$`,"m");let h;return m.test(l)?h=l.replace(m,`${t}: ${p}`):h=`${l}
|
|
465
|
+
${t}: ${p}`,`${i}${h}${c}${u}`}const uR=/^[a-z0-9][a-z0-9-]*$/;function dR(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:i,wsPrefix:l,refetchPlaybooks:c,navigate:u,toggleTheme:p}=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:uR,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(h,x)=>{const y=(h.name??"").trim();if(!y)throw new Error("Name is required");const b=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!b.ok){const E=await b.json().catch(()=>({}));throw new Error(E.error||`Failed to create workspace (HTTP ${b.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:h,hasUngrouped:x}=await av(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,hint:"workspace"});return y}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(h,x)=>{const y=(h.workspace??"").trim(),b=(h.title??"").trim();if(!b)throw new Error("Title is required");const E=mr(b);if(!E)throw new Error("Title must contain at least one alphanumeric character");let k=await am("/api/templates/project");k=Do(k,"slug",E),k=Do(k,"title",b),y&&y!=="_ungrouped"&&(k=Do(k,"workspace",y));const v=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),j=await v.json().catch(()=>({}));if(!v.ok)throw new Error(j.error||`Failed to create project (HTTP ${v.status})`);const C=y&&y!=="_ungrouped"?`/w/${y}/projects/${j.slug??E}`:`/projects/${j.slug??E}`;x.navigate(C)}}}),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:h},x]=await Promise.all([av(),lv()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,hint:"workspace"});for(const b of x){const E=b.workspace??"_ungrouped";y.push({value:E,label:`${b.title}`,hint:`project · ${b.workspace??"ungrouped"}`})}return y}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async h=>{const x=(h.scope??"_ungrouped").trim()||"_ungrouped",y=(h.description??"").trim();if(!y)throw new Error("Description is required");await og(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 h=await lv(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const y of h)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(h,x)=>{var N;const y=(h.project??"_standalone").trim()||"_standalone",b=(h.title??"").trim();if(!b)throw new Error("Title is required");const E=mr(b);if(!E)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let T=await am("/api/templates/assignment?standalone=1");T=Do(T,"slug",E),T=Do(T,"title",b);const L=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:T})}),P=await L.json().catch(()=>({}));if(!L.ok)throw new Error(P.error||`Failed to create assignment (HTTP ${L.status})`);const $=((N=P==null?void 0:P.assignment)==null?void 0:N.id)??(P==null?void 0:P.id);$?x.navigate(`/assignments/${$}`):x.navigate("/assignments");return}let k=await am("/api/templates/assignment");k=Do(k,"slug",E),k=Do(k,"title",b);const v=await fetch(`/api/projects/${encodeURIComponent(y)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),j=await v.json().catch(()=>({}));if(!v.ok)throw new Error(j.error||`Failed to create assignment (HTTP ${v.status})`);const C=j.slug??E;x.navigate(`/projects/${y}/assignments/${C}`)}}}),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:()=>u(`${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:()=>u(`${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:()=>u(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>u("/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 h=>{const x=h.trim();x&&await im("_ungrouped",x)}}}),l){const h=l.replace(/^\/w\//,"");m.push({id:`create-todo-workspace-${h}`,title:`New Todo in workspace ${h}`,subtitle:h,group:"Create",keywords:["new","create","todo","workspace",h],requiresInput:{placeholder:`Describe the todo for workspace ${h}…`,runWithInput:async x=>{const y=x.trim();y&&await im(h,y)}}})}n&&i&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${s??n}`,subtitle:`${n} · workspace ${i}`,group:"Create",keywords:["new","create","todo","project",n,i],requiresInput:{placeholder:`Describe the todo for project ${s??n}…`,runWithInput:async h=>{const x=h.trim();x&&await im(i,x)}}});for(const h of t)m.push({id:`toggle-playbook-${h.slug}`,title:`Toggle Playbook: ${h.name}`,subtitle:h.enabled?"enabled":"disabled",group:"Toggle",keywords:["toggle","playbook",h.slug,...h.tags??[]],run:()=>cR(h.slug,h.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>p()}),m}function Wt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function cv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rd(...e){return t=>{let n=!1;const s=e.map(i=>{const l=cv(i,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<s.length;i++){const l=s[i];typeof l=="function"?l():cv(e[i],null)}}}}function Fn(...e){return f.useCallback(Rd(...e),e)}function fR(e,t){const n=f.createContext(t),s=l=>{const{children:c,...u}=l,p=f.useMemo(()=>u,Object.values(u));return r.jsx(n.Provider,{value:p,children:c})};s.displayName=e+"Provider";function i(l){const c=f.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,i]}function Ho(e,t=[]){let n=[];function s(l,c){const u=f.createContext(c),p=n.length;n=[...n,c];const m=x=>{var j;const{scope:y,children:b,...E}=x,k=((j=y==null?void 0:y[e])==null?void 0:j[p])||u,v=f.useMemo(()=>E,Object.values(E));return r.jsx(k.Provider,{value:v,children:b})};m.displayName=l+"Provider";function h(x,y){var k;const b=((k=y==null?void 0:y[e])==null?void 0:k[p])||u,E=f.useContext(b);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,h]}const i=()=>{const l=n.map(c=>f.createContext(c));return function(u){const p=(u==null?void 0:u[e])||l;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return i.scopeName=e,[s,pR(i,...t)]}function pR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const c=s.reduce((u,{useScope:p,scopeName:m})=>{const x=p(l)[`__scope${m}`];return{...u,...x}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ro=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},mR=Nj[" useId ".trim().toString()]||(()=>{}),hR=0;function Hi(e){const[t,n]=f.useState(mR());return ro(()=>{n(s=>s??String(hR++))},[e]),e||(t?`radix-${t}`:"")}var gR=Nj[" useInsertionEffect ".trim().toString()]||ro;function Ad({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,l,c]=xR({defaultProp:t,onChange:n}),u=e!==void 0,p=u?e:i;{const h=f.useRef(e!==void 0);f.useEffect(()=>{const x=h.current;x!==u&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${u?"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.`),h.current=u},[u,s])}const m=f.useCallback(h=>{var x;if(u){const y=yR(h)?h(e):h;y!==e&&((x=c.current)==null||x.call(c,y))}else l(h)},[u,e,l,c]);return[p,m]}function xR({defaultProp:e,onChange:t}){const[n,s]=f.useState(e),i=f.useRef(n),l=f.useRef(t);return gR(()=>{l.current=t},[t]),f.useEffect(()=>{var c;i.current!==n&&((c=l.current)==null||c.call(l,n),i.current=n)},[n,i]),[n,s,l]}function yR(e){return typeof e=="function"}function bR(e){const t=vR(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(jR);if(p){const m=p.props.children,h=u.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function vR(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=SR(i),u=kR(l,i.props);return i.type!==f.Fragment&&(u.ref=s?Rd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wR=Symbol("radix.slottable");function jR(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wR}function kR(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function SR(e){var s,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=NR.reduce((e,t)=>{const n=bR(`Primitive.${t}`),s=f.forwardRef((i,l)=>{const{asChild:c,...u}=i,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(p,{...u,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function CR(e,t){e&&Cs.flushSync(()=>e.dispatchEvent(t))}function Fo(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function ER(e,t=globalThis==null?void 0:globalThis.document){const n=Fo(e);f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var TR="DismissableLayer",ah="dismissableLayer.update",PR="dismissableLayer.pointerDownOutside",RR="dismissableLayer.focusOutside",uv,I0=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ag=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...p}=e,m=f.useContext(I0),[h,x]=f.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=f.useState({}),E=Fn(t,$=>x($)),k=Array.from(m.layers),[v]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),j=k.indexOf(v),C=h?k.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,T=C>=j,L=$R($=>{const D=$.target,J=[...m.branches].some(ee=>ee.contains(D));!T||J||(i==null||i($),c==null||c($),$.defaultPrevented||u==null||u())},y),P=LR($=>{const D=$.target;[...m.branches].some(ee=>ee.contains(D))||(l==null||l($),c==null||c($),$.defaultPrevented||u==null||u())},y);return ER($=>{C===m.layers.size-1&&(s==null||s($),!$.defaultPrevented&&u&&($.preventDefault(),u()))},y),f.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(uv=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),dv(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=uv)}},[h,y,n,m]),f.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),dv())},[h,m]),f.useEffect(()=>{const $=()=>b({});return document.addEventListener(ah,$),()=>document.removeEventListener(ah,$)},[]),r.jsx(pn.div,{...p,ref:E,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:Wt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Wt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Wt(e.onPointerDownCapture,L.onPointerDownCapture)})});ag.displayName=TR;var AR="DismissableLayerBranch",DR=f.forwardRef((e,t)=>{const n=f.useContext(I0),s=f.useRef(null),i=Fn(t,s);return f.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(pn.div,{...e,ref:i})});DR.displayName=AR;function $R(e,t=globalThis==null?void 0:globalThis.document){const n=Fo(e),s=f.useRef(!1),i=f.useRef(()=>{});return f.useEffect(()=>{const l=u=>{if(u.target&&!s.current){let p=function(){O0(PR,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=p,t.addEventListener("click",i.current,{once:!0})):p()}else t.removeEventListener("click",i.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function LR(e,t=globalThis==null?void 0:globalThis.document){const n=Fo(e),s=f.useRef(!1);return f.useEffect(()=>{const i=l=>{l.target&&!s.current&&O0(RR,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function dv(){const e=new CustomEvent(ah);document.dispatchEvent(e)}function O0(e,t,n,{discrete:s}){const i=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?CR(i,l):i.dispatchEvent(l)}var lm="focusScope.autoFocusOnMount",cm="focusScope.autoFocusOnUnmount",fv={bubbles:!1,cancelable:!0},IR="FocusScope",_0=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...c}=e,[u,p]=f.useState(null),m=Fo(i),h=Fo(l),x=f.useRef(null),y=Fn(t,k=>p(k)),b=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let k=function(N){if(b.paused||!u)return;const T=N.target;u.contains(T)?x.current=T:eo(x.current,{select:!0})},v=function(N){if(b.paused||!u)return;const T=N.relatedTarget;T!==null&&(u.contains(T)||eo(x.current,{select:!0}))},j=function(N){if(document.activeElement===document.body)for(const L of N)L.removedNodes.length>0&&eo(u)};document.addEventListener("focusin",k),document.addEventListener("focusout",v);const C=new MutationObserver(j);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",v),C.disconnect()}}},[s,u,b.paused]),f.useEffect(()=>{if(u){mv.add(b);const k=document.activeElement;if(!u.contains(k)){const j=new CustomEvent(lm,fv);u.addEventListener(lm,m),u.dispatchEvent(j),j.defaultPrevented||(OR(BR(M0(u)),{select:!0}),document.activeElement===k&&eo(u))}return()=>{u.removeEventListener(lm,m),setTimeout(()=>{const j=new CustomEvent(cm,fv);u.addEventListener(cm,h),u.dispatchEvent(j),j.defaultPrevented||eo(k??document.body,{select:!0}),u.removeEventListener(cm,h),mv.remove(b)},0)}}},[u,m,h,b]);const E=f.useCallback(k=>{if(!n&&!s||b.paused)return;const v=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,j=document.activeElement;if(v&&j){const C=k.currentTarget,[N,T]=_R(C);N&&T?!k.shiftKey&&j===T?(k.preventDefault(),n&&eo(N,{select:!0})):k.shiftKey&&j===N&&(k.preventDefault(),n&&eo(T,{select:!0})):j===C&&k.preventDefault()}},[n,s,b.paused]);return r.jsx(pn.div,{tabIndex:-1,...c,ref:y,onKeyDown:E})});_0.displayName=IR;function OR(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(eo(s,{select:t}),document.activeElement!==n)return}function _R(e){const t=M0(e),n=pv(t,e),s=pv(t.reverse(),e);return[n,s]}function M0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pv(e,t){for(const n of e)if(!MR(n,{upTo:t}))return n}function MR(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 FR(e){return e instanceof HTMLInputElement&&"select"in e}function eo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&FR(e)&&t&&e.select()}}var mv=zR();function zR(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hv(e,t),e.unshift(t)},remove(t){var n;e=hv(e,t),(n=e[0])==null||n.resume()}}}function hv(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function BR(e){return e.filter(t=>t.tagName!=="A")}var UR="Portal",lg=f.forwardRef((e,t)=>{var u;const{container:n,...s}=e,[i,l]=f.useState(!1);ro(()=>l(!0),[]);const c=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?cT.createPortal(r.jsx(pn.div,{...s,ref:t}),c):null});lg.displayName=UR;function VR(e,t){return f.useReducer((n,s)=>t[n][s]??n,e)}var Wo=e=>{const{present:t,children:n}=e,s=HR(t),i=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),l=Fn(s.ref,WR(i));return typeof n=="function"||s.isPresent?f.cloneElement(i,{ref:l}):null};Wo.displayName="Presence";function HR(e){const[t,n]=f.useState(),s=f.useRef(null),i=f.useRef(e),l=f.useRef("none"),c=e?"mounted":"unmounted",[u,p]=VR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const m=hu(s.current);l.current=u==="mounted"?m:"none"},[u]),ro(()=>{const m=s.current,h=i.current;if(h!==e){const y=l.current,b=hu(m);e?p("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&y!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,p]),ro(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,x=b=>{const k=hu(s.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(p("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},y=b=>{b.target===t&&(l.current=hu(s.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function hu(e){return(e==null?void 0:e.animationName)||"none"}function WR(e){var s,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var um=0;function KR(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gv()),document.body.insertAdjacentElement("beforeend",e[1]??gv()),um++,()=>{um===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),um--}},[])}function gv(){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 rs=function(){return rs=Object.assign||function(t){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},rs.apply(this,arguments)};function F0(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 i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n}function qR(e,t,n){if(n||arguments.length===2)for(var s=0,i=t.length,l;s<i;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 _u="right-scroll-bar-position",Mu="width-before-scroll-bar",GR="with-scroll-bars-hidden",YR="--removed-body-scroll-bar-size";function dm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function JR(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=t,n.facade}var XR=typeof window<"u"?f.useLayoutEffect:f.useEffect,xv=new WeakMap;function QR(e,t){var n=JR(null,function(s){return e.forEach(function(i){return dm(i,s)})});return XR(function(){var s=xv.get(n);if(s){var i=new Set(s),l=new Set(e),c=n.current;i.forEach(function(u){l.has(u)||dm(u,null)}),l.forEach(function(u){i.has(u)||dm(u,c)})}xv.set(n,e)},[e]),n}function ZR(e){return e}function e3(e,t){t===void 0&&(t=ZR);var n=[],s=!1,i={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(u){return u!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(l),c=n}var p=function(){var h=c;c=[],h.forEach(l)},m=function(){return Promise.resolve().then(p)};m(),n={push:function(h){c.push(h),m()},filter:function(h){return c=c.filter(h),n}}}};return i}function t3(e){e===void 0&&(e={});var t=e3(null);return t.options=rs({async:!0,ssr:!1},e),t}var z0=function(e){var t=e.sideCar,n=F0(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 f.createElement(s,rs({},n))};z0.isSideCarExport=!0;function n3(e,t){return e.useMedium(t),z0}var B0=t3(),fm=function(){},Dd=f.forwardRef(function(e,t){var n=f.useRef(null),s=f.useState({onScrollCapture:fm,onWheelCapture:fm,onTouchMoveCapture:fm}),i=s[0],l=s[1],c=e.forwardProps,u=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,x=e.shards,y=e.sideCar,b=e.noRelative,E=e.noIsolation,k=e.inert,v=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,N=e.gapMode,T=F0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=y,P=QR([n,t]),$=rs(rs({},T),i);return f.createElement(f.Fragment,null,h&&f.createElement(L,{sideCar:B0,removeScrollBar:m,shards:x,noRelative:b,noIsolation:E,inert:k,setCallbacks:l,allowPinchZoom:!!v,lockRef:n,gapMode:N}),c?f.cloneElement(f.Children.only(u),rs(rs({},$),{ref:P})):f.createElement(C,rs({},$,{className:p,ref:P}),u))});Dd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Dd.classNames={fullWidth:Mu,zeroRight:_u};var r3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function s3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=r3();return t&&e.setAttribute("nonce",t),e}function o3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function i3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var a3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=s3())&&(o3(t,n),i3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},l3=function(){var e=a3();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},U0=function(){var e=l3(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},c3={left:0,top:0,right:0,gap:0},pm=function(e){return parseInt(e||"",10)||0},u3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[pm(n),pm(s),pm(i)]},d3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return c3;var t=u3(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])}},f3=U0(),Wi="data-scroll-locked",p3=function(e,t,n,s){var i=e.left,l=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
466
|
+
.`.concat(GR,` {
|
|
467
|
+
overflow: hidden `).concat(s,`;
|
|
468
|
+
padding-right: `).concat(u,"px ").concat(s,`;
|
|
469
|
+
}
|
|
470
|
+
body[`).concat(Wi,`] {
|
|
471
|
+
overflow: hidden `).concat(s,`;
|
|
472
|
+
overscroll-behavior: contain;
|
|
473
|
+
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
474
|
+
padding-left: `.concat(i,`px;
|
|
475
|
+
padding-top: `).concat(l,`px;
|
|
476
|
+
padding-right: `).concat(c,`px;
|
|
477
|
+
margin-left:0;
|
|
478
|
+
margin-top:0;
|
|
479
|
+
margin-right: `).concat(u,"px ").concat(s,`;
|
|
480
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.`).concat(_u,` {
|
|
484
|
+
right: `).concat(u,"px ").concat(s,`;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.`).concat(Mu,` {
|
|
488
|
+
margin-right: `).concat(u,"px ").concat(s,`;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.`).concat(_u," .").concat(_u,` {
|
|
492
|
+
right: 0 `).concat(s,`;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.`).concat(Mu," .").concat(Mu,` {
|
|
496
|
+
margin-right: 0 `).concat(s,`;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
body[`).concat(Wi,`] {
|
|
500
|
+
`).concat(YR,": ").concat(u,`px;
|
|
501
|
+
}
|
|
502
|
+
`)},yv=function(){var e=parseInt(document.body.getAttribute(Wi)||"0",10);return isFinite(e)?e:0},m3=function(){f.useEffect(function(){return document.body.setAttribute(Wi,(yv()+1).toString()),function(){var e=yv()-1;e<=0?document.body.removeAttribute(Wi):document.body.setAttribute(Wi,e.toString())}},[])},h3=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;m3();var l=f.useMemo(function(){return d3(i)},[i]);return f.createElement(f3,{styles:p3(l,!t,i,n?"":"!important")})},lh=!1;if(typeof window<"u")try{var gu=Object.defineProperty({},"passive",{get:function(){return lh=!0,!0}});window.addEventListener("test",gu,gu),window.removeEventListener("test",gu,gu)}catch{lh=!1}var Ci=lh?{passive:!1}:!1,g3=function(e){return e.tagName==="TEXTAREA"},V0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!g3(e)&&n[t]==="visible")},x3=function(e){return V0(e,"overflowY")},y3=function(e){return V0(e,"overflowX")},bv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=H0(e,s);if(i){var l=W0(e,s),c=l[1],u=l[2];if(c>u)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},b3=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},v3=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},H0=function(e,t){return e==="v"?x3(t):y3(t)},W0=function(e,t){return e==="v"?b3(t):v3(t)},w3=function(e,t){return e==="h"&&t==="rtl"?-1:1},j3=function(e,t,n,s,i){var l=w3(e,window.getComputedStyle(t).direction),c=l*s,u=n.target,p=t.contains(u),m=!1,h=c>0,x=0,y=0;do{if(!u)break;var b=W0(e,u),E=b[0],k=b[1],v=b[2],j=k-v-l*E;(E||j)&&H0(e,u)&&(x+=j,y+=E);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(h&&Math.abs(x)<1||!h&&Math.abs(y)<1)&&(m=!0),m},xu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vv=function(e){return[e.deltaX,e.deltaY]},wv=function(e){return e&&"current"in e?e.current:e},k3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},S3=function(e){return`
|
|
503
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
504
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
505
|
+
`)},N3=0,Ei=[];function C3(e){var t=f.useRef([]),n=f.useRef([0,0]),s=f.useRef(),i=f.useState(N3++)[0],l=f.useState(U0)[0],c=f.useRef(e);f.useEffect(function(){c.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var k=qR([e.lockRef.current],(e.shards||[]).map(wv),!0).filter(Boolean);return k.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),k.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(k,v){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!c.current.allowPinchZoom;var j=xu(k),C=n.current,N="deltaX"in k?k.deltaX:C[0]-j[0],T="deltaY"in k?k.deltaY:C[1]-j[1],L,P=k.target,$=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in k&&$==="h"&&P.type==="range")return!1;var D=window.getSelection(),J=D&&D.anchorNode,ee=J?J===P||J.contains(P):!1;if(ee)return!1;var M=bv($,P);if(!M)return!0;if(M?L=$:(L=$==="v"?"h":"v",M=bv($,P)),!M)return!1;if(!s.current&&"changedTouches"in k&&(N||T)&&(s.current=L),!L)return!0;var U=s.current||L;return j3(U,v,k,U==="h"?N:T)},[]),p=f.useCallback(function(k){var v=k;if(!(!Ei.length||Ei[Ei.length-1]!==l)){var j="deltaY"in v?vv(v):xu(v),C=t.current.filter(function(L){return L.name===v.type&&(L.target===v.target||v.target===L.shadowParent)&&k3(L.delta,j)})[0];if(C&&C.should){v.cancelable&&v.preventDefault();return}if(!C){var N=(c.current.shards||[]).map(wv).filter(Boolean).filter(function(L){return L.contains(v.target)}),T=N.length>0?u(v,N[0]):!c.current.noIsolation;T&&v.cancelable&&v.preventDefault()}}},[]),m=f.useCallback(function(k,v,j,C){var N={name:k,delta:v,target:j,should:C,shadowParent:E3(j)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(T){return T!==N})},1)},[]),h=f.useCallback(function(k){n.current=xu(k),s.current=void 0},[]),x=f.useCallback(function(k){m(k.type,vv(k),k.target,u(k,e.lockRef.current))},[]),y=f.useCallback(function(k){m(k.type,xu(k),k.target,u(k,e.lockRef.current))},[]);f.useEffect(function(){return Ei.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",p,Ci),document.addEventListener("touchmove",p,Ci),document.addEventListener("touchstart",h,Ci),function(){Ei=Ei.filter(function(k){return k!==l}),document.removeEventListener("wheel",p,Ci),document.removeEventListener("touchmove",p,Ci),document.removeEventListener("touchstart",h,Ci)}},[]);var b=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(l,{styles:S3(i)}):null,b?f.createElement(h3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function E3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const T3=n3(B0,C3);var K0=f.forwardRef(function(e,t){return f.createElement(Dd,rs({},e,{ref:t,sideCar:T3}))});K0.classNames=Dd.classNames;var P3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ti=new WeakMap,yu=new WeakMap,bu={},mm=0,q0=function(e){return e&&(e.host||q0(e.parentNode))},R3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=q0(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})},A3=function(e,t,n,s){var i=R3(t,Array.isArray(e)?e:[e]);bu[n]||(bu[n]=new WeakMap);var l=bu[n],c=[],u=new Set,p=new Set(i),m=function(x){!x||u.has(x)||(u.add(x),m(x.parentNode))};i.forEach(m);var h=function(x){!x||p.has(x)||Array.prototype.forEach.call(x.children,function(y){if(u.has(y))h(y);else try{var b=y.getAttribute(s),E=b!==null&&b!=="false",k=(Ti.get(y)||0)+1,v=(l.get(y)||0)+1;Ti.set(y,k),l.set(y,v),c.push(y),k===1&&E&&yu.set(y,!0),v===1&&y.setAttribute(n,"true"),E||y.setAttribute(s,"true")}catch(j){console.error("aria-hidden: cannot operate on ",y,j)}})};return h(t),u.clear(),mm++,function(){c.forEach(function(x){var y=Ti.get(x)-1,b=l.get(x)-1;Ti.set(x,y),l.set(x,b),y||(yu.has(x)||x.removeAttribute(s),yu.delete(x)),b||x.removeAttribute(n)}),mm--,mm||(Ti=new WeakMap,Ti=new WeakMap,yu=new WeakMap,bu={})}},D3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=P3(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),A3(s,i,n,"aria-hidden")):function(){return null}};function $3(e){const t=L3(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(O3);if(p){const m=p.props.children,h=u.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function L3(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=M3(i),u=_3(l,i.props);return i.type!==f.Fragment&&(u.ref=s?Rd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var I3=Symbol("radix.slottable");function O3(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===I3}function _3(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function M3(e){var s,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $d="Dialog",[G0,Y0]=Ho($d),[F3,Gr]=G0($d),J0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=f.useRef(null),p=f.useRef(null),[m,h]=Ad({prop:s,defaultProp:i??!1,onChange:l,caller:$d});return r.jsx(F3,{scope:t,triggerRef:u,contentRef:p,contentId:Hi(),titleId:Hi(),descriptionId:Hi(),open:m,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(x=>!x),[h]),modal:c,children:n})};J0.displayName=$d;var X0="DialogTrigger",Q0=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Gr(X0,n),l=Fn(t,i.triggerRef);return r.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dg(i.open),...s,ref:l,onClick:Wt(e.onClick,i.onOpenToggle)})});Q0.displayName=X0;var cg="DialogPortal",[z3,Z0]=G0(cg,{forceMount:void 0}),ek=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,l=Gr(cg,t);return r.jsx(z3,{scope:t,forceMount:n,children:f.Children.map(s,c=>r.jsx(Wo,{present:n||l.open,children:r.jsx(lg,{asChild:!0,container:i,children:c})}))})};ek.displayName=cg;var Ju="DialogOverlay",tk=f.forwardRef((e,t)=>{const n=Z0(Ju,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Gr(Ju,e.__scopeDialog);return l.modal?r.jsx(Wo,{present:s||l.open,children:r.jsx(U3,{...i,ref:t})}):null});tk.displayName=Ju;var B3=$3("DialogOverlay.RemoveScroll"),U3=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Gr(Ju,n);return r.jsx(K0,{as:B3,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(pn.div,{"data-state":dg(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),zo="DialogContent",nk=f.forwardRef((e,t)=>{const n=Z0(zo,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Gr(zo,e.__scopeDialog);return r.jsx(Wo,{present:s||l.open,children:l.modal?r.jsx(V3,{...i,ref:t}):r.jsx(H3,{...i,ref:t})})});nk.displayName=zo;var V3=f.forwardRef((e,t)=>{const n=Gr(zo,e.__scopeDialog),s=f.useRef(null),i=Fn(t,n.contentRef,s);return f.useEffect(()=>{const l=s.current;if(l)return D3(l)},[]),r.jsx(rk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Wt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Wt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&l.preventDefault()}),onFocusOutside:Wt(e.onFocusOutside,l=>l.preventDefault())})}),H3=f.forwardRef((e,t)=>{const n=Gr(zo,e.__scopeDialog),s=f.useRef(!1),i=f.useRef(!1);return r.jsx(rk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:l=>{var p,m;(p=e.onInteractOutside)==null||p.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),rk=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,...c}=e,u=Gr(zo,n),p=f.useRef(null),m=Fn(t,p);return KR(),r.jsxs(r.Fragment,{children:[r.jsx(_0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:l,children:r.jsx(ag,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":dg(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(K3,{titleId:u.titleId}),r.jsx(G3,{contentRef:p,descriptionId:u.descriptionId})]})]})}),ug="DialogTitle",sk=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Gr(ug,n);return r.jsx(pn.h2,{id:i.titleId,...s,ref:t})});sk.displayName=ug;var ok="DialogDescription",ik=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Gr(ok,n);return r.jsx(pn.p,{id:i.descriptionId,...s,ref:t})});ik.displayName=ok;var ak="DialogClose",lk=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Gr(ak,n);return r.jsx(pn.button,{type:"button",...s,ref:t,onClick:Wt(e.onClick,()=>i.onOpenChange(!1))})});lk.displayName=ak;function dg(e){return e?"open":"closed"}var ck="DialogTitleWarning",[W3,uk]=fR(ck,{contentName:zo,titleName:ug,docsSlug:"dialog"}),K3=({titleId:e})=>{const t=uk(ck),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
506
|
+
|
|
507
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
508
|
+
|
|
509
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},q3="DialogDescriptionWarning",G3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uk(q3).contentName}}.`;return f.useEffect(()=>{var l;const i=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},dk=J0,fk=Q0,pk=ek,fg=tk,pg=nk,mg=sk,hg=ik,gg=lk;const ir=dk,Y3=fk,J3=pk,X3=gg,mk=f.forwardRef(({className:e,...t},n)=>r.jsx(fg,{ref:n,className:Te("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));mk.displayName=fg.displayName;const qn=f.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(J3,{children:[r.jsx(mk,{}),r.jsx(pg,{ref:s,className:Te("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})]}));qn.displayName=pg.displayName;function Yr({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col space-y-2 text-left",e),...t})}function As({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Gn=f.forwardRef(({className:e,...t},n)=>r.jsx(mg,{ref:n,className:Te("text-lg font-semibold tracking-tight text-foreground",e),...t}));Gn.displayName=mg.displayName;const ps=f.forwardRef(({className:e,...t},n)=>r.jsx(hg,{ref:n,className:Te("text-sm leading-6 text-muted-foreground",e),...t}));ps.displayName=hg.displayName;const Q3=-1,Z3=-40;function hm(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,s=0,i=-2,l=0;for(let c=0;c<e.length;c++){const u=e[c];let p=!1;for(;s<t.length;)if(t[s]===u){if(n+=100,s===i+1&&(n+=20),s===0)n+=30;else{const m=t[s-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max(Z3,l*Q3)),i=s,l=0,s++,p=!0;break}else l++,s++;if(!p)return-1/0}return n}const jv={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function xg(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 u=hm(s,c.title.toLowerCase())*1,p=c.subtitle?hm(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?hm(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,h=Math.max(u,p,m);return{...c,score:h}}).filter(c=>c.score>-1/0);return l.sort((c,u)=>u.score!==c.score?u.score-c.score:c.title.length!==u.title.length?c.title.length-u.title.length:c.title!==u.title?c.title<u.title?-1:1:(jv[c.type]??99)-(jv[u.type]??99)),l.slice(0,n)}const eA={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function tA({entries:e}){const{paletteOpen:t,closePalette:n}=co(),s=$t(),[i,l]=f.useState(""),[c,u]=f.useState(0),p=f.useRef(null),m=f.useMemo(()=>xg(i,e,50),[i,e]);f.useEffect(()=>{u(0)},[i,t]),f.useEffect(()=>{t||l("")},[t]),f.useEffect(()=>{var b;const y=(b=p.current)==null?void 0:b.querySelector(`[data-palette-idx="${c}"]`);y==null||y.scrollIntoView({block:"nearest"})},[c]);function h(y){s(y.route),n()}function x(y){if(y.key==="ArrowDown")y.preventDefault(),u(b=>Math.min(m.length-1,b+1));else if(y.key==="ArrowUp")y.preventDefault(),u(b=>Math.max(0,b-1));else if(y.key==="Enter"){y.preventDefault();const b=m[c];b&&h(b)}}return r.jsx(ir,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(qn,{className:"max-w-xl p-0 gap-0",children:[r.jsx(Gn,{className:"sr-only",children:"Command palette"}),r.jsx("input",{autoFocus:!0,type:"text",value:i,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:p,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:i?"No matches":"Start typing to search"}):m.map((y,b)=>{const E=b===c;return r.jsxs("button",{type:"button","data-palette-idx":b,onClick:()=>h(y),onMouseEnter:()=>u(b),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${E?"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:eA[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 nA({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(hT,{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 rA({step:e,initialValue:t,disabled:n,onSubmit:s}){const[i,l]=f.useState(t??""),[c,u]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{var E;(E=p.current)==null||E.focus()},[]);const m=i.trim(),h=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),y=!n&&(!h||m.length>0)&&!x;function b(E){if(E.key==="Enter"){if(E.preventDefault(),!y){u(!0);return}s(m)}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:p,type:"text",value:i,onChange:E=>{l(E.target.value),u(!1)},onKeyDown:b,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 sA({step:e,disabled:t,onSubmit:n}){const[s,i]=f.useState({phase:"loading"}),[l,c]=f.useState(""),[u,p]=f.useState(0),[m,h]=f.useState(0),x=f.useRef(null),y=f.useRef(null);f.useEffect(()=>{var k;(k=x.current)==null||k.focus()},[]),f.useEffect(()=>{let k=!1;return i({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(v=>{k||i({phase:"loaded",options:v})}).catch(v=>{if(k)return;const j=v instanceof Error?v.message:"Failed to load options";i({phase:"error",message:j})}),()=>{k=!0}},[e,m]);const b=f.useMemo(()=>{if(s.phase!=="loaded")return[];const k=s.options.map(v=>({type:"option",title:v.label,subtitle:v.hint,keywords:[v.value],option:v}));return xg(l,k,100)},[s,l]);f.useEffect(()=>{p(0)},[b.length]),f.useEffect(()=>{var v;const k=(v=y.current)==null?void 0:v.querySelector(`[data-picker-idx="${u}"]`);k==null||k.scrollIntoView({block:"nearest"})},[u]);function E(k){if(s.phase==="loaded"){if(k.key==="ArrowDown")k.preventDefault(),p(v=>Math.min(b.length-1,v+1));else if(k.key==="ArrowUp")k.preventDefault(),p(v=>Math.max(0,v-1));else if(k.key==="Enter"){k.preventDefault();const v=b[u];v&&n(v.option.value)}}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:x,type:"text",value:l,onChange:k=>c(k.target.value),onKeyDown:E,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:()=>h(k=>k+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):b.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"}):b.map((k,v)=>{const j=v===u;return r.jsxs("button",{type:"button","data-picker-idx":v,onClick:()=>n(k.option.value),onMouseEnter:()=>p(v),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 ${j?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.option.label}),k.option.hint?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:k.option.hint}):null]},k.option.value)})})]})}function oA({entries:e}){var ue,me;const t=$t(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:i,bindAction:l,findConflict:c,pendingActionKind:u,consumePendingActionKind:p}=co(),[m,h]=f.useState(""),[x,y]=f.useState(0),[b,E]=f.useState(null),[k,v]=f.useState(""),[j,C]=f.useState(null),[N,T]=f.useState(null),[L,P]=f.useState(!1),[$,D]=f.useState(null),J=f.useRef(null),ee=f.useMemo(()=>e.map(V=>({type:V.group.toLowerCase(),title:V.title,subtitle:V.subtitle,keywords:V.keywords,action:V})),[e]),M=f.useMemo(()=>xg(m,ee,50),[m,ee]);f.useEffect(()=>{y(0)},[m,n]),f.useEffect(()=>{n||(h(""),E(null),v(""),C(null),T(null),P(!1),D(null))},[n]),f.useEffect(()=>{if(!n||!u)return;const V=p();if(!V)return;const ne=e.find(de=>de.bindableKind===V);ne&&U(ne)},[n,u]),f.useEffect(()=>{var ne;const V=(ne=J.current)==null?void 0:ne.querySelector(`[data-palette-idx="${x}"]`);V==null||V.scrollIntoView({block:"nearest"})},[x]);async function U(V){if(!L){if(V.flow&&V.flow.steps.length>0){C({action:V,stepIndex:0,values:{}}),D(null);return}if(V.requiresInput){E(V),v(""),D(null);return}if(V.run){P(!0),D(null);try{await V.run(),s()}catch(ne){D(ne instanceof Error?ne.message:"Action failed")}finally{P(!1)}}}}async function X(V){if(!j)return;const ne=j.action.flow.steps[j.stepIndex],de={...j.values,[ne.id]:V};if(j.stepIndex+1<j.action.flow.steps.length){C({action:j.action,stepIndex:j.stepIndex+1,values:de});return}P(!0),D(null);try{await j.action.flow.submit(de,{navigate:t}),s()}catch(ye){D(ye instanceof Error?ye.message:"Action failed")}finally{P(!1)}}function B(){if(j&&!L){if(j.stepIndex===0){C(null),D(null);return}C({action:j.action,stepIndex:j.stepIndex-1,values:j.values}),D(null)}}async function q(){if(L||!(b!=null&&b.requiresInput))return;const V=k.trim();if(V){P(!0),D(null);try{await b.requiresInput.runWithInput(V),s()}catch(ne){D(ne instanceof Error?ne.message:"Action failed")}finally{P(!1)}}}function Z(V){if(V.key==="ArrowDown")V.preventDefault(),y(ne=>Math.min(M.length-1,ne+1));else if(V.key==="ArrowUp")V.preventDefault(),y(ne=>Math.max(0,ne-1));else if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)){V.preventDefault();const ne=M[x];ne!=null&&ne.action.bindableKind&&T({action:ne.action,combo:null,conflict:null,saving:!1,error:null})}else if(V.key==="Enter"){V.preventDefault();const ne=M[x];ne&&U(ne.action)}}function le(V){V.key==="Enter"?(V.preventDefault(),q()):V.key==="Escape"&&(V.preventDefault(),E(null),v(""))}function _(V){if(!N||V.key==="Escape"||V.key==="Enter"&&!N.combo)return;V.preventDefault(),V.stopPropagation();const ne=T0(V.nativeEvent);if(!ne)return;const de=c(ne,N.action.bindableKind);T({...N,combo:ne,conflict:de,error:null})}async function G(){var V;if(!(!N||!N.combo||!N.action.bindableKind)){if((V=N.conflict)!=null&&V.description){T({...N,error:`Reserved: ${N.conflict.description}`});return}T({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),T(null)}catch(ne){T({...N,saving:!1,error:ne instanceof Error?ne.message:"Failed to save binding"})}}}const A=b!==null,z=j!==null,Q=N!==null,I=j?j.action.flow.steps[j.stepIndex]:null;return r.jsx(ir,{open:n,onOpenChange:V=>V?null:s(),children:r.jsxs(qn,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:V=>{if(!L){if(Q){V.preventDefault(),T(null);return}if(z){V.preventDefault(),B();return}A&&(V.preventDefault(),E(null),v(""),D(null))}},children:[r.jsx(Gn,{className:"sr-only",children:"Actions palette"}),Q&&N?r.jsxs("div",{onKeyDown:_,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(rh,{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:as(N.combo)}),(ue=N.conflict)!=null&&ue.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(me=N.conflict)!=null&&me.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 G(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:V=>{V.key==="Enter"&&G()}})]}):z&&I&&j?r.jsxs(r.Fragment,{children:[r.jsx(nA,{label:`${j.action.title} · ${I.label}`,onBack:B,disabled:L,stepCounter:{current:j.stepIndex+1,total:j.action.flow.steps.length}}),I.kind==="text"?r.jsx(rA,{step:I,initialValue:j.values[I.id],disabled:L,onSubmit:X}):r.jsx(sA,{step:I,disabled:L,onSubmit:X}),$?r.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):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:L?"Running…":""})]})]}):A?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:b.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:k,onChange:V=>v(V.target.value),onKeyDown:le,placeholder:b.requiresInput.placeholder,disabled:L,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",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):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:L?"Running…":""})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:V=>h(V.target.value),onKeyDown:Z,placeholder:"Run an action: new project, new todo, toggle…",disabled:L,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"}),$?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsx("div",{ref:J,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:m?"No matches":"Start typing to search actions"}):M.map((V,ne)=>{const de=ne===x,ye=V.action.bindableKind,ke=ye?i[ye]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":ne,onClick:()=>U(V.action),onMouseEnter:()=>y(ne),disabled:L,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${de?"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:V.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:V.action.title}),V.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:V.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:as(ke)}):null,ye?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:fe=>{fe.preventDefault(),fe.stopPropagation(),T({action:V.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 ${de?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx(rh,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},V.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:L?"Running…":`${M.length} action${M.length===1?"":"s"}`})]})]})]})})}const iA=[{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 aA(e){const t=sr(e);return t?iA.find(n=>n.combo===t)??null:null}const cl={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},lA={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},cA=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function kv(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${as(t)} then ${as(n)}`}return as(e)}function uA(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:i}=co(),l=f.useMemo(()=>{const p=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&p.add(sr(m));return p},[s]),c=f.useMemo(()=>{if(!e)return new Map;const p=n(),m=new Map;for(const h of p){if(l.has(sr(h.keys)))continue;const x=m.get(h.scope)??[];x.push({keys:h.keys,description:h.description}),m.set(h.scope,x)}return m},[e,n,l]),u=f.useMemo(()=>{const p=[];for(const[m,h]of Object.entries(s)){if(!h)continue;const x=i.find(y=>y.bindableKind===m);p.push({kind:m,combo:h,title:x?x.title:m})}return p},[s,i]);return r.jsx(ir,{open:e,onOpenChange:p=>p?null:t(),children:r.jsxs(qn,{className:"max-w-2xl",children:[r.jsx(Gn,{children:"Keyboard shortcuts"}),r.jsxs(ps,{children:["Press Esc to close. ",as("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:[cA.map(p=>{const m=c.get(p);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:lA[p]}),r.jsx("ul",{className:"space-y-1",children:m.map((h,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:h.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:kv(h.keys)})]},`${p}-${h.keys}-${x}`))})]},p)}),u.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:u.map(p=>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:p.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:kv(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const yg={bindings:{},custom:!1};let bl=null,Pi=null;const ch=new Set;function hk(e){bl=e;for(const t of ch)t(e)}function bg(e){if(!e||typeof e!="object")return yg;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[s,i]of Object.entries(t.bindings)){if(!GP(s)||typeof i!="string"||i.trim()==="")continue;const l=sr(i);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function dA(){return bl?Promise.resolve(bl):Pi||(Pi=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=bg(e);return bl=t,Pi=null,t}).catch(()=>(Pi=null,yg)),Pi)}function fA(){const[e,t]=f.useState(()=>bl??yg);return f.useEffect(()=>{let n=!1;return dA().then(s=>{n||t(s)}),ch.add(t),()=>{n=!0,ch.delete(t)}},[]),e}async function Sv(e){const t={};for(const i of Pd){const l=e[i];if(typeof l!="string")continue;const c=sr(l);c&&(t[i]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(i.error??"Failed to save hotkey bindings")}const s=bg(await n.json());return hk(s),s}async function pA(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=bg(await e.json());return hk(t),t}const Nv=1500;function mA(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const gk=f.createContext(null);function hA({children:e}){const{toggleTheme:t}=rg(),n=Wn(),s=$t(),i=mA(n.pathname),[l,c]=f.useState(!1),u=Vo(l),p=Td(l),m=E0(l),h=sg(l),x=P0(l),y=f.useMemo(()=>{var et,Ye,St,Bt;const O=u.data??[],W=((et=p.data)==null?void 0:et.assignments)??[],te=((Ye=m.data)==null?void 0:Ye.playbooks)??[],xe=((St=h.data)==null?void 0:St.sessions)??[],Ee=(((Bt=x.data)==null?void 0:Bt.workspaces)??[]).flatMap(st=>st.items.map(ae=>({...ae,workspace:st.workspace})));return lR({projects:O,assignments:W,playbooks:te,servers:xe,todos:Ee,wsPrefix:i})},[u.data,p.data,m.data,h.data,x.data,i]),E=f.useMemo(()=>f0(n.pathname),[n.pathname]).projectSlug,k=f.useMemo(()=>{var O;return E?((O=u.data)==null?void 0:O.find(W=>W.slug===E))??null:null},[u.data,E]),v=(k==null?void 0:k.title)??null,j=(k==null?void 0:k.workspace)??null,C=f.useMemo(()=>{var O;return dR({playbooks:((O=m.data)==null?void 0:O.playbooks)??[],projectSlug:E,currentProjectTitle:v,currentProjectWorkspace:j,wsPrefix:i,refetchPlaybooks:m.refetch,navigate:s,toggleTheme:t})},[m.data,m.refetch,E,v,j,i,s,t]),N=f.useRef(new Map),T=f.useRef(["global"]),L=f.useRef({phase:"idle"}),P=f.useRef(null),$=f.useRef(1),[D,J]=f.useState(!1),[ee,M]=f.useState(!1),[U,X]=f.useState(!1),[B,q]=f.useState(null);f.useEffect(()=>{(D||U)&&c(!0)},[D,U]);const{bindings:Z}=fA(),le=f.useMemo(()=>ZP(Z),[Z]),_=f.useCallback(O=>{const W=$.current++;return N.current.set(W,{...O,id:W}),W},[]),G=f.useCallback(O=>{N.current.delete(O)},[]),A=f.useCallback(O=>{T.current.push(O)},[]),z=f.useCallback(O=>{const W=T.current;for(let te=W.length-1;te>=0;te--)if(W[te]===O){W.splice(te,1);return}},[]),Q=f.useCallback(()=>J(!0),[]),I=f.useCallback(()=>J(!1),[]),ue=f.useCallback(()=>M(!0),[]),me=f.useCallback(()=>M(!1),[]),V=f.useCallback(()=>X(!0),[]),ne=f.useCallback(()=>{X(!1),q(null)},[]),de=f.useCallback(()=>Array.from(N.current.values()),[]),ye=f.useCallback(()=>{let O=null;return q(W=>(O=W,null)),O},[]),ke=f.useCallback(O=>{q(O),X(!0)},[]),fe=f.useCallback((O,W)=>{const te=sr(O);if(!te)return null;if(XP(te)){const xe=aA(te);return{description:(xe==null?void 0:xe.description)??"Reserved built-in shortcut"}}for(const[xe,Ae]of Object.entries(le))if(!(W&&xe===W)&&Ae===te)return{kind:xe};return null},[le]),Ve=f.useCallback(async(O,W)=>{const te=sr(W);if(!te)throw new Error("Empty combo");const xe=fe(te,O);if(xe){const Ee=xe.description?`Reserved: ${xe.description}`:`Already bound to "${xe.kind}"`;throw new Error(Ee)}const Ae={...Z,[O]:te};return await Sv(Ae),te},[Z,fe]),pe=f.useCallback(async O=>{if(!Z[O])return;const W={...Z};delete W[O],await Sv(W)},[Z]);f.useEffect(()=>{L.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[n.pathname]),f.useEffect(()=>{function O(Ee){if(!(Ee instanceof HTMLElement))return!1;const et=Ee.tagName;return!!(et==="INPUT"||et==="TEXTAREA"||et==="SELECT"||Ee.isContentEditable||Ee.closest('[role="combobox"], [role="textbox"]'))}function W(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function te(){const Ee=T.current;return Ee[Ee.length-1]??"global"}function xe(Ee){return Ee.scope==="global"?!0:Ee.scope===te()}function Ae(Ee){const et=mu(Ee,"Mod+k"),Ye=mu(Ee,"Mod+Shift+k"),St=Ee.key==="Escape",Bt=et||Ye||St;if(W()&&!Bt||O(Ee.target)&&!Bt)return;const st=L.current;if(st.phase==="awaiting-second")if(Date.now()-st.startedAt>Nv)L.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null);else{const Le=Array.from(N.current.values());for(const Be of Le){if(!xe(Be))continue;const Ge=Be.keys.split(" ");if(!(Ge.length!==2||Ge[0]!=="g")&&mu(Ee,Ge[1])&&!(Be.when&&!Be.when())){Ee.preventDefault(),L.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null),Be.handler(Ee);return}}L.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)}const ae=Array.from(N.current.values());for(const be of ae){if(!xe(be))continue;const Le=be.keys.split(" ");if(Le.length===1&&mu(Ee,Le[0])&&!(be.when&&!be.when())){Ee.preventDefault(),be.handler(Ee);return}}Ee.key==="g"&&!Ee.metaKey&&!Ee.ctrlKey&&!Ee.altKey&&!Ee.shiftKey&&Array.from(N.current.values()).some(Le=>xe(Le)&&Le.keys.startsWith("g "))&&(Ee.preventDefault(),L.current={phase:"awaiting-second",startedAt:Date.now()},P.current!==null&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>{L.current={phase:"idle"},P.current=null},Nv))}return window.addEventListener("keydown",Ae),()=>{window.removeEventListener("keydown",Ae),P.current!==null&&(window.clearTimeout(P.current),P.current=null)}},[]),f.useEffect(()=>{const O=_({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>G(O)},[_,G,t]),f.useEffect(()=>{const O=_({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>ue()});return()=>G(O)},[_,G,ue]),f.useEffect(()=>{const O=_({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(D){I();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||Q()}});return()=>G(O)},[_,G,Q,I,D]),f.useEffect(()=>{const O=_({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(U){ne();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||V()}});return()=>G(O)},[_,G,V,ne,U]),f.useEffect(()=>{const W=[{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(te=>_({keys:`g ${te.suffix}`,scope:"global",description:te.desc,handler:()=>s(Iu(te.basePath,i))}));return()=>W.forEach(G)},[_,G,s,i]),f.useEffect(()=>{const O=[];for(const[W,te]of Object.entries(le)){if(!te)continue;const xe=C.find(Ee=>Ee.bindableKind===W),Ae=xe?`Custom: ${xe.title}`:`Custom: ${W}`;O.push(_({keys:te,scope:"global",description:Ae,handler:()=>{q(W),X(!0)}}))}return()=>O.forEach(G)},[_,G,le,C]);const Re=f.useMemo(()=>({register:_,unregister:G,pushScope:A,popScope:z,openPalette:Q,closePalette:I,paletteOpen:D,openCheatsheet:ue,closeCheatsheet:me,cheatsheetOpen:ee,openActionsPalette:V,closeActionsPalette:ne,actionsPaletteOpen:U,listBindings:de,wsPrefix:i,paletteEntries:y,actionEntries:C,userBindings:Z,customBindings:le,bindAction:Ve,unbindAction:pe,findConflict:fe,openActionsPaletteWithAction:ke,pendingActionKind:B,consumePendingActionKind:ye}),[_,G,A,z,Q,I,D,ue,me,ee,V,ne,U,de,i,y,C,Z,le,Ve,pe,fe,ke,B,ye]);return r.jsxs(gk.Provider,{value:Re,children:[e,r.jsx(tA,{entries:y}),r.jsx(oA,{entries:C}),r.jsx(uA,{})]})}function co(){const e=f.useContext(gk);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function zt({keys:e,handler:t,scope:n="global",description:s,when:i,enabled:l=!0}){const{register:c,unregister:u}=co(),p=f.useRef(t),m=f.useRef(i);f.useEffect(()=>{p.current=t,m.current=i},[t,i]),f.useEffect(()=>{if(!l)return;const h=c({keys:e,handler:x=>p.current(x),scope:n,description:s,when:m.current?()=>m.current():void 0});return()=>u(h)},[c,u,e,n,s,l])}function uo(e){const{pushScope:t,popScope:n}=co();f.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function Xl(e,t){const[n,s]=f.useState(e.length===0?-1:0),i=Wn();f.useEffect(()=>{s(e.length===0?-1:0)},[i.pathname]),f.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),f.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(u=>{const p=Number(u.getAttribute("data-hotkey-row-index"));u.setAttribute("data-hotkey-selected",p===n?"true":"false")}),n>=0){const u=document.querySelector(`[data-hotkey-row-index="${n}"]`);u==null||u.scrollIntoView({block:"nearest"})}},[n,e.length]),zt({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))}),zt({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),zt({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),zt({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=f.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function gA({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const i=ln(),{resolvedTheme:l,toggleTheme:c}=rg(),{openPalette:u}=co();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(LT,{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((p,m)=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?r.jsx("span",{children:"/"}):null,r.jsx(Ne,{to:p.path,className:"hover:text-foreground",children:p.label})]},p.path)),r.jsx("span",{children:"/"})]}):null,r.jsx("h1",{className:"min-w-0 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:u,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(lo,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:as("Mod+k")})]}),r.jsx(Ne,{className:"shell-action",to:"/help",children:"Help"}),r.jsxs(Ne,{className:"shell-action",to:`${i}/create/project`,children:[r.jsx(en,{className:"h-4 w-4"}),r.jsx("span",{children:"New Project"})]}),n?r.jsxs(Ne,{className:"shell-action",to:`${i}/projects/${n}/create/assignment`,children:[r.jsx(en,{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(HT,{className:"h-4 w-4"}):r.jsx(IT,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}var xA=Symbol("radix.slottable");function yA(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xA,t}var xk="AlertDialog",[bA]=Ho(xk,[Y0]),Ds=Y0(),yk=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ds(t);return r.jsx(dk,{...s,...n,modal:!0})};yk.displayName=xk;var vA="AlertDialogTrigger",wA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ds(n);return r.jsx(fk,{...i,...s,ref:t})});wA.displayName=vA;var jA="AlertDialogPortal",bk=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ds(t);return r.jsx(pk,{...s,...n})};bk.displayName=jA;var kA="AlertDialogOverlay",vk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ds(n);return r.jsx(fg,{...i,...s,ref:t})});vk.displayName=kA;var Ki="AlertDialogContent",[SA,NA]=bA(Ki),CA=yA("AlertDialogContent"),wk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...i}=e,l=Ds(n),c=f.useRef(null),u=Fn(t,c),p=f.useRef(null);return r.jsx(W3,{contentName:Ki,titleName:jk,docsSlug:"alert-dialog",children:r.jsx(SA,{scope:n,cancelRef:p,children:r.jsxs(pg,{role:"alertdialog",...l,...i,ref:u,onOpenAutoFocus:Wt(i.onOpenAutoFocus,m=>{var h;m.preventDefault(),(h=p.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(CA,{children:s}),r.jsx(TA,{contentRef:c})]})})})});wk.displayName=Ki;var jk="AlertDialogTitle",kk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ds(n);return r.jsx(mg,{...i,...s,ref:t})});kk.displayName=jk;var Sk="AlertDialogDescription",Nk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ds(n);return r.jsx(hg,{...i,...s,ref:t})});Nk.displayName=Sk;var EA="AlertDialogAction",Ck=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ds(n);return r.jsx(gg,{...i,...s,ref:t})});Ck.displayName=EA;var Ek="AlertDialogCancel",Tk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:i}=NA(Ek,n),l=Ds(n),c=Fn(t,i);return r.jsx(gg,{...l,...s,ref:c})});Tk.displayName=Ek;var TA=({contentRef:e})=>{const t=`\`${Ki}\` requires a description for the component to be accessible for screen reader users.
|
|
510
|
+
|
|
511
|
+
You can add a description to the \`${Ki}\` by passing a \`${Sk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
512
|
+
|
|
513
|
+
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 \`${Ki}\`. 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.
|
|
514
|
+
|
|
515
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},PA=yk,RA=bk,Pk=vk,Rk=wk,Ak=Ck,Dk=Tk,$k=kk,Lk=Nk;const Xu=PA,AA=RA,Ik=f.forwardRef(({className:e,...t},n)=>r.jsx(Pk,{ref:n,className:Te("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Ik.displayName=Pk.displayName;const Dl=f.forwardRef(({className:e,...t},n)=>r.jsxs(AA,{children:[r.jsx(Ik,{}),r.jsx(Rk,{ref:n,className:Te("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})]}));Dl.displayName=Rk.displayName;function Qu({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col space-y-2 text-left",e),...t})}function Zu({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const $l=f.forwardRef(({className:e,...t},n)=>r.jsx($k,{ref:n,className:Te("text-lg font-semibold tracking-tight text-foreground",e),...t}));$l.displayName=$k.displayName;const Ll=f.forwardRef(({className:e,...t},n)=>r.jsx(Lk,{ref:n,className:Te("text-sm leading-6 text-muted-foreground",e),...t}));Ll.displayName=Lk.displayName;const ta=f.forwardRef(({className:e,...t},n)=>r.jsx(Ak,{ref:n,className:Te(e),...t}));ta.displayName=Ak.displayName;const Ld=f.forwardRef(({className:e,...t},n)=>r.jsx(Dk,{ref:n,className:Te(e),...t}));Ld.displayName=Dk.displayName;const DA=[{to:"/",label:"Overview",icon:Jj},{to:"/playbooks",label:"Playbooks",icon:Gj},{to:"/memories",label:"Memories",icon:mT},{to:"/resources",label:"Resources",icon:RT},{to:"/inventories",label:"Inventories",icon:kd},{to:"/usage",label:"Usage",icon:Sd},{to:"/todos",label:"Todos",icon:Rr},{to:"/views",label:"Saved Views",icon:Qj},{to:"/archive",label:"Archive",icon:jd}],$A=[{suffix:"/projects",label:"Projects",icon:qh},{suffix:"/assignments",label:"Assignments",icon:$T},{suffix:"/servers",label:"Servers",icon:Xh},{suffix:"/inventories",label:"Inventories",icon:kd},{suffix:"/usage",label:"Usage",icon:Sd},{suffix:"/agent-sessions",label:"Agent Sessions",icon:wd},{suffix:"/todos",label:"Todos",icon:Rr}],LA=[{to:"/help",label:"Help",icon:AT},{to:"/settings",label:"Settings",icon:UT}],Cv="syntaur.dashboard.sourceFirstNoticeDismissed";function IA({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:i}){const[l,c]=f.useState(!1);zt({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[u,p]=f.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Cv)==="1"}catch{return!1}});function m(){if(p(!0),!(typeof window>"u"))try{window.localStorage.setItem(Cv,"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(Ev,{sourceNoticeDismissed:u,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(Ne,{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(eg,{className:"h-4 w-4"})})]}),r.jsx(Ev,{sourceNoticeDismissed:u,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(gA,{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:i})]})]})})}function Ev({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:i}=Ed(),l=(i==null?void 0:i.workspaces)??[],c=(i==null?void 0:i.hasUngrouped)??!1,u=Wn(),[p,m]=f.useState(new Set),[h,x]=f.useState(!1),[y,b]=f.useState(""),[E,k]=f.useState(null),[v,j]=f.useState(null),[C,N]=f.useState(null),[T,L]=f.useState(!1),P=$t();function $(M){m(U=>{const X=new Set(U);return X.has(M)?X.delete(M):X.add(M),X})}const D=[...l,...c?["_ungrouped"]:[]];async function J(M){if(v){L(!0);try{const U=`/api/workspaces/${encodeURIComponent(v)}${M?"?cascade=true":""}`,X=await fetch(U,{method:"DELETE"});if(X.status===409){const B=await X.json().catch(()=>({}));N((B==null?void 0:B.blockedBy)??{projects:[],standalones:[]});return}if(!X.ok){const B=await X.json().catch(()=>({}));throw new Error(B.error||"Failed to delete workspace")}j(null),N(null)}catch(U){console.error(U),alert(U instanceof Error?U.message:"Failed to delete workspace")}finally{L(!1)}}}async function ee(M,U){try{if(M.type==="project"){const X=await fetch(`/api/projects/${encodeURIComponent(M.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:U})});if(!X.ok){const B=await X.json().catch(()=>({}));throw new Error(B.error||"Failed to move project")}return}if(M.type==="standalone-assignment"){const X=await fetch(`/api/assignments/${encodeURIComponent(M.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:U})});if(!X.ok){const B=await X.json().catch(()=>({}));throw new Error(B.error||"Failed to move assignment")}return}if(M.type==="project-assignment"){alert("Assignments inherit workspace from their project — drag the project (or move it) to change workspaces.");return}}catch(X){console.error(X),alert(X instanceof Error?X.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(Ne,{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(iv,{items:DA,onNavigate:s}),r.jsx("div",{className:"border-t border-border/40"}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[D.length===0&&!h&&r.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),D.map(M=>{const U=M==="_ungrouped",X=U?"Ungrouped":Nn(M),B=U?"/w/_ungrouped":`/w/${M}`,q=p.has(M),Z=n===M||n===null&&U&&u.pathname.startsWith("/w/_ungrouped"),le=E===M;return r.jsxs("div",{className:`rounded-md transition ${le?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:_=>{_.dataTransfer.types.includes("application/json")&&(_.preventDefault(),_.dataTransfer.dropEffect="move",k(M))},onDragLeave:_=>{_.currentTarget.contains(_.relatedTarget)||k(G=>G===M?null:G)},onDrop:async _=>{try{const G=_.dataTransfer.getData("application/json");if(!G)return;_.preventDefault();let A;try{A=JSON.parse(G)}catch{return}if(!(A!=null&&A.type)||!(A!=null&&A.id))return;await ee(A,U?null:M)}finally{k(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>$(M),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(cs,{className:`h-3 w-3 transition-transform ${q?"-rotate-90":""}`}),X]}),U?null:r.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),j(M),N(null)},title:`Delete workspace "${M}"`,"aria-label":`Delete workspace "${M}"`,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(Kn,{className:"h-3 w-3"})})]}),!q&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:$A.map(_=>{const G=`${B}${_.suffix}`,A=d0(u.pathname,_.suffix)&&u.pathname.startsWith(B),z=_.icon;return r.jsxs(Ne,{to:G,onClick:s,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${A?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[r.jsx(z,{className:"h-4 w-4"}),r.jsx("span",{children:_.label})]},G)})})]},M)}),h?r.jsx("form",{className:"px-3 py-1.5",onSubmit:M=>{M.preventDefault();const U=y.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");U&&(x(!1),b(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:U})}).then(()=>{s==null||s(),P(`/w/${U}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:M=>b(M.target.value),onKeyDown:M=>{M.key==="Escape"&&(x(!1),b(""))},onBlur:()=>{y.trim()||(x(!1),b(""))},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(en,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(iv,{items:LA,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(eg,{className:"h-4 w-4"})})]})}),r.jsx(Xu,{open:v!==null,onOpenChange:M=>{T||M||(j(null),N(null))},children:r.jsxs(Dl,{children:[r.jsxs(Qu,{children:[r.jsx($l,{children:C?"Workspace has references":"Delete workspace?"}),r.jsx(Ll,{children:C?r.jsxs(r.Fragment,{children:["The workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:v})," 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:v})," from the registry. This does not affect projects or standalones unless you choose to cascade."]})})]}),C?r.jsxs("div",{className:"space-y-2 text-sm",children:[C.projects.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Projects (",C.projects.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:C.projects.map(M=>r.jsx("li",{children:r.jsx(Ne,{to:`/projects/${M}`,className:"hover:underline",children:M})},M))})]}):null,C.standalones.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Standalones (",C.standalones.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:C.standalones.map(M=>r.jsx("li",{children:r.jsx(Ne,{to:`/assignments/${M}`,className:"hover:underline",children:M})},M))})]}):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(Zu,{children:[r.jsx(Ld,{disabled:T,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),C?r.jsx(ta,{disabled:T,onClick:M=>{M.preventDefault(),J(!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:T?"Working…":"Clear references and delete"}):r.jsx(ta,{disabled:T,onClick:M=>{M.preventDefault(),J(!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:T?"Working…":"Delete"})]})]})})]})}function OA(){const e=Wn(),{workspace:t}=Lt(),{title:n,breadcrumbs:s,projectSlug:i}=f0(e.pathname);return r.jsx(IA,{title:n,breadcrumbs:s,projectSlug:i,workspace:t??null,children:r.jsx(C2,{})})}function ft({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 mt({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 Fu({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 Me({title:e,description:t,children:n,className:s,actions:i}){return r.jsxs("section",{className:Te("surface-panel space-y-3",s),children:[e||i?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]}),i]}):null,n]})}function _A({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(Me,{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(Ne,{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,i)=>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:i+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(Fu,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const gm={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."},_o={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 MA(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function FA({hero:e,itemsById:t}){const n=ln();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:_o.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:gm.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(Ne,{to:`${n}/projects`,className:"shell-action bg-foreground text-background hover:opacity-90",children:_o.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,i=(s==null?void 0:s.assignmentTitle)??"",l=gm[e.copyKey]??gm[e.kind],c=MA(l,{total:e.total,title:i}),u=s?zA(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(Ne,{to:u,className:"shell-action bg-foreground text-background hover:opacity-90",children:["Open ",i||"assignment"]})})]})}function zA(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const vg=["kanban","list","table"],Ok=["title","status","priority","assignee","dependencies","created","updated"],BA=["asc","desc"],UA=["comfortable","compact"],VA=["none","status","type","priority","assignee","project"],HA=["last_24h","last_7d","last_30d","last_90d","older_7d","older_30d"];function qe(e){const t=e===void 0?[]:Array.isArray(e)?e:[e],n=[];for(const s of t){if(typeof s!="string")continue;const i=s.trim();!i||i==="all"||n.includes(i)||n.push(i)}return n}function WA(e,t){const n=qe(e),s=qe(t);return n.length===s.length&&n.every(i=>s.includes(i))}const KA={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",type:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Il={version:1,global:KA,projects:{}};function xm(e){return e==="table"?"table":"kanban"}function qA(e,t){return t?{...e,...t}:{...e}}function _k(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:qA(n.filters,s.filters)}:n}const ym=["title","status","priority","assignee","dependencies","created","updated"],GA={status:"all",priority:"all",assignee:"all",project:"all",activity:"all"},Tv="2026-05-21T00:00:00Z";function bm(e,t,n){return{id:e,name:t,workspace:null,config:{viewMode:"list",filters:{...GA,...n},sortField:"updated",sortDirection:"desc",listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}},createdAt:Tv,updatedAt:Tv}}const no={version:1,views:[bm("default-recently-updated","Recently updated",{}),bm("default-high-priority","High priority",{priority:"high"}),bm("default-stale","Stale",{activity:"stale"})],dashboard:{version:1,slots:[{id:"slot-0",widget:{kind:"agent-sessions"}},{id:"slot-1",widget:{kind:"saved-view",viewId:"default-recently-updated"}},{id:"slot-2",widget:{kind:"saved-view",viewId:"default-high-priority"}},{id:"slot-3",widget:{kind:"saved-view",viewId:"default-stale"}},{id:"slot-4",widget:{kind:"inventories"}}]}};function Mk(e,t){const n=qe(e.filters.project),s=n.length===0||n.length===1&&n[0]===t,i=e.filters.activity,l=typeof e.filters.search=="string"&&e.filters.search.trim().length>0;return s&&(!i||i==="all")&&!l}function Fk(e,t){switch(t.kind){case"global":return e.workspace===null;case"workspace":return e.workspace===t.workspace||e.workspace===null;case"project":return e.workspace===t.workspace||e.workspace===null?Mk(e.config,t.slug):!1}}const zk=`syntaur.savedViews.cache.v${no.version}`;let qi=YA(),Lo=null,wg=null;const uh=new Set,ed=new Set;let Bk=0;function Uk(){return++Bk}function dh(e){return e===Bk}function YA(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(zk);if(!e)return null;const t=JSON.parse(e);return t.version!==no.version?null:t}catch{return null}}function JA(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(zk,JSON.stringify(e))}catch{}}function Vk(e){qi=e,wg=null,JA(e);for(const t of uh)t(e);for(const t of ed)t(null)}function XA(e){wg=e;for(const t of ed)t(e)}function Hk(e){if(!e||typeof e!="object")return no;const t=e;return t.version!==no.version||!Array.isArray(t.views)||!t.dashboard?no:t}function Pv(){if(Lo)return Lo;const e=Uk();return Lo=fetch("/api/saved-views").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=Hk(t);return dh(e)&&Vk(n),Lo=null,qi??n}).catch(t=>{const n=t instanceof Error?t:new Error(String(t));return dh(e)&&XA(n),Lo=null,qi??no}),Lo}function jg(){const[e,t]=f.useState(()=>qi??no),[n,s]=f.useState(()=>qi===null),[i,l]=f.useState(()=>wg);return f.useEffect(()=>{let u=!1;qi===null&&s(!0),Pv().then(h=>{u||(t(h),s(!1))});const p=h=>{u||(t(h),s(!1),l(null))},m=h=>{u||(l(h),s(!1))};return uh.add(p),ed.add(m),()=>{u=!0,uh.delete(p),ed.delete(m)}},[]),{file:e,loading:n,error:i,refetch:()=>{Lo=null,s(!0),l(null),Pv()}}}function kg(){const{file:e,loading:t}=jg();return{views:e.views,loading:t}}function QA(){const{file:e,loading:t}=jg();return{layout:e.dashboard,loading:t}}function na(e){const{file:t,loading:n,error:s,refetch:i}=jg();return e?{view:t.views.find(c=>c.id===e)??null,loading:n,error:s,refetch:i}:{view:null,loading:!1,error:null,refetch:i}}async function Id(e,t,n){const s=Uk(),i=await fetch(t,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){const c=await i.json().catch(()=>({error:`HTTP ${i.status}`}));throw new Error(c.error??`HTTP ${i.status}`)}const l=Hk(await i.json());return dh(s)&&Vk(l),l}function td(e){return Id("POST","/api/saved-views",e)}function Od(e,t){return Id("PATCH",`/api/saved-views/${encodeURIComponent(e)}`,t)}function ZA(e){return Id("DELETE",`/api/saved-views/${encodeURIComponent(e)}`)}function eD(e){return Id("PUT","/api/dashboard",{slots:e})}const tD=["top","right","bottom","left"],so=Math.min,hr=Math.max,nd=Math.round,vu=Math.floor,ls=e=>({x:e,y:e}),nD={left:"right",right:"left",bottom:"top",top:"bottom"};function fh(e,t,n){return hr(e,so(t,n))}function Ts(e,t){return typeof e=="function"?e(t):e}function Ps(e){return e.split("-")[0]}function ca(e){return e.split("-")[1]}function Sg(e){return e==="x"?"y":"x"}function Ng(e){return e==="y"?"height":"width"}function os(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Cg(e){return Sg(os(e))}function rD(e,t,n){n===void 0&&(n=!1);const s=ca(e),i=Cg(e),l=Ng(i);let c=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=rd(c)),[c,rd(c)]}function sD(e){const t=rd(e);return[ph(e),t,ph(t)]}function ph(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Rv=["left","right"],Av=["right","left"],oD=["top","bottom"],iD=["bottom","top"];function aD(e,t,n){switch(e){case"top":case"bottom":return n?t?Av:Rv:t?Rv:Av;case"left":case"right":return t?oD:iD;default:return[]}}function lD(e,t,n,s){const i=ca(e);let l=aD(Ps(e),n==="start",s);return i&&(l=l.map(c=>c+"-"+i),t&&(l=l.concat(l.map(ph)))),l}function rd(e){const t=Ps(e);return nD[t]+e.slice(t.length)}function cD(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wk(e){return typeof e!="number"?cD(e):{top:e,right:e,bottom:e,left:e}}function sd(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function Dv(e,t,n){let{reference:s,floating:i}=e;const l=os(t),c=Cg(t),u=Ng(c),p=Ps(t),m=l==="y",h=s.x+s.width/2-i.width/2,x=s.y+s.height/2-i.height/2,y=s[u]/2-i[u]/2;let b;switch(p){case"top":b={x:h,y:s.y-i.height};break;case"bottom":b={x:h,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:x};break;case"left":b={x:s.x-i.width,y:x};break;default:b={x:s.x,y:s.y}}switch(ca(t)){case"start":b[c]-=y*(n&&m?-1:1);break;case"end":b[c]+=y*(n&&m?-1:1);break}return b}async function uD(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:l,rects:c,elements:u,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:x="floating",altBoundary:y=!1,padding:b=0}=Ts(t,e),E=Wk(b),v=u[y?x==="floating"?"reference":"floating":x],j=sd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(v)))==null||n?v:v.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:m,rootBoundary:h,strategy:p})),C=x==="floating"?{x:s,y:i,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),T=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},L=sd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:N,strategy:p}):C);return{top:(j.top-L.top+E.top)/T.y,bottom:(L.bottom-j.bottom+E.bottom)/T.y,left:(j.left-L.left+E.left)/T.x,right:(L.right-j.right+E.right)/T.x}}const dD=50,fD=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:l=[],platform:c}=n,u=c.detectOverflow?c:{...c,detectOverflow:uD},p=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:x}=Dv(m,s,p),y=s,b=0;const E={};for(let k=0;k<l.length;k++){const v=l[k];if(!v)continue;const{name:j,fn:C}=v,{x:N,y:T,data:L,reset:P}=await C({x:h,y:x,initialPlacement:s,placement:y,strategy:i,middlewareData:E,rects:m,platform:u,elements:{reference:e,floating:t}});h=N??h,x=T??x,E[j]={...E[j],...L},P&&b<dD&&(b++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(m=P.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:h,y:x}=Dv(m,y,p)),k=-1)}return{x:h,y:x,placement:y,strategy:i,middlewareData:E}},pD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:l,platform:c,elements:u,middlewareData:p}=t,{element:m,padding:h=0}=Ts(e,t)||{};if(m==null)return{};const x=Wk(h),y={x:n,y:s},b=Cg(i),E=Ng(b),k=await c.getDimensions(m),v=b==="y",j=v?"top":"left",C=v?"bottom":"right",N=v?"clientHeight":"clientWidth",T=l.reference[E]+l.reference[b]-y[b]-l.floating[E],L=y[b]-l.reference[b],P=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let $=P?P[N]:0;(!$||!await(c.isElement==null?void 0:c.isElement(P)))&&($=u.floating[N]||l.floating[E]);const D=T/2-L/2,J=$/2-k[E]/2-1,ee=so(x[j],J),M=so(x[C],J),U=ee,X=$-k[E]-M,B=$/2-k[E]/2+D,q=fh(U,B,X),Z=!p.arrow&&ca(i)!=null&&B!==q&&l.reference[E]/2-(B<U?ee:M)-k[E]/2<0,le=Z?B<U?B-U:B-X:0;return{[b]:y[b]+le,data:{[b]:q,centerOffset:B-q-le,...Z&&{alignmentOffset:le}},reset:Z}}}),mD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:l,rects:c,initialPlacement:u,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:k=!0,...v}=Ts(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const j=Ps(i),C=os(u),N=Ps(u)===u,T=await(p.isRTL==null?void 0:p.isRTL(m.floating)),L=y||(N||!k?[rd(u)]:sD(u)),P=E!=="none";!y&&P&&L.push(...lD(u,k,E,T));const $=[u,...L],D=await p.detectOverflow(t,v),J=[];let ee=((s=l.flip)==null?void 0:s.overflows)||[];if(h&&J.push(D[j]),x){const B=rD(i,c,T);J.push(D[B[0]],D[B[1]])}if(ee=[...ee,{placement:i,overflows:J}],!J.every(B=>B<=0)){var M,U;const B=(((M=l.flip)==null?void 0:M.index)||0)+1,q=$[B];if(q&&(!(x==="alignment"?C!==os(q):!1)||ee.every(_=>os(_.placement)===C?_.overflows[0]>0:!0)))return{data:{index:B,overflows:ee},reset:{placement:q}};let Z=(U=ee.filter(le=>le.overflows[0]<=0).sort((le,_)=>le.overflows[1]-_.overflows[1])[0])==null?void 0:U.placement;if(!Z)switch(b){case"bestFit":{var X;const le=(X=ee.filter(_=>{if(P){const G=os(_.placement);return G===C||G==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((_,G)=>_[1]-G[1])[0])==null?void 0:X[0];le&&(Z=le);break}case"initialPlacement":Z=u;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};function $v(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lv(e){return tD.some(t=>e[t]>=0)}const hD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...l}=Ts(e,t);switch(i){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),u=$v(c,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Lv(u)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),u=$v(c,n.floating);return{data:{escapedOffsets:u,escaped:Lv(u)}}}default:return{}}}}},Kk=new Set(["left","top"]);async function gD(e,t){const{placement:n,platform:s,elements:i}=e,l=await(s.isRTL==null?void 0:s.isRTL(i.floating)),c=Ps(n),u=ca(n),p=os(n)==="y",m=Kk.has(c)?-1:1,h=l&&p?-1:1,x=Ts(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:E}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return u&&typeof E=="number"&&(b=u==="end"?E*-1:E),p?{x:b*h,y:y*m}:{x:y*m,y:b*h}}const xD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:l,placement:c,middlewareData:u}=t,p=await gD(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:i+p.x,y:l+p.y,data:{...p,placement:c}}}}},yD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:l}=t,{mainAxis:c=!0,crossAxis:u=!1,limiter:p={fn:j=>{let{x:C,y:N}=j;return{x:C,y:N}}},...m}=Ts(e,t),h={x:n,y:s},x=await l.detectOverflow(t,m),y=os(Ps(i)),b=Sg(y);let E=h[b],k=h[y];if(c){const j=b==="y"?"top":"left",C=b==="y"?"bottom":"right",N=E+x[j],T=E-x[C];E=fh(N,E,T)}if(u){const j=y==="y"?"top":"left",C=y==="y"?"bottom":"right",N=k+x[j],T=k-x[C];k=fh(N,k,T)}const v=p.fn({...t,[b]:E,[y]:k});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[b]:c,[y]:u}}}}}},bD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:p=!0,crossAxis:m=!0}=Ts(e,t),h={x:n,y:s},x=os(i),y=Sg(x);let b=h[y],E=h[x];const k=Ts(u,t),v=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(p){const N=y==="y"?"height":"width",T=l.reference[y]-l.floating[N]+v.mainAxis,L=l.reference[y]+l.reference[N]-v.mainAxis;b<T?b=T:b>L&&(b=L)}if(m){var j,C;const N=y==="y"?"width":"height",T=Kk.has(Ps(i)),L=l.reference[x]-l.floating[N]+(T&&((j=c.offset)==null?void 0:j[x])||0)+(T?0:v.crossAxis),P=l.reference[x]+l.reference[N]+(T?0:((C=c.offset)==null?void 0:C[x])||0)-(T?v.crossAxis:0);E<L?E=L:E>P&&(E=P)}return{[y]:b,[x]:E}}}},vD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:l,platform:c,elements:u}=t,{apply:p=()=>{},...m}=Ts(e,t),h=await c.detectOverflow(t,m),x=Ps(i),y=ca(i),b=os(i)==="y",{width:E,height:k}=l.floating;let v,j;x==="top"||x==="bottom"?(v=x,j=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=x,v=y==="end"?"top":"bottom");const C=k-h.top-h.bottom,N=E-h.left-h.right,T=so(k-h[v],C),L=so(E-h[j],N),P=!t.middlewareData.shift;let $=T,D=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&($=C),P&&!y){const ee=hr(h.left,0),M=hr(h.right,0),U=hr(h.top,0),X=hr(h.bottom,0);b?D=E-2*(ee!==0||M!==0?ee+M:hr(h.left,h.right)):$=k-2*(U!==0||X!==0?U+X:hr(h.top,h.bottom))}await p({...t,availableWidth:D,availableHeight:$});const J=await c.getDimensions(u.floating);return E!==J.width||k!==J.height?{reset:{rects:!0}}:{}}}};function _d(){return typeof window<"u"}function ua(e){return qk(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ms(e){var t;return(t=(qk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qk(e){return _d()?e instanceof Node||e instanceof yr(e).Node:!1}function Hr(e){return _d()?e instanceof Element||e instanceof yr(e).Element:!1}function $s(e){return _d()?e instanceof HTMLElement||e instanceof yr(e).HTMLElement:!1}function Iv(e){return!_d()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function Ql(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=Wr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&i!=="inline"&&i!=="contents"}function wD(e){return/^(table|td|th)$/.test(ua(e))}function Md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const jD=/transform|translate|scale|rotate|perspective|filter/,kD=/paint|layout|strict|content/,$o=e=>!!e&&e!=="none";let vm;function Eg(e){const t=Hr(e)?Wr(e):e;return $o(t.transform)||$o(t.translate)||$o(t.scale)||$o(t.rotate)||$o(t.perspective)||!Tg()&&($o(t.backdropFilter)||$o(t.filter))||jD.test(t.willChange||"")||kD.test(t.contain||"")}function SD(e){let t=oo(e);for(;$s(t)&&!ra(t);){if(Eg(t))return t;if(Md(t))return null;t=oo(t)}return null}function Tg(){return vm==null&&(vm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vm}function ra(e){return/^(html|body|#document)$/.test(ua(e))}function Wr(e){return yr(e).getComputedStyle(e)}function Fd(e){return Hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(ua(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Iv(e)&&e.host||ms(e);return Iv(t)?t.host:t}function Gk(e){const t=oo(e);return ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:$s(t)&&Ql(t)?t:Gk(t)}function Ol(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Gk(e),l=i===((s=e.ownerDocument)==null?void 0:s.body),c=yr(i);if(l){const u=mh(c);return t.concat(c,c.visualViewport||[],Ql(i)?i:[],u&&n?Ol(u):[])}else return t.concat(i,Ol(i,[],n))}function mh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yk(e){const t=Wr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=$s(e),l=i?e.offsetWidth:n,c=i?e.offsetHeight:s,u=nd(n)!==l||nd(s)!==c;return u&&(n=l,s=c),{width:n,height:s,$:u}}function Pg(e){return Hr(e)?e:e.contextElement}function Gi(e){const t=Pg(e);if(!$s(t))return ls(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:l}=Yk(t);let c=(l?nd(n.width):n.width)/s,u=(l?nd(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const ND=ls(0);function Jk(e){const t=yr(e);return!Tg()||!t.visualViewport?ND:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function Bo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=Pg(e);let c=ls(1);t&&(s?Hr(s)&&(c=Gi(s)):c=Gi(e));const u=CD(l,n,s)?Jk(l):ls(0);let p=(i.left+u.x)/c.x,m=(i.top+u.y)/c.y,h=i.width/c.x,x=i.height/c.y;if(l){const y=yr(l),b=s&&Hr(s)?yr(s):s;let E=y,k=mh(E);for(;k&&s&&b!==E;){const v=Gi(k),j=k.getBoundingClientRect(),C=Wr(k),N=j.left+(k.clientLeft+parseFloat(C.paddingLeft))*v.x,T=j.top+(k.clientTop+parseFloat(C.paddingTop))*v.y;p*=v.x,m*=v.y,h*=v.x,x*=v.y,p+=N,m+=T,E=yr(k),k=mh(E)}}return sd({width:h,height:x,x:p,y:m})}function zd(e,t){const n=Fd(e).scrollLeft;return t?t.left+n:Bo(ms(e)).left+n}function Xk(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-zd(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function ED(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const l=i==="fixed",c=ms(s),u=t?Md(t.floating):!1;if(s===c||u&&l)return n;let p={scrollLeft:0,scrollTop:0},m=ls(1);const h=ls(0),x=$s(s);if((x||!x&&!l)&&((ua(s)!=="body"||Ql(c))&&(p=Fd(s)),x)){const b=Bo(s);m=Gi(s),h.x=b.x+s.clientLeft,h.y=b.y+s.clientTop}const y=c&&!x&&!l?Xk(c,p):ls(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-p.scrollLeft*m.x+h.x+y.x,y:n.y*m.y-p.scrollTop*m.y+h.y+y.y}}function TD(e){return Array.from(e.getClientRects())}function PD(e){const t=ms(e),n=Fd(e),s=e.ownerDocument.body,i=hr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=hr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+zd(e);const u=-n.scrollTop;return Wr(s).direction==="rtl"&&(c+=hr(t.clientWidth,s.clientWidth)-i),{width:i,height:l,x:c,y:u}}const Ov=25;function RD(e,t){const n=yr(e),s=ms(e),i=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,p=0;if(i){l=i.width,c=i.height;const h=Tg();(!h||h&&t==="fixed")&&(u=i.offsetLeft,p=i.offsetTop)}const m=zd(s);if(m<=0){const h=s.ownerDocument,x=h.body,y=getComputedStyle(x),b=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,E=Math.abs(s.clientWidth-x.clientWidth-b);E<=Ov&&(l-=E)}else m<=Ov&&(l+=m);return{width:l,height:c,x:u,y:p}}function AD(e,t){const n=Bo(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,l=$s(e)?Gi(e):ls(1),c=e.clientWidth*l.x,u=e.clientHeight*l.y,p=i*l.x,m=s*l.y;return{width:c,height:u,x:p,y:m}}function _v(e,t,n){let s;if(t==="viewport")s=RD(e,n);else if(t==="document")s=PD(ms(e));else if(Hr(t))s=AD(t,n);else{const i=Jk(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sd(s)}function Qk(e,t){const n=oo(e);return n===t||!Hr(n)||ra(n)?!1:Wr(n).position==="fixed"||Qk(n,t)}function DD(e,t){const n=t.get(e);if(n)return n;let s=Ol(e,[],!1).filter(u=>Hr(u)&&ua(u)!=="body"),i=null;const l=Wr(e).position==="fixed";let c=l?oo(e):e;for(;Hr(c)&&!ra(c);){const u=Wr(c),p=Eg(c);!p&&u.position==="fixed"&&(i=null),(l?!p&&!i:!p&&u.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Ql(c)&&!p&&Qk(e,c))?s=s.filter(h=>h!==c):i=u,c=oo(c)}return t.set(e,s),s}function $D(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const c=[...n==="clippingAncestors"?Md(t)?[]:DD(t,this._c):[].concat(n),s],u=_v(t,c[0],i);let p=u.top,m=u.right,h=u.bottom,x=u.left;for(let y=1;y<c.length;y++){const b=_v(t,c[y],i);p=hr(b.top,p),m=so(b.right,m),h=so(b.bottom,h),x=hr(b.left,x)}return{width:m-x,height:h-p,x,y:p}}function LD(e){const{width:t,height:n}=Yk(e);return{width:t,height:n}}function ID(e,t,n){const s=$s(t),i=ms(t),l=n==="fixed",c=Bo(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const p=ls(0);function m(){p.x=zd(i)}if(s||!s&&!l)if((ua(t)!=="body"||Ql(i))&&(u=Fd(t)),s){const b=Bo(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}else i&&m();l&&!s&&i&&m();const h=i&&!s&&!l?Xk(i,u):ls(0),x=c.left+u.scrollLeft-p.x-h.x,y=c.top+u.scrollTop-p.y-h.y;return{x,y,width:c.width,height:c.height}}function wm(e){return Wr(e).position==="static"}function Mv(e,t){if(!$s(e)||Wr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ms(e)===n&&(n=n.ownerDocument.body),n}function Zk(e,t){const n=yr(e);if(Md(e))return n;if(!$s(e)){let i=oo(e);for(;i&&!ra(i);){if(Hr(i)&&!wm(i))return i;i=oo(i)}return n}let s=Mv(e,t);for(;s&&wD(s)&&wm(s);)s=Mv(s,t);return s&&ra(s)&&wm(s)&&!Eg(s)?n:s||SD(e)||n}const OD=async function(e){const t=this.getOffsetParent||Zk,n=this.getDimensions,s=await n(e.floating);return{reference:ID(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function _D(e){return Wr(e).direction==="rtl"}const MD={convertOffsetParentRelativeRectToViewportRelativeRect:ED,getDocumentElement:ms,getClippingRect:$D,getOffsetParent:Zk,getElementRects:OD,getClientRects:TD,getDimensions:LD,getScale:Gi,isElement:Hr,isRTL:_D};function e1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FD(e,t){let n=null,s;const i=ms(e);function l(){var u;clearTimeout(s),(u=n)==null||u.disconnect(),n=null}function c(u,p){u===void 0&&(u=!1),p===void 0&&(p=1),l();const m=e.getBoundingClientRect(),{left:h,top:x,width:y,height:b}=m;if(u||t(),!y||!b)return;const E=vu(x),k=vu(i.clientWidth-(h+y)),v=vu(i.clientHeight-(x+b)),j=vu(h),N={rootMargin:-E+"px "+-k+"px "+-v+"px "+-j+"px",threshold:hr(0,so(1,p))||1};let T=!0;function L(P){const $=P[0].intersectionRatio;if($!==p){if(!T)return c();$?c(!1,$):s=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!e1(m,e.getBoundingClientRect())&&c(),T=!1}try{n=new IntersectionObserver(L,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,N)}n.observe(e)}return c(!0),l}function zD(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=Pg(e),h=i||l?[...m?Ol(m):[],...t?Ol(t):[]]:[];h.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),l&&j.addEventListener("resize",n)});const x=m&&u?FD(m,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(j=>{let[C]=j;C&&C.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(t)})),n()}),m&&!p&&b.observe(m),t&&b.observe(t));let E,k=p?Bo(e):null;p&&v();function v(){const j=Bo(e);k&&!e1(k,j)&&n(),k=j,E=requestAnimationFrame(v)}return n(),()=>{var j;h.forEach(C=>{i&&C.removeEventListener("scroll",n),l&&C.removeEventListener("resize",n)}),x==null||x(),(j=b)==null||j.disconnect(),b=null,p&&cancelAnimationFrame(E)}}const BD=xD,UD=yD,VD=mD,HD=vD,WD=hD,Fv=pD,KD=bD,qD=(e,t,n)=>{const s=new Map,i={platform:MD,...n},l={...i.platform,_c:s};return fD(e,t,{...i,platform:l})};var GD=typeof document<"u",YD=function(){},zu=GD?f.useLayoutEffect:YD;function od(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,i;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(!od(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const l=i[s];if(!(l==="_owner"&&e.$$typeof)&&!od(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function t1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zv(e,t){const n=t1(e);return Math.round(t*n)/n}function jm(e){const t=f.useRef(e);return zu(()=>{t.current=e}),t}function JD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:p,open:m}=e,[h,x]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=f.useState(s);od(y,s)||b(s);const[E,k]=f.useState(null),[v,j]=f.useState(null),C=f.useCallback(_=>{_!==P.current&&(P.current=_,k(_))},[]),N=f.useCallback(_=>{_!==$.current&&($.current=_,j(_))},[]),T=l||E,L=c||v,P=f.useRef(null),$=f.useRef(null),D=f.useRef(h),J=p!=null,ee=jm(p),M=jm(i),U=jm(m),X=f.useCallback(()=>{if(!P.current||!$.current)return;const _={placement:t,strategy:n,middleware:y};M.current&&(_.platform=M.current),qD(P.current,$.current,_).then(G=>{const A={...G,isPositioned:U.current!==!1};B.current&&!od(D.current,A)&&(D.current=A,Cs.flushSync(()=>{x(A)}))})},[y,t,n,M,U]);zu(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,x(_=>({..._,isPositioned:!1})))},[m]);const B=f.useRef(!1);zu(()=>(B.current=!0,()=>{B.current=!1}),[]),zu(()=>{if(T&&(P.current=T),L&&($.current=L),T&&L){if(ee.current)return ee.current(T,L,X);X()}},[T,L,X,ee,J]);const q=f.useMemo(()=>({reference:P,floating:$,setReference:C,setFloating:N}),[C,N]),Z=f.useMemo(()=>({reference:T,floating:L}),[T,L]),le=f.useMemo(()=>{const _={position:n,left:0,top:0};if(!Z.floating)return _;const G=zv(Z.floating,h.x),A=zv(Z.floating,h.y);return u?{..._,transform:"translate("+G+"px, "+A+"px)",...t1(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:A}},[n,u,Z.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:X,refs:q,elements:Z,floatingStyles:le}),[h,X,q,Z,le])}const XD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:i}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Fv({element:s.current,padding:i}).fn(n):{}:s?Fv({element:s,padding:i}).fn(n):{}}}},QD=(e,t)=>{const n=BD(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZD=(e,t)=>{const n=UD(e);return{name:n.name,fn:n.fn,options:[e,t]}},e4=(e,t)=>({fn:KD(e).fn,options:[e,t]}),t4=(e,t)=>{const n=VD(e);return{name:n.name,fn:n.fn,options:[e,t]}},n4=(e,t)=>{const n=HD(e);return{name:n.name,fn:n.fn,options:[e,t]}},r4=(e,t)=>{const n=WD(e);return{name:n.name,fn:n.fn,options:[e,t]}},s4=(e,t)=>{const n=XD(e);return{name:n.name,fn:n.fn,options:[e,t]}};var o4="Arrow",n1=f.forwardRef((e,t)=>{const{children:n,width:s=10,height:i=5,...l}=e;return r.jsx(pn.svg,{...l,ref:t,width:s,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});n1.displayName=o4;var i4=n1;function a4(e){const[t,n]=f.useState(void 0);return ro(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let c,u;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Rg="Popper",[r1,s1]=Ho(Rg),[l4,o1]=r1(Rg),i1=e=>{const{__scopePopper:t,children:n}=e,[s,i]=f.useState(null);return r.jsx(l4,{scope:t,anchor:s,onAnchorChange:i,children:n})};i1.displayName=Rg;var a1="PopperAnchor",l1=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...i}=e,l=o1(a1,n),c=f.useRef(null),u=Fn(t,c),p=f.useRef(null);return f.useEffect(()=>{const m=p.current;p.current=(s==null?void 0:s.current)||c.current,m!==p.current&&l.onAnchorChange(p.current)}),s?null:r.jsx(pn.div,{...i,ref:u})});l1.displayName=a1;var Ag="PopperContent",[c4,u4]=r1(Ag),c1=f.forwardRef((e,t)=>{var ne,de,ye,ke,fe,Ve;const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:E,...k}=e,v=o1(Ag,n),[j,C]=f.useState(null),N=Fn(t,pe=>C(pe)),[T,L]=f.useState(null),P=a4(T),$=(P==null?void 0:P.width)??0,D=(P==null?void 0:P.height)??0,J=s+(l!=="center"?"-"+l:""),ee=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],U=M.length>0,X={padding:ee,boundary:M.filter(f4),altBoundary:U},{refs:B,floatingStyles:q,placement:Z,isPositioned:le,middlewareData:_}=JD({strategy:"fixed",placement:J,whileElementsMounted:(...pe)=>zD(...pe,{animationFrame:b==="always"}),elements:{reference:v.anchor},middleware:[QD({mainAxis:i+D,alignmentAxis:c}),p&&ZD({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?e4():void 0,...X}),p&&t4({...X}),n4({...X,apply:({elements:pe,rects:Re,availableWidth:O,availableHeight:W})=>{const{width:te,height:xe}=Re.reference,Ae=pe.floating.style;Ae.setProperty("--radix-popper-available-width",`${O}px`),Ae.setProperty("--radix-popper-available-height",`${W}px`),Ae.setProperty("--radix-popper-anchor-width",`${te}px`),Ae.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),T&&s4({element:T,padding:u}),p4({arrowWidth:$,arrowHeight:D}),y&&r4({strategy:"referenceHidden",...X})]}),[G,A]=f1(Z),z=Fo(E);ro(()=>{le&&(z==null||z())},[le,z]);const Q=(ne=_.arrow)==null?void 0:ne.x,I=(de=_.arrow)==null?void 0:de.y,ue=((ye=_.arrow)==null?void 0:ye.centerOffset)!==0,[me,V]=f.useState();return ro(()=>{j&&V(window.getComputedStyle(j).zIndex)},[j]),r.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:le?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(ke=_.transformOrigin)==null?void 0:ke.x,(fe=_.transformOrigin)==null?void 0:fe.y].join(" "),...((Ve=_.hide)==null?void 0:Ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(c4,{scope:n,placedSide:G,onArrowChange:L,arrowX:Q,arrowY:I,shouldHideArrow:ue,children:r.jsx(pn.div,{"data-side":G,"data-align":A,...k,ref:N,style:{...k.style,animation:le?void 0:"none"}})})})});c1.displayName=Ag;var u1="PopperArrow",d4={top:"bottom",right:"left",bottom:"top",left:"right"},d1=f.forwardRef(function(t,n){const{__scopePopper:s,...i}=t,l=u4(u1,s),c=d4[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(i4,{...i,ref:n,style:{...i.style,display:"block"}})})});d1.displayName=u1;function f4(e){return e!==null}var p4=e=>({name:"transformOrigin",options:e,fn(t){var v,j,C;const{placement:n,rects:s,middlewareData:i}=t,c=((v=i.arrow)==null?void 0:v.centerOffset)!==0,u=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=f1(n),x={start:"0%",center:"50%",end:"100%"}[h],y=(((j=i.arrow)==null?void 0:j.x)??0)+u/2,b=(((C=i.arrow)==null?void 0:C.y)??0)+p/2;let E="",k="";return m==="bottom"?(E=c?x:`${y}px`,k=`${-p}px`):m==="top"?(E=c?x:`${y}px`,k=`${s.floating.height+p}px`):m==="right"?(E=`${-p}px`,k=c?x:`${b}px`):m==="left"&&(E=`${s.floating.width+p}px`,k=c?x:`${b}px`),{data:{x:E,y:k}}}});function f1(e){const[t,n="center"]=e.split("-");return[t,n]}var m4=i1,h4=l1,g4=c1,x4=d1,y4=Symbol("radix.slottable");function b4(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=y4,t}var v4=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"}),w4="VisuallyHidden",p1=f.forwardRef((e,t)=>r.jsx(pn.span,{...e,ref:t,style:{...v4,...e.style}}));p1.displayName=w4;var j4=p1,[Bd]=Ho("Tooltip",[s1]),Ud=s1(),m1="TooltipProvider",k4=700,hh="tooltip.open",[S4,Dg]=Bd(m1),h1=e=>{const{__scopeTooltip:t,delayDuration:n=k4,skipDelayDuration:s=300,disableHoverableContent:i=!1,children:l}=e,c=f.useRef(!0),u=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),r.jsx(S4,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(p.current),c.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(m=>{u.current=m},[]),disableHoverableContent:i,children:l})};h1.displayName=m1;var _l="Tooltip",[N4,Zl]=Bd(_l),g1=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:i,onOpenChange:l,disableHoverableContent:c,delayDuration:u}=e,p=Dg(_l,e.__scopeTooltip),m=Ud(t),[h,x]=f.useState(null),y=Hi(),b=f.useRef(0),E=c??p.disableHoverableContent,k=u??p.delayDuration,v=f.useRef(!1),[j,C]=Ad({prop:s,defaultProp:i??!1,onChange:$=>{$?(p.onOpen(),document.dispatchEvent(new CustomEvent(hh))):p.onClose(),l==null||l($)},caller:_l}),N=f.useMemo(()=>j?v.current?"delayed-open":"instant-open":"closed",[j]),T=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,v.current=!1,C(!0)},[C]),L=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C(!1)},[C]),P=f.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{v.current=!0,C(!0),b.current=0},k)},[k,C]);return f.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(m4,{...m,children:r.jsx(N4,{scope:t,contentId:y,open:j,stateAttribute:N,trigger:h,onTriggerChange:x,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?P():T()},[p.isOpenDelayedRef,P,T]),onTriggerLeave:f.useCallback(()=>{E?L():(window.clearTimeout(b.current),b.current=0)},[L,E]),onOpen:T,onClose:L,disableHoverableContent:E,children:n})})};g1.displayName=_l;var gh="TooltipTrigger",x1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=Zl(gh,n),l=Dg(gh,n),c=Ud(n),u=f.useRef(null),p=Fn(t,u,i.onTriggerChange),m=f.useRef(!1),h=f.useRef(!1),x=f.useCallback(()=>m.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(h4,{asChild:!0,...c,children:r.jsx(pn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:p,onPointerMove:Wt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Wt(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Wt(e.onPointerDown,()=>{i.open&&i.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Wt(e.onFocus,()=>{m.current||i.onOpen()}),onBlur:Wt(e.onBlur,i.onClose),onClick:Wt(e.onClick,i.onClose)})})});x1.displayName=gh;var $g="TooltipPortal",[C4,E4]=Bd($g,{forceMount:void 0}),y1=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:i}=e,l=Zl($g,t);return r.jsx(C4,{scope:t,forceMount:n,children:r.jsx(Wo,{present:n||l.open,children:r.jsx(lg,{asChild:!0,container:i,children:s})})})};y1.displayName=$g;var sa="TooltipContent",b1=f.forwardRef((e,t)=>{const n=E4(sa,e.__scopeTooltip),{forceMount:s=n.forceMount,side:i="top",...l}=e,c=Zl(sa,e.__scopeTooltip);return r.jsx(Wo,{present:s||c.open,children:c.disableHoverableContent?r.jsx(v1,{side:i,...l,ref:t}):r.jsx(T4,{side:i,...l,ref:t})})}),T4=f.forwardRef((e,t)=>{const n=Zl(sa,e.__scopeTooltip),s=Dg(sa,e.__scopeTooltip),i=f.useRef(null),l=Fn(t,i),[c,u]=f.useState(null),{trigger:p,onClose:m}=n,h=i.current,{onPointerInTransitChange:x}=s,y=f.useCallback(()=>{u(null),x(!1)},[x]),b=f.useCallback((E,k)=>{const v=E.currentTarget,j={x:E.clientX,y:E.clientY},C=$4(j,v.getBoundingClientRect()),N=L4(j,C),T=I4(k.getBoundingClientRect()),L=_4([...N,...T]);u(L),x(!0)},[x]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(p&&h){const E=v=>b(v,h),k=v=>b(v,p);return p.addEventListener("pointerleave",E),h.addEventListener("pointerleave",k),()=>{p.removeEventListener("pointerleave",E),h.removeEventListener("pointerleave",k)}}},[p,h,b,y]),f.useEffect(()=>{if(c){const E=k=>{const v=k.target,j={x:k.clientX,y:k.clientY},C=(p==null?void 0:p.contains(v))||(h==null?void 0:h.contains(v)),N=!O4(j,c);C?y():N&&(y(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[p,h,c,m,y]),r.jsx(v1,{...e,ref:l})}),[P4,R4]=Bd(_l,{isInside:!1}),A4=b4("TooltipContent"),v1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=e,p=Zl(sa,n),m=Ud(n),{onClose:h}=p;return f.useEffect(()=>(document.addEventListener(hh,h),()=>document.removeEventListener(hh,h)),[h]),f.useEffect(()=>{if(p.trigger){const x=y=>{const b=y.target;b!=null&&b.contains(p.trigger)&&h()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,h]),r.jsx(ag,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:h,children:r.jsxs(g4,{"data-state":p.stateAttribute,...m,...u,ref:t,style:{...u.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(A4,{children:s}),r.jsx(P4,{scope:n,isInside:!0,children:r.jsx(j4,{id:p.contentId,role:"tooltip",children:i||s})})]})})});b1.displayName=sa;var w1="TooltipArrow",D4=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=Ud(n);return R4(w1,n).isInside?null:r.jsx(x4,{...i,...s,ref:t})});D4.displayName=w1;function $4(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,i,l)){case l:return"left";case i:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function L4(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 I4(e){const{top:t,right:n,bottom:s,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:s},{x:i,y:s}]}function O4(e,t){const{x:n,y:s}=e;let i=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const u=t[l],p=t[c],m=u.x,h=u.y,x=p.x,y=p.y;h>s!=y>s&&n<(x-m)*(s-h)/(y-h)+m&&(i=!i)}return i}function _4(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),M4(t)}function M4(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const i=e[s];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const i=e[s];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}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 F4=h1,z4=g1,B4=x1,U4=y1,j1=b1;const Mo=F4,Tr=z4,Pr=B4,gr=f.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(U4,{children:r.jsx(j1,{ref:s,sideOffset:t,className:Te("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})}));gr.displayName=j1.displayName;function Lg({items:e,align:t="end"}){const[n,s]=f.useState(!1),i=f.useRef(null);return f.useEffect(()=>{if(!n)return;function l(u){i.current&&!i.current.contains(u.target)&&s(!1)}function c(u){u.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:i,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(ST,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:Te("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(Mo,{delayDuration:200,children:e.map(l=>{const c=l.icon,u=Te("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"),p=r.jsxs(r.Fragment,{children:[c?r.jsx(c,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 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:u,children:p})});return l.disabledReason?r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:m}),r.jsx(gr,{side:"left",children:l.disabledReason})]},l.key):r.jsx("div",{children:m},l.key)}return l.href?r.jsx(Ne,{to:l.href,className:u,onClick:()=>s(!1),children:p},l.key):r.jsx("button",{type:"button",className:u,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:p},l.key)})})})]})}function Bv(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}const V4={last_24h:1440*60*1e3,last_7d:10080*60*1e3,last_30d:720*60*60*1e3,last_90d:2160*60*60*1e3,older_7d:10080*60*1e3,older_30d:720*60*60*1e3};function H4(e){const[t,n,s]=e.split("-").map(Number);return new Date(t,n-1,s,0,0,0,0).getTime()}function W4(e){const[t,n,s]=e.split("-").map(Number);return new Date(t,n-1,s,23,59,59,999).getTime()}function K4(e,t,n=Date.now()){if(!t)return!0;const s=t.field==="created"?e.created??e.updated:e.updated,i=Date.parse(s);if(Number.isNaN(i))return!1;if(t.preset){const u=V4[t.preset];return u===void 0?!0:t.preset.startsWith("older_")?n-i>u:i>=n-u&&i<=n}const l=t.from&&t.from.length>0?t.from:void 0,c=t.to&&t.to.length>0?t.to:void 0;return!l&&!c?!0:!(l&&i<H4(l)||c&&i>W4(c))}function Ig(e,t,n={}){const{workspace:s,search:i,includeArchived:l}=n;if(e.archived===!0&&!l)return!1;const c=qe(t.status),u=qe(t.priority),p=qe(t.type),m=qe(t.assignee),h=qe(t.project),x=qe(t.tags),{activity:y}=t;if(s){if(s==="_ungrouped"){if(e.projectWorkspace!=null)return!1}else if(e.projectWorkspace!==s)return!1}if(c.length&&!c.includes(e.status)||u.length&&!u.includes(e.priority)||p.length&&!p.includes(e.type??"")||y==="stale"&&!Bv(e.updated)||y==="fresh"&&Bv(e.updated))return!1;if(m.length){const b=e.assignee??"__unassigned__";if(!m.includes(b))return!1}if(h.length&&!h.some(E=>E==="__standalone__"?e.projectSlug==null:e.projectSlug===E))return!1;if(x.length){const b=e.tags??[];if(!x.some(E=>b.includes(E)))return!1}if(!K4(e,t.dateRange))return!1;if(i){const b=i.trim().toLowerCase();if(b&&!`${e.title??""} ${e.slug??""} ${e.projectTitle??"standalone"} ${e.projectSlug??""}`.toLowerCase().includes(b))return!1}return!0}function k1(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}const S1={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 vl=null,Io=null;function q4(){return vl?Promise.resolve(vl):Io||(Io=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(vl=e,Io=null,e)).catch(()=>(Io=null,S1)),Io)}function Ko(){const[e,t]=f.useState(()=>vl??S1);return f.useEffect(()=>{q4().then(t)},[]),e}function Uv(){vl=null,Io=null}function ec(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 Vv={critical:0,high:1,medium:2,low:3};function wu(e){return Date.parse(e??"")||0}function tc(e,t,n){return[...e].sort((i,l)=>{let c=0;switch(t){case"title":c=i.title.localeCompare(l.title);break;case"status":c=i.status.localeCompare(l.status);break;case"priority":c=(Vv[i.priority]??99)-(Vv[l.priority]??99);break;case"assignee":c=(i.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=i.dependsOn.length-l.dependsOn.length;break;case"created":c=wu(i.created)-wu(l.created);break;case"updated":c=wu(i.updated)-wu(l.updated);break}return n==="asc"?c:-c})}function ct({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]})})}const xh='a, button, input, select, textarea, [contenteditable="true"], [role="button"], [data-no-drag]';function Vd({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:i,canDrop:l,onMove:c,getExternalDragData:u,onCardContextMenu:p,emptyMessage:m="No cards in this column.",hiddenColumnIds:h,onHideColumn:x,compact:y=!1,dragDisabled:b=!1}){const E=f.useMemo(()=>new Set(h??[]),[h]),k=f.useMemo(()=>e.filter(B=>!E.has(B.id)),[e,E]),v=f.useMemo(()=>e.filter(B=>E.has(B.id)),[e,E]),[j,C]=f.useState(null),[N,T]=f.useState(null),L=f.useRef(null),P=f.useMemo(()=>new Map(t.map(B=>[n(B),B])),[n,t]),$=f.useMemo(()=>k.map(B=>({column:B,items:t.filter(q=>s(q)===B.id)})),[k,s,t]),D=j?P.get(j)??null:null;function J(B){if(!D)return{allowed:!1};const q=s(D);return(l==null?void 0:l({item:D,fromColumnId:q,toColumnId:B}))??{allowed:!0}}function ee(){C(null),T(null)}function M(B,q,Z){if(b)return;const le=(u==null?void 0:u(q))??null;!c&&!le||(B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",Z),le&&B.dataTransfer.setData("application/json",JSON.stringify(le)),c&&C(Z))}function U(B,q,Z){b||!c||!D||!J(q).allowed||(B.preventDefault(),B.dataTransfer.dropEffect="move",T(_=>(_==null?void 0:_.columnId)===q&&_.index===Z?_:{columnId:q,index:Z}))}async function X(B,q,Z){var z;if(B.preventDefault(),b||!c||!D){ee();return}const le=s(D),G=(((z=$.find(Q=>Q.column.id===le))==null?void 0:z.items)??[]).findIndex(Q=>n(Q)===n(D));if(!J(q).allowed||G<0){ee();return}if(le===q&&(Z===G||Z===G+1)){ee();return}try{await c({item:D,fromColumnId:le,toColumnId:q,fromIndex:G,toIndex:Z})}finally{ee()}}return r.jsxs("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:[v.length>0&&x?r.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{children:"Hidden:"}),v.map(B=>r.jsxs("button",{type:"button",onClick:()=>x(B.id),className:"rounded-full border border-dashed border-border/60 px-2 py-0.5 hover:border-border hover:text-foreground",title:`Restore "${B.title}" column`,children:[B.title," ×"]},B.id))]}):null,r.jsx("div",{className:Te("grid min-w-max grid-flow-col gap-4",y?"auto-cols-[minmax(200px,240px)]":"auto-cols-[minmax(260px,320px)]"),children:$.map(({column:B,items:q})=>{const Z=J(B.id),le=(N==null?void 0:N.columnId)===B.id;return r.jsxs("section",{className:Te("flex flex-col rounded-lg border border-border/60 bg-card/85 shadow-sm",y?"min-h-[200px] p-2":"min-h-[320px] p-3",D&&!Z.allowed?"border-dashed opacity-65":"",D&&Z.allowed?"border-primary/30 bg-accent/30":"",le?"ring-2 ring-ring/30":""),title:D&&!Z.allowed?Z.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:Te("font-semibold uppercase tracking-[0.16em] text-muted-foreground",y?"text-xs":"text-sm"),children:B.title}),B.description&&!y?r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:B.description}):null]}),r.jsxs("div",{className:"flex items-center gap-1",children:[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:q.length}),x?r.jsx("button",{type:"button",onClick:()=>x(B.id),className:"rounded-full border border-transparent px-1.5 py-0.5 text-xs text-muted-foreground hover:border-border hover:text-foreground",title:`Hide "${B.title}" column`,"aria-label":`Hide column ${B.title}`,children:"×"}):null]})]}),r.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:_=>U(_,B.id,q.length),onDrop:_=>X(_,B.id,q.length),children:[q.length===0?b?r.jsx("div",{className:"flex min-h-[128px] items-center justify-center rounded-lg border border-border/60 bg-background/50 px-4 text-center text-sm text-muted-foreground",children:typeof m=="function"?m(B):m}):r.jsx(G4,{active:(N==null?void 0:N.columnId)===B.id&&N.index===0,disabled:!!D&&!Z.allowed,children:typeof m=="function"?m(B):m}):null,q.map((_,G)=>{const A=n(_),z=j===A;return r.jsxs(f.Fragment,{children:[r.jsx("div",{className:Te("h-2 rounded-full transition",(N==null?void 0:N.columnId)===B.id&&N.index===G?"bg-primary/70":"bg-transparent"),onDragOver:Q=>U(Q,B.id,G),onDrop:Q=>X(Q,B.id,G)}),r.jsx("div",{draggable:!b&&!!(c||u),onMouseDown:Q=>{L.current=Q.target},onDragStart:Q=>{const I=L.current;if(I!=null&&I.closest(xh)){Q.preventDefault();return}M(Q,_,A)},onDragEnd:ee,onContextMenu:Q=>{if(!p)return;const I=Q.target;I!=null&&I.closest(xh)||p(_,Q)},className:Te("transition",!b&&(c||u)?"cursor-grab active:cursor-grabbing":"",z?"scale-[0.98] opacity-50":""),children:i(_,{dragging:z})})]},A)}),q.length>0&&!b?r.jsx("div",{className:Te("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(N==null?void 0:N.columnId)===B.id&&N.index===q.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",D&&!Z.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},B.id)})})]})}function G4({active:e,disabled:t,children:n}){return r.jsx("div",{className:Te("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 xl="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",km="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",Y4="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",J4="border-status-review-foreground/30 bg-status-review text-status-review-foreground",X4="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",Q4="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",Z4="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",id={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:xl,icon:Uo},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:xl,icon:bT},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:xl,icon:Jj},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:km,icon:OT},in_progress:{label:"In Progress",description:"Actively being worked on.",className:km,icon:Jh},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:Y4,icon:th},review:{label:"Review",description:"Ready for inspection or approval.",className:J4,icon:FT},completed:{label:"Completed",description:"Finished successfully.",className:X4,icon:Kh},failed:{label:"Failed",description:"Could not be completed as planned.",className:Q4,icon:th},active:{label:"Active",description:"The project has active or review work in flight.",className:km,icon:nh},stopped:{label:"Stopped",description:"Session ended without completing.",className:xl,icon:xT},archived:{label:"Archived",description:"Hidden from normal views; restorable from the Archive page.",className:Z4,icon:nh}};function ad(e){const t=id[e];return t||{className:xl,icon:nh,label:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase()),description:`Status: ${e}`}}function N1(e,t){return Te("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)]",ad(e).className,t)}function vn({status:e,className:t,showIcon:n=!0,progress:s}){const i=ad(e),l=i.icon,c=s&&s.total>0,u=c?Math.min(1,Math.max(0,s.checked/s.total)):0,p=c?`${i.description} (${s.checked}/${s.total} criteria)`:i.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-u)})]}),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:p,className:N1(e,t),children:[m,r.jsx("span",{children:i.label})]})}function Hd(e){var t;return((t=id[e])==null?void 0:t.description)??`Status: ${e}`}function Ar({value:e,label:t,disabled:n=!1,disabledReason:s,onError:i}){const[l,c]=f.useState(!1);async function u(){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(p){i==null||i(p instanceof Error?p:new Error(String(p)))}}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(Al,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:u,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(Rs,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(Al,{className:"h-3 w-3","aria-hidden":"true"})})}function e$(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function t$({items:e,statusOrder:t,sortField:n,sortDirection:s,listSectionVisibility:i,compact:l=!1}){const c=Ko(),[u,p]=f.useState(()=>new Set(i.collapsed));f.useEffect(()=>{p(new Set(i.collapsed))},[i]);const m=h=>{p(x=>{const y=new Set(x);return y.has(h)?y.delete(h):y.add(h),y})};return r.jsx("div",{className:Te("space-y-2",l?"space-y-1.5":"space-y-3"),children:t.map(h=>{const x=tc(e.filter(E=>E.status===h),n,s);if(x.length===0)return null;const y=!u.has(h),b=ec(c,h);return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/90",children:[r.jsxs("button",{type:"button",onClick:()=>m(h),className:Te("flex w-full items-center gap-2 text-left",l?"px-3 py-2 text-xs":"px-4 py-3 text-sm"),children:[r.jsx(cs,{className:Te("text-muted-foreground transition-transform",l?"h-3.5 w-3.5":"h-4 w-4",y?"":"-rotate-90")}),r.jsx("span",{className:"font-semibold text-foreground",children:b}),r.jsx("span",{className:Te("rounded-full border border-border/60 text-muted-foreground",l?"px-1.5 py-0 text-[10px]":"px-2 py-0.5 text-xs"),children:x.length})]}),y&&r.jsx("ul",{className:Te("divide-y divide-border/40 border-t border-border/40",l?"text-xs":"text-sm"),children:x.map(E=>{const k=e$(E);return r.jsx("li",{children:r.jsxs(Ne,{to:k,className:Te("flex items-center gap-3 hover:bg-muted/40",l?"px-3 py-1.5":"px-4 py-2.5"),children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:E.title}),E.projectTitle?r.jsx("span",{className:"hidden truncate text-muted-foreground sm:inline",children:E.projectTitle}):null,r.jsx("span",{className:"shrink-0 text-muted-foreground",children:Mn(E.updated)})]})},`${E.projectSlug??"standalone"}:${E.id}`)})})]},h)})})}function n$(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function r$({items:e,sortField:t,sortDirection:n,tableColumnVisibility:s,compact:i=!1}){const l=new Set(s.hidden);l.delete("title");const c=h=>!l.has(h),u=tc(e,t,n),p=i?"py-2 pr-3":"py-3 pr-4",m=i?"text-xs":"text-sm";return r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:Te("w-full text-left",m),children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[c("title")?r.jsx("th",{className:Te("font-medium",p),children:"Assignment"}):null,c("status")?r.jsx("th",{className:Te("font-medium",p),children:"Status"}):null,c("priority")?r.jsx("th",{className:Te("font-medium",p),children:"Priority"}):null,c("assignee")?r.jsx("th",{className:Te("font-medium",p),children:"Assignee"}):null,c("dependencies")?r.jsx("th",{className:Te("font-medium",p),children:"Dependencies"}):null,c("created")?r.jsx("th",{className:Te("font-medium",p),children:"Created"}):null,c("updated")?r.jsx("th",{className:Te("font-medium",p),children:"Updated"}):null]})}),r.jsx("tbody",{children:u.map(h=>{const x=n$(h),y=`${h.projectSlug??"standalone"}:${h.id}`;return r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[c("title")?r.jsxs("td",{className:p,children:[r.jsx(Ne,{to:x,className:"font-semibold text-foreground hover:text-primary",children:h.title}),h.projectTitle?r.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h.projectTitle}):null]}):null,c("status")?r.jsx("td",{className:p,children:r.jsx(vn,{status:h.status})}):null,c("priority")?r.jsx("td",{className:Te("capitalize text-muted-foreground",p),children:h.priority}):null,c("assignee")?r.jsx("td",{className:Te("text-muted-foreground",p),children:h.assignee??"Unassigned"}):null,c("dependencies")?r.jsx("td",{className:Te("text-muted-foreground",p),children:h.dependsOn.length}):null,c("created")?r.jsx("td",{className:Te("text-muted-foreground",p),children:Mn(h.created)}):null,c("updated")?r.jsx("td",{className:Te("text-muted-foreground",p),children:Mn(h.updated)}):null]},y)})})]})})}function s$(e,t,n){return e.filter(s=>Ig(s,t,{workspace:n,search:t.search}))}function o$({viewId:e,onPickAnother:t}){const{view:n,loading:s,error:i,refetch:l}=na(e),{data:c,loading:u,error:p}=Td(),m=Ko(),h=f.useMemo(()=>m.order.map(y=>({id:y,title:ec(m,y),description:Hd(y)})),[m]),x=f.useMemo(()=>{if(!n||!c)return[];const y=s$(c.assignments,n.config.filters,n.workspace);return tc(y,n.config.sortField,n.config.sortDirection)},[c,n]);if(s||u&&!c)return r.jsx(ft,{label:"Loading view…"});if(i)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load view"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.message}),r.jsx("button",{type:"button",onClick:()=>l(),className:"shell-action mt-3",children:"Retry"})]});if(!n)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"View no longer exists"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"The saved view this slot was bound to has been deleted."}),r.jsx("button",{type:"button",onClick:t,className:"shell-action mt-3",children:"Pick another widget"})]});if(p)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load assignments"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p})]});if(x.length===0)return r.jsx(ct,{title:"No assignments match this view.",description:"Adjust the view's filters to surface different work, or pick another widget for this slot."});switch(n.config.viewMode){case"kanban":return r.jsx(Vd,{compact:!0,columns:h,items:x,getItemId:y=>y.slug||y.id,getColumnId:y=>y.status,hiddenColumnIds:n.config.kanbanColumnVisibility.hidden,renderCard:y=>r.jsx(i$,{item:y})});case"list":return r.jsx(t$,{items:x,statusOrder:m.order,sortField:n.config.sortField,sortDirection:n.config.sortDirection,listSectionVisibility:n.config.listSectionVisibility,compact:!0});case"table":return r.jsx(r$,{items:x,sortField:n.config.sortField,sortDirection:n.config.sortDirection,tableColumnVisibility:n.config.tableColumnVisibility,compact:!0})}}function i$({item:e}){const t=k1(e);return r.jsxs("div",{className:Te("rounded-md border border-border/60 bg-background/85 p-2 shadow-sm"),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ne,{to:t,className:"block truncate text-sm font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.projectTitle??"Standalone"})]}),r.jsx(vn,{status:e.status})]}),r.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 text-[10px] uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{className:"truncate",children:e.assignee??"Unassigned"}),r.jsx("span",{className:"shrink-0",children:Mn(e.updated)})]}),e.id?r.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground/70",children:[e.id.slice(0,8),r.jsx(Ar,{value:e.id})]}):null]})}function a$({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:_o.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:_o.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(l$,{session:t})},t.sessionId))})]})}function l$({session:e}){const t=ln(),[n,s]=f.useState(!1),i=c$(e,t),l=u$(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(Ne,{to:i,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," · ",c0(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:_o.recentSessionsCopyFallbackHint})]}):null]}),r.jsx(Ar,{value:e.path,label:_o.recentSessionsCopyPathLabel,disabled:c,disabledReason:_o.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function c$(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function u$(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}function d$(){const{data:e,loading:t,error:n}=C0();return t&&!e?r.jsx(ft,{label:"Loading sessions…"}):n?r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load sessions"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]}):r.jsx(a$,{sessions:(e==null?void 0:e.sessions)??[]})}const f$=5;function p$(){const{data:e,loading:t,error:n}=N0();if(t&&!e)return r.jsx(ft,{label:"Loading inventories…"});if(n)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load inventories"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]});const i=((e==null?void 0:e.inventories)??[]).slice(0,f$);return r.jsxs("aside",{"aria-labelledby":"overview-inventories-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsxs("header",{className:"flex items-center justify-between border-b border-border/40 px-4 py-3",children:[r.jsx("h3",{id:"overview-inventories-title",className:"text-sm font-semibold text-foreground",children:"Inventories"}),r.jsx(Ne,{to:"/inventories",className:"text-xs text-muted-foreground hover:text-foreground",children:"View all →"})]}),i.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No inventories yet."}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:"Create one to track leased resources across agents."})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:i.map(l=>{const c=l.inventory,u=l.active_leases.length,p=l.members.length,m=c.display_name??c.slug;return r.jsx("li",{children:r.jsxs(Ne,{to:`/inventories/${encodeURIComponent(c.slug)}`,className:"flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:m}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[u,"/",p," leased"]})]})},c.slug)})})]})}const C1={"saved-view":{title:"Saved view",icon:Qj,render:(e,t)=>e.kind!=="saved-view"?null:f.createElement(o$,{viewId:e.viewId,onPickAnother:t.onPickAnother})},"agent-sessions":{title:"Agent sessions",icon:wd,render:()=>f.createElement(d$)},inventories:{title:"Inventories",icon:kd,render:()=>f.createElement(p$)}};function m$({slot:e,onReplace:t,onRemove:n}){if(e.widget===null)return r.jsx("div",{className:"flex min-h-[320px] items-center justify-center rounded-lg border border-dashed border-border/60 bg-card/40 p-3 shadow-sm",children:r.jsxs("button",{type:"button",onClick:t,className:"shell-action inline-flex items-center gap-2",children:[r.jsx(en,{className:"h-4 w-4"}),"Add widget"]})});const s=C1[e.widget.kind];if(!s)return r.jsx("div",{className:"min-h-[320px] overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",children:r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/60 px-3 py-2 text-sm text-muted-foreground",children:["Unknown widget kind: ",e.widget.kind]})});const i=s.icon;return r.jsxs("div",{className:"min-h-[320px] overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",children:[r.jsxs("header",{className:"mb-2 flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.12em] text-muted-foreground",children:[r.jsx(i,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{className:"truncate",children:r.jsx(h$,{slot:e,fallback:s.title})})]}),r.jsx(Lg,{items:[{key:"replace",label:"Replace…",icon:_T,onSelect:t},{key:"remove",label:"Remove",icon:Kn,destructive:!0,onSelect:n}]})]}),r.jsx("div",{children:s.render(e.widget,{slotId:e.id,onPickAnother:t})})]})}function h$({slot:e,fallback:t}){var i,l;const n=((i=e.widget)==null?void 0:i.kind)==="saved-view"?e.widget.viewId:null,{view:s}=na(n);return((l=e.widget)==null?void 0:l.kind)==="saved-view"&&s?r.jsx(r.Fragment,{children:s.name}):r.jsx(r.Fragment,{children:t})}const g$=["agent-sessions","inventories"];function x$({open:e,onOpenChange:t,onSelect:n}){const{views:s,loading:i}=kg();function l(c){n(c),t(!1)}return r.jsx(ir,{open:e,onOpenChange:t,children:r.jsxs(qn,{className:"max-w-xl",children:[r.jsxs(Yr,{children:[r.jsx(Gn,{children:"Add a widget"}),r.jsx(ps,{children:"Choose a built-in widget or one of your saved views."})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Built-in widgets"}),r.jsx("ul",{className:"divide-y divide-border/40 rounded-md border border-border/60",children:g$.map(c=>{const u=C1[c],p=u.icon;return r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:c}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx(p,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsx("span",{className:"font-medium text-foreground",children:u.title})]})},c)})})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Saved views"}),i?r.jsx("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm text-muted-foreground",children:"Loading saved views…"}):s.length===0?r.jsxs("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No saved views yet"}),r.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Save a view from the assignments page first."," ",r.jsx(Ne,{to:"/views",className:"text-foreground underline hover:opacity-80",children:"Manage views →"})]})]}):r.jsx("ul",{className:"max-h-72 divide-y divide-border/40 overflow-auto rounded-md border border-border/60",children:s.map(c=>r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:"saved-view",viewId:c.id}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:c.name}),c.workspace!==null?r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] text-muted-foreground",title:`Scoped to workspace: ${c.workspace}`,children:c.workspace}):null,r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] capitalize text-muted-foreground",children:c.config.viewMode})]})},c.id))}),!i&&s.some(c=>c.workspace!==null)?r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Workspace-scoped views on the global Overview will only show items from that workspace."}):null]})]})})}function y$(){const{data:e,error:t,refetch:n}=IP(),{data:s}=j0(),{layout:i}=QA(),[l,c]=f.useState(!1),[u,p]=f.useState(null),[m,h]=f.useState(null);uo("list:overview"),zt({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{n()}});const x=f.useCallback(v=>{p(v),c(!0)},[]),y=f.useCallback(async v=>{h(null);try{await eD(v)}catch(j){h(j instanceof Error?j.message:String(j))}},[]),b=f.useCallback(v=>{if(u===null)return;const j=i.slots.map((C,N)=>N===u?{...C,widget:v}:C);p(null),y(j)},[i.slots,u,y]),E=f.useCallback(v=>{const j=i.slots.map((C,N)=>N===v?{...C,widget:null}:C);y(j)},[i.slots,y]),k={};if(e)for(const v of Object.keys(e.segments))for(const j of e.segments[v].items)k[j.id]=j;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"})]}),e?r.jsx(FA,{hero:e.hero,itemsById:k}):t?r.jsx(mt,{error:t}):r.jsx(ft,{label:"Loading overview…"}),e!=null&&e.firstRun?r.jsx(_A,{help:s}):null,m?r.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Couldn't save dashboard layout: ",m]}):null,r.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:i.slots.map((v,j)=>r.jsx(m$,{slot:v,index:j,onReplace:()=>x(j),onRemove:()=>E(j)},v.id))}),e!=null&&e.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Xh,{className:"h-3 w-3","aria-hidden":"true"}),r.jsxs("span",{children:["● ",e.serverStats.totalPorts," ports ·"," ",e.serverStats.deadSessions>0?`${e.serverStats.deadSessions} dead`:"all healthy"]})]}):null,r.jsx(x$,{open:l,onOpenChange:v=>{c(v),v||p(null)},onSelect:b})]})}function b$({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 v$(){const{data:e,loading:t,error:n}=j0(),{openCheatsheet:s}=co();return t?r.jsx(ft,{label:"Loading help…"}):n||!e?r.jsx(mt,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(Me,{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. ",as("Mod+k")," opens the command palette."]})]})}),r.jsx(Me,{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(i=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:i},i))})}),r.jsx(Me,{title:"Getting Started",children:r.jsx("div",{className:"space-y-3",children:e.workflow.map((i,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:i.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:i.detail}),i.command?r.jsx(Fu,{command:i.command.command,description:i.command.description,example:i.command.example}):null,i.href?r.jsx(Ne,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open the related surface"}):null]})]})},i.title))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(Me,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(i=>r.jsx(b$,{term:i.term,description:i.description},i.term))}),r.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(i=>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:i.term}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description})]},i.term))})]}),r.jsx(Me,{title:"Status Guide",children:r.jsx("div",{className:"space-y-3",children:e.statusGuide.map(i=>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(vn,{status:i.status}),r.jsx("p",{className:"font-semibold text-foreground",children:i.meaning})]}),r.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:i.useWhen})]},i.status))})})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Me,{title:"Ownership And File Rules",children:r.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(i=>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:i.label}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description}),r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:i.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))})]},i.label))})}),r.jsx(Me,{title:"How To Navigate The Dashboard",children:r.jsx("div",{className:"space-y-3",children:e.navigation.map(i=>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:i.label}),r.jsx(Ne,{className:"text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open"})]}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description})]},i.label))})})]}),r.jsx(Me,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(i=>r.jsx(Fu,{command:i.command,description:i.description,example:i.example},i.command))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Me,{title:"FAQ",children:r.jsx("div",{className:"space-y-3",children:e.faq.map(i=>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:i.question}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.answer})]},i.question))})}),r.jsx(Me,{title:"First Project Checklist",children:r.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((i,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:i.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:i.detail}),i.command?r.jsx(Fu,{command:i.command.command,example:i.command.example}):null,i.href?r.jsx(Ne,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open the related surface"}):null]})]})},i.title))})})]})]})}function Og({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 Wd=f.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(lo,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),r.jsx("input",{ref:s,value:e,onChange:i=>t(i.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"})]}));Wd.displayName="SearchInput";function Kd({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","aria-pressed":e===s.value,onClick:()=>n(s.value),className:Te("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))})}const w$={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"},Hv=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function ld({progress:e,className:t,showLegend:n=!1}){const s=Ko(),i=f.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(p=>p!=="total")).map(p=>({key:p,className:w$[p]??Hv[c++%Hv.length]}))},[s.order,e]),l=i.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:Te("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:`${Nn(c.key)}: ${e[c.key]??0}`},c.key))}),n?r.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:i.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:Te("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:Nn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const j$=["pending","active","blocked","failed","completed"],_g=j$,k$=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function E1(e){return e&&e.length>0?e:[...k$]}function S$(e,t,n){if(t<0||t>=e.length)return e;const s=[...e],[i]=s.splice(t,1),l=t<n?n-1:n;return s.splice(Math.max(0,Math.min(l,s.length)),0,i),s}const N$=220,ju=8;function T1({anchor:e,items:t,onClose:n}){const s=f.useRef(null),[i,l]=f.useState(null);return f.useLayoutEffect(()=>{if(!e){l(null);return}const c=s.current,u=(c==null?void 0:c.offsetWidth)??N$,p=(c==null?void 0:c.offsetHeight)??0,m=Math.max(ju,window.innerWidth-u-ju),h=Math.max(ju,window.innerHeight-p-ju);l({left:Math.min(e.x,m),top:Math.min(e.y,h)})},[e]),f.useEffect(()=>{if(!e)return;function c(m){s.current&&!s.current.contains(m.target)&&n()}function u(m){m.key==="Escape"&&n()}function p(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),document.addEventListener("contextmenu",c),window.addEventListener("scroll",p,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u),document.removeEventListener("contextmenu",c),window.removeEventListener("scroll",p,!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:(i==null?void 0:i.left)??e.x,top:(i==null?void 0:i.top)??e.y,visibility:i?"visible":"hidden"},children:r.jsx(Mo,{delayDuration:200,children:t.map(c=>{const u=c.icon,p=Te("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:[u?r.jsx(u,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 truncate",children:c.label})]});if(c.disabled){const h=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:p,children:m})});return c.disabledReason?r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:h}),r.jsx(gr,{side:"left",children:c.disabledReason})]},c.key):r.jsx("div",{children:h},c.key)}return c.href?r.jsx(Ne,{to:c.href,className:p,onClick:()=>n(),children:m},c.key):r.jsx("button",{type:"button",className:p,onClick:()=>{var h;(h=c.onSelect)==null||h.call(c),n()},children:m},c.key)})})})}const C$="__ungrouped__";function Mg({open:e,onOpenChange:t,currentWorkspace:n,onSubmit:s,title:i="Move to workspace",description:l="Pick the workspace this item should belong to."}){const{data:c,loading:u}=Ed(),[p,m]=f.useState(n),[h,x]=f.useState(!1),[y,b]=f.useState(null);f.useEffect(()=>{e&&(m(n),b(null))},[e,n]);const E=f.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(C=>({key:C,label:C,value:C})),{key:C$,label:"Ungrouped",value:null}],[c]),k=!h&&p!==n;async function v(){if(k){x(!0),b(null);try{await s(p),t(!1)}catch(j){b(j instanceof Error?j.message:"Failed to move item")}finally{x(!1)}}}return r.jsx(ir,{open:e,onOpenChange:j=>h?void 0:t(j),children:r.jsxs(qn,{children:[r.jsxs(Yr,{children:[r.jsx(Gn,{children:i}),r.jsx(ps,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:u&&E.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(Jh,{className:"h-4 w-4 animate-spin"})," Loading workspaces…"]}):E.map(j=>{const C=j.value===n,N=j.value===p;return r.jsxs("button",{type:"button",disabled:C||h,onClick:()=>m(j.value),className:Te("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition",C?"cursor-not-allowed bg-foreground/5 text-muted-foreground":N?"bg-accent/40 text-foreground":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:Te("block min-w-0 truncate",j.value===null?"italic text-muted-foreground":""),children:[j.label,C?r.jsx("span",{className:"ml-2 text-xs",children:"(current)"}):null]}),N?r.jsx(Rs,{className:"h-4 w-4 text-foreground"}):null]},j.key)})}),y?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:y}):null,r.jsxs(As,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),disabled:h,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:v,disabled:!k,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:h?"Moving…":"Move"})]})]})})}function Wv(){const{workspace:e}=Lt(),t=ln(),n=$t(),{data:s,loading:i,error:l,refetch:c}=Vo(),u=f.useRef(null);uo("list:projects");const[p,m]=f.useState(""),[h,x]=f.useState("all"),[y,b]=f.useState("all"),[E,k]=f.useState("updated"),[v,j]=fs(),C=v.get("view"),N=C==="table"||C==="kanban"?C:"cards",T=_=>{j(G=>{const A=new URLSearchParams(G);return _==="cards"?A.delete("view"):A.set("view",_),A})},[L,P]=f.useState({}),[$,D]=f.useState(null),[J,ee]=f.useState(null),M=f.useMemo(()=>s?s.filter(_=>{if(e){if(e==="_ungrouped"){if(_.workspace!==null)return!1}else if(_.workspace!==e)return!1}return h!=="all"&&_.status!==h||y!=="all"&&!_.tags.includes(y)?!1:p.trim()?`${_.title} ${_.tags.join(" ")} ${_.slug}`.toLowerCase().includes(p.toLowerCase()):!0}).sort((_,G)=>P$(_,G,E)):[],[s,p,h,y,E,e]),U=M.map(_=>`${_.slug}:${_.status}`).join("|");f.useEffect(()=>{P(R$(M))},[U,E]);const X=f.useMemo(()=>{const _=new Map(M.map(G=>[G.slug,G]));return _g.flatMap(G=>(L[G]??M.filter(z=>z.status===G).map(z=>z.slug)).map(z=>_.get(z)).filter(z=>!!z))},[M,L]),{visibleItems:B,visibleIndexByKey:q}=f.useMemo(()=>{const _=N==="kanban"?X:M,G=new Map;return _.forEach((A,z)=>G.set(A.slug,z)),{visibleItems:_,visibleIndexByKey:G}},[N,M,X]),{hotkeyRowProps:Z}=Xl(B,{scope:"list:projects",onOpen:_=>n(`${t}/projects/${_.slug}`)});if(zt({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var _;return(_=u.current)==null?void 0:_.focus()}}),zt({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),i)return r.jsx(ft,{label:"Loading projects…"});if(l||!s)return r.jsx(mt,{error:l||"Project list is unavailable."});const le=Array.from(new Set(s.flatMap(_=>_.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(Og,{children:[r.jsx(Wd,{ref:u,value:p,onChange:m,placeholder:"Search by project title or tag"}),r.jsxs("select",{value:h,onChange:_=>x(_.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.jsxs("select",{value:y,onChange:_=>b(_.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All tags"}),le.map(_=>r.jsx("option",{value:_,children:_},_))]}),r.jsxs("select",{value:E,onChange:_=>k(_.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(Kd,{value:N,onChange:_=>T(_),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),M.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(Ne,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),r.jsx(Ne,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):r.jsx(ct,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:r.jsx(Ne,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):N==="cards"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:M.map((_,G)=>r.jsxs(Ne,{to:`${t}/projects/${_.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...Z(G),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:_.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Mn(_.updated)]})]}),r.jsx(vn,{status:_.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(ld,{progress:_.progress,showLegend:!0}),r.jsx("div",{className:"flex flex-wrap gap-2",children:_.tags.map(A=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:A},A))}),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:_.needsAttention.blockedCount+_.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:_.progress.total})]})]})]})]},_.slug))}):N==="table"?r.jsx(Me,{title:`${M.length} project${M.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:M.map((_,G)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Z(G),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ne,{to:`${t}/projects/${_.slug}`,className:"font-semibold text-foreground hover:text-primary",children:_.title}),r.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:_.tags.map(A=>r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:A},A))})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx(vn,{status:_.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(ld,{progress:_.progress})})}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:_.needsAttention.blockedCount+_.needsAttention.failedCount}),r.jsx("td",{className:"py-4 text-muted-foreground",children:Mn(_.updated)})]},_.slug))})]})})}):r.jsx(Vd,{columns:T$,items:X,getItemId:_=>_.slug,getColumnId:_=>_.status,canDrop:({fromColumnId:_,toColumnId:G})=>({allowed:!0,reason:_===G?void 0:"This will set a manual status override on the project."}),onMove:({item:_,fromColumnId:G,toColumnId:A,fromIndex:z,toIndex:Q})=>{if(G===A){const I=L[G]??M.filter(ue=>ue.status===G).map(ue=>ue.slug);P(ue=>({...ue,[G]:S$(I,z,Q)}));return}fetch(`/api/projects/${_.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:A})}).then(()=>{window.location.reload()})},getExternalDragData:_=>({type:"project",id:_.slug}),onCardContextMenu:(_,G)=>{G.preventDefault(),D({project:_,anchor:{x:G.clientX,y:G.clientY}})},emptyMessage:_=>`No ${_.title.toLowerCase()} projects.`,renderCard:(_,{dragging:G})=>{const A=q.get(_.slug)??-1;return r.jsx("div",{...A>=0?Z(A):{},children:r.jsx(A$,{project:_,dragging:G})})}}),r.jsx(T1,{anchor:($==null?void 0:$.anchor)??null,items:$?[{key:"edit",label:"Edit",icon:Uo,onSelect:()=>n(`${t}/projects/${$.project.slug}`)},{key:"move",label:"Move to workspace…",icon:Yl,onSelect:()=>ee($.project)}]:[],onClose:()=>D(null)}),r.jsx(Mg,{open:J!==null,onOpenChange:_=>{_||ee(null)},currentWorkspace:(J==null?void 0:J.workspace)??null,title:"Move project to workspace",onSubmit:async _=>{if(!J)return;const G=await fetch(`/api/projects/${encodeURIComponent(J.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:_})});if(!G.ok){const A=await G.json().catch(()=>({}));throw new Error(A.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(Yh,{className:"mt-0.5 h-4 w-4"}),r.jsxs("p",{children:["Project status is derived from assignment state by default.",N==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const E$={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed"},T$=_g.map(e=>({id:e,title:E$[e],description:Hd(e)}));function P$(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return Kv(t)-Kv(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function Kv(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function R$(e){return Object.fromEntries(_g.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function A$({project:e,dragging:t}){const n=ln();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(Ne,{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 ",Mn(e.updated)]})]}),r.jsx(vn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(ld,{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"})]})}function P1({title:e,description:t,actions:n,className:s}){return r.jsxs("div",{className:Te("flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",s),children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground sm:text-2xl",children:e}):null,t?r.jsx("p",{className:"max-w-3xl text-sm leading-5 text-muted-foreground",children:t}):null]}),n?r.jsx("div",{className:"flex flex-wrap items-center gap-3",children:n}):null]})}function D$(){return r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-status-archived-foreground/30 bg-status-archived px-2 py-0.5 text-xs font-medium text-status-archived-foreground",children:[r.jsx(jd,{className:"h-3 w-3"}),"Archived"]})}function qv(e){return e.projectSlug?`/projects/${e.projectSlug}/assignments/${e.slug}`:`/assignments/${e.id}`}function $$(){const{data:e,loading:t,error:n,refetch:s}=OP(),[i,l]=f.useState(null),[c,u]=f.useState(null),[p,m]=f.useState({});async function h(v,j){l(j),u(null);try{const C=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"}});if(!C.ok){const N=await C.json().catch(()=>null);throw new Error((N==null?void 0:N.error)||`HTTP ${C.status}`)}s()}catch(C){u(C instanceof Error?C.message:"Restore failed")}finally{l(null)}}function x(v){return h(`/api/projects/${v.slug}/unarchive`,`project:${v.slug}`)}function y(v){const j=v.projectSlug?`/api/projects/${v.projectSlug}/assignments/${v.slug}/unarchive`:`/api/assignments/${v.id}/unarchive`;return h(j,`assignment:${v.id}`)}if(t)return r.jsx(ft,{label:"Loading archived content…"});if(n)return r.jsx(mt,{error:n});const b=(e==null?void 0:e.projects)??[],E=(e==null?void 0:e.assignments)??[],k=b.length===0&&E.length===0;return r.jsxs("div",{className:"space-y-6",children:[r.jsx(P1,{title:"Archive",description:"Archived projects and individually-archived assignments. Restoring a project also brings back its cascade-hidden assignments; assignments archived on their own stay archived until restored here."}),c?r.jsx("div",{className:"rounded border border-status-failed-foreground/30 bg-status-failed px-3 py-2 text-sm text-status-failed-foreground",children:c}):null,k?r.jsx(ct,{title:"Nothing archived",description:"Archived projects and assignments will appear here, ready to restore."}):r.jsxs(r.Fragment,{children:[b.length>0&&r.jsx(Me,{title:"Archived Projects",description:"Restoring a project unhides every cascade-hidden assignment; individually-archived children stay archived.",children:r.jsx("ul",{className:"divide-y divide-border",children:b.map(v=>{const j=p[v.slug]??!1;return r.jsxs("li",{className:"py-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsxs("button",{type:"button",onClick:()=>m(C=>({...C,[v.slug]:!j})),className:"inline-flex items-center gap-1.5 text-left text-sm font-medium text-foreground hover:text-foreground/80","aria-expanded":j,children:[j?r.jsx(cs,{className:"h-4 w-4"}):r.jsx(gT,{className:"h-4 w-4"}),r.jsx(qh,{className:"h-4 w-4 text-muted-foreground"}),v.title,r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",v.assignments.length," assignment",v.assignments.length===1?"":"s",")"]})]}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Archived ",v.archivedAt?Dr(v.archivedAt):"with no timestamp",v.archivedReason?` · ${v.archivedReason}`:""]}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(Ne,{to:`/projects/${v.slug}`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Open"}),r.jsxs("button",{type:"button",onClick:()=>x(v),disabled:i===`project:${v.slug}`,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 disabled:opacity-50",children:[r.jsx(Wu,{className:"h-3 w-3"}),"Restore"]})]})]}),j&&v.assignments.length>0&&r.jsx("ul",{className:"mt-2 space-y-1 pl-9",children:v.assignments.map(C=>r.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-sm",children:[r.jsx(Ne,{to:qv(C),className:"text-foreground hover:text-foreground/80",children:C.title}),r.jsx(vn,{status:C.status,showIcon:!1}),r.jsx("span",{className:"text-xs text-muted-foreground",children:C.archived?"Archived individually — stays archived after restore":"Hidden via project — returns on restore"})]},C.id))})]},v.slug)})})}),E.length>0&&r.jsx(Me,{title:"Archived Assignments",description:"Individually-archived assignments whose project is still active.",children:r.jsx("ul",{className:"divide-y divide-border",children:E.map(v=>r.jsxs("li",{className:"flex flex-wrap items-center gap-3 py-3",children:[r.jsx(Ne,{to:qv(v),className:"text-sm font-medium text-foreground hover:text-foreground/80",children:v.title}),r.jsx(vn,{status:v.status,showIcon:!1}),r.jsx(D$,{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[v.projectTitle??"Standalone"," · Archived"," ",v.archivedAt?Dr(v.archivedAt):"with no timestamp",v.archivedReason?` · ${v.archivedReason}`:""]}),r.jsxs("button",{type:"button",onClick:()=>y(v),disabled:i===`assignment:${v.id}`,className:"ml-auto 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 disabled:opacity-50",children:[r.jsx(Wu,{className:"h-3 w-3"}),"Restore"]})]},v.id))})})]})]})}const R1={definitions:[{id:"feature",label:"Feature"},{id:"bug",label:"Bug"},{id:"refactor",label:"Refactor"},{id:"research",label:"Research"},{id:"chore",label:"Chore"}],default:"feature",custom:!1};let Bu=null,Ri=null;function L$(){return Bu?Promise.resolve(Bu):Ri||(Ri=fetch("/api/config/types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Bu=e,Ri=null,e)).catch(()=>(Ri=null,R1)),Ri)}function qd(){const[e,t]=f.useState(()=>Bu??R1);return f.useEffect(()=>{L$().then(t)},[]),e}function Yi(e,t){if(!t)return"—";const n=e.definitions.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function I$(e,t){return t?e.definitions.find(n=>n.id===t)??null:null}function da({type:e,className:t,compact:n=!1}){const s=qd();if(!e)return null;const i=I$(s,e),l=(i==null?void 0:i.label)??e.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase()),c=i!=null&&i.color?{backgroundColor:`color-mix(in oklch, ${i.color} 18%, transparent)`,borderColor:`color-mix(in oklch, ${i.color} 50%, transparent)`,color:i.color}:void 0;return r.jsx("span",{title:(i==null?void 0:i.description)??`Type: ${l}`,style:c,className:Te("inline-flex items-center whitespace-nowrap rounded-full border text-xs capitalize",n?"px-2 py-0.5":"px-2.5 py-1",!c&&"border-border/60 text-muted-foreground",t),children:l})}const Gv="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",Yv="block min-w-0 truncate";function Fg({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:Te("flex flex-wrap items-center gap-1.5",t),children:e.map((n,s)=>{const i=`${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:Te(Gv,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${i} in ${n.system}`,children:[r.jsx("span",{className:Yv,children:i}),r.jsx(aa,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:Gv,title:i,children:r.jsx("span",{className:Yv,children:i})},l)})})}const O$={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 Rn({label:e,value:t,description:n,icon:s,tone:i="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]}),u=Te(O$[i],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(Ne,{to:l,className:u,children:c}):r.jsx("article",{className:u,children:c})}function Jv(e){const t=_$(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(F$);if(p){const m=p.props.children,h=u.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function _$(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=B$(i),u=z$(l,i.props);return i.type!==f.Fragment&&(u.ref=s?Rd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M$=Symbol("radix.slottable");function F$(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M$}function z$(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function B$(e){var s,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function U$(e){const t=e+"CollectionProvider",[n,s]=Ho(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=k=>{const{scope:v,children:j}=k,C=Zt.useRef(null),N=Zt.useRef(new Map).current;return r.jsx(i,{scope:v,itemMap:N,collectionRef:C,children:j})};c.displayName=t;const u=e+"CollectionSlot",p=Jv(u),m=Zt.forwardRef((k,v)=>{const{scope:j,children:C}=k,N=l(u,j),T=Fn(v,N.collectionRef);return r.jsx(p,{ref:T,children:C})});m.displayName=u;const h=e+"CollectionItemSlot",x="data-radix-collection-item",y=Jv(h),b=Zt.forwardRef((k,v)=>{const{scope:j,children:C,...N}=k,T=Zt.useRef(null),L=Fn(v,T),P=l(h,j);return Zt.useEffect(()=>(P.itemMap.set(T,{ref:T,...N}),()=>void P.itemMap.delete(T))),r.jsx(y,{[x]:"",ref:L,children:C})});b.displayName=h;function E(k){const v=l(e+"CollectionConsumer",k);return Zt.useCallback(()=>{const C=v.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${x}]`));return Array.from(v.itemMap.values()).sort((P,$)=>N.indexOf(P.ref.current)-N.indexOf($.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},E,s]}var V$=f.createContext(void 0);function A1(e){const t=f.useContext(V$);return e||t||"ltr"}var Sm="rovingFocusGroup.onEntryFocus",H$={bubbles:!1,cancelable:!0},nc="RovingFocusGroup",[yh,D1,W$]=U$(nc),[K$,$1]=Ho(nc,[W$]),[q$,G$]=K$(nc),L1=f.forwardRef((e,t)=>r.jsx(yh.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(yh.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Y$,{...e,ref:t})})}));L1.displayName=nc;var Y$=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...x}=e,y=f.useRef(null),b=Fn(t,y),E=A1(l),[k,v]=Ad({prop:c,defaultProp:u??null,onChange:p,caller:nc}),[j,C]=f.useState(!1),N=Fo(m),T=D1(n),L=f.useRef(!1),[P,$]=f.useState(0);return f.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(Sm,N),()=>D.removeEventListener(Sm,N)},[N]),r.jsx(q$,{scope:n,orientation:s,dir:E,loop:i,currentTabStopId:k,onItemFocus:f.useCallback(D=>v(D),[v]),onItemShiftTab:f.useCallback(()=>C(!0),[]),onFocusableItemAdd:f.useCallback(()=>$(D=>D+1),[]),onFocusableItemRemove:f.useCallback(()=>$(D=>D-1),[]),children:r.jsx(pn.div,{tabIndex:j||P===0?-1:0,"data-orientation":s,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:Wt(e.onMouseDown,()=>{L.current=!0}),onFocus:Wt(e.onFocus,D=>{const J=!L.current;if(D.target===D.currentTarget&&J&&!j){const ee=new CustomEvent(Sm,H$);if(D.currentTarget.dispatchEvent(ee),!ee.defaultPrevented){const M=T().filter(Z=>Z.focusable),U=M.find(Z=>Z.active),X=M.find(Z=>Z.id===k),q=[U,X,...M].filter(Boolean).map(Z=>Z.ref.current);_1(q,h)}}L.current=!1}),onBlur:Wt(e.onBlur,()=>C(!1))})})}),I1="RovingFocusGroupItem",O1=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:l,children:c,...u}=e,p=Hi(),m=l||p,h=G$(I1,n),x=h.currentTabStopId===m,y=D1(n),{onFocusableItemAdd:b,onFocusableItemRemove:E,currentTabStopId:k}=h;return f.useEffect(()=>{if(s)return b(),()=>E()},[s,b,E]),r.jsx(yh.ItemSlot,{scope:n,id:m,focusable:s,active:i,children:r.jsx(pn.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Wt(e.onMouseDown,v=>{s?h.onItemFocus(m):v.preventDefault()}),onFocus:Wt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:Wt(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){h.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const j=Q$(v,h.orientation,h.dir);if(j!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let N=y().filter(T=>T.focusable).map(T=>T.ref.current);if(j==="last")N.reverse();else if(j==="prev"||j==="next"){j==="prev"&&N.reverse();const T=N.indexOf(v.currentTarget);N=h.loop?Z$(N,T+1):N.slice(T+1)}setTimeout(()=>_1(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});O1.displayName=I1;var J$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function X$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Q$(e,t,n){const s=X$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return J$[s]}function _1(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function Z$(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var eL=L1,tL=O1,Gd="Tabs",[nL]=Ho(Gd,[$1]),M1=$1(),[rL,zg]=nL(Gd),F1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:u,activationMode:p="automatic",...m}=e,h=A1(u),[x,y]=Ad({prop:s,onChange:i,defaultProp:l??"",caller:Gd});return r.jsx(rL,{scope:n,baseId:Hi(),value:x,onValueChange:y,orientation:c,dir:h,activationMode:p,children:r.jsx(pn.div,{dir:h,"data-orientation":c,...m,ref:t})})});F1.displayName=Gd;var z1="TabsList",B1=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...i}=e,l=zg(z1,n),c=M1(n);return r.jsx(eL,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(pn.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});B1.displayName=z1;var U1="TabsTrigger",V1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:i=!1,...l}=e,c=zg(U1,n),u=M1(n),p=K1(c.baseId,s),m=q1(c.baseId,s),h=s===c.value;return r.jsx(tL,{asChild:!0,...u,focusable:!i,active:h,children:r.jsx(pn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:p,...l,ref:t,onMouseDown:Wt(e.onMouseDown,x=>{!i&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:Wt(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:Wt(e.onFocus,()=>{const x=c.activationMode!=="manual";!h&&!i&&x&&c.onValueChange(s)})})})});V1.displayName=U1;var H1="TabsContent",W1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:i,children:l,...c}=e,u=zg(H1,n),p=K1(u.baseId,s),m=q1(u.baseId,s),h=s===u.value,x=f.useRef(h);return f.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Wo,{present:i||h,children:({present:y})=>r.jsx(pn.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&l})})});W1.displayName=H1;function K1(e,t){return`${e}-trigger-${t}`}function q1(e,t){return`${e}-content-${t}`}var G1=F1,Y1=B1,bh=V1,vh=W1;function Bg({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(G1,{value:e,onValueChange:t,className:s,children:[r.jsx(Y1,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(i=>r.jsxs(bh,{value:i.value,className:Te("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:i.label}),typeof i.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:i.count}):null]},i.value))}),n.map(i=>r.jsx(vh,{value:i.value,className:"pt-3",children:i.content},i.value))]})}const sL="modulepreload",oL=function(e){return"/"+e},Xv={},iL=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),p=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=c(n.map(m=>{if(m=oL(m),m in Xv)return;Xv[m]=!0;const h=m.endsWith(".css"),x=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const y=document.createElement("link");if(y.rel=h?"stylesheet":sL,h||(y.as="script"),y.crossOrigin="",y.href=m,p&&y.setAttribute("nonce",p),document.head.appendChild(y),h)return new Promise((b,E)=>{y.addEventListener("load",b),y.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return i.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return t().catch(l)})};function aL({definition:e,className:t,nodeRoutes:n={}}){const s=f.useRef(null),[i,l]=f.useState(null),[c,u]=f.useState(!0),p=$t(),m=document.documentElement.classList.contains("dark")?"dark":"default";return f.useEffect(()=>{let h=!1;async function x(){if(s.current)try{const y=(await iL(async()=>{const{default:k}=await import("./mermaid.core-DUdss5Q8.js").then(v=>v.bF);return{default:k}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:lL(m==="dark")}),h)return;const b=`mermaid-${Date.now()}`,{svg:E}=await y.render(b,e);if(h||!s.current)return;s.current.innerHTML=E,cL(s.current,n,p),u(!1)}catch(y){h||(l(y instanceof Error?y.message:"Failed to render graph"),u(!1))}}return u(!0),l(null),x(),()=>{h=!0}},[e,p,n,m]),i?r.jsxs("div",{className:Te("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: ",i]}),r.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):r.jsxs("div",{className:Te("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 lL(e){const t=document.documentElement,n=x=>{const y=getComputedStyle(t).getPropertyValue(x).trim();return y?`oklch(${y})`:""},s=n("--card"),i=n("--card-foreground"),l=n("--border"),c=n("--primary"),u=n("--primary-foreground"),p=n("--muted"),m=n("--muted-foreground"),h=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:i,primaryBorderColor:l,secondaryColor:p,secondaryTextColor:i,secondaryBorderColor:l,tertiaryColor:p,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:i,mainBkg:s,nodeBkg:s,nodeTextColor:i,nodeBorder:l,clusterBkg:p,clusterBorder:l,edgeLabelBackground:s,titleColor:i,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:p,labelColor:i,errorBkgColor:h,errorTextColor:u}}function cL(e,t,n){var s;for(const i of e.querySelectorAll(".node")){const l=((s=i.textContent)==null?void 0:s.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;i.style.cursor="pointer",i.setAttribute("role","link"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`Open ${l}`);const u=()=>n(c);i.addEventListener("click",u),i.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())})}}function uL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pL={};function Qv(e,t){return(pL.jsx?fL:dL).test(e)}const mL=/[ \t\n\f\r]/g;function hL(e){return typeof e=="object"?e.type==="text"?Zv(e.value):!1:Zv(e)}function Zv(e){return e.replace(mL,"")===""}class rc{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}rc.prototype.normal={};rc.prototype.property={};rc.prototype.space=void 0;function J1(e,t){const n={},s={};for(const i of e)Object.assign(n,i.property),Object.assign(s,i.normal);return new rc(n,s,t)}function wh(e){return e.toLowerCase()}class ar{constructor(t,n){this.attribute=n,this.property=t}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let gL=0;const rt=qo(),dn=qo(),jh=qo(),Se=qo(),At=qo(),Ji=qo(),pr=qo();function qo(){return 2**++gL}const kh=Object.freeze(Object.defineProperty({__proto__:null,boolean:rt,booleanish:dn,commaOrSpaceSeparated:pr,commaSeparated:Ji,number:Se,overloadedBoolean:jh,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),Nm=Object.keys(kh);class Ug extends ar{constructor(t,n,s,i){let l=-1;if(super(t,n),ew(this,"space",i),typeof s=="number")for(;++l<Nm.length;){const c=Nm[l];ew(this,Nm[l],(s&kh[c])===kh[c])}}}Ug.prototype.defined=!0;function ew(e,t,n){n&&(e[t]=n)}function fa(e){const t={},n={};for(const[s,i]of Object.entries(e.properties)){const l=new Ug(s,e.transform(e.attributes||{},s),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[wh(s)]=s,n[wh(l.attribute)]=s}return new rc(t,n,e.space)}const X1=fa({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:At,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:Se,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:At,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:dn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Q1(e,t){return t in e?e[t]:t}function Z1(e,t){return Q1(e,t.toLowerCase())}const xL=fa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ji,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:rt,allowPaymentRequest:rt,allowUserMedia:rt,alt:null,as:null,async:rt,autoCapitalize:null,autoComplete:At,autoFocus:rt,autoPlay:rt,blocking:At,capture:null,charSet:null,checked:rt,cite:null,className:At,cols:Se,colSpan:null,content:null,contentEditable:dn,controls:rt,controlsList:At,coords:Se|Ji,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rt,defer:rt,dir:null,dirName:null,disabled:rt,download:jh,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rt,formTarget:null,headers:At,height:Se,hidden:jh,high:Se,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:rt,inputMode:null,integrity:null,is:null,isMap:rt,itemId:null,itemProp:At,itemRef:At,itemScope:rt,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rt,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:rt,muted:rt,name:null,nonce:null,noModule:rt,noValidate:rt,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:rt,optimum:Se,pattern:null,ping:At,placeholder:null,playsInline:rt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rt,referrerPolicy:null,rel:At,required:rt,reversed:rt,rows:Se,rowSpan:Se,sandbox:At,scope:null,scoped:rt,seamless:rt,selected:rt,shadowRootClonable:rt,shadowRootDelegatesFocus:rt,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:rt,useMap:null,value:dn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:rt,declare:rt,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:rt,noHref:rt,noShade:rt,noWrap:rt,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:rt,disableRemotePlayback:rt,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:Z1}),yL=fa({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:pr,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:At,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:rt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:Ji,g2:Ji,glyphName:Ji,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pr,rev:pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pr,requiredFeatures:pr,requiredFonts:pr,requiredFormats:pr,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pr,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Q1}),eS=fa({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()}}),tS=fa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Z1}),nS=fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bL={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"},vL=/[A-Z]/g,tw=/-[a-z]/g,wL=/^data[-\w.:]+$/i;function jL(e,t){const n=wh(t);let s=t,i=ar;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wL.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(tw,SL);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!tw.test(l)){let c=l.replace(vL,kL);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}i=Ug}return new i(s,t)}function kL(e){return"-"+e.toLowerCase()}function SL(e){return e.charAt(1).toUpperCase()}const NL=J1([X1,xL,eS,tS,nS],"html"),Vg=J1([X1,yL,eS,tS,nS],"svg");function CL(e){return e.join(" ").trim()}var Ai={},Cm,nw;function EL(){if(nw)return Cm;nw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g,p=`
|
|
516
|
+
`,m="/",h="*",x="",y="comment",b="declaration";function E(v,j){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];j=j||{};var C=1,N=1;function T(B){var q=B.match(t);q&&(C+=q.length);var Z=B.lastIndexOf(p);N=~Z?B.length-Z:N+B.length}function L(){var B={line:C,column:N};return function(q){return q.position=new P(B),J(),q}}function P(B){this.start=B,this.end={line:C,column:N},this.source=j.source}P.prototype.content=v;function $(B){var q=new Error(j.source+":"+C+":"+N+": "+B);if(q.reason=B,q.filename=j.source,q.line=C,q.column=N,q.source=v,!j.silent)throw q}function D(B){var q=B.exec(v);if(q){var Z=q[0];return T(Z),v=v.slice(Z.length),q}}function J(){D(n)}function ee(B){var q;for(B=B||[];q=M();)q!==!1&&B.push(q);return B}function M(){var B=L();if(!(m!=v.charAt(0)||h!=v.charAt(1))){for(var q=2;x!=v.charAt(q)&&(h!=v.charAt(q)||m!=v.charAt(q+1));)++q;if(q+=2,x===v.charAt(q-1))return $("End of comment missing");var Z=v.slice(2,q-2);return N+=2,T(Z),v=v.slice(q),N+=2,B({type:y,comment:Z})}}function U(){var B=L(),q=D(s);if(q){if(M(),!D(i))return $("property missing ':'");var Z=D(l),le=B({type:b,property:k(q[0].replace(e,x)),value:Z?k(Z[0].replace(e,x)):x});return D(c),le}}function X(){var B=[];ee(B);for(var q;q=U();)q!==!1&&(B.push(q),ee(B));return B}return J(),X()}function k(v){return v?v.replace(u,x):x}return Cm=E,Cm}var rw;function TL(){if(rw)return Ai;rw=1;var e=Ai&&Ai.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=n;const t=e(EL());function n(s,i){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),u=typeof i=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;u?i(m,h,p):h&&(l=l||{},l[m]=h)}),l}return Ai}var ul={},sw;function PL(){if(sw)return ul;sw=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},c=function(m,h){return h.toUpperCase()},u=function(m,h){return"".concat(h,"-")},p=function(m,h){return h===void 0&&(h={}),l(m)?m:(m=m.toLowerCase(),h.reactCompat?m=m.replace(i,u):m=m.replace(s,u),m.replace(t,c))};return ul.camelCase=p,ul}var dl,ow;function RL(){if(ow)return dl;ow=1;var e=dl&&dl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(TL()),n=PL();function s(i,l){var c={};return!i||typeof i!="string"||(0,t.default)(i,function(u,p){u&&p&&(c[(0,n.camelCase)(u,l)]=p)}),c}return s.default=s,dl=s,dl}var AL=RL();const DL=yd(AL),rS=sS("end"),Hg=sS("start");function sS(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 $L(e){const t=Hg(e),n=rS(e);if(t&&n)return{start:t,end:n}}function wl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?iw(e.position):"start"in e||"end"in e?iw(e):"line"in e||"column"in e?Sh(e):""}function Sh(e){return aw(e&&e.line)+":"+aw(e&&e.column)}function iw(e){return Sh(e&&e.start)+"-"+Sh(e&&e.end)}function aw(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let i="",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"?i=t:!l.cause&&t&&(c=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?l.ruleId=s:(l.source=s.slice(0,p),l.ruleId=s.slice(p+1))}if(!l.place&&l.ancestors&&l.ancestors){const p=l.ancestors[l.ancestors.length-1];p&&(l.place=p.position)}const u=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=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=wl(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}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const Wg={}.hasOwnProperty,LL=new Map,IL=/[A-Z]/g,OL=new Set(["table","tbody","thead","tfoot","tr"]),_L=new Set(["td","th"]),oS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ML(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=KL(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=WL(n,t.jsx,t.jsxs)}const i={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"?Vg:NL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=iS(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function iS(e,t,n){if(t.type==="element")return FL(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zL(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return UL(e,t,n);if(t.type==="mdxjsEsm")return BL(e,t);if(t.type==="root")return VL(e,t,n);if(t.type==="text")return HL(e,t)}function FL(e,t,n){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=Vg,e.schema=i),e.ancestors.push(t);const l=lS(e,t.tagName,!1),c=qL(e,t);let u=qg(e,t);return OL.has(t.tagName)&&(u=u.filter(function(p){return typeof p=="string"?!hL(p):!0})),aS(e,c,l,t),Kg(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function zL(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)}Ml(e,t.position)}function BL(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ml(e,t.position)}function UL(e,t,n){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=Vg,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:lS(e,t.name,!0),c=GL(e,t),u=qg(e,t);return aS(e,c,l,t),Kg(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function VL(e,t,n){const s={};return Kg(s,qg(e,t)),e.create(t,e.Fragment,s,n)}function HL(e,t){return t.value}function aS(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Kg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function WL(e,t,n){return s;function s(i,l,c,u){const m=Array.isArray(c.children)?n:t;return u?m(l,c,u):m(l,c)}}function KL(e,t){return n;function n(s,i,l,c){const u=Array.isArray(l.children),p=Hg(s);return t(i,l,c,u,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function qL(e,t){const n={};let s,i;for(i in t.properties)if(i!=="children"&&Wg.call(t.properties,i)){const l=YL(e,i,t.properties[i]);if(l){const[c,u]=l;e.tableCellAlignToStyle&&c==="align"&&typeof u=="string"&&_L.has(t.tagName)?s=u:n[c]=u}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function GL(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 u=c.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Ml(e,t.position);else{const i=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const u=s.value.data.estree.body[0];u.type,l=e.evaluater.evaluateExpression(u.expression)}else Ml(e,t.position);else l=s.value===null?!0:s.value;n[i]=l}return n}function qg(e,t){const n=[];let s=-1;const i=e.passKeys?new Map:LL;for(;++s<t.children.length;){const l=t.children[s];let c;if(e.passKeys){const p=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(p){const m=i.get(p)||0;c=p+"-"+m,i.set(p,m+1)}}const u=iS(e,l,c);u!==void 0&&n.push(u)}return n}function YL(e,t,n){const s=jL(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?uL(n):CL(n)),s.property==="style"){let i=typeof n=="object"?n:JL(e,String(n));return e.stylePropertyNameCase==="css"&&(i=XL(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&s.space?bL[s.property]||s.property:s.attribute,n]}}function JL(e,t){try{return DL(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,i=new zn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=oS+"#cannot-parse-style-attribute",i}}function lS(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,c;for(;++l<i.length;){const u=Qv(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};c=c?{type:"MemberExpression",object:c,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}s=c}else s=Qv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const i=s.value;return Wg.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ml(e)}function Ml(e,t){const n=new zn("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=oS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function XL(e){const t={};let n;for(n in e)Wg.call(e,n)&&(t[QL(n)]=e[n]);return t}function QL(e){let t=e.replace(IL,ZL);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ZL(e){return"-"+e.toLowerCase()}const Em={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"]},eI={};function tI(e,t){const n=eI,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return cS(e,s,i)}function cS(e,t,n){if(nI(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 lw(e.children,t,n)}return Array.isArray(e)?lw(e,t,n):""}function lw(e,t,n){const s=[];let i=-1;for(;++i<e.length;)s[i]=cS(e[i],t,n);return s.join("")}function nI(e){return!!(e&&typeof e=="object")}const cw=document.createElement("i");function Gg(e){const t="&"+e+";";cw.innerHTML=t;const n=cw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function us(e,t,n,s){const i=e.length;let l=0,c;if(t<0?t=-t>i?0:i+t:t=t>i?i: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 Er(e,t){return e.length>0?(us(e,e.length,0,t),e):t}const uw={}.hasOwnProperty;function rI(e){const t={};let n=-1;for(;++n<e.length;)sI(t,e[n]);return t}function sI(e,t){let n;for(n in t){const i=(uw.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){uw.call(i,c)||(i[c]=[]);const u=l[c];oI(i[c],Array.isArray(u)?u:u?[u]:[])}}}function oI(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);us(e,0,0,s)}function uS(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 Xi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ss=fo(/[A-Za-z]/),xr=fo(/[\dA-Za-z]/),iI=fo(/[#-'*+\--9=?A-Z^-~]/);function Nh(e){return e!==null&&(e<32||e===127)}const Ch=fo(/\d/),aI=fo(/[\dA-Fa-f]/),lI=fo(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function or(e){return e!==null&&(e<0||e===32)}function wt(e){return e===-2||e===-1||e===32}const cI=fo(new RegExp("\\p{P}|\\p{S}","u")),uI=fo(/\s/);function fo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function pa(e){const t=[];let n=-1,s=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(c=String.fromCharCode(l,u),i=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+i+1,c=""),i&&(n+=i,i=0)}return t.join("")+e.slice(s)}function Dt(e,t,n,s){const i=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return wt(p)?(e.enter(n),u(p)):t(p)}function u(p){return wt(p)&&l++<i?(e.consume(p),u):(e.exit(n),t(p))}}const dI={tokenize:fI};function fI(e){const t=e.attempt(this.parser.constructs.contentInitial,s,i);let n;return t;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Dt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),l(u)}function l(u){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(u)}function c(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Qe(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),c)}}const pI={tokenize:mI},dw={tokenize:hI};function mI(e){const t=this,n=[];let s=0,i,l,c;return u;function u(N){if(s<n.length){const T=n[s];return t.containerState=T[1],e.attempt(T[0].continuation,p,m)(N)}return m(N)}function p(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const T=t.events.length;let L=T,P;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){P=t.events[L][1].end;break}j(s);let $=T;for(;$<t.events.length;)t.events[$][1].end={...P},$++;return us(t.events,L+1,0,t.events.slice(T)),t.events.length=$,m(N)}return u(N)}function m(N){if(s===n.length){if(!i)return y(N);if(i.currentConstruct&&i.currentConstruct.concrete)return E(N);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dw,h,x)(N)}function h(N){return i&&C(),j(s),y(N)}function x(N){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,E(N)}function y(N){return t.containerState={},e.attempt(dw,b,E)(N)}function b(N){return s++,n.push([t.currentConstruct,t.containerState]),y(N)}function E(N){if(N===null){i&&C(),j(0),e.consume(N);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),k(N)}function k(N){if(N===null){v(e.exit("chunkFlow"),!0),j(0),e.consume(N);return}return Qe(N)?(e.consume(N),v(e.exit("chunkFlow")),s=0,t.interrupt=void 0,u):(e.consume(N),k)}function v(N,T){const L=t.sliceStream(N);if(T&&L.push(null),N.previous=l,l&&(l.next=N),l=N,i.defineSkip(N.start),i.write(L),t.parser.lazy[N.start.line]){let P=i.events.length;for(;P--;)if(i.events[P][1].start.offset<c&&(!i.events[P][1].end||i.events[P][1].end.offset>c))return;const $=t.events.length;let D=$,J,ee;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(J){ee=t.events[D][1].end;break}J=!0}for(j(s),P=$;P<t.events.length;)t.events[P][1].end={...ee},P++;us(t.events,D+1,0,t.events.slice($)),t.events.length=P}}function j(N){let T=n.length;for(;T-- >N;){const L=n[T];t.containerState=L[1],L[0].exit.call(t,e)}n.length=N}function C(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hI(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fw(e){if(e===null||or(e)||uI(e))return 1;if(cI(e))return 2}function Yg(e,t,n){const s=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!s.includes(l)&&(t=l(t,n),s.push(l))}return t}const Eh={name:"attention",resolveAll:gI,tokenize:xI};function gI(e,t){let n=-1,s,i,l,c,u,p,m,h;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;p=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};pw(x,-p),pw(y,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},u={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},i={type:p>1?"strong":"emphasis",start:{...c.start},end:{...u.end}},e[s][1].end={...c.start},e[n][1].start={...u.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Er(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Er(m,[["enter",i,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Er(m,Yg(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=Er(m,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Er(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,us(e,s-1,n-s+3,m),n=s+m.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function xI(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,i=fw(s);let l;return c;function c(p){return l=p,e.enter("attentionSequence"),u(p)}function u(p){if(p===l)return e.consume(p),u;const m=e.exit("attentionSequence"),h=fw(p),x=!h||h===2&&i||n.includes(p),y=!i||i===2&&h||n.includes(s);return m._open=!!(l===42?x:x&&(i||!y)),m._close=!!(l===42?y:y&&(h||!x)),t(p)}}function pw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yI={name:"autolink",tokenize:bI};function bI(e,t,n){let s=0;return i;function i(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return ss(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||xr(b)?(s=1,u(b)):m(b)}function u(b){return b===58?(e.consume(b),s=0,p):(b===43||b===45||b===46||xr(b))&&s++<32?(e.consume(b),u):(s=0,m(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Nh(b)?n(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),h):iI(b)?(e.consume(b),m):n(b)}function h(b){return xr(b)?x(b):n(b)}function x(b){return b===46?(e.consume(b),s=0,h):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||xr(b))&&s++<63){const E=b===45?y:x;return e.consume(b),E}return n(b)}}const Yd={partial:!0,tokenize:vI};function vI(e,t,n){return s;function s(l){return wt(l)?Dt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||Qe(l)?t(l):n(l)}}const dS={continuation:{tokenize:jI},exit:kI,name:"blockQuote",tokenize:wI};function wI(e,t,n){const s=this;return i;function i(c){if(c===62){const u=s.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return wt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function jI(e,t,n){const s=this;return i;function i(c){return wt(c)?Dt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(dS,t,n)(c)}}function kI(e){e.exit("blockQuote")}const fS={name:"characterEscape",tokenize:SI};function SI(e,t,n){return s;function s(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return lI(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const pS={name:"characterReference",tokenize:NI};function NI(e,t,n){const s=this;let i=0,l,c;return u;function u(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),p}function p(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=xr,h(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=aI,h):(e.enter("characterReferenceValue"),l=7,c=Ch,h(x))}function h(x){if(x===59&&i){const y=e.exit("characterReferenceValue");return c===xr&&!Gg(s.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&i++<l?(e.consume(x),h):n(x)}}const mw={partial:!0,tokenize:EI},hw={concrete:!0,name:"codeFenced",tokenize:CI};function CI(e,t,n){const s=this,i={partial:!0,tokenize:L};let l=0,c=0,u;return p;function p(P){return m(P)}function m(P){const $=s.events[s.events.length-1];return l=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,u=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(P)}function h(P){return P===u?(c++,e.consume(P),h):c<3?n(P):(e.exit("codeFencedFenceSequence"),wt(P)?Dt(e,x,"whitespace")(P):x(P))}function x(P){return P===null||Qe(P)?(e.exit("codeFencedFence"),s.interrupt?t(P):e.check(mw,k,T)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||Qe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(P)):wt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(e,b,"whitespace")(P)):P===96&&P===u?n(P):(e.consume(P),y)}function b(P){return P===null||Qe(P)?x(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(P))}function E(P){return P===null||Qe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(P)):P===96&&P===u?n(P):(e.consume(P),E)}function k(P){return e.attempt(i,T,v)(P)}function v(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),j}function j(P){return l>0&&wt(P)?Dt(e,C,"linePrefix",l+1)(P):C(P)}function C(P){return P===null||Qe(P)?e.check(mw,k,T)(P):(e.enter("codeFlowValue"),N(P))}function N(P){return P===null||Qe(P)?(e.exit("codeFlowValue"),C(P)):(e.consume(P),N)}function T(P){return e.exit("codeFenced"),t(P)}function L(P,$,D){let J=0;return ee;function ee(q){return P.enter("lineEnding"),P.consume(q),P.exit("lineEnding"),M}function M(q){return P.enter("codeFencedFence"),wt(q)?Dt(P,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):U(q)}function U(q){return q===u?(P.enter("codeFencedFenceSequence"),X(q)):D(q)}function X(q){return q===u?(J++,P.consume(q),X):J>=c?(P.exit("codeFencedFenceSequence"),wt(q)?Dt(P,B,"whitespace")(q):B(q)):D(q)}function B(q){return q===null||Qe(q)?(P.exit("codeFencedFence"),$(q)):D(q)}}}function EI(e,t,n){const s=this;return i;function i(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 Tm={name:"codeIndented",tokenize:PI},TI={partial:!0,tokenize:RI};function PI(e,t,n){const s=this;return i;function i(m){return e.enter("codeIndented"),Dt(e,l,"linePrefix",5)(m)}function l(m){const h=s.events[s.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?p(m):Qe(m)?e.attempt(TI,c,p)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||Qe(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),u)}function p(m){return e.exit("codeIndented"),t(m)}}function RI(e,t,n){const s=this;return i;function i(c){return s.parser.lazy[s.now().line]?n(c):Qe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i):Dt(e,l,"linePrefix",5)(c)}function l(c){const u=s.events[s.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):Qe(c)?i(c):n(c)}}const AI={name:"codeText",previous:$I,resolve:DI,tokenize:LI};function DI(e){let t=e.length-4,n=3,s,i;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;)i===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(i=s):(s===t||e[s][1].type==="lineEnding")&&(e[i][1].type="codeTextData",s!==i+2&&(e[i][1].end=e[s-1][1].end,e.splice(i+2,s-i-2),t-=s-i-2,s=i+2),i=void 0);return e}function $I(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LI(e,t,n){let s=0,i,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),u(x)}function u(x){return x===96?(e.consume(x),s++,u):(e.exit("codeTextSequence"),p(x))}function p(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),p):x===96?(l=e.enter("codeTextSequence"),i=0,h(x)):Qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Qe(x)?(e.exit("codeTextData"),p(x)):(e.consume(x),m)}function h(x){return x===96?(e.consume(x),i++,h):i===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class II{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 i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return s&&fl(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),fl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fl(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);fl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fl(this.left,n.reverse())}}}function fl(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 mS(e){const t={};let n=-1,s,i,l,c,u,p,m;const h=new II(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(s=h.get(n),n&&s[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,l=0,l<p.length&&p[l][1].type==="lineEndingBlank"&&(l+=2),l<p.length&&p[l][1].type==="content"))for(;++l<p.length&&p[l][1].type!=="content";)p[l][1].type==="chunkText"&&(p[l][1]._isInFirstContentOfListItem=!0,l++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,OI(h,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,i=void 0;l--;)if(c=h.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),c[1].type="lineEnding",i=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;i&&(s[1].end={...h.get(i)[1].start},u=h.slice(i,n),u.unshift(s),h.splice(i,n-i+1,u))}}return us(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function OI(e,t){const n=e.get(t)[1],s=e.get(t)[2];let i=t-1;const l=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const u=c.events,p=[],m={};let h,x,y=-1,b=n,E=0,k=0;const v=[k];for(;b;){for(;e.get(++i)[1]!==b;);l.push(i),b._tokenizer||(h=s.sliceStream(b),b.next||h.push(null),x&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(h),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=b,b=b.next}for(b=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(k=y+1,v.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):v.pop(),y=v.length;y--;){const j=u.slice(v[y],v[y+1]),C=l.pop();p.push([C,C+j.length-1]),e.splice(C,2,j)}for(p.reverse(),y=-1;++y<p.length;)m[E+p[y][0]]=E+p[y][1],E+=p[y][1]-p[y][0]-1;return m}const _I={resolve:FI,tokenize:zI},MI={partial:!0,tokenize:BI};function FI(e){return mS(e),e}function zI(e,t){let n;return s;function s(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?l(u):Qe(u)?e.check(MI,c,l)(u):(e.consume(u),i)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function c(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function BI(e,t,n){const s=this;return i;function i(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Dt(e,l,"linePrefix")}function l(c){if(c===null||Qe(c))return n(c);const u=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function hS(e,t,n,s,i,l,c,u,p){const m=p||Number.POSITIVE_INFINITY;let h=0;return x;function x(j){return j===60?(e.enter(s),e.enter(i),e.enter(l),e.consume(j),e.exit(l),y):j===null||j===32||j===41||Nh(j)?n(j):(e.enter(s),e.enter(c),e.enter(u),e.enter("chunkString",{contentType:"string"}),k(j))}function y(j){return j===62?(e.enter(l),e.consume(j),e.exit(l),e.exit(i),e.exit(s),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===62?(e.exit("chunkString"),e.exit(u),y(j)):j===null||j===60||Qe(j)?n(j):(e.consume(j),j===92?E:b)}function E(j){return j===60||j===62||j===92?(e.consume(j),b):b(j)}function k(j){return!h&&(j===null||j===41||or(j))?(e.exit("chunkString"),e.exit(u),e.exit(c),e.exit(s),t(j)):h<m&&j===40?(e.consume(j),h++,k):j===41?(e.consume(j),h--,k):j===null||j===32||j===40||Nh(j)?n(j):(e.consume(j),j===92?v:k)}function v(j){return j===40||j===41||j===92?(e.consume(j),k):k(j)}}function gS(e,t,n,s,i,l){const c=this;let u=0,p;return m;function m(b){return e.enter(s),e.enter(i),e.consume(b),e.exit(i),e.enter(l),h}function h(b){return u>999||b===null||b===91||b===93&&!p||b===94&&!u&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(l),e.enter(i),e.consume(b),e.exit(i),e.exit(s),t):Qe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||Qe(b)||u++>999?(e.exit("chunkString"),h(b)):(e.consume(b),p||(p=!wt(b)),b===92?y:x)}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,x):x(b)}}function xS(e,t,n,s,i,l){let c;return u;function u(y){return y===34||y===39||y===40?(e.enter(s),e.enter(i),e.consume(y),e.exit(i),c=y===40?41:y,p):n(y)}function p(y){return y===c?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),t):(e.enter(l),m(y))}function m(y){return y===c?(e.exit(l),p(c)):y===null?n(y):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Dt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===c||y===null||Qe(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?x:h)}function x(y){return y===c||y===92?(e.consume(y),h):h(y)}}function jl(e,t){let n;return s;function s(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,s):wt(i)?Dt(e,s,n?"linePrefix":"lineSuffix")(i):t(i)}}const UI={name:"definition",tokenize:HI},VI={partial:!0,tokenize:WI};function HI(e,t,n){const s=this;let i;return l;function l(b){return e.enter("definition"),c(b)}function c(b){return gS.call(s,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return i=Xi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):n(b)}function p(b){return or(b)?jl(e,m)(b):m(b)}function m(b){return hS(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(VI,x,x)(b)}function x(b){return wt(b)?Dt(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Qe(b)?(e.exit("definition"),s.parser.defined.push(i),t(b)):n(b)}}function WI(e,t,n){return s;function s(u){return or(u)?jl(e,i)(u):n(u)}function i(u){return xS(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return wt(u)?Dt(e,c,"whitespace")(u):c(u)}function c(u){return u===null||Qe(u)?t(u):n(u)}}const KI={name:"hardBreakEscape",tokenize:qI};function qI(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return Qe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const GI={name:"headingAtx",resolve:YI,tokenize:JI};function YI(e,t){let n=e.length-2,s=3,i,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&&(i={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"},us(e,s,n-s+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function JI(e,t,n){let s=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),c(h)}function c(h){return h===35&&s++<6?(e.consume(h),c):h===null||or(h)?(e.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||Qe(h)?(e.exit("atxHeading"),t(h)):wt(h)?Dt(e,u,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function p(h){return h===35?(e.consume(h),p):(e.exit("atxHeadingSequence"),u(h))}function m(h){return h===null||h===35||or(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),m)}}const XI=["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"],gw=["pre","script","style","textarea"],QI={concrete:!0,name:"htmlFlow",resolveTo:tO,tokenize:nO},ZI={partial:!0,tokenize:sO},eO={partial:!0,tokenize:rO};function tO(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 nO(e,t,n){const s=this;let i,l,c,u,p;return m;function m(I){return h(I)}function h(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),x}function x(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),l=!0,k):I===63?(e.consume(I),i=3,s.interrupt?t:A):ss(I)?(e.consume(I),c=String.fromCharCode(I),v):n(I)}function y(I){return I===45?(e.consume(I),i=2,b):I===91?(e.consume(I),i=5,u=0,E):ss(I)?(e.consume(I),i=4,s.interrupt?t:A):n(I)}function b(I){return I===45?(e.consume(I),s.interrupt?t:A):n(I)}function E(I){const ue="CDATA[";return I===ue.charCodeAt(u++)?(e.consume(I),u===ue.length?s.interrupt?t:U:E):n(I)}function k(I){return ss(I)?(e.consume(I),c=String.fromCharCode(I),v):n(I)}function v(I){if(I===null||I===47||I===62||or(I)){const ue=I===47,me=c.toLowerCase();return!ue&&!l&&gw.includes(me)?(i=1,s.interrupt?t(I):U(I)):XI.includes(c.toLowerCase())?(i=6,ue?(e.consume(I),j):s.interrupt?t(I):U(I)):(i=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(I):l?C(I):N(I))}return I===45||xr(I)?(e.consume(I),c+=String.fromCharCode(I),v):n(I)}function j(I){return I===62?(e.consume(I),s.interrupt?t:U):n(I)}function C(I){return wt(I)?(e.consume(I),C):ee(I)}function N(I){return I===47?(e.consume(I),ee):I===58||I===95||ss(I)?(e.consume(I),T):wt(I)?(e.consume(I),N):ee(I)}function T(I){return I===45||I===46||I===58||I===95||xr(I)?(e.consume(I),T):L(I)}function L(I){return I===61?(e.consume(I),P):wt(I)?(e.consume(I),L):N(I)}function P(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),p=I,$):wt(I)?(e.consume(I),P):D(I)}function $(I){return I===p?(e.consume(I),p=null,J):I===null||Qe(I)?n(I):(e.consume(I),$)}function D(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||or(I)?L(I):(e.consume(I),D)}function J(I){return I===47||I===62||wt(I)?N(I):n(I)}function ee(I){return I===62?(e.consume(I),M):n(I)}function M(I){return I===null||Qe(I)?U(I):wt(I)?(e.consume(I),M):n(I)}function U(I){return I===45&&i===2?(e.consume(I),Z):I===60&&i===1?(e.consume(I),le):I===62&&i===4?(e.consume(I),z):I===63&&i===3?(e.consume(I),A):I===93&&i===5?(e.consume(I),G):Qe(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ZI,Q,X)(I)):I===null||Qe(I)?(e.exit("htmlFlowData"),X(I)):(e.consume(I),U)}function X(I){return e.check(eO,B,Q)(I)}function B(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),q}function q(I){return I===null||Qe(I)?X(I):(e.enter("htmlFlowData"),U(I))}function Z(I){return I===45?(e.consume(I),A):U(I)}function le(I){return I===47?(e.consume(I),c="",_):U(I)}function _(I){if(I===62){const ue=c.toLowerCase();return gw.includes(ue)?(e.consume(I),z):U(I)}return ss(I)&&c.length<8?(e.consume(I),c+=String.fromCharCode(I),_):U(I)}function G(I){return I===93?(e.consume(I),A):U(I)}function A(I){return I===62?(e.consume(I),z):I===45&&i===2?(e.consume(I),A):U(I)}function z(I){return I===null||Qe(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),z)}function Q(I){return e.exit("htmlFlow"),t(I)}}function rO(e,t,n){const s=this;return i;function i(c){return Qe(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 sO(e,t,n){return s;function s(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Yd,t,n)}}const oO={name:"htmlText",tokenize:iO};function iO(e,t,n){const s=this;let i,l,c;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),L):A===63?(e.consume(A),N):ss(A)?(e.consume(A),D):n(A)}function m(A){return A===45?(e.consume(A),h):A===91?(e.consume(A),l=0,E):ss(A)?(e.consume(A),C):n(A)}function h(A){return A===45?(e.consume(A),b):n(A)}function x(A){return A===null?n(A):A===45?(e.consume(A),y):Qe(A)?(c=x,le(A)):(e.consume(A),x)}function y(A){return A===45?(e.consume(A),b):x(A)}function b(A){return A===62?Z(A):A===45?y(A):x(A)}function E(A){const z="CDATA[";return A===z.charCodeAt(l++)?(e.consume(A),l===z.length?k:E):n(A)}function k(A){return A===null?n(A):A===93?(e.consume(A),v):Qe(A)?(c=k,le(A)):(e.consume(A),k)}function v(A){return A===93?(e.consume(A),j):k(A)}function j(A){return A===62?Z(A):A===93?(e.consume(A),j):k(A)}function C(A){return A===null||A===62?Z(A):Qe(A)?(c=C,le(A)):(e.consume(A),C)}function N(A){return A===null?n(A):A===63?(e.consume(A),T):Qe(A)?(c=N,le(A)):(e.consume(A),N)}function T(A){return A===62?Z(A):N(A)}function L(A){return ss(A)?(e.consume(A),P):n(A)}function P(A){return A===45||xr(A)?(e.consume(A),P):$(A)}function $(A){return Qe(A)?(c=$,le(A)):wt(A)?(e.consume(A),$):Z(A)}function D(A){return A===45||xr(A)?(e.consume(A),D):A===47||A===62||or(A)?J(A):n(A)}function J(A){return A===47?(e.consume(A),Z):A===58||A===95||ss(A)?(e.consume(A),ee):Qe(A)?(c=J,le(A)):wt(A)?(e.consume(A),J):Z(A)}function ee(A){return A===45||A===46||A===58||A===95||xr(A)?(e.consume(A),ee):M(A)}function M(A){return A===61?(e.consume(A),U):Qe(A)?(c=M,le(A)):wt(A)?(e.consume(A),M):J(A)}function U(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,X):Qe(A)?(c=U,le(A)):wt(A)?(e.consume(A),U):(e.consume(A),B)}function X(A){return A===i?(e.consume(A),i=void 0,q):A===null?n(A):Qe(A)?(c=X,le(A)):(e.consume(A),X)}function B(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||or(A)?J(A):(e.consume(A),B)}function q(A){return A===47||A===62||or(A)?J(A):n(A)}function Z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function le(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return wt(A)?Dt(e,G,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):G(A)}function G(A){return e.enter("htmlTextData"),c(A)}}const Jg={name:"labelEnd",resolveAll:uO,resolveTo:dO,tokenize:fO},aO={tokenize:pO},lO={tokenize:mO},cO={tokenize:hO};function uO(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 i=s.type==="labelImage"?4:2;s.type="data",t+=i}}return e.length!==n.length&&us(e,0,e.length,n),e}function dO(e,t){let n=e.length,s=0,i,l,c,u;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){s=2;break}}else i.type==="labelEnd"&&(c=n);const p={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}},h={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[c-2][1].start}};return u=[["enter",p,t],["enter",m,t]],u=Er(u,e.slice(l+1,l+s+3)),u=Er(u,[["enter",h,t]]),u=Er(u,Yg(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),u=Er(u,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),u=Er(u,e.slice(c+1)),u=Er(u,[["exit",p,t]]),us(e,l,e.length,u),e}function fO(e,t,n){const s=this;let i=s.events.length,l,c;for(;i--;)if((s.events[i][1].type==="labelImage"||s.events[i][1].type==="labelLink")&&!s.events[i][1]._balanced){l=s.events[i][1];break}return u;function u(y){return l?l._inactive?x(y):(c=s.parser.defined.includes(Xi(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):n(y)}function p(y){return y===40?e.attempt(aO,h,c?h:x)(y):y===91?e.attempt(lO,h,c?m:x)(y):c?h(y):x(y)}function m(y){return e.attempt(cO,h,x)(y)}function h(y){return t(y)}function x(y){return l._balanced=!0,n(y)}}function pO(e,t,n){return s;function s(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),i}function i(x){return or(x)?jl(e,l)(x):l(x)}function l(x){return x===41?h(x):hS(e,c,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return or(x)?jl(e,p)(x):h(x)}function u(x){return n(x)}function p(x){return x===34||x===39||x===40?xS(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):h(x)}function m(x){return or(x)?jl(e,h)(x):h(x)}function h(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function mO(e,t,n){const s=this;return i;function i(u){return gS.call(s,e,l,c,"reference","referenceMarker","referenceString")(u)}function l(u){return s.parser.defined.includes(Xi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function c(u){return n(u)}}function hO(e,t,n){return s;function s(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const gO={name:"labelStartImage",resolveAll:Jg.resolveAll,tokenize:xO};function xO(e,t,n){const s=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),c):n(u)}function c(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(u):t(u)}}const yO={name:"labelStartLink",resolveAll:Jg.resolveAll,tokenize:bO};function bO(e,t,n){const s=this;return i;function i(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 Pm={name:"lineEnding",tokenize:vO};function vO(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const Uu={name:"thematicBreak",tokenize:wO};function wO(e,t,n){let s=0,i;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return i=m,u(m)}function u(m){return m===i?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||Qe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===i?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),wt(m)?Dt(e,u,"whitespace")(m):u(m))}}const nr={continuation:{tokenize:NO},exit:EO,name:"list",tokenize:SO},jO={partial:!0,tokenize:TO},kO={partial:!0,tokenize:CO};function SO(e,t,n){const s=this,i=s.events[s.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,c=0;return u;function u(b){const E=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:Ch(b)){if(s.containerState.type||(s.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Uu,n,m)(b):m(b);if(!s.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return n(b)}function p(b){return Ch(b)&&++c<10?(e.consume(b),p):(!s.interrupt||c<2)&&(s.containerState.marker?b===s.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,e.check(Yd,s.interrupt?n:h,e.attempt(jO,y,x))}function h(b){return s.containerState.initialBlankLine=!0,l++,y(b)}function x(b){return wt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function NO(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Yd,i,l);function i(u){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Dt(e,t,"listItemIndent",s.containerState.size+1)(u)}function l(u){return s.containerState.furtherBlankLines||!wt(u)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(u)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(kO,t,c)(u))}function c(u){return s.containerState._closeFlow=!0,s.interrupt=void 0,Dt(e,e.attempt(nr,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function CO(e,t,n){const s=this;return Dt(e,i,"listItemIndent",s.containerState.size+1);function i(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 EO(e){e.exit(this.containerState.type)}function TO(e,t,n){const s=this;return Dt(e,i,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const c=s.events[s.events.length-1];return!wt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const xw={name:"setextUnderline",resolveTo:PO,tokenize:RO};function PO(e,t){let n=e.length,s,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(i=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[i][1].type="setextHeadingText",l?(e.splice(i,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 RO(e,t,n){const s=this;let i;return l;function l(m){let h=s.events.length,x;for(;h--;)if(s.events[h][1].type!=="lineEnding"&&s.events[h][1].type!=="linePrefix"&&s.events[h][1].type!=="content"){x=s.events[h][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||x)?(e.enter("setextHeadingLine"),i=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===i?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),wt(m)?Dt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Qe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const AO={tokenize:DO};function DO(e){const t=this,n=e.attempt(Yd,s,e.attempt(this.parser.constructs.flowInitial,i,Dt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(_I,i)),"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 i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $O={resolveAll:bS()},LO=yS("string"),IO=yS("text");function yS(e){return{resolveAll:bS(e==="text"?OO:void 0),tokenize:t};function t(n){const s=this,i=this.parser.constructs[e],l=n.attempt(i,c,u);return c;function c(h){return m(h)?l(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),p}function p(h){return m(h)?(n.exit("data"),l(h)):(n.consume(h),p)}function m(h){if(h===null)return!0;const x=i[h];let y=-1;if(x)for(;++y<x.length;){const b=x[y];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function bS(e){return t;function t(n,s){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,s):n}}function OO(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],i=t.sliceStream(s);let l=i.length,c=-1,u=0,p;for(;l--;){const m=i[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)u++,c--;if(c)break;c=-1}else if(m===-2)p=!0,u++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const m={type:n===e.length||p||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-u,offset:s.end.offset-u},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 _O={42:nr,43:nr,45:nr,48:nr,49:nr,50:nr,51:nr,52:nr,53:nr,54:nr,55:nr,56:nr,57:nr,62:dS},MO={91:UI},FO={[-2]:Tm,[-1]:Tm,32:Tm},zO={35:GI,42:Uu,45:[xw,Uu],60:QI,61:xw,95:Uu,96:hw,126:hw},BO={38:pS,92:fS},UO={[-5]:Pm,[-4]:Pm,[-3]:Pm,33:gO,38:pS,42:Eh,60:[yI,oO],91:yO,92:[KI,fS],93:Jg,95:Eh,96:AI},VO={null:[Eh,$O]},HO={null:[42,95]},WO={null:[]},KO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HO,contentInitial:MO,disable:WO,document:_O,flow:zO,flowInitial:FO,insideSpan:VO,string:BO,text:UO},Symbol.toStringTag,{value:"Module"}));function qO(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 i={},l=[];let c=[],u=[];const p={attempt:$(L),check:$(P),consume:C,enter:N,exit:T,interrupt:$(P,{interrupt:!0})},m={code:null,containerState:{},defineSkip:k,events:[],now:E,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:x};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function x(M){return c=Er(c,M),v(),c[c.length-1]!==null?[]:(D(t,0),m.events=Yg(l,m.events,m),m.events)}function y(M,U){return YO(b(M),U)}function b(M){return GO(c,M)}function E(){const{_bufferIndex:M,_index:U,line:X,column:B,offset:q}=s;return{_bufferIndex:M,_index:U,line:X,column:B,offset:q}}function k(M){i[M.line]=M.column,ee()}function v(){let M;for(;s._index<c.length;){const U=c[s._index];if(typeof U=="string")for(M=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===M&&s._bufferIndex<U.length;)j(U.charCodeAt(s._bufferIndex));else j(U)}}function j(M){h=h(M)}function C(M){Qe(M)?(s.line++,s.column=1,s.offset+=M===-3?2:1,ee()):M!==-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=M}function N(M,U){const X=U||{};return X.type=M,X.start=E(),m.events.push(["enter",X,m]),u.push(X),X}function T(M){const U=u.pop();return U.end=E(),m.events.push(["exit",U,m]),U}function L(M,U){D(M,U.from)}function P(M,U){U.restore()}function $(M,U){return X;function X(B,q,Z){let le,_,G,A;return Array.isArray(B)?Q(B):"tokenize"in B?Q([B]):z(B);function z(V){return ne;function ne(de){const ye=de!==null&&V[de],ke=de!==null&&V.null,fe=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Q(fe)(de)}}function Q(V){return le=V,_=0,V.length===0?Z:I(V[_])}function I(V){return ne;function ne(de){return A=J(),G=V,V.partial||(m.currentConstruct=V),V.name&&m.parser.constructs.disable.null.includes(V.name)?me():V.tokenize.call(U?Object.assign(Object.create(m),U):m,p,ue,me)(de)}}function ue(V){return M(G,A),q}function me(V){return A.restore(),++_<le.length?I(le[_]):Z}}}function D(M,U){M.resolveAll&&!l.includes(M)&&l.push(M),M.resolve&&us(m.events,U,m.events.length-U,M.resolve(m.events.slice(U),m)),M.resolveTo&&(m.events=M.resolveTo(m.events,m))}function J(){const M=E(),U=m.previous,X=m.currentConstruct,B=m.events.length,q=Array.from(u);return{from:B,restore:Z};function Z(){s=M,m.previous=U,m.currentConstruct=X,m.events.length=B,u=q,ee()}}function ee(){s.line in i&&s.column<2&&(s.column=i[s.line],s.offset+=i[s.line]-1)}}function GO(e,t){const n=t.start._index,s=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let c;if(n===i)c=[e[n].slice(s,l)];else{if(c=e.slice(n,i),s>-1){const u=c[0];typeof u=="string"?c[0]=u.slice(s):c.shift()}l>0&&c.push(e[i].slice(0,l))}return c}function YO(e,t){let n=-1;const s=[];let i;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=`
|
|
517
|
+
`;break}case-3:{c=`\r
|
|
518
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&i)continue;c=" ";break}default:c=String.fromCharCode(l)}i=l===-2,s.push(c)}return s.join("")}function JO(e){const s={constructs:rI([KO,...(e||{}).extensions||[]]),content:i(dI),defined:[],document:i(pI),flow:i(AO),lazy:{},string:i(LO),text:i(IO)};return s;function i(l){return c;function c(u){return qO(s,l,u)}}}function XO(e){for(;!mS(e););return e}const yw=/[\0\t\n\r]/g;function QO(){let e=1,t="",n=!0,s;return i;function i(l,c,u){const p=[];let m,h,x,y,b;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(yw.lastIndex=x,m=yw.exec(l),y=m&&m.index!==void 0?m.index:l.length,b=l.charCodeAt(y),!m){t=l.slice(x);break}if(b===10&&x===y&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),x<y&&(p.push(l.slice(x,y)),e+=y-x),b){case 0:{p.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,p.push(-2);e++<h;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}x=y+1}return u&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const ZO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e_(e){return e.replace(ZO,t_)}function t_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return uS(n.slice(l?2:1),l?16:10)}return Gg(n)||e}const vS={}.hasOwnProperty;function n_(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),r_(n)(XO(JO(n).document().write(QO()(e,t,!0))))}function r_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ae),autolinkProtocol:J,autolinkEmail:J,atxHeading:l(O),blockQuote:l(ke),characterEscape:J,characterReference:J,codeFenced:l(fe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(fe,c),codeText:l(Ve,c),codeTextData:J,data:J,codeFlowValue:J,definition:l(pe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Re),hardBreakEscape:l(W),hardBreakTrailing:l(W),htmlFlow:l(te,c),htmlFlowData:J,htmlText:l(te,c),htmlTextData:J,image:l(xe),label:c,link:l(Ae),listItem:l(et),listItemValue:y,listOrdered:l(Ee,x),listUnordered:l(Ee),paragraph:l(Ye),reference:I,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(O),strong:l(St),thematicBreak:l(st)},exit:{atxHeading:p(),atxHeadingSequence:L,autolink:p(),autolinkEmail:ye,autolinkProtocol:de,blockQuote:p(),characterEscapeValue:ee,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:V,characterReference:ne,codeFenced:p(v),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:E,codeFlowValue:ee,codeIndented:p(j),codeText:p(q),codeTextData:ee,data:ee,definition:p(),definitionDestinationString:T,definitionLabelString:C,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(U),hardBreakTrailing:p(U),htmlFlow:p(X),htmlFlowData:ee,htmlText:p(B),htmlTextData:ee,image:p(le),label:G,labelText:_,lineEnding:M,link:p(Z),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:A,resourceTitleString:z,resource:Q,setextHeading:p(D),setextHeadingLineSequence:$,setextHeadingText:P,strong:p(),thematicBreak:p()}};wS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ae){let be={type:"root",children:[]};const Le={stack:[be],tokenStack:[],config:t,enter:u,exit:m,buffer:c,resume:h,data:n},Be=[];let Ge=-1;for(;++Ge<ae.length;)if(ae[Ge][1].type==="listOrdered"||ae[Ge][1].type==="listUnordered")if(ae[Ge][0]==="enter")Be.push(Ge);else{const it=Be.pop();Ge=i(ae,it,Ge)}for(Ge=-1;++Ge<ae.length;){const it=t[ae[Ge][0]];vS.call(it,ae[Ge][1].type)&&it[ae[Ge][1].type].call(Object.assign({sliceSerialize:ae[Ge][2].sliceSerialize},Le),ae[Ge][1])}if(Le.tokenStack.length>0){const it=Le.tokenStack[Le.tokenStack.length-1];(it[1]||bw).call(Le,void 0,it[0])}for(be.position={start:Xs(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Xs(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)be=t.transforms[Ge](be)||be;return be}function i(ae,be,Le){let Be=be-1,Ge=-1,it=!1,Kt,xt,tn,Nt;for(;++Be<=Le;){const yt=ae[Be];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?Ge++:Ge--,Nt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(Kt&&!Nt&&!Ge&&!tn&&(tn=Be),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!Ge&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||Ge===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(Kt){let kt=Be;for(xt=void 0;kt--;){const he=ae[kt];if(he[1].type==="lineEnding"||he[1].type==="lineEndingBlank"){if(he[0]==="exit")continue;xt&&(ae[xt][1].type="lineEndingBlank",it=!0),he[1].type="lineEnding",xt=kt}else if(!(he[1].type==="linePrefix"||he[1].type==="blockQuotePrefix"||he[1].type==="blockQuotePrefixWhitespace"||he[1].type==="blockQuoteMarker"||he[1].type==="listItemIndent"))break}tn&&(!xt||tn<xt)&&(Kt._spread=!0),Kt.end=Object.assign({},xt?ae[xt][1].start:yt[1].end),ae.splice(xt||Be,0,["exit",Kt,yt[2]]),Be++,Le++}if(yt[1].type==="listItemPrefix"){const kt={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};Kt=kt,ae.splice(Be,0,["enter",kt,yt[2]]),Be++,Le++,tn=void 0,Nt=!0}}}return ae[be][1]._spread=it,Le}function l(ae,be){return Le;function Le(Be){u.call(this,ae(Be),Be),be&&be.call(this,Be)}}function c(){this.stack.push({type:"fragment",children:[]})}function u(ae,be,Le){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([be,Le||void 0]),ae.position={start:Xs(be.start),end:void 0}}function p(ae){return be;function be(Le){ae&&ae.call(this,Le),m.call(this,Le)}}function m(ae,be){const Le=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==ae.type&&(be?be.call(this,ae,Be[0]):(Be[1]||bw).call(this,ae,Be[0]));else throw new Error("Cannot close `"+ae.type+"` ("+wl({start:ae.start,end:ae.end})+"): it’s not open");Le.position.end=Xs(ae.end)}function h(){return tI(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(ae){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.lang=ae}function E(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.meta=ae}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae.replace(/(\r?\n|\r)$/g,"")}function C(ae){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Xi(this.sliceSerialize(ae)).toLowerCase()}function N(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.title=ae}function T(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.url=ae}function L(ae){const be=this.stack[this.stack.length-1];if(!be.depth){const Le=this.sliceSerialize(ae).length;be.depth=Le}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function $(ae){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function J(ae){const Le=this.stack[this.stack.length-1].children;let Be=Le[Le.length-1];(!Be||Be.type!=="text")&&(Be=Bt(),Be.position={start:Xs(ae.start),end:void 0},Le.push(Be)),this.stack.push(Be)}function ee(ae){const be=this.stack.pop();be.value+=this.sliceSerialize(ae),be.position.end=Xs(ae.end)}function M(ae){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=be.children[be.children.length-1];Le.position.end=Xs(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(J.call(this,ae),ee.call(this,ae))}function U(){this.data.atHardBreak=!0}function X(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function B(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function q(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function Z(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=be,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function le(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=be,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function _(ae){const be=this.sliceSerialize(ae),Le=this.stack[this.stack.length-2];Le.label=e_(be),Le.identifier=Xi(be).toLowerCase()}function G(){const ae=this.stack[this.stack.length-1],be=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Be=ae.children;Le.children=Be}else Le.alt=be}function A(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.url=ae}function z(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.title=ae}function Q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ue(ae){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Xi(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function me(ae){this.data.characterReferenceType=ae.type}function V(ae){const be=this.sliceSerialize(ae),Le=this.data.characterReferenceType;let Be;Le?(Be=uS(be,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Gg(be);const Ge=this.stack[this.stack.length-1];Ge.value+=Be}function ne(ae){const be=this.stack.pop();be.position.end=Xs(ae.end)}function de(ae){ee.call(this,ae);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ae)}function ye(ae){ee.call(this,ae);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ae)}function ke(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function Ve(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function O(){return{type:"heading",depth:0,children:[]}}function W(){return{type:"break"}}function te(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function Ee(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function et(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Ye(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function Bt(){return{type:"text",value:""}}function st(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function wS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?wS(e,s):s_(e,s)}}function s_(e,t){let n;for(n in t)if(vS.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 bw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wl({start:t.start,end:t.end})+") is still open")}function o_(e){const t=this;t.parser=n;function n(s){return n_(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function i_(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 a_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
519
|
+
`}]}function l_(e,t){const n=t.value?t.value+`
|
|
520
|
+
`:"",s={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(s.className=["language-"+i[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 c_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),i=pa(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,u=e.footnoteCounts.get(s);u===void 0?(u=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,u+=1,e.footnoteCounts.set(s,u);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function f_(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 p_(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jS(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 i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const c=i[i.length-1];return c&&c.type==="text"?c.value+=s:i.push({type:"text",value:s}),i}function m_(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return jS(e,t);const i={src:pa(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(i.title=s.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function h_(e,t){const n={src:pa(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 g_(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 x_(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return jS(e,t);const i={href:pa(s.url||"")};s.title!==null&&s.title!==void 0&&(i.title=s.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function y_(e,t){const n={href:pa(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 b_(e,t,n){const s=e.all(t),i=n?v_(n):kS(t),l={},c=[];if(typeof t.checked=="boolean"){const h=s[0];let x;h&&h.type==="element"&&h.tagName==="p"?x=h:(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 u=-1;for(;++u<s.length;){const h=s[u];(i||u!==0||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
521
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?c.push(...h.children):c.push(h)}const p=s[s.length-1];p&&(i||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
522
|
+
`});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function v_(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=kS(n[s])}return t}function kS(e){const t=e.spread;return t??e.children.length>1}function w_(e,t){const n={},s=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<s.length;){const c=s[i];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 j_(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k_(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function S_(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N_(e,t){const n=e.all(t),s=n.shift(),i=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),i.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Hg(t.children[1]),p=rS(t.children[t.children.length-1]);u&&p&&(c.position={start:u,end:p}),i.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function C_(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,u=c?c.length:t.children.length;let p=-1;const m=[];for(;++p<u;){const x=t.children[p],y={},b=c?c[p]:void 0;b&&(y.align=b);let E={type:"element",tagName:l,properties:y,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,h),e.applyData(t,h)}function E_(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const vw=9,ww=32;function T_(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),i=0;const l=[];for(;s;)l.push(jw(t.slice(i,s.index),i>0,!0),s[0]),i=s.index+s[0].length,s=n.exec(t);return l.push(jw(t.slice(i),i>0,!1)),l.join("")}function jw(e,t,n){let s=0,i=e.length;if(t){let l=e.codePointAt(s);for(;l===vw||l===ww;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(i-1);for(;l===vw||l===ww;)i--,l=e.codePointAt(i-1)}return i>s?e.slice(s,i):""}function P_(e,t){const n={type:"text",value:T_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function R_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const A_={blockquote:i_,break:a_,code:l_,delete:c_,emphasis:u_,footnoteReference:d_,heading:f_,html:p_,imageReference:m_,image:h_,inlineCode:g_,linkReference:x_,link:y_,listItem:b_,list:w_,paragraph:j_,root:k_,strong:S_,table:N_,tableCell:E_,tableRow:C_,text:P_,thematicBreak:R_,toml:ku,yaml:ku,definition:ku,footnoteDefinition:ku};function ku(){}const SS=-1,Jd=0,kl=1,cd=2,Xg=3,Qg=4,Zg=5,ex=6,NS=7,CS=8,kw=typeof self=="object"?self:globalThis,D_=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),s=i=>{if(e.has(i))return e.get(i);const[l,c]=t[i];switch(l){case Jd:case SS:return n(c,i);case kl:{const u=n([],i);for(const p of c)u.push(s(p));return u}case cd:{const u=n({},i);for(const[p,m]of c)u[s(p)]=s(m);return u}case Xg:return n(new Date(c),i);case Qg:{const{source:u,flags:p}=c;return n(new RegExp(u,p),i)}case Zg:{const u=n(new Map,i);for(const[p,m]of c)u.set(s(p),s(m));return u}case ex:{const u=n(new Set,i);for(const p of c)u.add(s(p));return u}case NS:{const{name:u,message:p}=c;return n(new kw[u](p),i)}case CS:return n(BigInt(c),i);case"BigInt":return n(Object(BigInt(c)),i);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:u}=new Uint8Array(c);return n(new DataView(u),c)}}return n(new kw[l](c),i)};return s},Sw=e=>D_(new Map,e)(0),Di="",{toString:$_}={},{keys:L_}=Object,pl=e=>{const t=typeof e;if(t!=="object"||!e)return[Jd,t];const n=$_.call(e).slice(8,-1);switch(n){case"Array":return[kl,Di];case"Object":return[cd,Di];case"Date":return[Xg,Di];case"RegExp":return[Qg,Di];case"Map":return[Zg,Di];case"Set":return[ex,Di];case"DataView":return[kl,n]}return n.includes("Array")?[kl,n]:n.includes("Error")?[NS,n]:[cd,n]},Su=([e,t])=>e===Jd&&(t==="function"||t==="symbol"),I_=(e,t,n,s)=>{const i=(c,u)=>{const p=s.push(c)-1;return n.set(u,p),p},l=c=>{if(n.has(c))return n.get(c);let[u,p]=pl(c);switch(u){case Jd:{let h=c;switch(p){case"bigint":u=CS,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return i([SS],c)}return i([u,h],c)}case kl:{if(p){let y=c;return p==="DataView"?y=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(c)),i([p,[...y]],c)}const h=[],x=i([u,h],c);for(const y of c)h.push(l(y));return x}case cd:{if(p)switch(p){case"BigInt":return i([p,c.toString()],c);case"Boolean":case"Number":case"String":return i([p,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const h=[],x=i([u,h],c);for(const y of L_(c))(e||!Su(pl(c[y])))&&h.push([l(y),l(c[y])]);return x}case Xg:return i([u,c.toISOString()],c);case Qg:{const{source:h,flags:x}=c;return i([u,{source:h,flags:x}],c)}case Zg:{const h=[],x=i([u,h],c);for(const[y,b]of c)(e||!(Su(pl(y))||Su(pl(b))))&&h.push([l(y),l(b)]);return x}case ex:{const h=[],x=i([u,h],c);for(const y of c)(e||!Su(pl(y)))&&h.push(l(y));return x}}const{message:m}=c;return i([u,{name:p,message:m}],c)};return l},Nw=(e,{json:t,lossy:n}={})=>{const s=[];return I_(!(t||n),!!t,new Map,s)(e),s},ud=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sw(Nw(e,t)):structuredClone(e):(e,t)=>Sw(Nw(e,t));function O_(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 __(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function M_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||O_,s=e.options.footnoteBackLabel||__,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const h=e.all(m),x=String(m.identifier).toUpperCase(),y=pa(x.toLowerCase());let b=0;const E=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++b<=k;){E.length>0&&E.push({type:"text",value:" "});let C=typeof n=="string"?n:n(p,b);typeof C=="string"&&(C={type:"text",value:C}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const C=v.children[v.children.length-1];C&&C.type==="text"?C.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...E)}else h.push(...E);const j={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(h,!0)};e.patch(m,j),u.push(j)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ud(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
523
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
524
|
+
`}]}}const ES=(function(e){if(e==null)return U_;if(typeof e=="function")return Xd(e);if(typeof e=="object")return Array.isArray(e)?F_(e):z_(e);if(typeof e=="string")return B_(e);throw new Error("Expected function, string, or object as test")});function F_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ES(e[n]);return Xd(s);function s(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function z_(e){const t=e;return Xd(n);function n(s){const i=s;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function B_(e){return Xd(t);function t(n){return n&&n.type===e}}function Xd(e){return t;function t(n,s,i){return!!(V_(n)&&e.call(this,n,typeof s=="number"?s:void 0,i||void 0))}}function U_(){return!0}function V_(e){return e!==null&&typeof e=="object"&&"type"in e}const TS=[],H_=!0,Cw=!1,W_="skip";function K_(e,t,n,s){let i;typeof t=="function"&&typeof n!="function"?(s=n,n=t):i=t;const l=ES(i),c=s?-1:1;u(e,void 0,[])();function u(p,m,h){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const b=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=TS,E,k,v;if((!t||l(p,m,h[h.length-1]||void 0))&&(b=q_(n(p,h)),b[0]===Cw))return b;if("children"in p&&p.children){const j=p;if(j.children&&b[0]!==W_)for(k=(s?j.children.length:-1)+c,v=h.concat(j);k>-1&&k<j.children.length;){const C=j.children[k];if(E=u(C,k,v)(),E[0]===Cw)return E;k=typeof E[1]=="number"?E[1]:k+c}}return b}}}function q_(e){return Array.isArray(e)?e:typeof e=="number"?[H_,e]:e==null?TS:[e]}function PS(e,t,n,s){let i,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,i=n):(l=t,c=n,i=s),K_(e,l,u,i);function u(p,m){const h=m[m.length-1],x=h?h.children.indexOf(p):void 0;return c(p,x,h)}}const Th={}.hasOwnProperty,G_={};function Y_(e,t){const n=t||G_,s=new Map,i=new Map,l=new Map,c={...A_,...n.handlers},u={all:m,applyData:X_,definitionById:s,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:J_,wrap:Z_};return PS(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const x=h.type==="definition"?s:i,y=String(h.identifier).toUpperCase();x.has(y)||x.set(y,h)}}),u;function p(h,x){const y=h.type,b=u.handlers[y];if(Th.call(u.handlers,y)&&b)return b(u,h,x);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in h){const{children:k,...v}=h,j=ud(v);return j.children=u.all(h),j}return ud(h)}return(u.options.unknownHandler||Q_)(u,h,x)}function m(h){const x=[];if("children"in h){const y=h.children;let b=-1;for(;++b<y.length;){const E=u.one(y[b],h);if(E){if(b&&y[b-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=Ew(E.value)),!Array.isArray(E)&&E.type==="element")){const k=E.children[0];k&&k.type==="text"&&(k.value=Ew(k.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function J_(e,t){e.position&&(t.position=$L(e))}function X_(e,t){let n=t;if(e&&e.data){const s=e.data.hName,i=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,ud(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Q_(e,t){const n=t.data||{},s="value"in t&&!(Th.call(n,"hProperties")||Th.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 Z_(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
|
|
525
|
+
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
526
|
+
`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
527
|
+
`}),n}function Ew(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Tw(e,t){const n=Y_(e,t),s=n.one(e,void 0),i=M_(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
528
|
+
`},i),l}function eM(e,t){return e&&"run"in e?async function(n,s){const i=Tw(n,{file:s,...t});await e.run(i,s)}:function(n,s){return Tw(n,{file:s,...e||t})}}function Pw(e){if(e)throw e}var Rm,Rw;function tM(){if(Rw)return Rm;Rw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=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 h=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!h&&!x)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},c=function(m,h){n&&h.name==="__proto__"?n(m,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):m[h.name]=h.newValue},u=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(s)return s(m,h).value}else return;return m[h]};return Rm=function p(){var m,h,x,y,b,E,k=arguments[0],v=1,j=arguments.length,C=!1;for(typeof k=="boolean"&&(C=k,k=arguments[1]||{},v=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});v<j;++v)if(m=arguments[v],m!=null)for(h in m)x=u(k,h),y=u(m,h),k!==y&&(C&&y&&(l(y)||(b=i(y)))?(b?(b=!1,E=x&&i(x)?x:[]):E=x&&l(x)?x:{},c(k,{name:h,newValue:p(C,E,y)})):typeof y<"u"&&c(k,{name:h,newValue:y}));return k},Rm}var nM=tM();const Am=yd(nM);function Ph(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 rM(){const e=[],t={run:n,use:s};return t;function n(...i){let l=-1;const c=i.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);u(null,...i);function u(p,...m){const h=e[++l];let x=-1;if(p){c(p);return}for(;++x<i.length;)(m[x]===null||m[x]===void 0)&&(m[x]=i[x]);i=m,h?sM(h,u)(...m):c(null,...m)}}function s(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function sM(e,t){let n;return s;function s(...c){const u=e.length>c.length;let p;u&&c.push(i);try{p=e.apply(this,c)}catch(m){const h=m;if(u&&n)throw h;return i(h)}u||(p&&p.then&&typeof p.then=="function"?p.then(l,i):p instanceof Error?i(p):l(p))}function i(c,...u){n||(n=!0,t(c,...u))}function l(c){i(null,c)}}const ns={basename:oM,dirname:iM,extname:aM,join:lM,sep:"/"};function oM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sc(e);let n=0,s=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else c<0&&(l=!0,c=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(s=i):(u=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function iM(e){if(sc(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 aM(e){sc(e);let t=e.length,n=-1,s=0,i=-1,l=0,c;for(;t--;){const u=e.codePointAt(t);if(u===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),u===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===s+1?"":e.slice(i,n)}function lM(...e){let t=-1,n;for(;++t<e.length;)sc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cM(n)}function cM(e){sc(e);const t=e.codePointAt(0)===47;let n=uM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uM(e,t){let n="",s=0,i=-1,l=0,c=-1,u,p;for(;++c<=e.length;){if(c<e.length)u=e.codePointAt(c);else{if(u===47)break;u=47}if(u===47){if(!(i===c-1||l===1))if(i!==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(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",s=0):(n=n.slice(0,p),s=n.length-1-n.lastIndexOf("/")),i=c,l=0;continue}}else if(n.length>0){n="",s=0,i=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(i+1,c):n=e.slice(i+1,c),s=c-i-1;i=c,l=0}else u===46&&l>-1?l++:l=-1}return n}function sc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dM={cwd:fM};function fM(){return"/"}function Rh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pM(e){if(typeof e=="string")e=new URL(e);else if(!Rh(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 mM(e)}function mM(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Dm=["history","path","basename","stem","extname","dirname"];class RS{constructor(t){let n;t?Rh(t)?n={path:t}:typeof t=="string"||hM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Dm.length;){const l=Dm[s];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Dm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ns.basename(this.path):void 0}set basename(t){Lm(t,"basename"),$m(t,"basename"),this.path=ns.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ns.dirname(this.path):void 0}set dirname(t){Aw(this.basename,"dirname"),this.path=ns.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ns.extname(this.path):void 0}set extname(t){if($m(t,"extname"),Aw(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=ns.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rh(t)&&(t=pM(t)),Lm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ns.basename(this.path,this.extname):void 0}set stem(t){Lm(t,"stem"),$m(t,"stem"),this.path=ns.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const i=this.message(t,n,s);throw i.fatal=!0,i}info(t,n,s){const i=this.message(t,n,s);return i.fatal=void 0,i}message(t,n,s){const i=new zn(t,n,s);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function $m(e,t){if(e&&e.includes(ns.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ns.sep+"`")}function Lm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Aw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gM=(function(e){const s=this.constructor.prototype,i=s[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),xM={}.hasOwnProperty;class tx extends gM{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=rM()}copy(){const t=new tx;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(Am(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_m("data",this.frozen),this.namespace[t]=n,this):xM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_m("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 i=n.call(t,...s);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Nu(t),s=this.parser||this.Parser;return Im("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Im("process",this.parser||this.Parser),Om("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,c){const u=Nu(t),p=s.parse(u);s.run(p,u,function(h,x,y){if(h||!x||!y)return m(h);const b=x,E=s.stringify(b,y);vM(E)?y.value=E:y.result=E,m(h,y)});function m(h,x){h||!x?c(h):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,s;return this.freeze(),Im("processSync",this.parser||this.Parser),Om("processSync",this.compiler||this.Compiler),this.process(t,i),$w("processSync","process",n),s;function i(l,c){n=!0,Pw(l),s=c}}run(t,n,s){Dw(t),this.freeze();const i=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?l(void 0,s):new Promise(l);function l(c,u){const p=Nu(n);i.run(t,p,m);function m(h,x,y){const b=x||t;h?u(h):c?c(b):s(void 0,b,y)}}}runSync(t,n){let s=!1,i;return this.run(t,n,l),$w("runSync","run",s),i;function l(c,u){Pw(c),i=u,s=!0}}stringify(t,n){this.freeze();const s=Nu(n),i=this.compiler||this.Compiler;return Om("stringify",i),Dw(t),i(t,s)}use(t,...n){const s=this.attachers,i=this.namespace;if(_m("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[h,...x]=m;p(h,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");u(m.plugins),m.settings&&(i.settings=Am(!0,i.settings,m.settings))}function u(m){let h=-1;if(m!=null)if(Array.isArray(m))for(;++h<m.length;){const x=m[h];l(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,h){let x=-1,y=-1;for(;++x<s.length;)if(s[x][0]===m){y=x;break}if(y===-1)s.push([m,...h]);else if(h.length>0){let[b,...E]=h;const k=s[y][1];Ph(k)&&Ph(b)&&(b=Am(!0,k,b)),s[y]=[m,b,...E]}}}}const yM=new tx().freeze();function Im(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Om(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _m(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 Dw(e){if(!Ph(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $w(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nu(e){return bM(e)?e:new RS(e)}function bM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vM(e){return typeof e=="string"||wM(e)}function wM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lw=[],Iw={allowDangerousHtml:!0},kM=/^(https?|ircs?|mailto|xmpp)$/i,SM=[{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 NM(e){const t=CM(e),n=EM(e);return TM(t.runSync(t.parse(n),n),e)}function CM(e){const t=e.rehypePlugins||Lw,n=e.remarkPlugins||Lw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Iw}:Iw;return yM().use(o_).use(n).use(eM,s).use(t)}function EM(e){const t=e.children||"",n=new RS;return typeof t=="string"&&(n.value=t),n}function TM(e,t){const n=t.allowedElements,s=t.allowElement,i=t.components,l=t.disallowedElements,c=t.skipHtml,u=t.unwrapDisallowed,p=t.urlTransform||PM;for(const h of SM)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+jM+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),PS(e,m),ML(e,{Fragment:r.Fragment,components:i,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function m(h,x,y){if(h.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:h.value},x;if(h.type==="element"){let b;for(b in Em)if(Object.hasOwn(Em,b)&&Object.hasOwn(h.properties,b)){const E=h.properties[b],k=Em[b];(k===null||k.includes(h.tagName))&&(h.properties[b]=p(String(E||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!b&&s&&typeof x=="number"&&(b=!s(h,x,y)),b&&y&&typeof x=="number")return u&&h.children?y.children.splice(x,1,...h.children):y.children.splice(x,1),x}}}function PM(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||s!==-1&&t>s||kM.test(e.slice(0,t))?e:""}function fn({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:Te("prose-syntaur max-w-none",t),children:r.jsx(NM,{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 RM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(i=>i(s))},t)}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ma(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nx(e){return"nodeType"in e}function lr(e){var t,n;return e?ma(e)?e:nx(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function rx(e){const{Document:t}=lr(e);return e instanceof t}function oc(e){return ma(e)?!1:e instanceof lr(e).HTMLElement}function AS(e){return e instanceof lr(e).SVGElement}function ha(e){return e?ma(e)?e.document:nx(e)?rx(e)?e:oc(e)||AS(e)?e.ownerDocument:document:document:document}const ds=Qd?f.useLayoutEffect:f.useEffect;function sx(e){const t=f.useRef(e);return ds(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}function AM(){const e=f.useRef(null),t=f.useCallback((s,i)=>{e.current=setInterval(s,i)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Fl(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return ds(()=>{n.current!==e&&(n.current=e)},t),n}function ic(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function dd(e){const t=sx(e),n=f.useRef(null),s=f.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,s]}function Ah(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let Mm={};function ac(e,t){return f.useMemo(()=>{if(t)return t;const n=Mm[e]==null?0:Mm[e]+1;return Mm[e]=n,e+"-"+n},[e,t])}function DS(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.reduce((l,c)=>{const u=Object.entries(c);for(const[p,m]of u){const h=l[p];h!=null&&(l[p]=h+e*m)}return l},{...t})}}const Qi=DS(1),zl=DS(-1);function DM(e){return"clientX"in e&&"clientY"in e}function ox(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function $M(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function Dh(e){if($M(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 DM(e)?{x:e.clientX,y:e.clientY}:null}const io=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[io.Translate.toString(e),io.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Ow="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function LM(e){return e.matches(Ow)?e:e.querySelector(Ow)}const IM={display:"none"};function OM(e){let{id:t,value:n}=e;return Zt.createElement("div",{id:t,style:IM},n)}function _M(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const i={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 Zt.createElement("div",{id:t,style:i,role:"status","aria-live":s,"aria-atomic":!0},n)}function MM(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const $S=f.createContext(null);function FM(e){const t=f.useContext($S);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zM(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:i,event:l}=s;e.forEach(c=>{var u;return(u=c[i])==null?void 0:u.call(c,l)})},[e]),t]}const BM={draggable:`
|
|
529
|
+
To pick up a draggable item, press the space bar.
|
|
530
|
+
While dragging, use the arrow keys to move the item.
|
|
531
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
532
|
+
`},UM={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 VM(e){let{announcements:t=UM,container:n,hiddenTextDescribedById:s,screenReaderInstructions:i=BM}=e;const{announce:l,announcement:c}=MM(),u=ac("DndLiveRegion"),[p,m]=f.useState(!1);if(f.useEffect(()=>{m(!0)},[]),FM(f.useMemo(()=>({onDragStart(x){let{active:y}=x;l(t.onDragStart({active:y}))},onDragMove(x){let{active:y,over:b}=x;t.onDragMove&&l(t.onDragMove({active:y,over:b}))},onDragOver(x){let{active:y,over:b}=x;l(t.onDragOver({active:y,over:b}))},onDragEnd(x){let{active:y,over:b}=x;l(t.onDragEnd({active:y,over:b}))},onDragCancel(x){let{active:y,over:b}=x;l(t.onDragCancel({active:y,over:b}))}}),[l,t])),!p)return null;const h=Zt.createElement(Zt.Fragment,null,Zt.createElement(OM,{id:s,value:i.draggable}),Zt.createElement(_M,{id:u,announcement:c}));return n?Cs.createPortal(h,n):h}var xn;(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"})(xn||(xn={}));function fd(){}function ao(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Zd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Kr=Object.freeze({x:0,y:0});function LS(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function IS(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function HM(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function _w(e){let{left:t,top:n,height:s,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+s},{x:t+i,y:n+s}]}function OS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Mw(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 ef=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=Mw(t,t.left,t.top),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=LS(Mw(p),i);l.push({id:u,data:{droppableContainer:c,value:m}})}}return l.sort(IS)},WM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=_w(t),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=_w(p),h=i.reduce((y,b,E)=>y+LS(m[E],b),0),x=Number((h/4).toFixed(4));l.push({id:u,data:{droppableContainer:c,value:x}})}}return l.sort(IS)};function KM(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=i-s,u=l-n;if(s<i&&n<l){const p=t.width*t.height,m=e.width*e.height,h=c*u,x=h/(p+m-h);return Number(x.toFixed(4))}return 0}const qM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=[];for(const l of s){const{id:c}=l,u=n.get(c);if(u){const p=KM(u,t);p>0&&i.push({id:c,data:{droppableContainer:l,value:p}})}}return i.sort(HM)};function GM(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function _S(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Kr}function YM(e){return function(n){for(var s=arguments.length,i=new Array(s>1?s-1:0),l=1;l<s;l++)i[l-1]=arguments[l];return i.reduce((c,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const JM=YM(1);function XM(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 QM(e,t,n){const s=XM(t);if(!s)return e;const{scaleX:i,scaleY:l,x:c,y:u}=s,p=e.left-c-(1-i)*parseFloat(n),m=e.top-u-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i:e.width,x=l?e.height/l:e.height;return{width:h,height:x,top:m,right:p+h,bottom:m+x,left:p}}const ZM={ignoreTransform:!1};function ga(e,t){t===void 0&&(t=ZM);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=lr(e).getComputedStyle(e);m&&(n=QM(n,m,h))}const{top:s,left:i,width:l,height:c,bottom:u,right:p}=n;return{top:s,left:i,width:l,height:c,bottom:u,right:p}}function Fw(e){return ga(e,{ignoreTransform:!0})}function e5(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function t5(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function n5(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=t[i];return typeof l=="string"?n.test(l):!1})}function tf(e,t){const n=[];function s(i){if(t!=null&&n.length>=t||!i)return n;if(rx(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!oc(i)||AS(i)||n.includes(i))return n;const l=lr(e).getComputedStyle(i);return i!==e&&n5(i,l)&&n.push(i),t5(i,l)?n:s(i.parentNode)}return e?s(e):n}function MS(e){const[t]=tf(e,1);return t??null}function Fm(e){return!Qd||!e?null:ma(e)?e:nx(e)?rx(e)||e===ha(e).scrollingElement?window:oc(e)?e:null:null}function FS(e){return ma(e)?e.scrollX:e.scrollLeft}function zS(e){return ma(e)?e.scrollY:e.scrollTop}function $h(e){return{x:FS(e),y:zS(e)}}var Cn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Cn||(Cn={}));function BS(e){return!Qd||!e?!1:e===document.scrollingElement}function US(e){const t={x:0,y:0},n=BS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,u=e.scrollLeft>=s.x;return{isTop:i,isLeft:l,isBottom:c,isRight:u,maxScroll:s,minScroll:t}}const r5={x:.2,y:.2};function s5(e,t,n,s,i){let{top:l,left:c,right:u,bottom:p}=n;s===void 0&&(s=10),i===void 0&&(i=r5);const{isTop:m,isBottom:h,isLeft:x,isRight:y}=US(e),b={x:0,y:0},E={x:0,y:0},k={height:t.height*i.y,width:t.width*i.x};return!m&&l<=t.top+k.height?(b.y=Cn.Backward,E.y=s*Math.abs((t.top+k.height-l)/k.height)):!h&&p>=t.bottom-k.height&&(b.y=Cn.Forward,E.y=s*Math.abs((t.bottom-k.height-p)/k.height)),!y&&u>=t.right-k.width?(b.x=Cn.Forward,E.x=s*Math.abs((t.right-k.width-u)/k.width)):!x&&c<=t.left+k.width&&(b.x=Cn.Backward,E.x=s*Math.abs((t.left+k.width-c)/k.width)),{direction:b,speed:E}}function o5(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:i}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:i,width:e.clientWidth,height:e.clientHeight}}function VS(e){return e.reduce((t,n)=>Qi(t,$h(n)),Kr)}function i5(e){return e.reduce((t,n)=>t+FS(n),0)}function a5(e){return e.reduce((t,n)=>t+zS(n),0)}function l5(e,t){if(t===void 0&&(t=ga),!e)return;const{top:n,left:s,bottom:i,right:l}=t(e);MS(e)&&(i<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const c5=[["x",["left","right"],i5],["y",["top","bottom"],a5]];class ix{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=tf(n),i=VS(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,u]of c5)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=u(s),h=i[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Sl{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 i;(i=this.target)==null||i.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function u5(e){const{EventTarget:t}=lr(e);return e instanceof t?e:ha(e)}function zm(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 Cr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Cr||(Cr={}));function zw(e){e.preventDefault()}function d5(e){e.stopPropagation()}var lt;(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"})(lt||(lt={}));const HS={start:[lt.Space,lt.Enter],cancel:[lt.Esc],end:[lt.Space,lt.Enter,lt.Tab]},f5=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case lt.Right:return{...n,x:n.x+25};case lt.Left:return{...n,x:n.x-25};case lt.Down:return{...n,y:n.y+25};case lt.Up:return{...n,y:n.y-25}}};class xa{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 Sl(ha(n)),this.windowListeners=new Sl(lr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Cr.Resize,this.handleCancel),this.windowListeners.add(Cr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Cr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&l5(s),n(Kr)}handleKeyDown(t){if(ox(t)){const{active:n,context:s,options:i}=this.props,{keyboardCodes:l=HS,coordinateGetter:c=f5,scrollBehavior:u="smooth"}=i,{code:p}=t;if(l.end.includes(p)){this.handleEnd(t);return}if(l.cancel.includes(p)){this.handleCancel(t);return}const{collisionRect:m}=s.current,h=m?{x:m.left,y:m.top}:Kr;this.referenceCoordinates||(this.referenceCoordinates=h);const x=c(t,{active:n,context:s.current,currentCoordinates:h});if(x){const y=zl(x,h),b={x:0,y:0},{scrollableAncestors:E}=s.current;for(const k of E){const v=t.code,{isTop:j,isRight:C,isLeft:N,isBottom:T,maxScroll:L,minScroll:P}=US(k),$=o5(k),D={x:Math.min(v===lt.Right?$.right-$.width/2:$.right,Math.max(v===lt.Right?$.left:$.left+$.width/2,x.x)),y:Math.min(v===lt.Down?$.bottom-$.height/2:$.bottom,Math.max(v===lt.Down?$.top:$.top+$.height/2,x.y))},J=v===lt.Right&&!C||v===lt.Left&&!N,ee=v===lt.Down&&!T||v===lt.Up&&!j;if(J&&D.x!==x.x){const M=k.scrollLeft+y.x,U=v===lt.Right&&M<=L.x||v===lt.Left&&M>=P.x;if(U&&!y.y){k.scrollTo({left:M,behavior:u});return}U?b.x=k.scrollLeft-M:b.x=v===lt.Right?k.scrollLeft-L.x:k.scrollLeft-P.x,b.x&&k.scrollBy({left:-b.x,behavior:u});break}else if(ee&&D.y!==x.y){const M=k.scrollTop+y.y,U=v===lt.Down&&M<=L.y||v===lt.Up&&M>=P.y;if(U&&!y.x){k.scrollTo({top:M,behavior:u});return}U?b.y=k.scrollTop-M:b.y=v===lt.Down?k.scrollTop-L.y:k.scrollTop-P.y,b.y&&k.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,Qi(zl(x,this.referenceCoordinates),b))}}}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()}}xa.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=HS,onActivation:i}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Bw(e){return!!(e&&"distance"in e)}function Uw(e){return!!(e&&"delay"in e)}class ax{constructor(t,n,s){var i;s===void 0&&(s=u5(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=ha(c),this.documentListeners=new Sl(this.document),this.listeners=new Sl(s),this.windowListeners=new Sl(lr(c)),this.initialCoordinates=(i=Dh(l))!=null?i:Kr,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(Cr.Resize,this.handleCancel),this.windowListeners.add(Cr.DragStart,zw),this.windowListeners.add(Cr.VisibilityChange,this.handleCancel),this.windowListeners.add(Cr.ContextMenu,zw),this.documentListeners.add(Cr.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Uw(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bw(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:i}=this.props;i(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Cr.Click,d5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Cr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:i,props:l}=this,{onMove:c,options:{activationConstraint:u}}=l;if(!i)return;const p=(n=Dh(t))!=null?n:Kr,m=zl(i,p);if(!s&&u){if(Bw(u)){if(u.tolerance!=null&&zm(m,u.tolerance))return this.handleCancel();if(zm(m,u.distance))return this.handleStart()}if(Uw(u)&&zm(m,u.tolerance))return this.handleCancel();this.handlePending(u,m);return}t.cancelable&&t.preventDefault(),c(p)}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===lt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const p5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ya extends ax{constructor(t){const{event:n}=t,s=ha(n.target);super(t,p5,s)}}ya.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 m5={move:{name:"mousemove"},end:{name:"mouseup"}};var Lh;(function(e){e[e.RightClick=2]="RightClick"})(Lh||(Lh={}));class h5 extends ax{constructor(t){super(t,m5,ha(t.event.target))}}h5.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===Lh.RightClick?!1:(s==null||s({event:n}),!0)}}];const Bm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class g5 extends ax{constructor(t){super(t,Bm)}static setup(){return window.addEventListener(Bm.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Bm.move.name,t)};function t(){}}}g5.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:i}=n;return i.length>1?!1:(s==null||s({event:n}),!0)}}];var Nl;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Nl||(Nl={}));var pd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(pd||(pd={}));function x5(e){let{acceleration:t,activator:n=Nl.Pointer,canScroll:s,draggingRect:i,enabled:l,interval:c=5,order:u=pd.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:x,threshold:y}=e;const b=b5({delta:x,disabled:!l}),[E,k]=AM(),v=f.useRef({x:0,y:0}),j=f.useRef({x:0,y:0}),C=f.useMemo(()=>{switch(n){case Nl.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case Nl.DraggableRect:return i}},[n,i,p]),N=f.useRef(null),T=f.useCallback(()=>{const P=N.current;if(!P)return;const $=v.current.x*j.current.x,D=v.current.y*j.current.y;P.scrollBy($,D)},[]),L=f.useMemo(()=>u===pd.TreeOrder?[...m].reverse():m,[u,m]);f.useEffect(()=>{if(!l||!m.length||!C){k();return}for(const P of L){if((s==null?void 0:s(P))===!1)continue;const $=m.indexOf(P),D=h[$];if(!D)continue;const{direction:J,speed:ee}=s5(P,D,C,t,y);for(const M of["x","y"])b[M][J[M]]||(ee[M]=0,J[M]=0);if(ee.x>0||ee.y>0){k(),N.current=P,E(T,c),v.current=ee,j.current=J;return}}v.current={x:0,y:0},j.current={x:0,y:0},k()},[t,T,s,k,l,c,JSON.stringify(C),JSON.stringify(b),E,m,L,h,JSON.stringify(y)])}const y5={x:{[Cn.Backward]:!1,[Cn.Forward]:!1},y:{[Cn.Backward]:!1,[Cn.Forward]:!1}};function b5(e){let{delta:t,disabled:n}=e;const s=Ah(t);return ic(i=>{if(n||!s||!i)return y5;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[Cn.Backward]:i.x[Cn.Backward]||l.x===-1,[Cn.Forward]:i.x[Cn.Forward]||l.x===1},y:{[Cn.Backward]:i.y[Cn.Backward]||l.y===-1,[Cn.Forward]:i.y[Cn.Forward]||l.y===1}}},[n,t,s])}function v5(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return ic(i=>{var l;return t==null?null:(l=s??i)!=null?l:null},[s,t])}function w5(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:i}=s,l=i.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...l]},[]),[e,t])}var Bl;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Bl||(Bl={}));var Ih;(function(e){e.Optimized="optimized"})(Ih||(Ih={}));const Vw=new Map;function j5(e,t){let{dragging:n,dependencies:s,config:i}=t;const[l,c]=f.useState(null),{frequency:u,measure:p,strategy:m}=i,h=f.useRef(e),x=v(),y=Fl(x),b=f.useCallback(function(j){j===void 0&&(j=[]),!y.current&&c(C=>C===null?j:C.concat(j.filter(N=>!C.includes(N))))},[y]),E=f.useRef(null),k=ic(j=>{if(x&&!n)return Vw;if(!j||j===Vw||h.current!==e||l!=null){const C=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){C.set(N.id,N.rect.current);continue}const T=N.node.current,L=T?new ix(p(T),T):null;N.rect.current=L,L&&C.set(N.id,L)}return C}return j},[e,l,n,x,p]);return f.useEffect(()=>{h.current=e},[e]),f.useEffect(()=>{x||b()},[n,x]),f.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),f.useEffect(()=>{x||typeof u!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},u))},[u,x,b,...s]),{droppableRects:k,measureDroppableContainers:b,measuringScheduled:l!=null};function v(){switch(m){case Bl.Always:return!1;case Bl.BeforeDragging:return n;default:return!n}}}function WS(e,t){return ic(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function k5(e,t){return WS(e,t)}function S5(e){let{callback:t,disabled:n}=e;const s=sx(t),i=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return f.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function nf(e){let{callback:t,disabled:n}=e;const s=sx(t),i=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return f.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function N5(e){return new ix(ga(e),e)}function Hw(e,t,n){t===void 0&&(t=N5);const[s,i]=f.useState(null);function l(){i(p=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=p??n)!=null?m:null}const h=t(e);return JSON.stringify(p)===JSON.stringify(h)?p:h})}const c=S5({callback(p){if(e)for(const m of p){const{type:h,target:x}=m;if(h==="childList"&&x instanceof HTMLElement&&x.contains(e)){l();break}}}}),u=nf({callback:l});return ds(()=>{l(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),s}function C5(e){const t=WS(e);return _S(e,t)}const Ww=[];function E5(e){const t=f.useRef(e),n=ic(s=>e?s&&s!==Ww&&e&&t.current&&e.parentNode===t.current.parentNode?s:tf(e):Ww,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function T5(e){const[t,n]=f.useState(null),s=f.useRef(e),i=f.useCallback(l=>{const c=Fm(l.target);c&&n(u=>u?(u.set(c,$h(c)),new Map(u)):null)},[]);return f.useEffect(()=>{const l=s.current;if(e!==l){c(l);const u=e.map(p=>{const m=Fm(p);return m?(m.addEventListener("scroll",i,{passive:!0}),[m,$h(m)]):null}).filter(p=>p!=null);n(u.length?new Map(u):null),s.current=e}return()=>{c(e),c(l)};function c(u){u.forEach(p=>{const m=Fm(p);m==null||m.removeEventListener("scroll",i)})}},[i,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Qi(l,c),Kr):VS(e):Kr,[e,t])}function Kw(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==Kr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?zl(e,n.current):Kr}function P5(e){f.useEffect(()=>{if(!Qd)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 R5(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:i,handler:l}=s;return n[i]=c=>{l(c,t)},n},{}),[e,t])}function KS(e){return f.useMemo(()=>e?e5(e):null,[e])}const qw=[];function A5(e,t){t===void 0&&(t=ga);const[n]=e,s=KS(n?lr(n):null),[i,l]=f.useState(qw);function c(){l(()=>e.length?e.map(p=>BS(p)?s:new ix(t(p),p)):qw)}const u=nf({callback:c});return ds(()=>{u==null||u.disconnect(),c(),e.forEach(p=>u==null?void 0:u.observe(p))},[e]),i}function D5(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return oc(t)?t:e}function $5(e){let{measure:t}=e;const[n,s]=f.useState(null),i=f.useCallback(m=>{for(const{target:h}of m)if(oc(h)){s(x=>{const y=t(h);return x?{...x,width:y.width,height:y.height}:y});break}},[t]),l=nf({callback:i}),c=f.useCallback(m=>{const h=D5(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),s(h?t(h):null)},[t,l]),[u,p]=dd(c);return f.useMemo(()=>({nodeRef:u,rect:n,setRef:p}),[n,u,p])}const L5=[{sensor:ya,options:{}},{sensor:xa,options:{}}],I5={current:{}},Vu={draggable:{measure:Fw},droppable:{measure:Fw,strategy:Bl.WhileDragging,frequency:Ih.Optimized},dragOverlay:{measure:ga}};class Cl 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 O5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Vu,measureDroppableContainers:fd,windowRect:null,measuringScheduled:!1},_5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fd,draggableNodes:new Map,over:null,measureDroppableContainers:fd},rf=f.createContext(_5),qS=f.createContext(O5);function M5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cl}}}function F5(e,t){switch(t.type){case xn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xn.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 xn.DragEnd:case xn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xn.RegisterDroppable:{const{element:n}=t,{id:s}=n,i=new Cl(e.droppable.containers);return i.set(s,n),{...e,droppable:{...e.droppable,containers:i}}}case xn.SetDroppableDisabled:{const{id:n,key:s,disabled:i}=t,l=e.droppable.containers.get(n);if(!l||s!==l.key)return e;const c=new Cl(e.droppable.containers);return c.set(n,{...l,disabled:i}),{...e,droppable:{...e.droppable,containers:c}}}case xn.UnregisterDroppable:{const{id:n,key:s}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const l=new Cl(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function z5(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:i}=f.useContext(rf),l=Ah(s),c=Ah(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!ox(l)||document.activeElement===l.target)return;const u=i.get(c);if(!u)return;const{activatorNode:p,node:m}=u;if(!p.current&&!m.current)return;requestAnimationFrame(()=>{for(const h of[p.current,m.current]){if(!h)continue;const x=LM(h);if(x){x.focus();break}}})}},[s,t,i,c,l]),null}function B5(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((i,l)=>l({transform:i,...s}),n):n}function U5(e){return f.useMemo(()=>({draggable:{...Vu.draggable,...e==null?void 0:e.draggable},droppable:{...Vu.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Vu.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 V5(e){let{activeNode:t,measure:n,initialRect:s,config:i=!0}=e;const l=f.useRef(!1),{x:c,y:u}=typeof i=="boolean"?{x:i,y:i}:i;ds(()=>{if(!c&&!u||!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 h=n(m),x=_S(h,s);if(c||(x.x=0),u||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const y=MS(m);y&&y.scrollBy({top:x.y,left:x.x})}},[t,c,u,s,n])}const GS=f.createContext({...Kr,scaleX:1,scaleY:1});var to;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(to||(to={}));const sf=f.memo(function(t){var n,s,i,l;let{id:c,accessibility:u,autoScroll:p=!0,children:m,sensors:h=L5,collisionDetection:x=qM,measuring:y,modifiers:b,...E}=t;const k=f.useReducer(F5,void 0,M5),[v,j]=k,[C,N]=zM(),[T,L]=f.useState(to.Uninitialized),P=T===to.Initialized,{draggable:{active:$,nodes:D,translate:J},droppable:{containers:ee}}=v,M=$!=null?D.get($):null,U=f.useRef({initial:null,translated:null}),X=f.useMemo(()=>{var Ct;return $!=null?{id:$,data:(Ct=M==null?void 0:M.data)!=null?Ct:I5,rect:U}:null},[$,M]),B=f.useRef(null),[q,Z]=f.useState(null),[le,_]=f.useState(null),G=Fl(E,Object.values(E)),A=ac("DndDescribedBy",c),z=f.useMemo(()=>ee.getEnabled(),[ee]),Q=U5(y),{droppableRects:I,measureDroppableContainers:ue,measuringScheduled:me}=j5(z,{dragging:P,dependencies:[J.x,J.y],config:Q.droppable}),V=v5(D,$),ne=f.useMemo(()=>le?Dh(le):null,[le]),de=nn(),ye=k5(V,Q.draggable.measure);V5({activeNode:$!=null?D.get($):null,config:de.layoutShiftCompensation,initialRect:ye,measure:Q.draggable.measure});const ke=Hw(V,Q.draggable.measure,ye),fe=Hw(V?V.parentElement:null),Ve=f.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:ee,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=ee.getNodeFor((n=Ve.current.over)==null?void 0:n.id),Re=$5({measure:Q.dragOverlay.measure}),O=(s=Re.nodeRef.current)!=null?s:V,W=P?(i=Re.rect)!=null?i:ke:null,te=!!(Re.nodeRef.current&&Re.rect),xe=C5(te?null:ke),Ae=KS(O?lr(O):null),Ee=E5(P?pe??V:null),et=A5(Ee),Ye=B5(b,{transform:{x:J.x-xe.x,y:J.y-xe.y,scaleX:1,scaleY:1},activatorEvent:le,active:X,activeNodeRect:ke,containerNodeRect:fe,draggingNodeRect:W,over:Ve.current.over,overlayNodeRect:Re.rect,scrollableAncestors:Ee,scrollableAncestorRects:et,windowRect:Ae}),St=ne?Qi(ne,J):null,Bt=T5(Ee),st=Kw(Bt),ae=Kw(Bt,[ke]),be=Qi(Ye,st),Le=W?JM(W,Ye):null,Be=X&&Le?x({active:X,collisionRect:Le,droppableRects:I,droppableContainers:z,pointerCoordinates:St}):null,Ge=OS(Be,"id"),[it,Kt]=f.useState(null),xt=te?Ye:Qi(Ye,ae),tn=GM(xt,(l=it==null?void 0:it.rect)!=null?l:null,ke),Nt=f.useRef(null),yt=f.useCallback((Ct,jt)=>{let{sensor:Ut,options:An}=jt;if(B.current==null)return;const qt=D.get(B.current);if(!qt)return;const rn=Ct.nativeEvent,Vt=new Ut({active:B.current,activeNode:qt,event:rn,options:An,context:Ve,onAbort(ut){if(!D.get(ut))return;const{onDragAbort:Et}=G.current,re={id:ut};Et==null||Et(re),C({type:"onDragAbort",event:re})},onPending(ut,wn,Et,re){if(!D.get(ut))return;const{onDragPending:He}=G.current,It={id:ut,constraint:wn,initialCoordinates:Et,offset:re};He==null||He(It),C({type:"onDragPending",event:It})},onStart(ut){const wn=B.current;if(wn==null)return;const Et=D.get(wn);if(!Et)return;const{onDragStart:re}=G.current,Pe={activatorEvent:rn,active:{id:wn,data:Et.data,rect:U}};Cs.unstable_batchedUpdates(()=>{re==null||re(Pe),L(to.Initializing),j({type:xn.DragStart,initialCoordinates:ut,active:wn}),C({type:"onDragStart",event:Pe}),Z(Nt.current),_(rn)})},onMove(ut){j({type:xn.DragMove,coordinates:ut})},onEnd:Yn(xn.DragEnd),onCancel:Yn(xn.DragCancel)});Nt.current=Vt;function Yn(ut){return async function(){const{active:Et,collisions:re,over:Pe,scrollAdjustedTranslate:He}=Ve.current;let It=null;if(Et&&He){const{cancelDrop:mn}=G.current;It={activatorEvent:rn,active:Et,collisions:re,delta:He,over:Pe},ut===xn.DragEnd&&typeof mn=="function"&&await Promise.resolve(mn(It))&&(ut=xn.DragCancel)}B.current=null,Cs.unstable_batchedUpdates(()=>{j({type:ut}),L(to.Uninitialized),Kt(null),Z(null),_(null),Nt.current=null;const mn=ut===xn.DragEnd?"onDragEnd":"onDragCancel";if(It){const bt=G.current[mn];bt==null||bt(It),C({type:mn,event:It})}})}}},[D]),kt=f.useCallback((Ct,jt)=>(Ut,An)=>{const qt=Ut.nativeEvent,rn=D.get(An);if(B.current!==null||!rn||qt.dndKit||qt.defaultPrevented)return;const Vt={active:rn};Ct(Ut,jt.options,Vt)===!0&&(qt.dndKit={capturedBy:jt.sensor},B.current=An,yt(Ut,jt))},[D,yt]),he=w5(h,kt);P5(h),ds(()=>{ke&&T===to.Initializing&&L(to.Initialized)},[ke,T]),f.useEffect(()=>{const{onDragMove:Ct}=G.current,{active:jt,activatorEvent:Ut,collisions:An,over:qt}=Ve.current;if(!jt||!Ut)return;const rn={active:jt,activatorEvent:Ut,collisions:An,delta:{x:be.x,y:be.y},over:qt};Cs.unstable_batchedUpdates(()=>{Ct==null||Ct(rn),C({type:"onDragMove",event:rn})})},[be.x,be.y]),f.useEffect(()=>{const{active:Ct,activatorEvent:jt,collisions:Ut,droppableContainers:An,scrollAdjustedTranslate:qt}=Ve.current;if(!Ct||B.current==null||!jt||!qt)return;const{onDragOver:rn}=G.current,Vt=An.get(Ge),Yn=Vt&&Vt.rect.current?{id:Vt.id,rect:Vt.rect.current,data:Vt.data,disabled:Vt.disabled}:null,ut={active:Ct,activatorEvent:jt,collisions:Ut,delta:{x:qt.x,y:qt.y},over:Yn};Cs.unstable_batchedUpdates(()=>{Kt(Yn),rn==null||rn(ut),C({type:"onDragOver",event:ut})})},[Ge]),ds(()=>{Ve.current={activatorEvent:le,active:X,activeNode:V,collisionRect:Le,collisions:Be,droppableRects:I,draggableNodes:D,draggingNode:O,draggingNodeRect:W,droppableContainers:ee,over:it,scrollableAncestors:Ee,scrollAdjustedTranslate:be},U.current={initial:W,translated:Le}},[X,V,Be,Le,D,O,W,I,ee,it,Ee,be]),x5({...de,delta:J,draggingRect:Le,pointerCoordinates:St,scrollableAncestors:Ee,scrollableAncestorRects:et});const Ze=f.useMemo(()=>({active:X,activeNode:V,activeNodeRect:ke,activatorEvent:le,collisions:Be,containerNodeRect:fe,dragOverlay:Re,draggableNodes:D,droppableContainers:ee,droppableRects:I,over:it,measureDroppableContainers:ue,scrollableAncestors:Ee,scrollableAncestorRects:et,measuringConfiguration:Q,measuringScheduled:me,windowRect:Ae}),[X,V,ke,le,Be,fe,Re,D,ee,I,it,ue,Ee,et,Q,me,Ae]),Je=f.useMemo(()=>({activatorEvent:le,activators:he,active:X,activeNodeRect:ke,ariaDescribedById:{draggable:A},dispatch:j,draggableNodes:D,over:it,measureDroppableContainers:ue}),[le,he,X,ke,j,A,D,it,ue]);return Zt.createElement($S.Provider,{value:N},Zt.createElement(rf.Provider,{value:Je},Zt.createElement(qS.Provider,{value:Ze},Zt.createElement(GS.Provider,{value:tn},m)),Zt.createElement(z5,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Zt.createElement(VM,{...u,hiddenTextDescribedById:A}));function nn(){const Ct=(q==null?void 0:q.autoScrollEnabled)===!1,jt=typeof p=="object"?p.enabled===!1:p===!1,Ut=P&&!Ct&&!jt;return typeof p=="object"?{...p,enabled:Ut}:{enabled:Ut}}}),H5=f.createContext(null),Gw="button",W5="Draggable";function K5(e){let{id:t,data:n,disabled:s=!1,attributes:i}=e;const l=ac(W5),{activators:c,activatorEvent:u,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:x,over:y}=f.useContext(rf),{role:b=Gw,roleDescription:E="draggable",tabIndex:k=0}=i??{},v=(p==null?void 0:p.id)===t,j=f.useContext(v?GS:H5),[C,N]=dd(),[T,L]=dd(),P=R5(c,t),$=Fl(n);ds(()=>(x.set(t,{id:t,key:l,node:C,activatorNode:T,data:$}),()=>{const J=x.get(t);J&&J.key===l&&x.delete(t)}),[x,t]);const D=f.useMemo(()=>({role:b,tabIndex:k,"aria-disabled":s,"aria-pressed":v&&b===Gw?!0:void 0,"aria-roledescription":E,"aria-describedby":h.draggable}),[s,b,k,v,E,h.draggable]);return{active:p,activatorEvent:u,activeNodeRect:m,attributes:D,isDragging:v,listeners:s?void 0:P,node:C,over:y,setNodeRef:N,setActivatorNodeRef:L,transform:j}}function q5(){return f.useContext(qS)}const G5="Droppable",Y5={timeout:25};function J5(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:i}=e;const l=ac(G5),{active:c,dispatch:u,over:p,measureDroppableContainers:m}=f.useContext(rf),h=f.useRef({disabled:n}),x=f.useRef(!1),y=f.useRef(null),b=f.useRef(null),{disabled:E,updateMeasurementsFor:k,timeout:v}={...Y5,...i},j=Fl(k??s),C=f.useCallback(()=>{if(!x.current){x.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(j.current)?j.current:[j.current]),b.current=null},v)},[v]),N=nf({callback:C,disabled:E||!c}),T=f.useCallback((D,J)=>{N&&(J&&(N.unobserve(J),x.current=!1),D&&N.observe(D))},[N]),[L,P]=dd(T),$=Fl(t);return f.useEffect(()=>{!N||!L.current||(N.disconnect(),x.current=!1,N.observe(L.current))},[L,N]),f.useEffect(()=>(u({type:xn.RegisterDroppable,element:{id:s,key:l,disabled:n,node:L,rect:y,data:$}}),()=>u({type:xn.UnregisterDroppable,key:l,id:s})),[s]),f.useEffect(()=>{n!==h.current.disabled&&(u({type:xn.SetDroppableDisabled,id:s,key:l,disabled:n}),h.current.disabled=n)},[s,l,n,u]),{active:c,rect:y,isOver:(p==null?void 0:p.id)===s,node:L,over:p,setNodeRef:P}}function ba(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function X5(e,t){return e.reduce((n,s,i)=>{const l=t.get(s);return l&&(n[i]=l),n},Array(e.length))}function Cu(e){return e!==null&&e>=0}function Q5(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 Z5(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const YS=e=>{let{rects:t,activeIndex:n,overIndex:s,index:i}=e;const l=ba(t,s,n),c=t[i],u=l[i];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},Eu={scaleX:1,scaleY:1},of=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:i,rects:l,overIndex:c}=e;const u=(t=l[n])!=null?t:s;if(!u)return null;if(i===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...Eu}:null}const p=eF(l,i,n);return i>n&&i<=c?{x:0,y:-u.height-p,...Eu}:i<n&&i>=c?{x:0,y:u.height+p,...Eu}:{x:0,y:0,...Eu}};function eF(e,t,n){const s=e[t],i=e[t-1],l=e[t+1];return s?n<t?i?s.top-(i.top+i.height):l?l.top-(s.top+s.height):0:l?l.top-(s.top+s.height):i?s.top-(i.top+i.height):0:0}const JS="Sortable",XS=Zt.createContext({activeIndex:-1,containerId:JS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:YS,disabled:{draggable:!1,droppable:!1}});function af(e){let{children:t,id:n,items:s,strategy:i=YS,disabled:l=!1}=e;const{active:c,dragOverlay:u,droppableRects:p,over:m,measureDroppableContainers:h}=q5(),x=ac(JS,n),y=u.rect!==null,b=f.useMemo(()=>s.map(P=>typeof P=="object"&&"id"in P?P.id:P),[s]),E=c!=null,k=c?b.indexOf(c.id):-1,v=m?b.indexOf(m.id):-1,j=f.useRef(b),C=!Q5(b,j.current),N=v!==-1&&k===-1||C,T=Z5(l);ds(()=>{C&&E&&h(b)},[C,b,E,h]),f.useEffect(()=>{j.current=b},[b]);const L=f.useMemo(()=>({activeIndex:k,containerId:x,disabled:T,disableTransforms:N,items:b,overIndex:v,useDragOverlay:y,sortedRects:X5(b,p),strategy:i}),[k,x,T.draggable,T.droppable,N,b,v,p,y,i]);return Zt.createElement(XS.Provider,{value:L},t)}const tF=e=>{let{id:t,items:n,activeIndex:s,overIndex:i}=e;return ba(n,s,i).indexOf(t)},nF=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:i,items:l,newIndex:c,previousItems:u,previousContainerId:p,transition:m}=e;return!m||!s||u!==l&&i===c?!1:n?!0:c!==i&&t===p},rF={duration:200,easing:"ease"},QS="transform",sF=io.Transition.toString({property:QS,duration:0,easing:"linear"}),oF={roleDescription:"sortable"};function iF(e){let{disabled:t,index:n,node:s,rect:i}=e;const[l,c]=f.useState(null),u=f.useRef(n);return ds(()=>{if(!t&&n!==u.current&&s.current){const p=i.current;if(p){const m=ga(s.current,{ignoreTransform:!0}),h={x:p.left-m.left,y:p.top-m.top,scaleX:p.width/m.width,scaleY:p.height/m.height};(h.x||h.y)&&c(h)}}n!==u.current&&(u.current=n)},[t,n,s,i]),f.useEffect(()=>{l&&c(null)},[l]),l}function lf(e){let{animateLayoutChanges:t=nF,attributes:n,disabled:s,data:i,getNewIndex:l=tF,id:c,strategy:u,resizeObserverConfig:p,transition:m=rF}=e;const{items:h,containerId:x,activeIndex:y,disabled:b,disableTransforms:E,sortedRects:k,overIndex:v,useDragOverlay:j,strategy:C}=f.useContext(XS),N=aF(s,b),T=h.indexOf(c),L=f.useMemo(()=>({sortable:{containerId:x,index:T,items:h},...i}),[x,i,T,h]),P=f.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:$,node:D,isOver:J,setNodeRef:ee}=J5({id:c,data:L,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...p}}),{active:M,activatorEvent:U,activeNodeRect:X,attributes:B,setNodeRef:q,listeners:Z,isDragging:le,over:_,setActivatorNodeRef:G,transform:A}=K5({id:c,data:L,attributes:{...oF,...n},disabled:N.draggable}),z=RM(ee,q),Q=!!M,I=Q&&!E&&Cu(y)&&Cu(v),ue=!j&&le,me=ue&&I?A:null,ne=I?me??(u??C)({rects:k,activeNodeRect:X,activeIndex:y,overIndex:v,index:T}):null,de=Cu(y)&&Cu(v)?l({id:c,items:h,activeIndex:y,overIndex:v}):T,ye=M==null?void 0:M.id,ke=f.useRef({activeId:ye,items:h,newIndex:de,containerId:x}),fe=h!==ke.current.items,Ve=t({active:M,containerId:x,isDragging:le,isSorting:Q,id:c,index:T,items:h,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:m,wasDragging:ke.current.activeId!=null}),pe=iF({disabled:!Ve,index:T,node:D,rect:$});return f.useEffect(()=>{Q&&ke.current.newIndex!==de&&(ke.current.newIndex=de),x!==ke.current.containerId&&(ke.current.containerId=x),h!==ke.current.items&&(ke.current.items=h)},[Q,de,x,h]),f.useEffect(()=>{if(ye===ke.current.activeId)return;if(ye!=null&&ke.current.activeId==null){ke.current.activeId=ye;return}const O=setTimeout(()=>{ke.current.activeId=ye},50);return()=>clearTimeout(O)},[ye]),{active:M,activeIndex:y,attributes:B,data:L,rect:$,index:T,newIndex:de,items:h,isOver:J,isSorting:Q,isDragging:le,listeners:Z,node:D,overIndex:v,over:_,setNodeRef:z,setActivatorNodeRef:G,setDroppableNodeRef:ee,setDraggableNodeRef:q,transform:pe??ne,transition:Re()};function Re(){if(pe||fe&&ke.current.newIndex===T)return sF;if(!(ue&&!ox(U)||!m)&&(Q||Ve))return io.Transition.toString({...m,property:QS})}}function aF(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}}function md(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const lF=[lt.Down,lt.Right,lt.Up,lt.Left],cF=(e,t)=>{let{context:{active:n,collisionRect:s,droppableRects:i,droppableContainers:l,over:c,scrollableAncestors:u}}=t;if(lF.includes(e.code)){if(e.preventDefault(),!n||!s)return;const p=[];l.getEnabled().forEach(x=>{if(!x||x!=null&&x.disabled)return;const y=i.get(x.id);if(y)switch(e.code){case lt.Down:s.top<y.top&&p.push(x);break;case lt.Up:s.top>y.top&&p.push(x);break;case lt.Left:s.left>y.left&&p.push(x);break;case lt.Right:s.left<y.left&&p.push(x);break}});const m=WM({collisionRect:s,droppableRects:i,droppableContainers:p});let h=OS(m,"id");if(h===(c==null?void 0:c.id)&&m.length>1&&(h=m[1].id),h!=null){const x=l.get(n.id),y=l.get(h),b=y?i.get(y.id):null,E=y==null?void 0:y.node.current;if(E&&b&&x&&y){const v=tf(E).some((P,$)=>u[$]!==P),j=ZS(x,y),C=uF(x,y),N=v||!j?{x:0,y:0}:{x:C?s.width-b.width:0,y:C?s.height-b.height:0},T={x:b.left,y:b.top};return N.x&&N.y?T:zl(T,N)}}}};function ZS(e,t){return!md(e)||!md(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function uF(e,t){return!md(e)||!md(t)||!ZS(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function hs(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function dF(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{if(e)try{const p=await fetch(hs(e));if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{i(!1)}},[e]);return f.useEffect(()=>{u()},[u]),Jl(p=>{p.type==="todos-updated"&&p.projectSlug===e&&u()}),{data:t,loading:s,error:l,refetch:u}}async function fF(e,t,n){await fetch(hs(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function pF(e,t,n){await fetch(`${hs(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function mF(e,t,n){await fetch(`${hs(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function hF(e,t,n){await fetch(`${hs(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function gF(e,t){await fetch(`${hs(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function xF(e,t){await fetch(`${hs(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function yF(e,t){await fetch(`${hs(e)}/${t}`,{method:"DELETE"})}async function eN(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 i=null;try{i=s?JSON.parse(s):null}catch{}const l=(i==null?void 0:i.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function bF(e,t){return await eN(`${hs(e)}/promote`,t)}async function vF(e,t,n){await eN(`${hs(e)}/${t}/move`,{to:n})}const Yw=[{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 lx({status:e,onChange:t}){const[n,s]=f.useState(!1),i=f.useRef(null);f.useEffect(()=>{if(!n)return;function c(u){i.current&&!i.current.contains(u.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=Yw.find(c=>c.value===e);return r.jsxs("div",{className:"relative",ref:i,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:Yw.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 tN="__one_off__";function cx({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i,defaultProject:l,defaultTitle:c,allowOneOff:u=!0}){const[p,m]=f.useState("new"),[h,x]=f.useState(!1),[y,b]=f.useState(null),[E,k]=f.useState(null),[v,j]=f.useState(null),[C,N]=f.useState(""),[T,L]=f.useState(""),[P,$]=f.useState(""),[D,J]=f.useState(""),[ee,M]=f.useState(""),[U,X]=f.useState(""),[B,q]=f.useState(null),[Z,le]=f.useState(!1),_=t.length>1;f.useEffect(()=>{if(!e){m("new"),b(null),N(""),L(""),$(""),J(""),M(""),X(""),q(null);return}N(l??""),L(c??"");let ue=!1;return(async()=>{try{const me=await fetch("/api/projects");if(!me.ok)throw new Error(`HTTP ${me.status}`);const V=await me.json();ue||k(V.filter(ne=>!ne.archived))}catch(me){ue||j(me instanceof Error?me.message:String(me))}})(),()=>{ue=!0}},[e,l,c]),f.useEffect(()=>{if(!ee){q(null);return}let ue=!1;return le(!0),(async()=>{try{const me=await fetch(`/api/projects/${encodeURIComponent(ee)}/assignments`);if(!me.ok)throw new Error(`HTTP ${me.status}`);const V=await me.json();ue||q(V)}catch{ue||q([])}finally{ue||le(!1)}})(),()=>{ue=!0}},[ee]);const G=f.useMemo(()=>E??[],[E]);async function A(ue){if(ue.preventDefault(),!C){b('Pick a target project (or "One-off").');return}if(_&&!T.trim()){b("Title is required when promoting multiple todos.");return}const me=C===tN?{oneOff:!0}:{project:C};if(n.kind==="aggregate"){const ne={groups:n.groups,mode:"new-assignment",target:me,title:T.trim()||void 0,type:P.trim()||void 0,priority:D||void 0};await I(ne);return}const V={todoIds:t,mode:"new-assignment",target:me,title:T.trim()||void 0,type:P.trim()||void 0,priority:D||void 0};await Q(V)}async function z(ue){if(ue.preventDefault(),n.kind==="aggregate"){b("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!ee||!U){b("Pick both project and assignment.");return}const me={todoIds:t,mode:"to-assignment",target:{assignment:`${ee}/${U}`}};await Q(me)}async function Q(ue){x(!0),b(null);try{let me;if(n.kind==="workspace")me=await rR(n.workspace,ue);else if(n.kind==="project")me=await bF(n.projectId,ue);else throw new Error("Aggregate scope requires runBulkMutation.");i(me),s(!1)}catch(me){b(me instanceof Error?me.message:String(me))}finally{x(!1)}}async function I(ue){x(!0),b(null);try{const me=await sR(ue);i(me),s(!1)}catch(me){b(me instanceof Error?me.message:String(me))}finally{x(!1)}}return r.jsx(ir,{open:e,onOpenChange:ue=>h?void 0:s(ue),children:r.jsxs(qn,{className:"max-w-xl",children:[r.jsxs(Yr,{children:[r.jsxs(Gn,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ps,{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(G1,{value:p,onValueChange:ue=>m(ue),children:[r.jsxs(Y1,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(bh,{value:"new",className:Te("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(bh,{value:"existing",className:Te("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(vh,{value:"new",children:r.jsxs("form",{onSubmit:A,className:"space-y-4",children:[r.jsx($i,{label:"Target project",children:r.jsx(Jw,{value:C,onChange:N,projects:G,error:v,disabled:h,allowOneOff:u})}),r.jsx($i,{label:_?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:T,onChange:ue=>L(ue.target.value),disabled:h,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx($i,{label:"Type",children:r.jsx("input",{type:"text",value:P,onChange:ue=>$(ue.target.value),placeholder:"feature",disabled:h,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsx($i,{label:"Priority",children:r.jsxs("select",{value:D,onChange:ue=>J(ue.target.value),disabled:h,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(Xw,{message:y}):null,r.jsx(Qw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})}),r.jsx(vh,{value:"existing",children:r.jsxs("form",{onSubmit:z,className:"space-y-4",children:[r.jsx($i,{label:"Project",children:r.jsx(Jw,{value:ee,onChange:ue=>{M(ue),X("")},projects:G,error:v,disabled:h})}),r.jsx($i,{label:Z?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:U,onChange:ue=>X(ue.target.value),disabled:h||!ee||Z,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:ee?"Select assignment...":"Pick a project first"}),(B??[]).map(ue=>r.jsxs("option",{value:ue.slug,children:[ue.title," (",ue.status,")"]},ue.slug))]})}),y?r.jsx(Xw,{message:y}):null,r.jsx(Qw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})})]})]})})}function $i({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 Jw({value:e,onChange:t,projects:n,error:s,disabled:i,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:i,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),l?r.jsx("option",{value:tN,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function Xw({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 Qw({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(As,{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 nN({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i}){const[l,c]=f.useState("project"),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(!1),[b,E]=f.useState(null),[k,v]=f.useState(null),[j,C]=f.useState(null);f.useEffect(()=>{if(!e){c("project"),p(""),h(""),E(null),v(null);return}let $=!1;return(async()=>{try{const D=await fetch("/api/projects");if(!D.ok)throw new Error(`HTTP ${D.status}`);const J=await D.json();$||C(J.filter(ee=>!ee.archived))}catch(D){$||v(D instanceof Error?D.message:String(D))}})(),()=>{$=!0}},[e]);const N=f.useMemo(()=>j?n.kind==="project"?j.filter($=>$.slug!==n.projectId):j:[],[j,n]);function T(){if(l==="global")return{global:!0};if(l==="workspace"){const $=u.trim();return $?{workspace:$}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function L($,D){try{return n.kind==="workspace"?await oR(n.workspace,$,D):await vF(n.projectId,$,D),{ok:!0}}catch(J){return{ok:!1,error:J instanceof Error?J.message:String(J)}}}async function P($){$.preventDefault(),v(null);const D=T();if(typeof D=="string"){v(D);return}y(!0),E(null);const J=[],ee=[];for(const M of t){const U=await L(M,D);U.ok?J.push(M):ee.push({id:M,error:U.error})}y(!1),i(),ee.length===0?s(!1):E({succeeded:J,failed:ee})}return r.jsx(ir,{open:e,onOpenChange:$=>x?void 0:s($),children:r.jsx(qn,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:P,className:"space-y-4",children:[r.jsxs(Yr,{children:[r.jsxs(Gn,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ps,{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(Um,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(Um,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(Um,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Zw,{label:"Target project",children:r.jsxs("select",{value:m,onChange:$=>h($.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),N.map($=>r.jsxs("option",{value:$.slug,children:[$.title," (",$.slug,")"]},$.slug))]})}):null,l==="workspace"?r.jsx(Zw,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:u,onChange:$=>p($.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,k?r.jsx(wF,{message:k}):null,b?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 ",b.succeeded.length," of ",t.length,"; ",b.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:b.failed.map($=>r.jsxs("li",{children:["[t:",$.id,"] ",$.error]},$.id))})]}):null,r.jsxs(As,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:b?"Close":"Cancel"}),b===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 Zw({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 Um({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 wF({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})}const jF={open:{icon:"○",cls:"text-muted-foreground",label:"Open"},in_progress:{icon:"◉",cls:"text-status-in-progress-foreground",label:"In progress"},blocked:{icon:"✕",cls:"text-status-blocked-foreground",label:"Blocked"},completed:{icon:"✓",cls:"text-status-completed-foreground",label:"Completed"},mixed:{icon:"◐",cls:"text-muted-foreground",label:"Mixed"}};function kF({bundle:e}){const t=jF[e.derivedStatus.status],{counts:n}=e.derivedStatus;return r.jsxs("div",{className:"border rounded-md p-3 mb-2 bg-card",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:`text-lg leading-none ${t.cls}`,title:t.label,children:t.icon}),r.jsxs("span",{className:"font-mono text-sm text-muted-foreground",children:["b:",e.id]}),e.slug&&r.jsx("span",{className:"font-medium",children:e.slug}),r.jsxs("span",{className:"ml-auto text-sm text-muted-foreground",children:[n.completed,"/",n.total," done"]})]}),r.jsxs("div",{className:"mt-2 grid gap-1 text-sm",children:[e.branch&&r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Branch:"})," ",r.jsx("code",{className:"font-mono",children:e.branch})]}),e.worktreePath&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Worktree:"})," ",r.jsx("code",{className:"font-mono",children:e.worktreePath})]}),e.planDir&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Plan:"})," ",r.jsx("code",{className:"font-mono",children:e.planDir})]})]}),r.jsx("ul",{className:"mt-2 ml-6 text-sm list-disc",children:e.members.map(s=>r.jsxs("li",{className:s.status==="completed"?"line-through text-muted-foreground":"",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground mr-2",children:["t:",s.id]}),s.description]},s.id))})]})}function SF({bundles:e,title:t="Bundles"}){return e.length===0?null:r.jsxs("section",{className:"mb-6",children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:[t," (",e.length,")"]}),e.map(n=>r.jsx(kF,{bundle:n},n.id))]})}function NF(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch(`/api/bundles/${encodeURIComponent(e)}`);if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch bundles")}finally{i(!1)}},[e]);return f.useEffect(()=>{u()},[u]),Jl(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function CF({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:u,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:b,setActivatorNodeRef:E,transform:k,transition:v,isDragging:j}=lf({id:e.id,disabled:m}),C={transform:io.Transform.toString(k),transition:v,zIndex:j?50:void 0,position:j?"relative":void 0};return r.jsxs("div",{ref:b,style:C,"data-todo-id":e.id,...h??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${j?"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:E,...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(Nd,{className:"h-4 w-4"})}),r.jsx(lx,{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(rN,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Rs,{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=>u(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>u(N,e.id),children:r.jsx(Al,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>i(e.id,N),children:r.jsx(Yl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:r.jsx(Kn,{className:"h-3 w-3"})})]})]})}function rN({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(Mo,{delayDuration:120,children:r.jsxs(Tr,{children:[r.jsx(Pr,{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(Gh,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"block min-w-0 max-w-[120px] truncate",children:e.branch})]})}),r.jsx(gr,{children:e.branch})]})}):null,e.planDir?r.jsx(Mo,{delayDuration:120,children:r.jsxs(Tr,{children:[r.jsx(Pr,{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(Xj,{className:"h-2.5 w-2.5"})})}),r.jsxs(gr,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(Mo,{delayDuration:120,children:r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(gr,{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 EF(){const{workspace:e}=Lt(),t=e||"_global",{data:n,loading:s,error:i,refetch:l}=tR(t),{data:c}=NF(t),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[b,E]=f.useState(""),[k,v]=f.useState(null),[j,C]=f.useState(new Set),[N,T]=f.useState(!1),[L,P]=f.useState(!1),[$,D]=f.useState(null),J=f.useRef(null);uo("list:todos");const ee=!!(u.trim()||m||x),M=Zd(ao(ya,{activationConstraint:{distance:8}}),ao(xa));function U(O,W){O.stopPropagation(),navigator.clipboard.writeText(W),v(W),setTimeout(()=>v(te=>te===W?null:te),1500)}const X=f.useMemo(()=>{if(!(n!=null&&n.items))return[];const O=new Set;for(const W of n.items)for(const te of W.tags)O.add(te);return Array.from(O).sort()},[n]),B=f.useMemo(()=>{if(!(n!=null&&n.items))return[];let O=n.items;if(u.trim()){const W=u.toLowerCase();O=O.filter(te=>te.description.toLowerCase().includes(W)||te.tags.some(xe=>xe.toLowerCase().includes(W))||te.id.includes(W))}return m&&(O=O.filter(W=>W.status===m)),x&&(O=O.filter(W=>W.tags.includes(x))),O},[n,u,m,x]);f.useEffect(()=>{C(new Set)},[u,m,x,t]);const q=f.useMemo(()=>B.filter(O=>j.has(O.id)).length,[B,j]),Z=B.length>0&&q===B.length,le=q>0&&!Z;function _(O){C(W=>{const te=new Set(W);return te.has(O)?te.delete(O):te.add(O),te})}function G(){C(O=>{const W=new Set(O);if(Z)for(const te of B)W.delete(te.id);else for(const te of B)W.add(te.id);return W})}function A(){C(new Set)}const z=$?[$]:Array.from(j);function Q(){C(new Set),D(null),l()}function I(){C(new Set),l()}async function ue(){b.trim()&&(await og(t,b.trim()),E(""),l())}const me={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function V(O,W){de(O,me[W]||"open")}async function ne(O,W,te){O.stopPropagation(),window.confirm(`Delete "${te}"? This can't be undone.`)&&(await L0(t,W),l())}async function de(O,W){switch(W){case"open":await $0(t,O);break;case"in_progress":await D0(t,O);break;case"completed":await R0(t,O);break;case"blocked":await A0(t,O);break}l()}const{hotkeyRowProps:ye}=Xl(B,{scope:"list:todos",bindO:!1,onOpen:O=>V(O.id,O.status)});zt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var O;return(O=J.current)==null?void 0:O.focus()}}),zt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[ke,fe]=fs(),Ve=ke.get("focus");f.useEffect(()=>{if(!Ve)return;const O=document.querySelector(`[data-todo-id="${window.CSS.escape(Ve)}"]`);if(!O)return;O.scrollIntoView({block:"nearest"}),O.classList.add("ring-2","ring-primary/60");const W=window.setTimeout(()=>{O.classList.remove("ring-2","ring-primary/60"),fe(te=>{const xe=new URLSearchParams(te);return xe.delete("focus"),xe})},1500);return()=>window.clearTimeout(W)},[Ve,B.length,fe]);async function pe(O){const{active:W,over:te}=O;if(!te||W.id===te.id||!(n!=null&&n.items))return;const xe=n.items.findIndex(et=>et.id===W.id),Ae=n.items.findIndex(et=>et.id===te.id);if(xe===-1||Ae===-1)return;const Ee=ba(n.items,xe,Ae);await nR(t,Ee.map(et=>et.id)),l()}if(s)return r.jsx(ft,{label:"Loading todos..."});if(i)return r.jsx(mt,{error:i});const Re=(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(Rn,{label:"Open",value:Re.open,icon:Rr}),r.jsx(Rn,{label:"In Progress",value:Re.in_progress,icon:Rr,tone:"info"}),r.jsx(Rn,{label:"Blocked",value:Re.blocked,icon:Zh,tone:"warn"}),r.jsx(Rn,{label:"Total",value:Re.total,icon:Rr})]}),c&&r.jsx(SF,{bundles:c.bundles}),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:b,onChange:O=>E(O.target.value),onKeyDown:O=>O.key==="Enter"&&ue(),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:ue,disabled:!b.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(en,{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(lo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:J,type:"text",placeholder:"Search...",value:u,onChange:O=>p(O.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:m,onChange:O=>h(O.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"})]}),X.length>0&&r.jsxs("select",{value:x,onChange:O=>y(O.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"}),X.map(O=>r.jsxs("option",{value:O,children:["#",O]},O))]})]}),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:()=>{D(null),P(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:A,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,B.length===0?r.jsx(ct,{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:Z,ref:O=>{O&&(O.indeterminate=le)},onChange:G,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",B.length,")"]})]}),r.jsx(sf,{sensors:M,collisionDetection:ef,onDragEnd:pe,children:r.jsx(af,{items:B.map(O=>O.id),strategy:of,children:r.jsx("div",{className:"space-y-1",children:B.map((O,W)=>r.jsx(CF,{item:O,copiedId:k,selected:j.has(O.id),onToggleSelected:te=>_(te),onMoveOne:(te,xe)=>{xe.stopPropagation(),D(te),P(!0)},onCycleStatus:V,onStatusChange:de,onCopyId:U,onDelete:ne,disabled:ee,hotkeyRowProps:ye(W)},O.id))})})})]}),r.jsx(cx,{open:N,selectedIds:Array.from(j),scope:{kind:"workspace",workspace:t},onOpenChange:T,onDone:I}),r.jsx(nN,{open:L,selectedIds:z,scope:{kind:"workspace",workspace:t},onOpenChange:O=>{P(O),O||D(null)},onDone:Q})]})}function TF({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:u,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:b,setActivatorNodeRef:E,transform:k,transition:v,isDragging:j}=lf({id:e.id,disabled:m}),C={transform:io.Transform.toString(k),transition:v,zIndex:j?50:void 0,position:j?"relative":void 0};return r.jsxs("div",{ref:b,style:C,"data-todo-id":e.id,...h??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${j?"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:E,...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(Nd,{className:"h-4 w-4"})}),r.jsx(lx,{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(rN,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Rs,{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=>u(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>u(N,e.id),children:r.jsx(Al,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>i(e.id,N),children:r.jsx(Yl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:r.jsx(Kn,{className:"h-3 w-3"})})]})]})}function PF({projectId:e}){const{data:t,loading:n,error:s,refetch:i}=dF(e),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[b,E]=f.useState(null),[k,v]=f.useState(new Set),[j,C]=f.useState(!1),[N,T]=f.useState(!1),[L,P]=f.useState(null),$=f.useRef(null);uo("list:todos");const D=!!(l.trim()||u||m),J=Zd(ao(ya,{activationConstraint:{distance:8}}),ao(xa));function ee(pe,Re){pe.stopPropagation(),navigator.clipboard.writeText(Re),E(Re),setTimeout(()=>E(O=>O===Re?null:O),1500)}const M=f.useMemo(()=>{if(!(t!=null&&t.items))return[];const pe=new Set;for(const Re of t.items)for(const O of Re.tags)pe.add(O);return Array.from(pe).sort()},[t]),U=f.useMemo(()=>{if(!(t!=null&&t.items))return[];let pe=t.items;if(l.trim()){const Re=l.toLowerCase();pe=pe.filter(O=>O.description.toLowerCase().includes(Re)||O.tags.some(W=>W.toLowerCase().includes(Re))||O.id.includes(Re))}return u&&(pe=pe.filter(Re=>Re.status===u)),m&&(pe=pe.filter(Re=>Re.tags.includes(m))),pe},[t,l,u,m]);f.useEffect(()=>{v(new Set)},[l,u,m,e]);const X=f.useMemo(()=>U.filter(pe=>k.has(pe.id)).length,[U,k]),B=U.length>0&&X===U.length,q=X>0&&!B;function Z(pe){v(Re=>{const O=new Set(Re);return O.has(pe)?O.delete(pe):O.add(pe),O})}function le(){v(pe=>{const Re=new Set(pe);if(B)for(const O of U)Re.delete(O.id);else for(const O of U)Re.add(O.id);return Re})}function _(){v(new Set)}const G=L?[L]:Array.from(k);function A(){v(new Set),P(null),i()}function z(){v(new Set),i()}async function Q(){x.trim()&&(await fF(e,x.trim()),y(""),i())}const I={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ue(pe,Re){V(pe,I[Re]||"open")}async function me(pe,Re,O){pe.stopPropagation(),window.confirm(`Delete "${O}"? This can't be undone.`)&&(await yF(e,Re),i())}async function V(pe,Re){switch(Re){case"open":await gF(e,pe);break;case"in_progress":await hF(e,pe);break;case"completed":await pF(e,pe);break;case"blocked":await mF(e,pe);break}i()}const{hotkeyRowProps:ne}=Xl(U,{scope:"list:todos",bindO:!1,onOpen:pe=>ue(pe.id,pe.status)});zt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var pe;return(pe=$.current)==null?void 0:pe.focus()}}),zt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>i()});const[de,ye]=fs(),ke=de.get("focus");f.useEffect(()=>{if(!ke)return;const pe=document.querySelector(`[data-todo-id="${window.CSS.escape(ke)}"]`);if(!pe)return;pe.scrollIntoView({block:"nearest"}),pe.classList.add("ring-2","ring-primary/60");const Re=window.setTimeout(()=>{pe.classList.remove("ring-2","ring-primary/60"),ye(O=>{const W=new URLSearchParams(O);return W.delete("focus"),W},{replace:!0})},1500);return()=>window.clearTimeout(Re)},[ke,U.length,ye]);async function fe(pe){const{active:Re,over:O}=pe;if(!O||Re.id===O.id||!(t!=null&&t.items))return;const W=t.items.findIndex(Ae=>Ae.id===Re.id),te=t.items.findIndex(Ae=>Ae.id===O.id);if(W===-1||te===-1)return;const xe=ba(t.items,W,te);await xF(e,xe.map(Ae=>Ae.id)),i()}if(n)return r.jsx(ft,{label:"Loading todos..."});if(s)return r.jsx(mt,{error:s});const Ve=(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(Rn,{label:"Open",value:Ve.open,icon:Rr}),r.jsx(Rn,{label:"In Progress",value:Ve.in_progress,icon:Rr,tone:"info"}),r.jsx(Rn,{label:"Blocked",value:Ve.blocked,icon:Zh,tone:"warn"}),r.jsx(Rn,{label:"Total",value:Ve.total,icon:Rr})]}),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:pe=>y(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Q(),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:Q,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(en,{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(lo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:$,type:"text",placeholder:"Search...",value:l,onChange:pe=>c(pe.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:u,onChange:pe=>p(pe.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"})]}),M.length>0&&r.jsxs("select",{value:m,onChange:pe=>h(pe.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"}),M.map(pe=>r.jsxs("option",{value:pe,children:["#",pe]},pe))]})]}),k.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:[k.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>C(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{P(null),T(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:_,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,U.length===0?r.jsx(ct,{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:B,ref:pe=>{pe&&(pe.indeterminate=q)},onChange:le,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]})]}),r.jsx(sf,{sensors:J,collisionDetection:ef,onDragEnd:fe,children:r.jsx(af,{items:U.map(pe=>pe.id),strategy:of,children:r.jsx("div",{className:"space-y-1",children:U.map((pe,Re)=>r.jsx(TF,{item:pe,copiedId:b,selected:k.has(pe.id),onToggleSelected:O=>Z(O),onMoveOne:(O,W)=>{W.stopPropagation(),P(O),T(!0)},onCycleStatus:ue,onStatusChange:V,onCopyId:ee,onDelete:me,disabled:D,hotkeyRowProps:ne(Re)},pe.id))})})})]}),r.jsx(cx,{open:j,selectedIds:Array.from(k),scope:{kind:"project",projectId:e},onOpenChange:C,onDone:z}),r.jsx(nN,{open:N,selectedIds:G,scope:{kind:"project",projectId:e},onOpenChange:pe=>{T(pe),pe||P(null)},onDone:A})]})}const RF={title:"Assignment",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"},ej=new Set(["title"]);function sN({visibility:e,onChange:t}){const[n,s]=f.useState(!1);function i(c){if(ej.has(c))return;const p=e.hidden.includes(c)?e.hidden.filter(m=>m!==c):[...e.hidden,c];t({hidden:p})}const l=e.hidden.length;return r.jsxs(ir,{open:n,onOpenChange:s,children:[r.jsx(Y3,{asChild:!0,children:r.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Show or hide table columns",children:[r.jsx(jT,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsxs("span",{children:["Columns",l>0?` (${ym.length-l}/${ym.length})`:""]})]})}),r.jsxs(qn,{className:"max-w-sm",children:[r.jsx(Yr,{children:r.jsx(Gn,{children:"Columns"})}),r.jsx("div",{className:"space-y-2",children:ym.map(c=>{const u=e.hidden.includes(c),p=ej.has(c);return r.jsxs("label",{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm ${p?"opacity-60":"cursor-pointer hover:bg-background/80"}`,children:[r.jsx("input",{type:"checkbox",checked:!u,onChange:()=>i(c),disabled:p,className:"h-4 w-4 rounded border-border accent-foreground"}),r.jsx("span",{children:RF[c]}),p?r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"always shown"}):null]},c)})})]})]})}const Zi={...Il,custom:!1},oN=`view-prefs.cache.v${Il.version}`;let Ul=AF(),Li=null;const Vl=new Set;let iN=0;function ux(){return++iN}function dx(e){return e===iN}function AF(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(oN);if(!e)return null;const t=JSON.parse(e);return t.version!==Il.version?null:t}catch{return null}}function DF(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(oN,JSON.stringify(e))}catch{}}function fx(e){Ul=e,DF(e);for(const t of Vl)t(e)}function px(e){if(!e||typeof e!="object")return Zi;const t=e;return t.version!==Il.version||!t.global||!t.projects?Zi:{version:Il.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function mx(){if(Li)return Li;const e=ux();return Li=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=px(t);return dx(e)&&fx(n),Li=null,Ul??n}).catch(()=>(Li=null,Ul??Zi)),Li}function aN(e){const[t,n]=f.useState(()=>Ul??Zi);return f.useEffect(()=>{let s=!1;return mx().then(i=>{s||n(i)}),Vl.add(n),()=>{s=!0,Vl.delete(n)}},[]),_k(t,e??null)}function $F(){const[e,t]=f.useState(()=>Ul??Zi);return f.useEffect(()=>{let n=!1;return mx().then(s=>{n||t(s)}),Vl.add(t),()=>{n=!0,Vl.delete(t)}},[]),e}async function lN(e){const t=ux(),n=await fetch("/api/view-prefs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){const i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(i.error??"Failed to save view-prefs")}const s=px(await n.json());return dx(t)&&fx(s),s}function cN(e){return lN({global:e})}function uN(e,t){return lN({projects:{[e]:t}})}async function LF(){const e=ux(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=px(await t.json());return dx(e)&&fx(n),n}const tj=80;function dN({open:e,onOpenChange:t,initialName:n="",onSubmit:s,title:i="Save view"}){const[l,c]=f.useState(n),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{e&&(c(n),h(null),p(!1))},[e,n]);const x=l.trim(),y=x.length>0&&x.length<=tj;return r.jsx(ir,{open:e,onOpenChange:t,children:r.jsx(qn,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:async b=>{if(b.preventDefault(),!(!y||u)){p(!0),h(null);try{await s(x)}catch(E){h(E instanceof Error?E.message:String(E)),p(!1)}}},children:[r.jsx(Yr,{children:r.jsx(Gn,{children:i})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"text",value:l,autoFocus:!0,required:!0,maxLength:tj,onChange:b=>c(b.target.value),placeholder:"View name",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"}),m?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:m}):null]}),r.jsxs(As,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:u,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!y||u,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:u?"Saving…":"Save"})]})]})})})}function fN({scope:e,loadedViewId:t,onApply:n,onOpenSaveDialog:s}){const{views:i,loading:l}=kg(),[c,u]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{if(!c)return;function y(E){p.current&&!p.current.contains(E.target)&&u(!1)}function b(E){E.key==="Escape"&&u(!1)}return document.addEventListener("mousedown",y),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",b)}},[c]);const m=f.useMemo(()=>i.filter(y=>Fk(y,e)),[i,e]),h=t?i.find(y=>y.id===t)??null:null,x=l?"Saved views…":h?h.name:"Saved views";return r.jsxs("div",{className:"relative",ref:p,children:[r.jsxs("button",{type:"button",disabled:l,onClick:()=>u(y=>!y),className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background disabled:opacity-50","aria-haspopup":"true","aria-expanded":c,title:"Saved views",children:[r.jsx("span",{className:"max-w-[160px] truncate",children:x}),r.jsx(cs,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),c&&r.jsx("div",{className:"absolute right-0 top-full z-30 mt-1 min-w-[240px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:m.length===0?r.jsxs("div",{className:"px-3 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"mb-2",children:"No saved views yet — Save the current view to start."}),r.jsx("button",{type:"button",onClick:()=>{u(!1),s()},className:"shell-action w-full justify-center",children:"Save current view"})]}):m.map(y=>{const b=y.id===t;return r.jsxs("button",{type:"button",onClick:()=>{u(!1),n(y)},className:Te("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",b&&"font-semibold text-foreground"),children:[r.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:b?r.jsx(Rs,{className:"h-3.5 w-3.5","aria-hidden":"true"}):null}),r.jsx("span",{className:"truncate",children:y.name})]},y.id)})})]})}const IF={__unassigned__:"Unassigned",__standalone__:"No project"};function Pn({options:e,value:t,onChange:n,allLabel:s="Any",className:i,disabled:l,ariaLabel:c}){const[u,p]=f.useState(!1),m=f.useRef(null),h=f.useRef(null),x=f.useRef([]),y=f.useMemo(()=>{const C=new Set(e.map(T=>T.value)),N=t.filter(T=>!C.has(T)).map(T=>({value:T,label:IF[T]??T}));return[...e,...N]},[e,t]),b=f.useMemo(()=>new Set(t),[t]);f.useEffect(()=>{if(!u)return;function C(N){m.current&&!m.current.contains(N.target)&&p(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]),f.useEffect(()=>{var C;u&&((C=x.current[0])==null||C.focus())},[u]);const E=f.useMemo(()=>{if(t.length===0)return s;if(t.length===1){const C=y.find(N=>N.value===t[0]);return C?C.label:t[0]}return`${t.length} selected`},[t,y,s]);function k(C){n(b.has(C)?t.filter(N=>N!==C):[...t,C])}function v(C){var T;const N=Math.max(0,Math.min(C,y.length-1));(T=x.current[N])==null||T.focus()}function j(C){var P;const N=x.current,T=document.activeElement,L=N.findIndex($=>$===T);C.key==="ArrowDown"?(C.preventDefault(),v(L<0?0:L+1)):C.key==="ArrowUp"?(C.preventDefault(),v(L<0?y.length-1:L-1)):C.key==="Home"?(C.preventDefault(),v(0)):C.key==="End"?(C.preventDefault(),v(y.length-1)):C.key==="Escape"&&(C.preventDefault(),p(!1),(P=h.current)==null||P.focus())}return r.jsxs("div",{className:"relative",ref:m,children:[r.jsxs("button",{type:"button",ref:h,disabled:l,"aria-haspopup":"menu","aria-expanded":u,"aria-label":c,onClick:()=>p(C=>!C),onKeyDown:C=>{!u&&(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),p(!0))},className:Te("editor-input inline-flex items-center justify-between gap-1.5 text-left",t.length>0&&"border-foreground/40 text-foreground",i),children:[r.jsx("span",{className:"truncate",children:E}),r.jsx(cs,{className:"h-3.5 w-3.5 shrink-0 opacity-60","aria-hidden":"true"})]}),u?r.jsxs("div",{role:"menu","aria-label":c,onKeyDown:j,className:"absolute left-0 top-full z-30 mt-1 max-h-72 min-w-[200px] overflow-auto rounded-md border border-border/70 bg-background py-1 shadow-lg",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1",children:[r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===y.length,onClick:()=>n(y.map(C=>C.value)),children:"Select all"}),r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===0,onClick:()=>n([]),children:"Clear"})]}),y.length===0?r.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"No options"}):y.map((C,N)=>{const T=b.has(C.value);return r.jsxs("button",{ref:L=>{x.current[N]=L},type:"button",role:"menuitemcheckbox","aria-checked":T,tabIndex:-1,onClick:()=>k(C.value),className:Te("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",T?"text-foreground":"text-muted-foreground"),children:[r.jsx("span",{className:Te("flex h-4 w-4 shrink-0 items-center justify-center rounded border",T?"border-foreground bg-foreground text-background":"border-border/70"),"aria-hidden":"true",children:T?r.jsx(Rs,{className:"h-3 w-3"}):null}),r.jsx("span",{className:"truncate",children:C.label})]},C.value)})]}):null]})}const nj={last_24h:"Last 24 hours",last_7d:"Last 7 days",last_30d:"Last 30 days",last_90d:"Last 90 days",older_7d:"Older than 7 days",older_30d:"Older than 30 days"},OF=["updated","created"];function hx({value:e,onChange:t,className:n,ariaLabel:s="Date range filter"}){const[i,l]=f.useState(!1),c=f.useRef(null),u=(e==null?void 0:e.field)??"updated",p=!!(e&&!e.preset&&(e.from||e.to)),[m,h]=f.useState(p);f.useEffect(()=>h(p),[p]),f.useEffect(()=>{if(!i)return;function j(N){c.current&&!c.current.contains(N.target)&&l(!1)}function C(N){N.key==="Escape"&&l(!1)}return document.addEventListener("mousedown",j),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",C)}},[i]);const x=!!(e&&(e.preset||e.from||e.to)),y=f.useMemo(()=>!x||!e?"Any date":e.preset?`${u}: ${nj[e.preset]??e.preset}`:`${u}: ${e.from||"…"} → ${e.to||"…"}`,[x,e,u]);function b(j){t(e?{...e,field:j}:{field:j,preset:"",from:"",to:""})}function E(j){h(!1),t({field:u,preset:j,from:"",to:""})}function k(){h(!1),t(null)}function v(j,C){const N={field:u,preset:"",from:(e==null?void 0:e.from)??"",to:(e==null?void 0:e.to)??""};t({...N,[j]:C})}return r.jsxs("div",{className:"relative",ref:c,children:[r.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":i,"aria-label":s,onClick:()=>l(j=>!j),className:Te("editor-input inline-flex items-center justify-between gap-1.5 text-left",x&&"border-foreground/40 text-foreground",n),children:[r.jsx("span",{className:"truncate",children:y}),r.jsx(cs,{className:"h-3.5 w-3.5 shrink-0 opacity-60","aria-hidden":"true"})]}),i?r.jsxs("div",{className:"absolute left-0 top-full z-30 mt-1 w-64 rounded-md border border-border/70 bg-background p-2 shadow-lg",children:[r.jsx("div",{className:"mb-2 inline-flex rounded-md border border-border/60 bg-background/80 p-0.5",children:OF.map(j=>r.jsx("button",{type:"button","aria-pressed":u===j,onClick:()=>b(j),className:Te("rounded-sm px-2.5 py-1 text-xs font-medium capitalize transition",u===j?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:j},j))}),r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Vm,{label:"Any date",selected:!x,onClick:k}),HA.map(j=>r.jsx(Vm,{label:nj[j],selected:(e==null?void 0:e.preset)===j,onClick:()=>E(j)},j)),r.jsx(Vm,{label:"Custom range…",selected:m,onClick:()=>{h(!0),t({field:u,preset:"",from:(e==null?void 0:e.from)??"",to:(e==null?void 0:e.to)??""})}})]}),m?r.jsxs("div",{className:"mt-2 space-y-1.5 border-t border-border/60 pt-2",children:[r.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:["From",r.jsx("input",{type:"date",value:(e==null?void 0:e.from)??"",max:(e==null?void 0:e.to)||void 0,onChange:j=>v("from",j.target.value),className:"editor-input w-40"})]}),r.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:["To",r.jsx("input",{type:"date",value:(e==null?void 0:e.to)??"",min:(e==null?void 0:e.from)||void 0,onChange:j=>v("to",j.target.value),className:"editor-input w-40"})]})]}):null]}):null]})}function Vm({label:e,selected:t,onClick:n}){return r.jsxs("button",{type:"button",onClick:n,className:Te("flex w-full items-center justify-between gap-2 rounded px-2 py-1.5 text-left text-sm transition hover:bg-foreground/5",t?"text-foreground":"text-muted-foreground"),children:[r.jsx("span",{children:e}),t?r.jsx(Rs,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}):null]})}function Hl(e){if(!e)return;if(e.preset)return{field:e.field,preset:e.preset};const t=e.from&&e.from.length>0?e.from:void 0,n=e.to&&e.to.length>0?e.to:void 0;if(!t&&!n)return;const s={field:e.field};return t&&(s.from=t),n&&(s.to=n),s}function pN(e){return e?{field:e.field,preset:e.preset??"",from:e.from??"",to:e.to??""}:null}const _F=new Set(["status","type","priority","assignee","project","tags","activity","dateRange","search"]);function MF(e,t){const n={};for(const[s,i]of Object.entries(e))_F.has(s)||(n[s]=i);return{...n,...t}}function gx(e,t,n){return{...e,viewMode:t.viewMode,filters:MF(e.filters,t.filters),sortField:t.sortField,sortDirection:t.sortDirection,listSectionVisibility:{collapsed:[...n.listSectionVisibility.collapsed]},kanbanColumnVisibility:{hidden:[...n.kanbanColumnVisibility.hidden]},tableColumnVisibility:{hidden:[...n.tableColumnVisibility.hidden]}}}function FF(e,t){var m;const n={},s=qe(e.status);s.length&&(n.status=s);const i=qe(e.type);i.length&&(n.type=i);const l=qe(e.priority);l.length&&(n.priority=l);const c=qe(e.assignee);c.length&&(n.assignee=c);const u=qe(e.tags);if(u.length&&(n.tags=u),t&&t!=="all")n.project=[t];else{const h=qe(e.project);h.length&&(n.project=h)}e.activity&&e.activity!=="all"&&(n.activity=e.activity),e.dateRange&&(n.dateRange=e.dateRange);const p=(m=e.search)==null?void 0:m.trim();return p&&(n.search=p),n}function Wl(e){const t={viewMode:e.state.viewMode,filters:FF(e.state.filters,e.context.projectSlug),sortField:e.state.sortField,sortDirection:e.state.sortDirection,listSectionVisibility:{collapsed:[...e.state.listSectionVisibility.collapsed]},kanbanColumnVisibility:{hidden:[...e.state.kanbanColumnVisibility.hidden]},tableColumnVisibility:{hidden:[...e.state.tableColumnVisibility.hidden]}};return{name:e.name.trim(),workspace:e.context.workspace,config:t}}function mN(e,t){var s,i,l,c,u,p,m,h,x,y,b,E,k,v;const{config:n}=e;if((s=t.setViewMode)==null||s.call(t,n.viewMode),(i=t.setStatusFilter)==null||i.call(t,qe(n.filters.status)),(l=t.setTypeFilter)==null||l.call(t,qe(n.filters.type)),(c=t.setPriorityFilter)==null||c.call(t,qe(n.filters.priority)),(u=t.setAssigneeFilter)==null||u.call(t,qe(n.filters.assignee)),(p=t.setProjectFilter)==null||p.call(t,qe(n.filters.project)),(m=t.setTagsFilter)==null||m.call(t,qe(n.filters.tags)),(h=t.setDateRange)==null||h.call(t,pN(n.filters.dateRange)),(x=t.setSearch)==null||x.call(t,n.filters.search??""),t.setActivityFilter){const j=n.filters.activity??"all";t.setActivityFilter(j==="fresh"||j==="stale"?j:"all")}(y=t.setSortField)==null||y.call(t,n.sortField),(b=t.setSortDirection)==null||b.call(t,n.sortDirection),(E=t.setListSectionVisibility)==null||E.call(t,{collapsed:[...n.listSectionVisibility.collapsed]}),(k=t.setKanbanColumnVisibility)==null||k.call(t,{hidden:[...n.kanbanColumnVisibility.hidden]}),(v=t.setTableColumnVisibility)==null||v.call(t,{hidden:[...n.tableColumnVisibility.hidden]})}function hN(e){const t=e.workspace?`/w/${e.workspace}`:"",n=qe(e.config.filters.project);return n.length===1&&n[0]!=="__standalone__"&&Mk(e.config,n[0])?`${t}/projects/${n[0]}?tab=assignments&loadView=${encodeURIComponent(e.id)}`:`${t}/assignments?loadView=${encodeURIComponent(e.id)}`}const zF=["critical","high","medium","low"],Ii={viewMode:"kanban",sortField:"updated",sortDirection:"desc"};function rj(e,t){const{config:n}=Wl({name:"",context:{workspace:t,projectSlug:null},state:{viewMode:e.viewMode,filters:e.filters,sortField:e.sortField,sortDirection:e.sortDirection,listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}}});return{workspace:t,config:n}}const BF={last_24h:"last 24 hours",last_7d:"last 7 days",last_30d:"last 30 days",last_90d:"last 90 days",older_7d:"older than 7 days",older_30d:"older than 30 days"};function UF(e){if(e.preset)return`${e.field} ${BF[e.preset]??e.preset}`;const t=e.from??"…",n=e.to??"…";return`${e.field} ${t}→${n}`}function VF(e){var s;const t=[];for(const i of["status","priority","type","assignee","project","tags"]){const l=qe(e[i]);l.length&&t.push(`${i}=${l.join(", ")}`)}e.activity&&e.activity!=="all"&&t.push(`activity=${e.activity}`),e.dateRange&&t.push(UF(e.dateRange));const n=(s=e.search)==null?void 0:s.trim();return n&&t.push(`search="${n}"`),t.join(" · ")||"no filters"}const HF=4e3;function xx(){const[e,t]=f.useState(null),n=f.useRef(null),s=f.useCallback(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null),t(null)},[]),i=f.useCallback((l,c="error")=>{n.current!==null&&clearTimeout(n.current),t({id:Date.now()+Math.random(),message:l,kind:c}),n.current=setTimeout(()=>{t(null),n.current=null},HF)},[]);return f.useEffect(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{toast:e,showToast:i,dismissToast:s}}function yx({toast:e,onDismiss:t}){if(!e)return null;const n=e.kind==="error";return r.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-50 flex max-w-sm",role:"status","aria-live":"polite",children:r.jsx("button",{type:"button",onClick:t,className:Te("syntaur-toast pointer-events-auto rounded-md border px-4 py-3 text-sm font-medium shadow-lg transition",n?"border-error-foreground/30 bg-error text-error-foreground hover:opacity-90":"border-success-foreground/30 bg-success text-success-foreground hover:opacity-90"),children:e.message},e.id)})}const WF=new Set(["overview","assignments","todos","dependencies","knowledge"]),sj="__unknown_type__";function oj(){const{slug:e,workspace:t}=Lt(),n=ln(),s=$t();uo("project"),zt({keys:"a",scope:"project",description:"Create assignment",handler:()=>s(`${n}/projects/${e}/create/assignment`)}),zt({keys:"e",scope:"project",description:"Edit project",handler:()=>s(`${n}/projects/${e}/edit`)});const{data:i,loading:l,error:c,refetch:u}=k0(e),p=Ko(),m=qd(),{data:h}=Ed(),[x,y]=fs(),b=x.get("tab"),E=b&&WF.has(b)?b:"overview";function k(re){y(Pe=>{const He=new URLSearchParams(Pe);return re==="overview"?He.delete("tab"):He.set("tab",re),He},{replace:!0})}const v=e?`p:${e}`:null,j=aN(v),[C,N]=f.useState(()=>xm(j.defaultView)),[T,L]=f.useState(()=>qe(j.filters.status)),[P,$]=f.useState(()=>qe(j.filters.assignee)),[D,J]=f.useState(()=>qe(j.filters.priority)),[ee,M]=f.useState(()=>qe(j.filters.type)),[U,X]=f.useState(()=>qe(j.filters.tags)),[B,q]=f.useState(null),[Z,le]=f.useState(()=>j.grouping),[_,G]=f.useState(()=>j.sortField),[A,z]=f.useState(()=>j.sortDirection),[Q,I]=f.useState(()=>({collapsed:[]})),[ue,me]=f.useState(()=>({hidden:[]})),[V,ne]=f.useState(()=>({hidden:[]})),[de,ye]=f.useState(null),[ke,fe]=f.useState(!1),[Ve,pe]=f.useState(!1),{toast:Re,showToast:O,dismissToast:W}=xx(),te={kind:"project",slug:e??"",workspace:t??null},xe=x.get("loadView"),{view:Ae,loading:Ee,error:et}=na(xe),{view:Ye,loading:St,error:Bt}=na(de),st=f.useRef(null);f.useEffect(()=>{de&&!St&&!Bt&&!Ye&&ye(null)},[Ye,Bt,de,St]),f.useEffect(()=>{ye(null),st.current=null,q(null)},[e,t]),f.useEffect(()=>{N(xm(j.defaultView)),L(qe(j.filters.status)),$(qe(j.filters.assignee)),J(qe(j.filters.priority)),M(qe(j.filters.type)),X(qe(j.filters.tags)),le(j.grouping),G(j.sortField),z(j.sortDirection)},[e,j.defaultView,j.filters.status,j.filters.assignee,j.filters.priority,j.filters.type,j.filters.tags,j.grouping,j.sortField,j.sortDirection]);const ae=f.useCallback(re=>{v&&uN(v,re).catch(Pe=>{console.warn("Failed to persist project view prefs:",Pe)})},[v]),be=f.useCallback(re=>{N(re),ae({defaultView:re})},[ae]),Le=f.useCallback(re=>{L(re),ae({filters:{status:re}})},[ae]),Be=f.useCallback(re=>{$(re),ae({filters:{assignee:re}})},[ae]),Ge=f.useCallback(re=>{J(re),ae({filters:{priority:re}})},[ae]),it=f.useCallback(re=>{M(re),ae({filters:{type:re}})},[ae]),Kt=f.useCallback(re=>{X(re),ae({filters:{tags:re}})},[ae]),xt=f.useCallback(re=>{le(re),ae({grouping:re})},[ae]),tn=f.useCallback(re=>{G(re),ae({sortField:re})},[ae]),Nt=f.useCallback(re=>{z(re),ae({sortDirection:re})},[ae]),yt=f.useCallback(()=>({viewMode:C,filters:{status:T,priority:D,type:ee,assignee:P,tags:U,project:"all",activity:"all",dateRange:Hl(B)},sortField:_,sortDirection:A,listSectionVisibility:Q,kanbanColumnVisibility:ue,tableColumnVisibility:V}),[C,T,D,ee,P,U,B,_,A,Q,ue,V]),kt=f.useCallback(re=>{mN(re,{setViewMode:Pe=>N(xm(Pe)),setStatusFilter:Le,setPriorityFilter:Ge,setTypeFilter:it,setAssigneeFilter:Be,setTagsFilter:Kt,setDateRange:q,setSortField:tn,setSortDirection:Nt,setListSectionVisibility:I,setKanbanColumnVisibility:me,setTableColumnVisibility:ne}),ye(re.id)},[Le,Ge,it,Be,Kt,tn,Nt]),he=f.useCallback(re=>{kt(re),st.current=re.id,y(Pe=>{const He=new URLSearchParams(Pe);return He.set("loadView",re.id),He},{replace:!0})},[kt,y]),Ze=f.useCallback(async re=>{try{const Pe=Wl({name:re,context:{workspace:t??null,projectSlug:e??null},state:yt()}),He=await td(Pe),It=He.views[He.views.length-1];ye((It==null?void 0:It.id)??null),It&&(st.current=It.id,y(mn=>{const bt=new URLSearchParams(mn);return bt.set("loadView",It.id),bt},{replace:!0})),fe(!1),pe(!1),O(`Saved view "${re}"`,"success")}catch(Pe){throw O(Pe instanceof Error?Pe.message:"Failed to save view","error"),Pe}},[yt,y,O,e,t]),Je=f.useCallback(async()=>{if(!(!de||!Ye))try{const re=qe(Ye.config.filters.project)[0]??null,Pe=Wl({name:Ye.name,context:{workspace:t??null,projectSlug:re},state:yt()}),He=gx(Ye.config,Pe.config,Pe.config);await Od(de,{config:He}),O("View updated","success")}catch(re){O(re instanceof Error?re.message:"Failed to update view","error")}},[yt,Ye,de,O,t]);f.useEffect(()=>{if(!xe){st.current=null;return}if(st.current!==xe&&(de&&de!==xe&&ye(null),!Ee)){if(et){O("Couldn't load saved view — try again","error");return}if(Ae){if(st.current=xe,!Fk(Ae,{kind:"project",slug:e??"",workspace:t??null})){s(hN(Ae),{replace:!0});return}kt(Ae),y(re=>{const Pe=new URLSearchParams(re);return Pe.delete("loadView"),Pe},{replace:!0});return}st.current=xe,O("Saved view no longer exists","error"),y(re=>{const Pe=new URLSearchParams(re);return Pe.delete("loadView"),Pe},{replace:!0})}},[xe,Ae,Ee,et,de,kt,y,O,s,e,t]);function nn(re){_===re?Nt(A==="asc"?"desc":"asc"):(tn(re),Nt("asc"))}const Ct=f.useMemo(()=>i?Object.fromEntries(i.assignments.flatMap(re=>{const Pe=`${n}/projects/${i.slug}/assignments/${re.slug}`;return[[re.slug,Pe],[re.title,Pe]]})):{},[i]);async function jt(re){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:re})}),u()}async function Ut(re){try{const Pe=await fetch(`/api/projects/${e}/${re?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!Pe.ok){const He=await Pe.json().catch(()=>null);O((He==null?void 0:He.error)||`HTTP ${Pe.status}`,"error");return}u()}catch(Pe){O(Pe instanceof Error?Pe.message:"Failed to update archive state","error")}}async function An(re){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:re})}),u()}if(l)return r.jsx(ft,{label:"Loading project workspace…"});if(c||!i)return r.jsx(mt,{error:c||"Project not found."});const qt=(()=>{const re=new Set;for(const He of i.assignments)He.assignee&&re.add(He.assignee);const Pe=[{value:"__unassigned__",label:"Unassigned"}];for(const He of Array.from(re).sort())Pe.push({value:He,label:He});return Pe})(),rn=Array.from(new Set(i.assignments.flatMap(re=>re.tags??[]))).sort().map(re=>({value:re,label:re})),Vt=i.assignments.filter(re=>Ig(re,{status:T,priority:D,type:ee,assignee:P,tags:U,dateRange:Hl(B)})),Yn=tc(Vt,_,A),ut=new Set(m.definitions.map(re=>re.id)),wn=Z==="type"?[...m.definitions.map(re=>({id:re.id,title:Yi(m,re.id),description:re.description})),...Vt.some(re=>!re.type||!ut.has(re.type))?[{id:sj,title:"Other",description:"Assignments with no recognized type."}]:[]]:E1(p.order).map(re=>({id:re,title:ec(p,re),description:Hd(re)}));function Et({field:re,children:Pe}){const He=_===re;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>nn(re),className:"inline-flex items-center gap-1 hover:text-foreground",children:[Pe,He?A==="asc"?r.jsx(Yj,{className:"h-3 w-3"}):r.jsx(cs,{className:"h-3 w-3"}):null]})})}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(vn,{status:i.status}),i.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>jt(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:re=>{re.target.value&&jt(re.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),p.statuses.map(re=>r.jsx("option",{value:re.id,children:re.label},re.id)),r.jsx("option",{value:"active",children:"Active"})]}),r.jsx("button",{type:"button",className:"shell-action",onClick:()=>Ut(!i.archived),title:i.archived?"Restore this project and its cascade-hidden assignments":"Archive this project (hides it and its assignments from normal views)",children:i.archived?"Restore":"Archive"}),h&&h.workspaces.length>0&&r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:re=>{re.target.value==="_ungrouped"?An(null):re.target.value&&An(re.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),h.workspaces.filter(re=>re!==i.workspace).map(re=>r.jsx("option",{value:re,children:re},re)),i.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(Ne,{className:"shell-action",to:`${n}/projects/${i.slug}/edit`,children:[r.jsx(rv,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Project"})]}),r.jsxs(Ne,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${n}/projects/${i.slug}/create/assignment`,children:[r.jsx(en,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(Fg,{externalIds:i.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",Mn(i.created),". Last source update ",Dr(i.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(Rn,{label:"Assignments",value:i.progress.total}),r.jsx(Rn,{label:"In Progress",value:i.progress.in_progress??0,tone:"info"}),r.jsx(Rn,{label:"Review",value:i.progress.review??0,tone:"info"}),r.jsx(Rn,{label:"Blocked",value:i.progress.blocked??0,tone:"warn"}),r.jsx(Rn,{label:"Completed",value:i.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(Bg,{value:E,onValueChange:k,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Me,{title:"Project Overview",children:r.jsx(fn,{content:i.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:i.assignments.filter(re=>!re.archived).length,content:r.jsx("div",{className:"space-y-5",children:r.jsx(Me,{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.jsx(Pn,{ariaLabel:"Status filter",className:"max-w-[170px]",allLabel:"All statuses",options:p.statuses.map(re=>({value:re.id,label:re.label})),value:T,onChange:Le}),r.jsx(Pn,{ariaLabel:"Assignee filter",className:"max-w-[170px]",allLabel:"All assignees",options:qt,value:P,onChange:Be}),r.jsx(Pn,{ariaLabel:"Priority filter",className:"max-w-[170px]",allLabel:"All priorities",options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],value:D,onChange:Ge}),r.jsx(Pn,{ariaLabel:"Type filter",className:"max-w-[170px]",allLabel:"All types",options:m.definitions.map(re=>({value:re.id,label:Yi(m,re.id)})),value:ee,onChange:it}),r.jsx(Pn,{ariaLabel:"Tags filter",className:"max-w-[170px]",allLabel:"Any tags",options:rn,value:U,onChange:Kt}),r.jsx(hx,{className:"max-w-[190px]",value:B,onChange:q}),C==="kanban"&&r.jsxs("select",{value:Z==="type"?"type":"status",onChange:re=>xt(re.target.value),className:"editor-input max-w-[170px]",title:"Group kanban by",children:[r.jsx("option",{value:"status",children:"Group: Status"}),r.jsx("option",{value:"type",children:"Group: Type"})]}),r.jsx(Kd,{value:C,onChange:re=>be(re),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]}),r.jsx(fN,{scope:te,loadedViewId:de,onApply:he,onOpenSaveDialog:()=>{pe(!1),fe(!0)}}),r.jsx("button",{type:"button",onClick:()=>{Ye?Je():(pe(!1),fe(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:Ye?`Update ${Ye.name}`:"Save current view",children:Ye?`Update '${Ye.name}'`:"Save view"}),Ye?r.jsx("button",{type:"button",onClick:()=>{pe(!0),fe(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),children:Vt.length===0?r.jsx(ct,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:r.jsx(Ne,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${n}/projects/${i.slug}/create/assignment`,children:"Create Assignment"})}):C==="kanban"?r.jsx(Vd,{columns:wn,items:Yn,getItemId:re=>re.slug,getColumnId:re=>Z==="type"?re.type&&ut.has(re.type)?re.type:sj:re.status,dragDisabled:!0,renderCard:re=>r.jsx(KF,{projectSlug:i.slug,assignment:re}),emptyMessage:re=>`No ${re.title.toLowerCase()} assignments.`,hiddenColumnIds:ue.hidden,onHideColumn:re=>me(Pe=>({hidden:Pe.hidden.includes(re)?Pe.hidden.filter(It=>It!==re):[...Pe.hidden,re]}))}):(()=>{const re=new Set(V.hidden),Pe=He=>He==="title"||!re.has(He);return r.jsxs("div",{className:"overflow-x-auto",children:[r.jsx("div",{className:"mb-3 flex items-center justify-end",children:r.jsx(sN,{visibility:V,onChange:ne})}),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:[Pe("title")?r.jsx(Et,{field:"title",children:"Assignment"}):null,Pe("status")?r.jsx(Et,{field:"status",children:"Status"}):null,r.jsx("th",{className:"pb-3 font-medium",children:"Type"}),Pe("priority")?r.jsx(Et,{field:"priority",children:"Priority"}):null,Pe("assignee")?r.jsx(Et,{field:"assignee",children:"Assignee"}):null,Pe("dependencies")?r.jsx(Et,{field:"dependencies",children:"Dependencies"}):null,Pe("created")?r.jsx(Et,{field:"created",children:"Created"}):null,Pe("updated")?r.jsx(Et,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:Yn.map(He=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[Pe("title")?r.jsx("td",{className:"py-4",children:r.jsx(Ne,{to:`${n}/projects/${i.slug}/assignments/${He.slug}`,className:"font-semibold text-foreground hover:text-primary",children:He.title})}):null,Pe("status")?r.jsx("td",{className:"py-4",children:r.jsx(vn,{status:He.status})}):null,r.jsx("td",{className:"py-4",children:r.jsx(da,{type:He.type,compact:!0})}),Pe("priority")?r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:He.priority}):null,Pe("assignee")?r.jsx("td",{className:"py-4 text-muted-foreground",children:He.assignee??"—"}):null,Pe("dependencies")?r.jsx("td",{className:"py-4 text-muted-foreground",children:He.dependsOn.length}):null,Pe("created")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Mn(He.created)}):null,Pe("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Mn(He.updated)}):null]},He.slug))})]})]})})()})})},{value:"todos",label:"Todos",content:r.jsx(PF,{projectId:i.slug})},{value:"dependencies",label:"Dependencies",content:i.dependencyGraph?r.jsx(Me,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(aL,{definition:i.dependencyGraph,nodeRoutes:Ct})}):r.jsx(ct,{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(Me,{title:"Resources",description:"Shared project references.",actions:r.jsxs(Ne,{className:"shell-action",to:`/resources/new?project=${i.slug}`,children:[r.jsx(en,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:i.resources.length===0?r.jsx(ct,{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:i.resources.map(re=>r.jsxs(Ne,{to:`/projects/${i.slug}/resources/${re.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:re.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[re.category," · ",re.source]})]},re.slug))})}),r.jsx(Me,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:r.jsxs(Ne,{className:"shell-action",to:`/memories/new?project=${i.slug}`,children:[r.jsx(en,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:i.memories.length===0?r.jsx(ct,{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:i.memories.map(re=>r.jsxs(Ne,{to:`/projects/${i.slug}/memories/${re.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:re.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[re.scope," · ",re.source]})]},re.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Me,{title:"Progress Summary",children:r.jsx(ld,{progress:i.progress,showLegend:!0})}),r.jsx(Me,{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:i.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:i.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:i.needsAttention.openQuestions})]})]})}),r.jsx(Me,{title:"Quick Links",children:r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs(Ne,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${i.slug}/edit`,children:[r.jsx(rv,{className:"h-4 w-4"}),"Edit project source"]}),r.jsxs(Ne,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${i.slug}/create/assignment`,children:[r.jsx(en,{className:"h-4 w-4"}),"Create assignment"]}),r.jsxs(Ne,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[r.jsx(pT,{className:"h-4 w-4"}),"Review project rules"]}),r.jsxs("button",{type:"button",onClick:()=>k("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[r.jsx(Gh,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),i.archived?r.jsxs(Me,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",i.archivedAt?Dr(i.archivedAt):"with no timestamp recorded","."]}),i.archivedReason?r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.archivedReason}):null]}):null]})]}),r.jsx(yx,{toast:Re,onDismiss:W}),r.jsx(dN,{open:ke,onOpenChange:re=>{fe(re),re||pe(!1)},initialName:Ve&&Ye?`${Ye.name} (copy)`:"",title:Ve?"Save as new view":"Save view",onSubmit:Ze})]})}function KF({projectSlug:e,assignment:t}){const n=ln();return r.jsxs(Ne,{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(Ar,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Mn(t.updated)]})]}),r.jsx(vn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(da,{type:t.type}),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 gN({session:e,onMarkStopped:t}){const n=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=resume`,s=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=fork`,i="size-3.5",l=Te("shell-action","inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50"),c="inline-flex outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm",u=!e.resumeSupported&&!e.forkSupported;return r.jsx(Mo,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[u&&r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Bi,{className:i}),r.jsx("span",{children:"Reopen"})]})})}),r.jsx(gr,{side:"top",children:"Reopen unavailable — this agent has no resume/fork command configured"})]}),e.resumeSupported&&(e.isLive?r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx(Bi,{className:i}),r.jsx("span",{children:"Resume"})]})})}),r.jsx(gr,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsxs("a",{href:n,className:l,children:[r.jsx(Bi,{className:i}),r.jsx("span",{children:"Resume"})]})}),r.jsx(gr,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsxs("a",{href:s,className:l,children:[r.jsx(TT,{className:i}),r.jsx("span",{children:"Fork"})]})}),r.jsx(gr,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(Qh,{className:i}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(gr,{side:"top",children:e.resumeSupported?"Tell the dashboard this session has ended so Resume re-enables":"Tell the dashboard this session has ended"})]})]})})}async function qF(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function xN({sessions:e,loading:t,error:n}){return t&&!e?null:n&&!e?r.jsx(Me,{title:"Agent Sessions",children:r.jsx(ct,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(Me,{title:"Agent Sessions",children:r.jsx(ct,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(Me,{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(wd,{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(Ar,{value:s.sessionId})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(vn,{status:s.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:Dr(s.started)})]}),r.jsx(gN,{session:s,onMarkStopped:qF})]},s.sessionId))})})}const Hm="Cost / Usage";function yN({summary:e,error:t}){return t&&!e?r.jsx(Me,{title:Hm,children:r.jsx(ct,{title:"Couldn't load usage",description:t})}):e?e.lastEventDay===null?r.jsx(Me,{title:Hm,children:r.jsx(ct,{title:"No usage recorded yet",description:"Cost and token totals appear here once the usage collector records activity for this assignment."})}):r.jsx(Me,{title:Hm,children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(ij,{label:"Total cost",value:Gu(e.totalCost)}),r.jsx(ij,{label:"Total tokens",value:qu(e.totalTokens)})]}),e.byModel.length>1?r.jsxs("div",{className:"space-y-1.5 border-t border-border pt-3",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"By model"}),r.jsx("div",{className:"space-y-1",children:e.byModel.map(n=>r.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(Sd,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate font-mono text-xs text-foreground",title:n.model,children:n.model})]}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[qu(n.totalTokens)," · ",Gu(n.totalCost)]})]},n.model))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last usage recorded ",CP(e.lastEventDay)]})]})}):null}function ij({label:e,value:t}){return r.jsxs("div",{className:"space-y-0.5",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r.jsx("p",{className:"text-lg font-semibold tabular-nums text-foreground",children:t})]})}function bN({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:i,onOpenChange:l}){const[c,u]=f.useState("");f.useEffect(()=>{e||u("")},[e,t==null?void 0:t.command]);const p=f.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,h=s?"Applying...":t.label,x=c.trim()||void 0;return r.jsx(ir,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(qn,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),i(x)},children:[r.jsxs(Yr,{children:[r.jsx(Gn,{children:m}),r.jsx(ps,{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:p}),r.jsx("textarea",{value:c,onChange:y=>u(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(As,{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:h})]})]})})})}function va({open:e,title:t,description:n,confirmLabel:s,cancelLabel:i="Cancel",loading:l=!1,destructive:c=!1,onConfirm:u,onOpenChange:p}){return r.jsx(Xu,{open:e,onOpenChange:m=>l?void 0:p(m),children:r.jsxs(Dl,{children:[r.jsxs(Qu,{children:[r.jsx($l,{children:t}),r.jsx(Ll,{children:n})]}),r.jsxs(Zu,{children:[r.jsx(Ld,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:i}),r.jsx(ta,{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(),u()},children:l?"Working...":s})]})]})})}function Tu(e,t){const n=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`;return t?`${n}&terminal=${encodeURIComponent(t)}`:n}function vN({target:e,worktreePath:t=null,repository:n=null,size:s="default",title:i}){const l=e.kind==="assignment"&&!t&&!n,[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(!1),y=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",b="Set a workspace path first — see the Workspace Before Code playbook",E=Te("shell-action",s==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");if(l)return r.jsxs("button",{type:"button",disabled:!0,title:b,className:E,"aria-disabled":!0,children:[r.jsx(Bi,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]});async function k(){if(!h){x(!0);try{const j=await fetch("/api/launch/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:e})});if(!j.ok){window.location.href=Tu(e);return}const C=await j.json();if(C.ok){window.location.href=Tu(e);return}if(C.reason==="workspace-path-invalid"){m(C.message);return}u(C)}catch(j){console.warn("preflight failed, firing without override:",j),window.location.href=Tu(e)}finally{x(!1)}}}function v(){c&&(window.location.href=Tu(e,c.suggestedFallback),u(null))}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",onClick:k,disabled:h,title:i??y,className:E,children:[r.jsx(Bi,{className:"size-3.5"}),r.jsx("span",{children:e.kind==="session"?"Open":"Open in agent"})]}),r.jsx(Xu,{open:c!==null,onOpenChange:j=>!j&&u(null),children:r.jsxs(Dl,{children:[r.jsxs(Qu,{children:[r.jsxs($l,{children:[c==null?void 0:c.terminal," is not installed"]}),r.jsxs(Ll,{children:["Open in ",r.jsx("strong",{children:c==null?void 0:c.suggestedFallback})," instead? You can change the default in"," ",r.jsx(Ne,{to:"/settings",className:"underline hover:text-foreground",onClick:()=>u(null),children:"Settings"}),"."]})]}),r.jsxs(Zu,{children:[r.jsx(Ld,{className:"shell-action mt-0",children:"Cancel"}),r.jsxs(ta,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:j=>{j.preventDefault(),v()},children:["Open in ",c==null?void 0:c.suggestedFallback]})]})]})}),r.jsx(Xu,{open:p!==null,onOpenChange:j=>!j&&m(null),children:r.jsxs(Dl,{children:[r.jsxs(Qu,{children:[r.jsx($l,{children:"Can't open in agent"}),r.jsxs(Ll,{children:[p," Set a valid worktree or repository for this assignment, then try again."]})]}),r.jsx(Zu,{children:r.jsx(ta,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:()=>m(null),children:"OK"})})]})})]})}function GF(e){if(!e.trim())return"Branch name is required.";if(/\s/.test(e))return"Branch name cannot contain whitespace.";if(/[\x00-\x1F\x7F~^:?*[\\]/.test(e))return"Branch name cannot contain any of: ~ ^ : ? * [ \\ or control characters.";if(e.startsWith("-"))return'Branch name cannot start with "-".';if(e.startsWith("/")||e.endsWith("/"))return'Branch name cannot start or end with "/".';if(e.endsWith("."))return'Branch name cannot end with ".".';if(e.includes(".."))return'Branch name cannot contain "..".';if(e.includes("@{"))return'Branch name cannot contain "@{".';if(e==="@")return'Branch name cannot be "@".';for(const t of e.split("/")){if(!t)return'Branch name cannot contain empty path segments (e.g. "a//b").';if(t.startsWith("."))return'Branch name segments cannot start with ".".';if(t.endsWith(".lock"))return'Branch name segments cannot end with ".lock".'}return null}async function wN(e,t,n,s){const i=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 i.json().catch(()=>null);if(!i.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${i.status}`);return l.assignment}async function jN(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})}),i=await s.json().catch(()=>null);if(!s.ok)throw new Error((i==null?void 0:i.error)||`HTTP ${s.status}`);return i.assignment}async function YF(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 kN(e){return e.requiresReason||e.command==="block"}async function JF(e){const t=await fetch(`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),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 XF(e){const t=await fetch(`/api/assignments/${e.id}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}class SN extends Error{constructor(t,n){super(t),this.stderr=n,this.name="CreateWorktreeError"}}async function NN(e){const t=await e.json().catch(()=>null);return new SN((t==null?void 0:t.error)||`HTTP ${e.status}`,t==null?void 0:t.stderr)}async function QF(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 ZF(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 e6(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 NN(s);return(await s.json()).assignment}async function t6(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 NN(n);return(await n.json()).assignment}async function cf(e){const t=await e.json().catch(()=>null);if(!e.ok)throw new Error((t==null?void 0:t.error)||`HTTP ${e.status}`);return t}async function n6(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/repository-branches?repo=${encodeURIComponent(n)}`);return cf(s)}async function r6(e,t){const n=await fetch(`/api/assignments/${e}/repository-branches?repo=${encodeURIComponent(t)}`);return cf(n)}async function s6(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}/source-assignments`);return(await cf(n)).sourceAssignments}async function o6(e){const t=await fetch(`/api/assignments/${e}/source-assignments`);return(await cf(t)).sourceAssignments}const Wm="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 disabled:cursor-not-allowed disabled:opacity-50";function CN({projectSlug:e,assignmentSlug:t,assignmentId:n,defaultBranch:s,defaultParentBranch:i="main",onCreated:l}){const c=e&&t?{kind:"project-nested",projectSlug:e,assignmentSlug:t}:{kind:"standalone",assignmentId:n},[u,p]=f.useState(!1),[m,h]=f.useState("new-branch"),[x,y]=f.useState(null),[b,E]=f.useState(null),[k,v]=f.useState(""),[j,C]=f.useState(!1),[N,T]=f.useState(""),[L,P]=f.useState([]),[$,D]=f.useState(!1),[J,ee]=f.useState(null),[M,U]=f.useState(""),[X,B]=f.useState(null),[q,Z]=f.useState(null),[le,_]=f.useState(""),[G,A]=f.useState(s),[z,Q]=f.useState(!1),[I,ue]=f.useState(null);f.useEffect(()=>{if(!u)return;let O=!1;return h("new-branch"),y(null),E(null),v(""),C(!1),T(""),P([]),D(!1),ee(null),U(""),B(null),Z(null),_(""),A(s),ue(null),(c.kind==="project-nested"?QF(c.projectSlug):ZF(c.assignmentId)).then(xe=>{if(!O)if(y(xe),xe.length===0)C(!0);else{const Ae=xe.find(et=>et.source==="project"),Ee=xe.find(et=>et.source==="sibling");v((Ae==null?void 0:Ae.path)??(Ee==null?void 0:Ee.path)??xe[0].path)}}).catch(xe=>{O||(E(xe.message),y([]),C(!0))}),(c.kind==="project-nested"?s6(c.projectSlug,c.assignmentSlug):o6(c.assignmentId)).then(xe=>{O||B(xe)}).catch(xe=>{O||(Z(xe.message),B([]))}),()=>{O=!0}},[u,s,i,e,t,n]);const me=m==="branch-off"?(X??[]).find(O=>O.id===le)??null:null,V=m==="branch-off"?(me==null?void 0:me.repository)??"":j?N.trim():k;f.useEffect(()=>{if(!u||m!=="new-branch")return;if(!V){P([]),ee(null),D(!1),U("");return}let O=!1;return D(!0),ee(null),U(""),(c.kind==="project-nested"?n6(c.projectSlug,c.assignmentSlug,V):r6(c.assignmentId,V)).then(te=>{if(O)return;P(te.branches);const xe=(te.defaultBranch&&te.branches.includes(te.defaultBranch)?te.defaultBranch:te.branches.includes(i)?i:te.branches[0])??"";U(xe),D(!1)}).catch(te=>{O||(P([]),ee(te.message),D(!1))}),()=>{O=!0}},[u,m,V,i,e,t,n]);const ne=GF(G.trim()),de=f.useMemo(()=>!V||!G.trim()?"":`${V.replace(/\/+$/,"")}/.worktrees/${G.trim()}`,[V,G]),ye=x!==null&&x.length===0,ke=X!==null&&X.length===0,fe=O=>{O!==m&&(h(O),_(""),ue(null),O==="branch-off"&&(U(""),P([]),ee(null),D(!1)))},Ve=O=>{_(O);const W=(X??[]).find(te=>te.id===O);U((W==null?void 0:W.branch)??"")},pe=z||ne!==null||!V||!M.trim()||(m==="new-branch"?x===null||$:X===null||!le),Re=async()=>{Q(!0),ue(null);try{const O={repository:V,branch:G.trim(),parentBranch:M.trim()};c.kind==="project-nested"?await e6(c.projectSlug,c.assignmentSlug,O):await t6(c.assignmentId,O),p(!1),l()}catch(O){O instanceof SN?ue({message:O.message,stderr:O.stderr}):O instanceof Error?ue({message:O.message}):ue({message:String(O)})}finally{Q(!1)}};return r.jsxs(ir,{open:u,onOpenChange:O=>z?void 0:p(O),children:[r.jsxs("button",{type:"button",className:"shell-action inline-flex items-center gap-1.5",onClick:()=>p(!0),children:[r.jsx(ET,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Create worktree"})]}),r.jsxs(qn,{children:[r.jsxs(Yr,{children:[r.jsx(Gn,{children:"Create worktree"}),r.jsxs(ps,{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:"grid grid-cols-2 gap-1 rounded-md border border-border/70 p-1",children:[r.jsx("button",{type:"button",disabled:z,onClick:()=>fe("new-branch"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="new-branch"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"New branch from repo"}),r.jsx("button",{type:"button",disabled:z,onClick:()=>fe("branch-off"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="branch-off"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"Branch off another assignment"})]}),m==="new-branch"?r.jsxs(r.Fragment,{children:[ye?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,b?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: ",b]}):null,r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),r.jsx("select",{className:Wm,value:k,onChange:O=>v(O.target.value),disabled:z||x===null||j,children:(x??[]).map(O=>r.jsxs("option",{value:O.path,children:[O.path,O.source==="project"?" (project)":O.sourceAssignmentSlug?` (sibling — ${O.sourceAssignmentSlug})`:" (sibling)"]},`${O.source}:${O.path}`))}),ye?null:r.jsx("button",{type:"button",className:"justify-self-start text-[11px] text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:z,onClick:()=>C(O=>!O),children:j?"Use a listed repository":"Enter a custom repository path (advanced)"}),j?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:N,onChange:O=>T(O.target.value),disabled:z}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Parent branch"}),r.jsx("select",{className:Wm,value:M,onChange:O=>U(O.target.value),disabled:z||$||L.length===0,children:$?r.jsx("option",{value:"",children:"Loading branches…"}):L.length===0?r.jsx("option",{value:"",children:J?"Could not load branches":V?"No branches found":"— pick a repository —"}):L.map(O=>r.jsx("option",{value:O,children:O},O))}),J?r.jsxs("span",{className:"text-[11px] text-error-foreground",children:["Could not load branches: ",J]}):null]})]}):r.jsxs(r.Fragment,{children:[q?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 assignments: ",q]}):null,ke?r.jsx("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:"No other assignments with a configured workspace to branch off. Create a worktree for one first, or use “New branch from repo”."}):r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Source assignment"}),r.jsxs("select",{className:Wm,value:le,onChange:O=>Ve(O.target.value),disabled:z||X===null,children:[r.jsx("option",{value:"",children:"— select an assignment —"}),(X??[]).map(O=>r.jsxs("option",{value:O.id,children:[O.title," (",O.branch,")"]},O.id))]})]}),me?r.jsxs("div",{className:"grid gap-2 rounded-md border border-border/70 bg-muted/40 px-3 py-2 text-xs",children:[r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Repository (from source)"}),r.jsx("code",{className:"break-all",children:me.repository})]}),r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Parent branch (from source)"}),r.jsx("code",{children:me.branch})]})]}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"New branch name"}),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:G,onChange:O=>A(O.target.value),disabled:z}),ne?r.jsx("span",{className:"text-[11px] text-error-foreground",children:ne}):null]}),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 break-all",children:de||r.jsx("span",{className:"opacity-60",children:"— pick a repo & branch —"})})]}),I?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:I.message}),I.stderr?r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-[11px] opacity-90",children:I.stderr}):null]}):null]}),r.jsxs(As,{children:[r.jsx(X3,{disabled:z,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",disabled:pe,onClick:()=>void Re(),className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:z?"Working…":"Create worktree"})]})]})]})}function i6(e){const t=e.split(`
|
|
533
|
+
`),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 i=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(`
|
|
534
|
+
`).replace(/\n{3,}/g,`
|
|
535
|
+
|
|
536
|
+
`).trim();return{acceptanceCriteria:i,summaryBody:l}}function a6(e){const t=e.split(`
|
|
537
|
+
`),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 i=t.slice(n+1,s).join(`
|
|
538
|
+
`).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
|
|
539
|
+
|
|
540
|
+
`).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
541
|
+
`).replace(/\n{3,}/g,`
|
|
542
|
+
|
|
543
|
+
`).trim();return{hasSection:!0,todosMarkdown:i,remaining:l}}function l6({projectSlug:e,dependencies:t,blockedReason:n}){const[s,i]=f.useState(!1);if(t.length===0)return null;const l=t.filter(u=>u.status!=="completed"&&u.status!=="review"),c=l.length===0;return c&&!s?r.jsxs("button",{type:"button",onClick:()=>i(!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(Kh,{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(cs,{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(th,{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(Me,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?r.jsx("button",{type:"button",onClick:()=>i(!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(u=>r.jsxs(Ne,{to:`/projects/${e}/assignments/${u.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(vn,{status:u.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:u.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.slug})]}),u.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:u.assignee}),r.jsx(Ku,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},u.slug))})})]})}function c6({links:e}){const t=ln();if(e.length===0)return null;const n=e.filter(i=>!i.isReverse),s=e.filter(i=>i.isReverse);return r.jsx(Me,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:r.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(i=>r.jsxs(Ne,{to:`${t}/projects/${i.projectSlug}/assignments/${i.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(qj,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(vn,{status:i.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:i.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:i.slug})]}),r.jsx(Ku,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${i.slug}`)),s.map(i=>r.jsxs(Ne,{to:`${t}/projects/${i.projectSlug}/assignments/${i.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(Kj,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(vn,{status:i.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:i.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:i.slug})]}),r.jsx(Ku,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${i.slug}`))]})})}function u6(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 i=t.get(s.id);s.replyTo&&t.has(s.replyTo)?t.get(s.replyTo).replies.push(i):n.push(i)}return n}function d6(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function EN({projectSlug:e,assignmentSlug:t,entries:n}){const[s,i]=f.useState(n);f.useEffect(()=>{i(n)},[n]);const l=f.useMemo(()=>u6(s),[s]),[c,u]=f.useState(""),[p,m]=f.useState("note"),[h,x]=f.useState(!1),[y,b]=f.useState(null);async function E(v){var N;if(v.preventDefault(),!c.trim())return;x(!0),b(null);const j=`tmp-${Date.now()}`,C={id:j,timestamp:new Date().toISOString(),author:"human",type:p,body:c,resolved:p==="question"?!1:void 0};i(T=>[...T,C]);try{const T=await fetch(d6(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!T.ok){const $=await T.text();throw new Error($||`HTTP ${T.status}`)}const L=await T.json().catch(()=>null),P=(N=L==null?void 0:L.comment)==null?void 0:N.id;i($=>$.map(D=>D.id===j?{...D,id:P??D.id}:D)),u(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(T){b(T instanceof Error?T.message:String(T)),i(L=>L.filter(P=>P.id!==j))}finally{x(!1)}}async function k(v,j){i(C=>C.map(N=>N.id===v?{...N,resolved:j}:N));try{const C=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(v)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(v)}/resolved`,N=await fetch(C,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:j})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(C){b(C instanceof Error?C.message:String(C)),i(N=>N.map(T=>T.id===v?{...T,resolved:!j}:T))}}return r.jsx(Me,{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(v=>r.jsx(TN,{node:v,onToggleResolved:k,depth:0},v.entry.id)),r.jsxs("form",{onSubmit:E,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:v=>u(v.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:p,onChange:v=>m(v.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:h||!c.trim(),className:"shell-action",children:h?"Posting…":"Post comment"}),y?r.jsx("span",{className:"text-xs text-error-foreground",children:y}):null]})]})]})})}function TN({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:i}=e,l=s.type==="question";return r.jsxs("div",{className:Te("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:Te("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:Te("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(Kh,{className:"h-3 w-3"}):r.jsx(yT,{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(MT,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(fn,{content:s.body}),i.length>0?r.jsx("div",{className:"space-y-2",children:i.map(c=>r.jsx(TN,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const f6=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function aj(){var Be,Ge,it,Kt,xt,tn,Nt,yt,kt;const{slug:e,aslug:t}=Lt(),n=$t(),s=ln(),[i,l]=fs(),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(null),[y,b]=f.useState(null),[E,k]=f.useState(null),[v,j]=f.useState(!1),[C,N]=f.useState(!1),[T,L]=f.useState(0),P=i.get("tab")??"summary",$=Ko(),{data:D,loading:J,error:ee,refetch:M}=_P(e,t),{data:U}=k0(e),{data:X}=sg(),{data:B,loading:q,error:Z}=FP(e,t),{data:le,loading:_,error:G}=BP(e,t),A=f.useMemo(()=>{if(!D||!U)return[];const he=new Map(U.assignments.map(Ze=>[Ze.slug,Ze]));return D.dependsOn.map(Ze=>{const Je=he.get(Ze);return{slug:Ze,title:(Je==null?void 0:Je.title)??Ze,status:(Je==null?void 0:Je.status)??"pending",priority:(Je==null?void 0:Je.priority)??"medium",assignee:(Je==null?void 0:Je.assignee)??null}})},[D,U]),z=A.filter(he=>he.status!=="completed"&&he.status!=="review");uo("assignment");const Q=f.useMemo(()=>((U==null?void 0:U.assignments)??[]).map(he=>he.slug),[U]),I=t?Q.indexOf(t):-1,ue=I>0?Q[I-1]:null,me=I>=0&&I<Q.length-1?Q[I+1]:null,V=`${s}/projects/${e}/assignments/${t}`;zt({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${V}/edit`)}),zt({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${V}/plan/edit`)}),zt({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${V}/handoff/edit`)}),zt({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${V}/decision-record/edit`)}),zt({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${V}/scratchpad/edit`)}),zt({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!ue,handler:()=>ue&&n(`${s}/projects/${e}/assignments/${ue}`)}),zt({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!me,handler:()=>me&&n(`${s}/projects/${e}/assignments/${me}`)});const ne=f.useMemo(()=>D?i6(D.body):{acceptanceCriteria:[],summaryBody:""},[D]),de=f.useMemo(()=>a6(ne.summaryBody),[ne.summaryBody]),ye=ne.acceptanceCriteria,ke=ye.filter(he=>he.checked).length,fe=ye.length>0&&ke===ye.length,Ve=f.useRef(fe),pe=f.useRef(!1);if(f.useEffect(()=>{if(D){if(!pe.current){Ve.current=fe,pe.current=!0;return}fe&&!Ve.current&&L(he=>he+1),Ve.current=fe}},[fe,D]),J)return r.jsx(ft,{label:"Loading assignment workspace…"});if(ee||!D||!e||!t)return r.jsx(mt,{error:ee||"Assignment not found."});const Re=e,O=t,W=ye.length>0?{checked:ke,total:ye.length}:void 0,te=D.availableTransitions??[],xe=te.filter(he=>!he.disabled&&he.targetStatus!==D.status),Ae=f6.map(he=>xe.find(Ze=>Ze.command===he)).find(Boolean)??xe[0]??null,Ee=[];if(X!=null&&X.sessions)for(const he of X.sessions)for(const Ze of he.windows)for(const Je of Ze.panes)((Be=Je.assignment)==null?void 0:Be.project)===e&&((Ge=Je.assignment)==null?void 0:Ge.slug)===t&&Ee.push({sessionName:he.name,command:Je.command,urls:Je.urls});async function et(he){u(null);try{await jN(Re,O,he),M()}catch(Ze){u(Ze.message)}}async function Ye(he){u(null);try{const Ze=await fetch(`/api/projects/${Re}/assignments/${O}/${he?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!Ze.ok){const Je=await Ze.json().catch(()=>null);throw new Error((Je==null?void 0:Je.error)||`HTTP ${Ze.status}`)}M()}catch(Ze){u(Ze.message)}}async function St(){N(!0);try{await YF(Re,O),n(`${s}/projects/${Re}`)}catch(he){u(he.message),N(!1),j(!1)}}async function Bt(he,Ze){u(null),m(he.command);try{return await wN(Re,O,he,Ze),M(),!0}catch(Je){return u(Je.message),!1}finally{m(null)}}function st(he){if(kN(he)){x(he);return}Bt(he)}async function ae(he,Ze){b(null),k(he);try{const Je=await fetch(`/api/projects/${Re}/assignments/${O}/acceptance-criteria/${he}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Ze})}),nn=await Je.json();if(!Je.ok)throw new Error(nn.error||`HTTP ${Je.status}`);M()}catch(Je){b(Je.message)}finally{k(null)}}const be=[...xe.filter(he=>he!==Ae).map(he=>({key:`transition-${he.command}`,label:he.label,onSelect:()=>st(he),disabled:p===he.command})),...te.filter(he=>he.disabled||he.targetStatus===D.status).map(he=>({key:`transition-${he.command}`,label:he.label,disabled:!0,disabledReason:he.targetStatus===D.status?`Already ${D.status.replace(/_/g," ")}`:he.disabledReason??he.warning??he.description})),...$.statuses.map(he=>({key:`override-${he.id}`,label:`Override → ${he.label}`,onSelect:()=>et(he.id),disabled:he.id===D.status,disabledReason:he.id===D.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:CT,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:zT,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:sm,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:Ku,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:PT,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:D.archived?"unarchive":"archive",label:D.archived?"Restore assignment":"Archive assignment",icon:D.archived?Wu:jd,onSelect:()=>Ye(!D.archived)},{key:"delete",label:"Delete assignment",icon:Kn,destructive:!0,onSelect:()=>j(!0)}],Le=(Ae==null?void 0:Ae.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(vn,{status:D.status,progress:W}),r.jsx(da,{type:D.type}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:D.title}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",c0(D.updated)]}),z.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",z.length," unmet dep",z.length===1?"":"s"]}),r.jsx(Fg,{externalIds:D.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(vN,{target:{kind:"assignment",id:D.id},worktreePath:((it=D.workspace)==null?void 0:it.worktreePath)??null,repository:((Kt=D.workspace)==null?void 0:Kt.repository)??null}),!((xt=D.workspace)!=null&&xt.worktreePath)&&e&&t&&r.jsx(CN,{projectSlug:e,assignmentSlug:t,defaultBranch:`syntaur/${e}/${t}`,onCreated:()=>M()}),Ae&&r.jsx("button",{type:"button",title:Ae.warning||Ae.description,disabled:p===Ae.command,onClick:()=>st(Ae),className:Te("shell-action disabled:cursor-not-allowed disabled:opacity-50",Ae.warning&&"border-warning-foreground/40",Le&&T>0&&"send-to-review-glow"),children:r.jsx("span",{children:p===Ae.command?"Working…":Ae.label})},Le?`review-${T}`:Ae.command),r.jsx(Lg,{items:be,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,D.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:"})," ",D.blockedReason]}):null]}),A.length>0&&r.jsx(l6,{projectSlug:e,dependencies:A,blockedReason:D.blockedReason}),D.enrichedLinks&&D.enrichedLinks.length>0&&r.jsx(c6,{links:D.enrichedLinks}),D.referencedBy&&D.referencedBy.length>0&&r.jsx(Me,{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:D.referencedBy.map(he=>{const Ze=he.sourceProjectSlug===null?`/assignments/${he.sourceId}`:`${s}/projects/${he.sourceProjectSlug}/assignments/${he.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ne,{to:Ze,className:"text-foreground hover:text-primary",children:he.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",he.mentions," mention",he.mentions===1?"":"s",")"]}),he.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]},he.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(Bg,{value:P,onValueChange:he=>l({tab:he}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[ne.acceptanceCriteria.length>0?r.jsx(Me,{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,ne.acceptanceCriteria.map((he,Ze)=>{const Je=E!==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:he.checked,disabled:Je,onChange:nn=>ae(Ze,nn.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":he.checked,children:he.text})]},`${Ze}-${he.text}`)})]})}):null,de.hasSection?r.jsx(Me,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(fn,{content:de.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(Me,{title:"Assignment Summary",children:r.jsx(fn,{content:de.remaining,emptyState:ne.acceptanceCriteria.length>0||de.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:D.plan?1:0,content:D.plan?r.jsx("div",{className:"space-y-5",children:r.jsxs(Me,{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(Ne,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[r.jsx(sm,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(vn,{status:D.plan.status})}),r.jsx(fn,{content:D.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(ct,{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:D.scratchpad?1:0,content:D.scratchpad?r.jsx(Me,{title:"Scratchpad",actions:r.jsxs(Ne,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(sm,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(fn,{content:D.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(ct,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((tn=D.handoff)==null?void 0:tn.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.handoff?r.jsx(Me,{children:r.jsx(fn,{content:D.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(ct,{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:((Nt=D.progress)==null?void 0:Nt.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.progress&&D.progress.entries.length>0?r.jsx(Me,{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:D.progress.entries.map((he,Ze)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:he.timestamp}),r.jsx(fn,{content:he.body})]},`${he.timestamp}-${Ze}`))})}):r.jsx(ct,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((yt=D.comments)==null?void 0:yt.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.comments&&D.comments.entries.length>0?r.jsx(EN,{projectSlug:e,assignmentSlug:t,entries:D.comments.entries}):r.jsx(ct,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((kt=D.decisionRecord)==null?void 0:kt.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.decisionRecord?r.jsx(Me,{children:r.jsx(fn,{content:D.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(ct,{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(Me,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Qs,{label:"ID",value:D.id,copyable:!0}),r.jsx(Qs,{label:"Priority",value:D.priority}),D.assignee&&r.jsx(Qs,{label:"Assignee",value:D.assignee}),r.jsx(Qs,{label:"Updated",value:`${l0(D.updated)} · Created ${a0(D.created)}`}),D.workspace.repository&&r.jsx(Qs,{label:"Repository",value:D.workspace.repository,copyable:!0}),D.workspace.worktreePath&&r.jsx(Qs,{label:"Worktree",value:D.workspace.worktreePath,copyable:!0}),D.workspace.branch&&r.jsx(Qs,{label:"Branch",value:D.workspace.branch,copyable:!0}),D.workspace.parentBranch&&r.jsx(Qs,{label:"Parent branch",value:D.workspace.parentBranch,copyable:!0}),D.externalIds.map((he,Ze)=>r.jsx(p6,{entry:he},`${he.system}:${he.id}:${Ze}`))]})}),Ee.length>0&&r.jsx(Me,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:Ee.map((he,Ze)=>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:he.command}),r.jsx("span",{className:"text-xs text-muted-foreground",children:he.sessionName}),he.urls.map(Je=>r.jsxs("a",{href:Je,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[Je.replace("http://localhost:",":"),r.jsx(aa,{className:"h-2.5 w-2.5"})]},Je))]},Ze))})}),r.jsx(xN,{sessions:B==null?void 0:B.sessions,loading:q,error:Z}),r.jsx(yN,{summary:le==null?void 0:le.summary,loading:_,error:G})]})]}),r.jsx(bN,{open:h!==null,action:h,assignmentTitle:D.title,loading:p===(h==null?void 0:h.command),onOpenChange:he=>{he||x(null)},onConfirm:async he=>{if(!h)return;await Bt(h,he)&&x(null)}}),r.jsx(va,{open:v,title:"Delete assignment?",description:`This will permanently delete "${D.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:C,onOpenChange:he=>{he||j(!1)},onConfirm:St})]})}function Qs({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:"block min-w-0 truncate",title:t,children:t}),n&&t!=="—"&&r.jsx(Ar,{value:t})]})]})}function p6({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(aa,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function m6(){var N,T,L,P,$,D,J,ee;const{id:e}=Lt(),[t,n]=fs(),s=t.get("tab")??"summary",{data:i,loading:l,error:c,refetch:u}=MP(e),{data:p,loading:m,error:h}=zP(e),{data:x,loading:y,error:b}=UP(i==null?void 0:i.slug),[E,k]=f.useState(!1),[v,j]=f.useState(null);async function C(M){if(e){j(null);try{const U=await fetch(`/api/assignments/${e}/${M?"archive":"unarchive"}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!U.ok){const X=await U.json().catch(()=>null);throw new Error((X==null?void 0:X.error)||`HTTP ${U.status}`)}u()}catch(U){j(U instanceof Error?U.message:"Archive failed")}}}return l?r.jsx(ft,{}):c?r.jsx(mt,{error:c}):i?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(vn,{status:i.status}),r.jsx(da,{type:i.type}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:i.id}),r.jsx(Fg,{externalIds:i.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(vN,{target:{kind:"assignment",id:i.id},worktreePath:((N=i.workspace)==null?void 0:N.worktreePath)??null,repository:((T=i.workspace)==null?void 0:T.repository)??null,size:"compact"}),!((L=i.workspace)!=null&&L.worktreePath)&&r.jsx(CN,{assignmentId:i.id,defaultBranch:`syntaur/${i.slug}`,onCreated:()=>u()}),r.jsxs("button",{type:"button",onClick:()=>k(!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(Yl,{className:"h-3 w-3"}),"Move to workspace…"]}),r.jsx(Ne,{to:`/assignments/${i.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.jsxs("button",{type:"button",onClick:()=>C(!i.archived),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",title:i.archived?"Restore this assignment":"Archive this assignment",children:[i.archived?r.jsx(Wu,{className:"h-3 w-3"}):r.jsx(jd,{className:"h-3 w-3"}),i.archived?"Restore":"Archive"]})]})]}),r.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:i.title}),i.blockedReason?r.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",i.blockedReason]}):null,v?r.jsx("p",{className:"text-sm text-status-failed-foreground",children:v}):null]}),r.jsx(Me,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Zs,{label:"ID",value:i.id,copyable:!0}),r.jsx(Zs,{label:"Priority",value:i.priority}),i.assignee&&r.jsx(Zs,{label:"Assignee",value:i.assignee}),r.jsx(Zs,{label:"Updated",value:`${l0(i.updated)} · Created ${a0(i.created)}`}),i.workspace.repository&&r.jsx(Zs,{label:"Repository",value:i.workspace.repository,copyable:!0}),i.workspace.worktreePath&&r.jsx(Zs,{label:"Worktree",value:i.workspace.worktreePath,copyable:!0}),i.workspace.branch&&r.jsx(Zs,{label:"Branch",value:i.workspace.branch,copyable:!0}),i.workspace.parentBranch&&r.jsx(Zs,{label:"Parent branch",value:i.workspace.parentBranch,copyable:!0}),i.externalIds.map((M,U)=>r.jsx(h6,{entry:M},`${M.system}:${M.id}:${U}`))]})}),i.referencedBy&&i.referencedBy.length>0?r.jsx(Me,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:i.referencedBy.map(M=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ne,{to:M.sourceProjectSlug===null?`/assignments/${M.sourceId}`:`/projects/${M.sourceProjectSlug}/assignments/${M.sourceSlug}`,className:"text-foreground hover:text-primary",children:M.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",M.mentions," mention",M.mentions===1?"":"s",")"]})]},M.sourceId))})}):null,r.jsx(xN,{sessions:p==null?void 0:p.sessions,loading:m,error:h}),r.jsx(yN,{summary:x==null?void 0:x.summary,loading:y,error:b}),r.jsx(Bg,{value:s,onValueChange:M=>n({tab:M}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Me,{title:"Assignment",children:r.jsx(fn,{content:i.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((P=i.progress)==null?void 0:P.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.progress&&i.progress.entries.length>0?r.jsx(Me,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:r.jsx("ol",{className:"space-y-4",children:i.progress.entries.map((M,U)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:M.timestamp}),r.jsx(fn,{content:M.body})]},`${M.timestamp}-${U}`))})}):r.jsx(ct,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:(($=i.comments)==null?void 0:$.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(EN,{projectSlug:null,assignmentSlug:i.id,entries:((D=i.comments)==null?void 0:D.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:i.plan?r.jsxs(Me,{children:[r.jsx(fn,{content:i.plan.body,emptyState:"Plan file exists but is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ne,{to:`/assignments/${i.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(ct,{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:i.scratchpad?r.jsxs(Me,{children:[r.jsx(fn,{content:i.scratchpad.body,emptyState:"Scratchpad is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ne,{to:`/assignments/${i.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(ct,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((J=i.handoff)==null?void 0:J.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.handoff?r.jsxs(Me,{children:[r.jsx(fn,{content:i.handoff.body,emptyState:"No handoff history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ne,{to:`/assignments/${i.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(ct,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((ee=i.decisionRecord)==null?void 0:ee.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.decisionRecord?r.jsxs(Me,{children:[r.jsx(fn,{content:i.decisionRecord.body,emptyState:"No decision history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ne,{to:`/assignments/${i.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(ct,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(Mg,{open:E,onOpenChange:k,currentWorkspace:i.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async M=>{const U=await fetch(`/api/assignments/${encodeURIComponent(i.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:M})});if(!U.ok){const X=await U.json().catch(()=>({}));throw new Error(X.error||"Failed to move assignment")}u()}})]}):r.jsx(mt,{error:"Assignment not found"})}function Zs({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(Ar,{value:t})]})]})}function h6({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(aa,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function g6({currentStatus:e,availableTransitions:t,onSelect:n,disabled:s=!1}){const[i,l]=f.useState(!1),[c,u]=f.useState(null),[p,m]=f.useState(0),h=f.useRef(null),x=f.useRef(null),y=f.useId(),b=ad(e),E=b.icon,k=f.useCallback(T=>{l(!1),T&&requestAnimationFrame(()=>{var L;(L=h.current)==null||L.focus()})},[]),v=f.useCallback(()=>{var L;const T=(L=h.current)==null?void 0:L.getBoundingClientRect();T&&u({top:T.top,left:T.left,width:T.width,bottom:T.bottom})},[]);f.useLayoutEffect(()=>{i&&v()},[i,v]),f.useEffect(()=>{if(!i)return;const T=()=>v();return window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[i,v]),f.useEffect(()=>{if(!i)return;const T=L=>{var $,D;const P=L.target;P&&(($=x.current)!=null&&$.contains(P)||(D=h.current)!=null&&D.contains(P)||k(!1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[i,k]),f.useEffect(()=>{i&&m(0)},[i,t.length]);function j(T){(T.key==="Enter"||T.key===" "||T.key==="ArrowDown")&&(T.preventDefault(),l(!0))}function C(T){if(t.length===0){T.key==="Escape"&&(T.preventDefault(),k(!0));return}if(T.key==="ArrowDown")T.preventDefault(),m(L=>(L+1)%t.length);else if(T.key==="ArrowUp")T.preventDefault(),m(L=>(L-1+t.length)%t.length);else if(T.key==="Home")T.preventDefault(),m(0);else if(T.key==="End")T.preventDefault(),m(t.length-1);else if(T.key==="Enter"){T.preventDefault();const L=t[p];L&&(n(L),k(!0))}else T.key==="Escape"&&(T.preventDefault(),k(!0))}function N(T){n(T),k(!1)}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:h,type:"button","data-no-drag":!0,disabled:s,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?y:void 0,onClick:()=>{s||l(T=>!T)},onKeyDown:j,title:`Status: ${b.label}. Click to change.`,className:Te(N1(e),"cursor-pointer transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",s&&"cursor-not-allowed opacity-60"),children:[r.jsx(E,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:b.label})]}),i&&c&&typeof document<"u"?Cs.createPortal(r.jsx("div",{ref:x,id:y,role:"menu",tabIndex:-1,autoFocus:!0,onKeyDown:C,style:{position:"fixed",top:c.bottom+6,left:c.left,minWidth:Math.max(c.width,180),zIndex:60},className:"rounded-md border border-border/70 bg-popover py-1 text-sm text-popover-foreground shadow-lg",children:t.length===0?r.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No transitions available from this status."}):t.map((T,L)=>{const P=ad(T.targetStatus),$=P.icon,D=L===p;return r.jsxs("button",{type:"button",role:"menuitem","data-no-drag":!0,onMouseEnter:()=>m(L),onClick:()=>N(T),title:T.warning||T.description,className:Te("flex w-full flex-col items-stretch gap-0.5 px-3 py-1.5 text-left text-sm transition",D?"bg-foreground/5":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:"flex items-center justify-between gap-2",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r.jsx($,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate",children:T.label})]}),r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:P.label})]}),T.warning?r.jsx("span",{className:"text-[11px] leading-snug text-warning-foreground",children:T.warning}):null]},`${T.command}:${T.targetStatus}`)})}),document.body):null]})}function x6({title:e,detailHref:t,onSave:n,disabled:s=!1}){const[i,l]=f.useState(!1);return i?r.jsx(y6,{initialTitle:e,disabled:s,onSave:n,onExit:()=>l(!1)}):r.jsxs("div",{className:"group flex items-baseline gap-1.5",children:[r.jsx("button",{type:"button","data-no-drag":!0,disabled:s,onClick:()=>{s||l(!0)},className:Te("text-left text-base font-semibold text-foreground transition hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",s&&"cursor-not-allowed opacity-60"),title:"Click to rename",children:e}),r.jsx(Ne,{to:t,"data-no-drag":!0,"aria-label":"Open detail page",title:"Open detail page",onClick:c=>c.stopPropagation(),className:"text-muted-foreground opacity-0 transition group-hover:opacity-100 focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",children:r.jsx(aa,{className:"h-3.5 w-3.5"})})]})}function y6({initialTitle:e,disabled:t,onSave:n,onExit:s}){const i=f.useRef(e),[l,c]=f.useState(e),[u,p]=f.useState(!1),[m,h]=f.useState(!1),x=f.useRef(null),y=f.useRef(!1);f.useEffect(()=>{const v=x.current;v&&(v.focus(),v.select())},[]);const b=f.useCallback(()=>{var v;h(!0),window.setTimeout(()=>h(!1),260),(v=x.current)==null||v.focus()},[]),E=f.useCallback(async()=>{if(y.current)return;const v=l.trim();if(v.length===0){b();return}if(v===i.current){s();return}y.current=!0,p(!0);try{await n(v)}catch{}finally{p(!1),s()}},[l,s,n,b]);function k(v){v.key==="Enter"?(v.preventDefault(),E()):v.key==="Escape"&&(v.preventDefault(),y.current=!0,s())}return r.jsx("input",{ref:x,type:"text","data-no-drag":!0,disabled:t||u,value:l,onChange:v=>c(v.target.value),onKeyDown:k,onBlur:()=>void E(),className:Te("w-full rounded-sm border border-border bg-background px-1.5 py-0.5 text-base font-semibold text-foreground outline-none transition focus:border-ring focus:ring-1 focus:ring-ring",m&&"syntaur-input-shake",u&&"opacity-70")})}const lj=vg;function cj(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function b6(e,t){return e.toString()===t.toString()}function uj(){const{workspace:e}=Lt(),t=ln(),n=$t(),s=f.useRef(null);uo("list:assignments");const{data:i,loading:l,error:c,refetch:u}=Td(),p=Ko(),m=qd(),[h,x]=fs(),y=e?`w:${e}`:null,b=aN(y),E=f.useRef(void 0),k=f.useMemo(()=>E1(p.order),[p]),v=f.useMemo(()=>{const F={};for(const oe of k)F[oe]=ec(p,oe);return F},[k,p]),j=f.useMemo(()=>k.map(F=>({id:F,title:v[F]??F,description:Hd(F)})),[k,v]),C=f.useMemo(()=>m.definitions.map(F=>({id:F.id,title:Yi(m,F.id),description:F.description})),[m]),N="__unknown_type__",T=f.useMemo(()=>new Set(["all",...k]),[k]),L=h.get("view"),P=h.get("status"),$=h.get("stale"),D=L&&lj.includes(L)?L:"kanban";function J(F){if(!F)return[];const oe=[];for(const ge of F.split(",")){const De=ge.trim();!De||De==="all"||!T.has(De)||oe.includes(De)||oe.push(De)}return oe}const ee=f.useCallback(F=>{x(oe=>{const ge=new URLSearchParams(oe);return F==="kanban"?ge.delete("view"):ge.set("view",F),ge})},[x]),[M,U]=f.useState(""),[X,B]=f.useState(()=>J(P)),[q,Z]=f.useState(()=>qe(b.filters.priority)),[le,_]=f.useState(()=>qe(b.filters.type)),[G,A]=f.useState(()=>qe(b.filters.assignee)),[z,Q]=f.useState(()=>qe(b.filters.project)),[I,ue]=f.useState(()=>qe(b.filters.tags)),[me,V]=f.useState(null),[ne,de]=f.useState(()=>cj($)),[ye,ke]=f.useState(()=>b.sortField),[fe,Ve]=f.useState(()=>b.sortDirection),[pe,Re]=f.useState(()=>({hidden:[]})),[O,W]=f.useState(()=>({hidden:[]})),[te,xe]=f.useState(()=>b.grouping),Ae=te==="type"?"type":"status",[Ee,et]=f.useState(()=>new Set),[Ye,St]=f.useState([]),{toast:Bt,showToast:st,dismissToast:ae}=xx(),[be,Le]=f.useState(null),[Be,Ge]=f.useState(null),[it,Kt]=f.useState(null),[xt,tn]=f.useState(null),[Nt,yt]=f.useState(null),[kt,he]=f.useState(null),[Ze,Je]=f.useState(null),[nn,Ct]=f.useState(null),[jt,Ut]=f.useState(null),[An,qt]=f.useState(!1),[rn,Vt]=f.useState(!1),Yn=e?{kind:"workspace",workspace:e}:{kind:"global"},ut=h.get("loadView"),{view:wn,loading:Et,error:re}=na(ut),{view:Pe,loading:He,error:It}=na(jt),mn=f.useRef(null);f.useEffect(()=>{St((i==null?void 0:i.assignments)??[])},[i]),f.useEffect(()=>{jt&&!He&&!It&&!Pe&&Ut(null)},[Pe,It,jt,He]),f.useEffect(()=>{Ut(null),mn.current=null,V(null),U("")},[e]),f.useEffect(()=>{const F=J(P);WA(F,X)||B(F);const oe=cj($);oe!==ne&&de(oe)},[ne,$,X,P]),f.useEffect(()=>{E.current===y&&x(F=>{const oe=new URLSearchParams(F);return X.length===0?oe.delete("status"):oe.set("status",X.join(",")),ne==="all"?oe.delete("stale"):ne==="stale"?oe.set("stale","1"):oe.set("stale","0"),b6(F,oe)?F:oe})},[ne,y,x,X]),f.useEffect(()=>{Z(qe(b.filters.priority)),_(qe(b.filters.type)),A(qe(b.filters.assignee)),Q(qe(b.filters.project)),ue(qe(b.filters.tags)),ke(b.sortField),Ve(b.sortDirection),xe(b.grouping)},[b.filters.priority,b.filters.type,b.filters.assignee,b.filters.project,b.filters.tags,b.sortField,b.sortDirection,b.grouping]),f.useEffect(()=>{if(E.current===y)return;let F=!1;return mx().then(oe=>{if(F||E.current===y)return;const ge=_k(oe,y),De=ge.defaultView,tt=qe(ge.filters.status),at=ge.filters.activity??"all",dt=new URLSearchParams(window.location.search);let cn=!1;const sn=new URLSearchParams(dt);dt.get("view")===null&&De!=="kanban"&&lj.includes(De)&&(sn.set("view",De),cn=!0),dt.get("status")===null&&tt.length>0&&(sn.set("status",tt.join(",")),B(tt),cn=!0),dt.get("stale")===null&&at!=="all"&&(sn.set("stale",at==="stale"?"1":"0"),de(at),cn=!0),cn&&x(sn,{replace:!0}),queueMicrotask(()=>{E.current=y})}),()=>{F=!0}},[y]);const bt=f.useCallback(F=>{(y===null?cN(F):uN(y,F)).catch(ge=>{console.warn("Failed to persist view prefs:",ge)})},[y]),hf=f.useCallback(F=>{ee(F),bt({defaultView:F})},[ee,bt]),Sa=f.useCallback(F=>{B(F),bt({filters:{status:F}})},[bt]),Ir=f.useCallback(F=>{Z(F),bt({filters:{priority:F}})},[bt]),Go=f.useCallback(F=>{_(F),bt({filters:{type:F}})},[bt]),Yo=f.useCallback(F=>{A(F),bt({filters:{assignee:F}})},[bt]),Na=f.useCallback(F=>{Q(F),bt({filters:{project:F}})},[bt]),Jo=f.useCallback(F=>{ue(F),bt({filters:{tags:F}})},[bt]),Xo=f.useCallback(F=>{de(F),bt({filters:{activity:F}})},[bt]),Qo=f.useCallback(F=>{ke(F),bt({sortField:F})},[bt]),po=f.useCallback(F=>{Ve(F),bt({sortDirection:F})},[bt]),gf=f.useCallback(F=>{xe(F),bt({grouping:F})},[bt]),Zo=f.useCallback(()=>({viewMode:D,filters:{status:X,priority:q,type:le,assignee:G,project:z,tags:I,activity:ne,dateRange:Hl(me),search:M},sortField:ye,sortDirection:fe,listSectionVisibility:{collapsed:[...Ee]},kanbanColumnVisibility:pe,tableColumnVisibility:O}),[D,X,q,le,G,z,I,ne,me,M,ye,fe,Ee,pe,O]),Pt=f.useCallback(F=>{mN(F,{setViewMode:ee,setStatusFilter:Sa,setPriorityFilter:Ir,setTypeFilter:Go,setAssigneeFilter:Yo,setProjectFilter:Na,setTagsFilter:Jo,setActivityFilter:Xo,setDateRange:V,setSearch:U,setSortField:Qo,setSortDirection:po,setListSectionVisibility:oe=>et(new Set(oe.collapsed)),setKanbanColumnVisibility:Re,setTableColumnVisibility:W}),Ut(F.id)},[ee,Sa,Ir,Go,Yo,Na,Jo,Xo,Qo,po]),xf=f.useCallback(F=>{Pt(F),mn.current=F.id,x(oe=>{const ge=new URLSearchParams(oe);return ge.set("loadView",F.id),ge},{replace:!0})},[Pt,x]),Ca=f.useCallback(async F=>{try{const oe=Wl({name:F,context:{workspace:e??null,projectSlug:null},state:Zo()}),ge=await td(oe),De=ge.views[ge.views.length-1];Ut((De==null?void 0:De.id)??null),De&&(mn.current=De.id,x(tt=>{const at=new URLSearchParams(tt);return at.set("loadView",De.id),at},{replace:!0})),qt(!1),Vt(!1),st(`Saved view "${F}"`,"success")}catch(oe){throw st(oe instanceof Error?oe.message:"Failed to save view","error"),oe}},[Zo,x,st,e]),lc=f.useCallback(async()=>{if(!(!jt||!Pe))try{const F=Wl({name:Pe.name,context:{workspace:e??null,projectSlug:null},state:Zo()}),oe=gx(Pe.config,F.config,F.config);await Od(jt,{config:oe}),st("View updated","success")}catch(F){st(F instanceof Error?F.message:"Failed to update view","error")}},[Zo,Pe,jt,st,e]);f.useEffect(()=>{if(!ut){mn.current=null;return}if(mn.current!==ut&&(jt&&jt!==ut&&Ut(null),!Et)){if(re){st("Couldn't load saved view — try again","error");return}if(wn){mn.current=ut,Pt(wn),x(F=>{const oe=new URLSearchParams(F);return oe.delete("loadView"),oe},{replace:!0});return}mn.current=ut,st("Saved view no longer exists","error"),x(F=>{const oe=new URLSearchParams(F);return oe.delete("loadView"),oe},{replace:!0})}},[ut,wn,Et,re,jt,Pt,x,st]);const Bn=f.useMemo(()=>Ye.filter(F=>e?e==="_ungrouped"?F.projectWorkspace===null:F.projectWorkspace===e:!0),[Ye,e]),yf=f.useMemo(()=>Array.from(new Set(Bn.map(F=>F.status))).sort(),[Bn]),cc=f.useMemo(()=>Array.from(new Set(Bn.map(F=>F.priority))).sort(),[Bn]),ei=f.useMemo(()=>Array.from(new Set(Bn.map(F=>F.assignee??"__unassigned__"))).sort(),[Bn]),br=f.useMemo(()=>Array.from(new Map(Bn.filter(F=>F.projectSlug!==null).map(F=>[F.projectSlug,F.projectTitle]))).sort(([,F],[,oe])=>F.localeCompare(oe)),[Bn]),bf=f.useMemo(()=>Array.from(new Set(Bn.flatMap(F=>F.tags??[]))).sort(),[Bn]),ht=f.useMemo(()=>Ye.filter(F=>Ig(F,{status:X,priority:q,type:le,assignee:G,project:z,tags:I,activity:ne,dateRange:Hl(me)},{workspace:e,search:M})),[ne,Ye,M,X,q,le,G,z,I,me,e]),mo=f.useMemo(()=>tc(ht,ye,fe),[ht,ye,fe]),Ea=f.useMemo(()=>{if(te==="none")return[{id:"__all__",label:"All assignments",items:ht}];if(te==="type"){const F=m.definitions.map(De=>({id:De.id,label:Yi(m,De.id),items:ht.filter(tt=>tt.type===De.id)})),oe=new Set(m.definitions.map(De=>De.id)),ge=ht.filter(De=>!De.type||!oe.has(De.type));return ge.length>0&&F.push({id:N,label:"Other",items:ge}),F}if(te==="priority")return["critical","high","medium","low"].map(oe=>({id:oe,label:oe.charAt(0).toUpperCase()+oe.slice(1),items:ht.filter(ge=>ge.priority===oe)}));if(te==="assignee")return Array.from(new Set(ht.map(oe=>oe.assignee??"__unassigned__"))).sort().map(oe=>({id:oe,label:oe==="__unassigned__"?"Unassigned":oe,items:ht.filter(ge=>(ge.assignee??"__unassigned__")===oe)}));if(te==="project"){const F=new Map;for(const oe of ht){const ge=oe.projectSlug??"__standalone__",De=oe.projectTitle??"Standalone";F.has(ge)||F.set(ge,De)}return Array.from(F.entries()).sort(([,oe],[,ge])=>oe.localeCompare(ge)).map(([oe,ge])=>({id:oe,label:ge,items:ht.filter(De=>(De.projectSlug??"__standalone__")===oe)}))}return k.map(F=>({id:F,label:v[F]??F,items:ht.filter(oe=>oe.status===F)}))},[te,ht,m,k,v]),vf=f.useMemo(()=>{const F=new Set(m.definitions.map(ge=>ge.id));return ht.some(ge=>!ge.type||!F.has(ge.type))?[...C,{id:N,title:"Other",description:"Assignments with no recognized type."}]:C},[C,m,ht]),{visibleItems:ti,visibleIndexByKey:ho}=f.useMemo(()=>{let F;if(D==="table")F=mo;else if(D==="kanban"){const ge=new Set(m.definitions.map(De=>De.id));Ae==="type"?F=[...m.definitions.flatMap(De=>ht.filter(tt=>tt.type===De.id)),...ht.filter(De=>!De.type||!ge.has(De.type))]:F=k.flatMap(De=>ht.filter(tt=>tt.status===De))}else F=Ea.flatMap(ge=>ge.items);const oe=new Map;return F.forEach((ge,De)=>oe.set(an(ge),De)),{visibleItems:F,visibleIndexByKey:oe}},[D,mo,Ea,Ae,m,ht,k]),{hotkeyRowProps:gs}=Xl(ti,{scope:"list:assignments",onOpen:F=>{if(F.projectSlug===null){n(`/assignments/${F.id}`);return}const oe=F.projectWorkspace?`/w/${F.projectWorkspace}`:t;n(`${oe}/projects/${F.projectSlug}/assignments/${F.slug}`)}});if(zt({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var F;return(F=s.current)==null?void 0:F.focus()}}),zt({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>u()}),l)return r.jsx(ft,{label:"Loading assignments board…"});if(c||!i)return r.jsx(mt,{error:c||"Assignments board is unavailable."});async function go({item:F,toColumnId:oe,action:ge,reason:De}){Le(an(F));const tt=Ye;St(at=>at.map(dt=>an(dt)===an(F)?{...dt,status:oe,blockedReason:oe==="blocked"?De??dt.blockedReason:null}:dt));try{if(F.projectSlug===null){if(!ge)throw new Error("Standalone assignments require a transition action, not status override.");const dt=await fetch(`/api/assignments/${encodeURIComponent(F.id)}/transitions/${encodeURIComponent(ge.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(De?{reason:De}:{})});if(!dt.ok)throw new Error((await dt.json()).error??`HTTP ${dt.status}`);const sn=(await dt.json()).assignment;St($n=>$n.map(Un=>an(Un)===an(F)?{...Un,status:sn.status,blockedReason:sn.blockedReason,availableTransitions:sn.availableTransitions,updated:sn.updated}:Un));return}const at=ge?await wN(F.projectSlug,F.slug,ge,De):await jN(F.projectSlug,F.slug,oe);return St(dt=>dt.map(cn=>an(cn)===an(F)?{...cn,status:at.status,blockedReason:at.blockedReason,availableTransitions:at.availableTransitions,updated:at.updated}:cn)),u(),!0}catch(at){return St(tt),st(at.message,"error"),!1}finally{Le(null)}}async function ni({item:F,toColumnId:oe,action:ge}){if(F.status===oe)return;const De=ge??ml(F,oe);if(De!=null&&De.disabled){st(De.disabledReason||`Cannot move this assignment to ${oe}.`,"error");return}if(De&&kN(De)){tn({item:F,toColumnId:oe,action:De});return}await go({item:F,toColumnId:oe,action:De})}async function wf(F,oe){if(oe===F.title)return;const ge=an(F),De=Ye;St(tt=>tt.map(at=>an(at)===ge?{...at,title:oe}:at)),Le(ge);try{const tt=F.projectSlug===null?await XF({id:F.id,title:oe}):await JF({projectSlug:F.projectSlug,assignmentSlug:F.slug,title:oe});St(at=>at.map(dt=>an(dt)===ge?{...dt,title:tt.title,updated:tt.updated}:dt)),u()}catch(tt){throw St(De),st(tt.message,"error"),tt}finally{Le(null)}}function Ta(F){et(oe=>{const ge=new Set(oe);return ge.has(F)?ge.delete(F):ge.add(F),ge})}function uc(F){ye===F?po(fe==="asc"?"desc":"asc"):(Qo(F),po("asc"))}const Dn=Be?Ye.find(F=>an(F)===Be)??null:null;function xo(F,oe){F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",oe),Ge(oe)}function Pa(){Ge(null),Kt(null)}function Ra(F,oe){if(!Dn)return;const ge=ml(Dn,oe);Dn.status===oe||ge!=null&&ge.disabled||(F.preventDefault(),F.dataTransfer.dropEffect="move",Kt(oe))}function vt(F,oe){it===oe&&!F.currentTarget.contains(F.relatedTarget)&&Kt(null)}function dc(F,oe){if(F.preventDefault(),!Dn||Dn.status===oe){Pa();return}Pa(),ni({item:Dn,toColumnId:oe})}function Jr({field:F,children:oe}){const ge=ye===F;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>uc(F),className:"inline-flex items-center gap-1 hover:text-foreground",children:[oe,ge?fe==="asc"?r.jsx(Yj,{className:"h-3 w-3"}):r.jsx(cs,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":b.density,children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs(Ne,{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(en,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(Og,{children:[r.jsx(Wd,{ref:s,value:M,onChange:U,placeholder:"Search assignments or projects"}),r.jsx(Pn,{ariaLabel:"Status filter",className:"max-w-[180px]",allLabel:"All statuses",options:yf.map(F=>({value:F,label:v[F]??F})),value:X,onChange:Sa}),r.jsx(Pn,{ariaLabel:"Priority filter",className:"max-w-[180px]",allLabel:"All priorities",options:cc.map(F=>({value:F,label:F[0].toUpperCase()+F.slice(1)})),value:q,onChange:Ir}),r.jsx(Pn,{ariaLabel:"Type filter",className:"max-w-[180px]",allLabel:"All types",options:m.definitions.map(F=>({value:F.id,label:Yi(m,F.id)})),value:le,onChange:Go}),r.jsx(Pn,{ariaLabel:"Assignee filter",className:"max-w-[180px]",allLabel:"All assignees",options:[{value:"__unassigned__",label:"Unassigned"},...ei.filter(F=>F!=="__unassigned__").map(F=>({value:F,label:F}))],value:G,onChange:Yo}),r.jsx(Pn,{ariaLabel:"Project filter",className:"max-w-[180px]",allLabel:"All projects",options:[{value:"__standalone__",label:"Standalone"},...br.map(([F,oe])=>({value:F,label:oe}))],value:z,onChange:Na}),r.jsx(Pn,{ariaLabel:"Tags filter",className:"max-w-[180px]",allLabel:"Any tags",options:bf.map(F=>({value:F,label:F})),value:I,onChange:Jo}),r.jsx(hx,{className:"max-w-[200px]",value:me,onChange:V}),r.jsxs("select",{value:ne,onChange:F=>Xo(F.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("select",{value:D==="kanban"?Ae:te,onChange:F=>gf(F.target.value),className:"editor-input max-w-[180px]",title:"Group by",children:VA.map(F=>{const oe=D==="kanban"&&F!=="status"&&F!=="type",ge=F==="none"?"No grouping":`Group: ${F.charAt(0).toUpperCase()+F.slice(1)}`;return r.jsx("option",{value:F,disabled:oe,children:oe?`${ge} (list only)`:ge},F)})}),r.jsx(Kd,{value:D,onChange:F=>hf(F),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]}),D==="table"?r.jsx(sN,{visibility:O,onChange:W}):null,r.jsx(fN,{scope:Yn,loadedViewId:jt,onApply:xf,onOpenSaveDialog:()=>{Vt(!1),qt(!0)}}),r.jsx("button",{type:"button",onClick:()=>{Pe?lc():(Vt(!1),qt(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:Pe?`Update ${Pe.name}`:"Save current view",children:Pe?`Update '${Pe.name}'`:"Save view"}),Pe?r.jsx("button",{type:"button",onClick:()=>{Vt(!0),qt(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),i.assignments.length===0?r.jsx(ct,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:r.jsxs(Ne,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[r.jsx(qh,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):ht.length===0?r.jsx(ct,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):D==="table"?(()=>{const F=new Set(O.hidden),oe=ge=>ge==="title"||!F.has(ge);return r.jsx(Me,{title:`${mo.length} assignment${mo.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:[oe("title")?r.jsx(Jr,{field:"title",children:"Assignment"}):null,oe("status")?r.jsx(Jr,{field:"status",children:"Status"}):null,r.jsx("th",{className:"py-2 pr-4 text-xs font-medium uppercase tracking-wider",children:"Type"}),oe("priority")?r.jsx(Jr,{field:"priority",children:"Priority"}):null,oe("assignee")?r.jsx(Jr,{field:"assignee",children:"Assignee"}):null,oe("dependencies")?r.jsx(Jr,{field:"dependencies",children:"Dependencies"}):null,oe("created")?r.jsx(Jr,{field:"created",children:"Created"}):null,oe("updated")?r.jsx(Jr,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:mo.map((ge,De)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...gs(De),children:[oe("title")?r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ne,{to:ge.projectSlug===null?`/assignments/${ge.id}`:`${t}/projects/${ge.projectSlug}/assignments/${ge.slug}`,className:"font-semibold text-foreground hover:text-primary",children:ge.title}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:ge.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:ge.id,children:[ge.id.slice(0,8),r.jsx(Ar,{value:ge.id})]})]}):null,oe("status")?r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:ge.status,disabled:be===an(ge),onChange:tt=>ni({item:ge,toColumnId:tt.target.value}),className:Te("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")]`,(id[ge.status]??id.pending).className,be===an(ge)&&"animate-pulse opacity-60"),children:k.map(tt=>{const at=ge.status===tt?void 0:ml(ge,tt),dt=(at==null?void 0:at.disabled)??!1;return r.jsx("option",{value:tt,disabled:dt,title:dt?(at==null?void 0:at.disabledReason)??void 0:void 0,children:v[tt]},tt)})})}):null,r.jsx("td",{className:"py-4 pr-4",children:r.jsx(da,{type:ge.type,compact:!0})}),oe("priority")?r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:ge.priority}):null,oe("assignee")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:ge.assignee??"Unassigned"}):null,oe("dependencies")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:ge.dependsOn.length}):null,oe("created")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Mn(ge.created)}):null,oe("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Mn(ge.updated)}):null]},an(ge)))})]})})})})():D==="list"?r.jsx("div",{className:"space-y-3",children:Ea.map(({id:F,label:oe,items:ge})=>{var sn;if(ge.length===0&&!(Dn&&te==="status"))return null;const De=!Ee.has(F),tt=te==="status",at=tt&&Dn?Dn.status!==F&&!((sn=ml(Dn,F))!=null&&sn.disabled):!1,dt=tt&&Dn?Dn.status!==F&&!at:!1,cn=tt&&it===F;return r.jsxs("div",{className:Te("rounded-lg border border-border/60 bg-card/90 transition",cn&&at&&"ring-2 ring-ring/30",dt&&"border-dashed opacity-65"),onDragOver:tt?$n=>Ra($n,F):void 0,onDragLeave:tt?$n=>vt($n,F):void 0,onDrop:tt?$n=>dc($n,F):void 0,children:[r.jsxs("button",{type:"button",onClick:()=>Ta(F),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(cs,{className:`h-4 w-4 text-muted-foreground transition-transform ${De?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:oe}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:ge.length})]}),De&&ge.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:ge.map($n=>{const Un=an($n),Or=Be===Un,fc=ho.get(Un)??-1,yo=tt;return r.jsx("div",{draggable:yo,onDragStart:yo?bo=>xo(bo,Un):void 0,onDragEnd:yo?Pa:void 0,...fc>=0?gs(fc):{},className:Te("transition",yo&&"cursor-grab active:cursor-grabbing",Or&&"scale-[0.98] opacity-50"),children:r.jsx(dj,{assignment:$n,dragging:Or,transitioning:be===Un})},Un)})})]},F)})}):r.jsx(Vd,{columns:Ae==="type"?vf:j,items:ht,getItemId:an,getColumnId:F=>Ae==="type"?F.type&&m.definitions.some(oe=>oe.id===F.type)?F.type:N:F.status,canDrop:({item:F,fromColumnId:oe,toColumnId:ge})=>{if(oe===ge)return{allowed:!0};const De=ml(F,ge);return De!=null&&De.disabled?{allowed:!1,reason:De.disabledReason||De.description}:{allowed:!0,reason:De?De.warning||De.description:`Move to ${ge} (direct status change).`}},onMove:Ae==="type"?void 0:({item:F,toColumnId:oe})=>ni({item:F,toColumnId:oe}),dragDisabled:Ae==="type",getExternalDragData:F=>F.projectSlug===null?{type:"standalone-assignment",id:F.id}:{type:"project-assignment",id:F.id},onCardContextMenu:(F,oe)=>{oe.preventDefault(),yt({item:F,anchor:{x:oe.clientX,y:oe.clientY}})},emptyMessage:F=>`No ${F.title.toLowerCase()} assignments.`,hiddenColumnIds:pe.hidden,onHideColumn:F=>Re(oe=>({hidden:oe.hidden.includes(F)?oe.hidden.filter(De=>De!==F):[...oe.hidden,F]})),renderCard:(F,{dragging:oe})=>{const ge=ho.get(an(F))??-1;return r.jsx("div",{...ge>=0?gs(ge):{},children:r.jsx(dj,{assignment:F,dragging:oe,transitioning:be===an(F),onPillSelect:De=>void ni({item:F,toColumnId:De.targetStatus,action:De}),onRenameTitle:De=>wf(F,De)})})}}),r.jsx(yx,{toast:Bt,onDismiss:ae}),r.jsx(dN,{open:An,onOpenChange:F=>{qt(F),F||Vt(!1)},initialName:rn&&Pe?`${Pe.name} (copy)`:"",title:rn?"Save as new view":"Save view",onSubmit:Ca}),r.jsx(bN,{open:xt!==null,action:(xt==null?void 0:xt.action)??null,assignmentTitle:(xt==null?void 0:xt.item.title)??"Assignment",loading:be===(xt?an(xt.item):null),onOpenChange:F=>{F||tn(null)},onConfirm:async F=>{if(!xt)return;const oe=xt;await go({item:oe.item,toColumnId:oe.toColumnId,action:oe.action,reason:F})&&tn(null)}}),r.jsx(T1,{anchor:(Nt==null?void 0:Nt.anchor)??null,items:Nt?v6(Nt.item,{onEdit:()=>{const F=Nt.item,oe=F.projectSlug===null?`/assignments/${F.id}`:`${F.projectWorkspace?`/w/${F.projectWorkspace}`:t}/projects/${F.projectSlug}/assignments/${F.slug}`;n(oe)},onDelete:()=>he(Nt.item),onMove:()=>Ct(Nt.item)}):[],onClose:()=>yt(null)}),r.jsx(va,{open:kt!==null,title:"Delete assignment?",description:kt?`"${kt.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:Ze!==null,onOpenChange:F=>{!F&&Ze===null&&he(null)},onConfirm:async()=>{if(!kt||kt.projectSlug===null){he(null);return}const F=an(kt);Je(F);try{const oe=await fetch(`/api/projects/${encodeURIComponent(kt.projectSlug)}/assignments/${encodeURIComponent(kt.slug)}`,{method:"DELETE"});if(!oe.ok){const ge=await oe.json().catch(()=>({}));throw new Error(ge.error||"Failed to delete assignment")}he(null),u()}catch(oe){alert(oe instanceof Error?oe.message:"Failed to delete assignment")}finally{Je(null)}}}),r.jsx(Mg,{open:nn!==null,onOpenChange:F=>{F||Ct(null)},currentWorkspace:(nn==null?void 0:nn.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async F=>{if(!nn)return;const oe=await fetch(`/api/assignments/${encodeURIComponent(nn.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:F})});if(!oe.ok){const ge=await oe.json().catch(()=>({}));throw new Error(ge.error||"Failed to move assignment")}u()}})]})}function v6(e,t){const n=[{key:"edit",label:"Edit",icon:Uo,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:Kn,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:Yl,onSelect:t.onMove}),n}function dj({assignment:e,dragging:t,transitioning:n,onPillSelect:s,onRenameTitle:i}){var y;const l=$t(),c=f.useRef(null),u=f.useRef(!1),p=k1(e),m=!!(s&&i),h=()=>{const b=c.current,E=!!(b!=null&&b.querySelector('[aria-expanded="true"]')),k=!!document.querySelector('[role="menu"]'),v=document.activeElement,j=!!(v&&(b!=null&&b.contains(v))&&(v.tagName==="INPUT"||v.tagName==="TEXTAREA"));u.current=E||k||j},x=b=>{if(u.current)return;const E=b.target;!E||E.closest(xh)||l(p)};return r.jsxs("div",{ref:c,className:Te("vp-card rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",m&&"cursor-pointer"),onMouseDown:m?h:void 0,onClick:m?x:void 0,children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[m?r.jsx(x6,{title:e.title,detailHref:p,onSave:i,disabled:n}):r.jsx(Ne,{to:p,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:[(y=e.id)==null?void 0:y.slice(0,8),e.id&&r.jsx(Ar,{value:e.id})]})]}),m?r.jsx(g6,{currentStatus:e.status,availableTransitions:e.availableTransitions,onSelect:s,disabled:n}):r.jsx(vn,{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(da,{type:e.type}),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:Mn(e.updated)})]})]})}function ml(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function an(e){return e.id||e.slug||"unknown"}function Lr(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),i=n.split(`
|
|
544
|
+
`),l=[],c=new Map;let u=null,p=[];const m=()=>{u&&(l.push(u),c.set(u,p))};for(const h of i){const x=h.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!h.startsWith(" ")){m(),u=x[1],p=[h];continue}u&&p.push(h)}return m(),{order:l,blocks:c,body:s}}function wa(e){return`---
|
|
545
|
+
${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
|
|
546
|
+
`)}
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
${e.body.replace(/^\n+/,"")}`}function yn(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const s=n[0].match(/^[^:]+:\s*(.*)$/);if(!s)return"";const i=s[1].trim();return i==="null"?"":i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")?i.slice(1,-1):i}function w6(e,t){return yn(e,t)==="true"}function El(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 j6(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 bn(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${j6(n)}`])}function Tl(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 Pl(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function uf(e){const t=Lr(e);return{title:yn(t,"title"),slug:yn(t,"slug"),workspace:yn(t,"workspace"),archived:w6(t,"archived"),archivedAt:yn(t,"archivedAt"),archivedReason:yn(t,"archivedReason"),tags:El(t,"tags").join(", "),body:t.body}}function k6(e,t){const n=Lr(e),s={...uf(e),...t};return bn(n,"title",s.title),bn(n,"slug",s.slug),bn(n,"workspace",s.workspace||null),bn(n,"archived",s.archived),bn(n,"archivedAt",s.archivedAt||null),bn(n,"archivedReason",s.archivedReason||null),Tl(n,"tags",Pl(s.tags)),n.body=s.body,wa(n)}function df(e){const t=Lr(e);return{title:yn(t,"title"),slug:yn(t,"slug"),status:yn(t,"status"),priority:yn(t,"priority")||"medium",assignee:yn(t,"assignee"),dependsOn:El(t,"dependsOn").join(", "),links:El(t,"links").join(", "),blockedReason:yn(t,"blockedReason"),tags:El(t,"tags").join(", "),body:t.body}}function S6(e,t){const n=Lr(e),s={...df(e),...t};return bn(n,"title",s.title),bn(n,"slug",s.slug),bn(n,"status",s.status),bn(n,"priority",s.priority),bn(n,"assignee",s.assignee||null),Tl(n,"dependsOn",Pl(s.dependsOn)),Tl(n,"links",Pl(s.links)),bn(n,"blockedReason",s.blockedReason||null),Tl(n,"tags",Pl(s.tags)),n.body=s.body,wa(n)}function ff(e){const t=Lr(e);return{assignment:yn(t,"assignment"),status:yn(t,"status"),body:t.body}}function N6(e,t){const n=Lr(e),s={...ff(e),...t};return bn(n,"assignment",s.assignment),bn(n,"status",s.status),n.body=s.body,wa(n)}function pf(e){const t=Lr(e);return{assignment:yn(t,"assignment"),body:t.body}}function C6(e,t){const n=Lr(e),s={...pf(e),...t};return bn(n,"assignment",s.assignment),n.body=s.body,wa(n)}function mf(e){const t=Lr(e);return{name:yn(t,"name"),slug:yn(t,"slug"),description:yn(t,"description"),whenToUse:yn(t,"when_to_use"),tags:El(t,"tags").join(", "),body:t.body}}function E6(e,t){const n=Lr(e),s={...mf(e),...t};return bn(n,"name",s.name),bn(n,"slug",s.slug),bn(n,"description",s.description||null),bn(n,"when_to_use",s.whenToUse||null),Tl(n,"tags",Pl(s.tags)),n.body=s.body,wa(n)}function bx(e){return{body:Lr(e).body}}function PN(e){return bx(e)}function RN(e,t){const n=Lr(e);return t.body!==void 0&&(n.body=t.body),wa(n)}function T6(e,t){return RN(e,t)}function Ft(e,t,n){switch(e){case"project":return k6(t,n);case"assignment":return S6(t,n);case"plan":return N6(t,n);case"scratchpad":return C6(t,n);case"playbook":return E6(t,n);case"memory":return RN(t,n);case"resource":return T6(t,n);default:return t}}function ja({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:i,error:l,title:c,description:u,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:x=!1}){const[y,b]=f.useState(e),[E,k]=f.useState(!1),[v,j]=f.useState("edit");f.useEffect(()=>{b(e)},[e]);const C=D6(t,y),N=y!==e,T=A6(t,y),L=N?"Unsaved changes":n==="create"?"Draft":"Saved",P=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:L})]}),u?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:u}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:p,className:"shell-action",children:[r.jsx(Kj,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),P?r.jsxs("button",{type:"button",onClick:()=>k($=>!$),className:"shell-action",children:[r.jsx(NT,{className:"h-4 w-4"}),r.jsx("span",{children:E?"Structured":"Raw Markdown"})]}):null,r.jsxs("button",{type:"button",onClick:()=>s(y),disabled:i||C.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(Cd,{className:"h-4 w-4"}),r.jsx("span",{children:i?"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,C.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:C.map($=>r.jsx("li",{children:$},$))})}):null]}),r.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[r.jsx("button",{type:"button",onClick:()=>j("edit"),className:`shell-action ${v==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>j("preview"),className:`shell-action ${v==="preview"?"bg-foreground text-background":""}`,children:[r.jsx(nv,{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:v==="preview"?"hidden md:block":"",children:r.jsx("div",{className:"surface-panel space-y-3",children:E?r.jsx("textarea",{value:y,onChange:$=>b($.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(P6,{documentType:t,content:y,onChange:b,allowSlugEdit:x})})}),r.jsx("div",{className:v==="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(nv,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(fn,{content:T,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function P6({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=uf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(hl,{children:[r.jsx(Tt,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===mr(l.title)||!l.slug.trim())&&(p.slug=mr(u)),n(Ft(e,t,p))},className:"editor-input"})}),r.jsx(Tt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Ft(e,t,{slug:mr(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(Tt,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(Ft(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(R6,{value:l.workspace,onChange:c=>n(Ft(e,t,{workspace:c}))})]}),r.jsx(Tt,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Ft(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=df(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(hl,{children:[r.jsx(Tt,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===mr(l.title)||!l.slug.trim())&&(p.slug=mr(u)),n(Ft(e,t,p))},className:"editor-input"})}),r.jsx(Tt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Ft(e,t,{slug:mr(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(Tt,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Ft(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(Tt,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(Ft(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(Tt,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(Ft(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(Tt,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(Ft(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(Tt,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(Ft(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(Tt,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(Ft(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(Tt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(Ft(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(Tt,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Ft(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=ff(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(hl,{children:[r.jsx(Tt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(Tt,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Ft(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(Tt,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Ft(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=pf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(hl,{children:r.jsx(Tt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(Tt,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Ft(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?bx(t):PN(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Tt,{label:c,children:r.jsx("textarea",{value:l.body,onChange:u=>n(Ft(e,t,{body:u.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 i=mf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(hl,{children:[r.jsx(Tt,{label:"Playbook name",children:r.jsx("input",{value:i.name,onChange:l=>{const c=l.target.value,u={name:c};s&&(i.slug===mr(i.name)||!i.slug.trim())&&(u.slug=mr(c)),n(Ft(e,t,u))},className:"editor-input"})}),r.jsx(Tt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:i.slug,disabled:!s,onChange:l=>n(Ft(e,t,{slug:mr(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(Tt,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:i.description,onChange:l=>n(Ft(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(Tt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:i.tags,onChange:l=>n(Ft(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(Tt,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:i.whenToUse,onChange:l=>n(Ft(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(Tt,{label:"Playbook rules",children:r.jsx("textarea",{value:i.body,onChange:l=>n(Ft(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function hl({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function Tt({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 R6({value:e,onChange:t}){const{data:n}=Ed(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(Tt,{label:"Workspace",children:r.jsxs("select",{value:e,onChange:i=>t(i.target.value),className:"editor-input",children:[r.jsx("option",{value:"",children:"Ungrouped"}),s.map(i=>r.jsx("option",{value:i,children:i},i))]})})}function A6(e,t){switch(e){case"project":return uf(t).body;case"assignment":return df(t).body;case"plan":return ff(t).body;case"scratchpad":return pf(t).body;case"playbook":return mf(t).body;case"memory":return bx(t).body;case"resource":return PN(t).body}}function D6(e,t){switch(e){case"project":{const n=uf(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!Ou(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=df(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!Ou(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return ff(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return pf(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=mf(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!Ou(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function fj(){const e=$t(),{workspace:t}=Lt(),n=ln(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let b=y.content;t&&t!=="_ungrouped"&&(b=b.replace(/^(tags: \[\])$/m,`$1
|
|
550
|
+
workspace: ${t}`)),i(b),c(!1)}).catch(y=>{h(y.message),c(!1)})},[t]);async function x(y){p(!0),h(null);try{const b=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await b.json();if(!b.ok){h(E.error||`HTTP ${b.status}`),p(!1);return}e(`${n}/projects/${E.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(ft,{label:"Loading project template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ja,{initialContent:s||"",documentType:"project",mode:"create",onSave:x,saving:u,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 pj(){const{slug:e}=Lt(),t=ln(),n=$t(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/assignment").then(y=>y.json()).then(y=>{i(y.content),c(!1)}).catch(y=>{h(y.message),c(!1)})},[]);async function x(y){if(!e){h("Project slug is required.");return}p(!0),h(null);try{const b=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),E=await b.json();if(!b.ok){h(E.error||`HTTP ${b.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${E.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(ft,{label:"Loading assignment template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ja,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:u,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 mj(){const{workspace:e}=Lt(),t=ln(),n=$t(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{const y=new URLSearchParams({standalone:"1"});e&&y.set("workspace",e),fetch(`/api/templates/assignment?${y.toString()}`).then(b=>b.json()).then(b=>{i(b.content),c(!1)}).catch(b=>{h(b.message),c(!1)})},[e]);async function x(y){var b;p(!0),h(null);try{const E=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),k=await E.json();if(!E.ok){h(k.error||`HTTP ${E.status}`),p(!1);return}const v=(b=k==null?void 0:k.assignment)==null?void 0:b.id;if(!v){h("Server did not return the new assignment id."),p(!1);return}n(`/assignments/${v}`)}catch(E){h(E.message),p(!1);return}p(!1)}return l?r.jsx(ft,{label:"Loading assignment template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ja,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:u,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 ka({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,documentType:l,helpTitle:c,helpBody:u}){const p=$t(),{data:m,loading:h,error:x}=S0(e),[y,b]=f.useState(!1),[E,k]=f.useState(null);async function v(j){b(!0),k(null);try{const C=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),N=await C.json();if(!C.ok){k(N.error||`HTTP ${C.status}`),b(!1);return}p(n)}catch(C){k(C.message),b(!1);return}b(!1)}return h?r.jsx(ft,{label:`Loading ${s.toLowerCase()}…`}):x||!m?r.jsx(mt,{error:x||`${s} is unavailable.`}):r.jsx(ja,{initialContent:m.content,documentType:l,onSave:v,saving:y,error:E,title:s,description:i,onCancel:()=>p(n),helpTitle:c,helpBody:u})}function hj(){const{slug:e}=Lt(),t=ln(),n=e??"";return r.jsx(ka,{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 Km(){const{slug:e,aslug:t,id:n}=Lt(),s=ln(),i=!!n,l=i?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=i?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,u=i?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(ka,{loadUrl:l,saveUrl:c,redirectTo:u,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 qm(){const{slug:e,aslug:t,id:n}=Lt(),s=ln(),i=!!n,l=i?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=i?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,u=i?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(ka,{loadUrl:l,saveUrl:c,redirectTo:u,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 Gm(){const{slug:e,aslug:t,id:n}=Lt(),s=ln(),i=!!n,l=i?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=i?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,u=i?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(ka,{loadUrl:l,saveUrl:c,redirectTo:u,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 AN({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,helpTitle:l,helpBody:c}){const u=$t(),{data:p,loading:m,error:h}=S0(e),[x,y]=f.useState(""),[b,E]=f.useState(""),[k,v]=f.useState(!1),[j,C]=f.useState(null);async function N(){v(!0),C(null);try{const T=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:b})}),L=await T.json();if(!T.ok){C(L.error||`HTTP ${T.status}`),v(!1);return}u(n)}catch(T){C(T.message),v(!1);return}v(!1)}return m?r.jsx(ft,{label:`Loading ${s.toLowerCase()}…`}):h||!p?r.jsx(mt,{error:h||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Me,{title:s,description:i,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:T=>y(T.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:b,onChange:T=>E(T.target.value),className:"editor-textarea",spellCheck:!1})]}),j?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:j}):null,r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:()=>u(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:k||!b.trim(),className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:k?"Appending…":"Append Entry"})]})]})}),r.jsx(Me,{title:"Current Document",children:r.jsx(fn,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Ym(){const{slug:e,aslug:t,id:n}=Lt(),s=ln(),i=!!n,l=i?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=i?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,u=i?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(AN,{loadUrl:l,saveUrl:c,redirectTo:u,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 Jm(){const{slug:e,aslug:t,id:n}=Lt(),s=ln(),i=!!n,l=i?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=i?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,u=i?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(AN,{loadUrl:l,saveUrl:c,redirectTo:u,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 gj(){const{workspace:e}=Lt(),{data:t}=Vo(),{data:n,loading:s,error:i,refetch:l}=sg(),[c,u]=f.useState(!1),[p,m]=f.useState(""),[h,x]=f.useState(!1),y=Wn();f.useEffect(()=>{const C=y.hash.match(/^#server-(.+)/);if(!C)return;const N=decodeURIComponent(C[1]),T=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!T)return;T.scrollIntoView({block:"nearest"}),T.classList.add("ring-2","ring-primary/60");const L=window.setTimeout(()=>T.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(L)},[y.hash,n]);const b=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const C=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(T=>T.panes.some(L=>L.assignment&&L.assignment.project!==null&&C.has(L.assignment.project))))})();async function E(C){if(C.preventDefault(),!!p.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim()})}),m(""),u(!1),l()}catch{}}async function k(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function v(C){await fetch(`/api/servers/${encodeURIComponent(C)}`,{method:"DELETE"}),l()}async function j(C){await fetch(`/api/servers/${encodeURIComponent(C)}/refresh`,{method:"POST"}),l()}return s?r.jsx(ft,{label:"Loading servers…"}):i?r.jsx(mt,{error:i}):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:E,className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",value:p,onChange:C=>m(C.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:()=>u(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>u(!0),children:[r.jsx(en,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:k,disabled:h,children:[r.jsx(Zj,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),b.length===0?r.jsx(ct,{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:b.map(C=>r.jsx($6,{session:C,onRefresh:()=>j(C.name),onRemove:()=>v(C.name),onRefetch:l},C.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(Bi,{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 $6({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(Xh,{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(Zj,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(Kn,{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(i=>r.jsxs("div",{children:[r.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",i.index,": ",i.name]}),r.jsx("div",{className:"space-y-1.5",children:i.panes.map(l=>r.jsx(L6,{pane:l,sessionName:e.name,windowIndex:i.index,onRefetch:s},`${i.index}:${l.index}`))})]},i.index))}),!e.alive&&r.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(BT,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function L6({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const i=ln(),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:"block min-w-0 truncate",title:e.cwd,children:l}),r.jsx(Ar,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(Gh,{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(aa,{className:"h-2.5 w-2.5"})]},c))}),r.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?r.jsxs(Ne,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${i}/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(DT,{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 DN(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 I6(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":DN(s)}function O6(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 _6(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function xj(){const{data:e,loading:t,error:n,refetch:s}=N0(),[i,l]=f.useState(()=>Date.now()),[c,u]=f.useState(null),[p,m]=f.useState(!1);if(f.useEffect(()=>{const x=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(x)},[]),t)return r.jsx(ft,{label:"Loading inventories…"});if(n)return r.jsx(mt,{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(ct,{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 h(){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(),u(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(M6,{detail:x,now:i,onForceRelease:y=>u({slug:x.inventory.slug,lease:y})},x.inventory.slug))}),r.jsx(va,{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:p,onConfirm:h,onOpenChange:x=>{x||u(null)}})]})}function M6({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:i,active_leases:l}=e,c=i.filter(p=>p.status==="idle").length,u=i.filter(p=>p.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(kd,{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=",DN(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",u," leased · ",i.length," total"]})})]}),r.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:i.map(p=>r.jsx(F6,{member:p},p.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(p=>r.jsx(z6,{lease:p,now:t,onForceRelease:()=>n(p)},p.lease_id))})]})]})}function F6({member:e}){const t=_6(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 ${O6(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 z6({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(vT,{className:"h-3 w-3"}),I6(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(VT,{className:"h-3 w-3"}),"Force release"]})]})]})}function B6(){return new Date(Date.now()-720*60*60*1e3).toISOString().slice(0,10)}function U6(){return new Date().toISOString().slice(0,10)}function yj(){const[e,t]=f.useState(B6()),[n,s]=f.useState(U6()),[i,l]=f.useState(""),[c,u]=f.useState("project"),[p,m]=f.useState(null),[h,x]=f.useState(!0),[y,b]=f.useState(null),[E,k]=f.useState([]);return f.useEffect(()=>{const v=new AbortController;x(!0),b(null);const j=new URLSearchParams({since:e,until:n,groupBy:c});return i&&j.set("project",i),fetch(`/api/usage?${j.toString()}`,{signal:v.signal}).then(C=>{if(!C.ok)throw new Error(`HTTP ${C.status}`);return C.json()}).then(C=>{if(m(C),!i){const N=new Set;for(const T of C.daily)T.project_slug&&N.add(T.project_slug);k([...N].sort())}x(!1)}).catch(C=>{C instanceof Error&&C.name==="AbortError"||(b(C instanceof Error?C.message:String(C)),x(!1))}),()=>{v.abort()}},[e,n,i,c]),r.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[r.jsxs("header",{className:"flex items-center gap-3 mb-6",children:[r.jsx(Sd,{className:"w-6 h-6 text-amber-400"}),r.jsx("h1",{className:"text-2xl font-semibold",children:"Token usage"})]}),r.jsxs("div",{className:"flex flex-wrap gap-4 items-end mb-6 p-4 rounded-lg bg-zinc-900/50 border border-zinc-800",children:[r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Since"}),r.jsx("input",{type:"date",value:e,onChange:v=>t(v.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Until"}),r.jsx("input",{type:"date",value:n,onChange:v=>s(v.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Project"}),r.jsxs("select",{value:i,onChange:v=>l(v.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"",children:"All"}),E.map(v=>r.jsx("option",{value:v,children:v},v))]})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Group by"}),r.jsxs("select",{value:c,onChange:v=>u(v.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"project",children:"Project"}),r.jsx("option",{value:"assignment",children:"Assignment"})]})]})]}),h&&r.jsx("p",{className:"text-zinc-400",children:"Loading…"}),y&&r.jsxs("p",{className:"text-red-400",children:["Error: ",y]}),p&&!h&&!y&&r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"mb-8",children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Summary"}),p.summary.length===0?r.jsxs("p",{className:"text-zinc-500 text-sm",children:["No usage data in this window. Run"," ",r.jsx("code",{className:"bg-zinc-800 px-1 py-0.5 rounded text-amber-300",children:"syntaur usage"})," ","to ingest the latest ccusage data."]}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),c==="assignment"&&r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Last event"})]})}),r.jsx("tbody",{children:p.summary.map((v,j)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2",children:v.projectSlug||"(unattributed)"}),c==="assignment"&&r.jsx("td",{className:"px-3 py-2",children:v.assignmentSlug||"(unattributed)"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:qu(v.totalTokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Gu(v.totalCost)}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:v.lastEventDay})]},j))})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Daily breakdown"}),p.daily.length===0?r.jsx("p",{className:"text-zinc-500 text-sm",children:"No daily rows."}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Day"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Tool"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Model"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"})]})}),r.jsx("tbody",{children:p.daily.map((v,j)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2 tabular-nums",children:v.day}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:v.tool}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:v.model}),r.jsx("td",{className:"px-3 py-2",children:v.project_slug||"–"}),r.jsx("td",{className:"px-3 py-2",children:v.assignment_slug||"–"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:qu(v.total_tokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Gu(v.total_cost)})]},j))})]})]})]})]})}function bj(){const{workspace:e}=Lt(),{data:t}=Vo(),{data:n,loading:s,error:i}=C0(),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState("started_desc"),[b,E]=f.useState(0),[k,v]=f.useState(new Set),[j,C]=f.useState(!1),[N,T]=f.useState(null),[L,P]=f.useState(null),$=(n==null?void 0:n.sessions.some(B=>B.status==="active"))??!1;f.useEffect(()=>{if(!$)return;const B=window.setInterval(()=>E(q=>q+1),3e4);return()=>window.clearInterval(B)},[$]),f.useEffect(()=>{v(B=>{if(B.size===0)return B;const q=new Set((n==null?void 0:n.sessions.map(le=>le.sessionId))??[]),Z=new Set([...B].filter(le=>q.has(le)));return Z.size===B.size?B:Z})},[n]);const D=f.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const B=l.trim().toLowerCase();return[...n.sessions.filter(Z=>{var G;if(e&&t){const A=((G=t.find(z=>z.slug===Z.projectSlug))==null?void 0:G.workspace)??null;if(e==="_ungrouped"){if(A!==null)return!1}else if(A!==e)return!1}const le=H6(Z.started);return u&&(!le||le<u)||m&&(!le||le>m)?!1:B?[Z.projectSlug??"",Z.assignmentSlug??"",Z.agent,Z.sessionId,Z.path,Z.description??"",Z.transcriptPath??""].join(" ").toLowerCase().includes(B):!0})].sort((Z,le)=>W6(Z,le,x))},[n,l,x,u,m,b,e,t]);function J(B){v(q=>{const Z=new Set(q);return Z.has(B)?Z.delete(B):Z.add(B),Z})}function ee(){k.size===D.length&&D.length>0?v(new Set):v(new Set(D.map(B=>B.sessionId)))}async function M(B){T(null),C(!0);try{const q=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:B})}),Z=await q.json().catch(()=>null);if(!q.ok)throw new Error((Z==null?void 0:Z.error)||`HTTP ${q.status}`);v(le=>new Set([...le].filter(_=>!B.includes(_)))),P(null)}catch(q){T(q.message)}finally{C(!1)}}async function U(B){try{const q=await fetch(`/api/agent-sessions/${encodeURIComponent(B)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!q.ok){const Z=await q.json().catch(()=>null);T((Z==null?void 0:Z.error)||`Failed to mark session stopped: HTTP ${q.status}`)}}catch(q){T(q.message)}}if(s)return r.jsx(ft,{label:"Loading agent sessions..."});if(i)return r.jsx(mt,{error:i});if(!n)return null;const X=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(Og,{children:[r.jsx(Wd,{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:u,onChange:B=>p(B.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:B=>h(B.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("select",{value:x,onChange:B=>y(B.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,k.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:[k.size," session",k.size!==1?"s":""," selected"]}),r.jsxs("button",{className:"shell-action text-destructive",onClick:()=>P({sessionIds:[...k],title:`Delete ${k.size} selected session${k.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:k.size===1?"Delete Session":"Delete Sessions"}),disabled:j,children:[r.jsx(Kn,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),r.jsx("button",{className:"shell-action",onClick:()=>v(new Set),children:"Clear Selection"})]}),X?D.length===0?r.jsx(ct,{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:ee,className:"text-muted-foreground hover:text-foreground",children:k.size===D.length&&D.length>0?r.jsx(Rr,{className:"h-4 w-4"}):r.jsx(Qh,{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:D.map(B=>r.jsx(V6,{session:B,selected:k.has(B.sessionId),onToggle:()=>J(B.sessionId),onDelete:()=>P({sessionIds:[B.sessionId],title:`Delete session ${B.sessionId.slice(0,8)}...?`,description:`Remove this ${B.agent} session record${B.assignmentSlug?` for ${B.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"}),onMarkStopped:U},B.sessionId))})]})}):r.jsx(ct,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(va,{open:L!==null,title:(L==null?void 0:L.title)??"Delete session?",description:(L==null?void 0:L.description)??"",confirmLabel:(L==null?void 0:L.confirmLabel)??"Delete",destructive:!0,loading:j,onOpenChange:B=>{B||P(null)},onConfirm:async()=>{L&&await M(L.sessionIds)}})]})}function V6({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:i}){const l=ln(),c=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,u=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",p=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(Rr,{className:"h-4 w-4"}):r.jsx(Qh,{className:"h-4 w-4"})})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?r.jsx(Ne,{to:`${l}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:Nn(e.projectSlug),children:Nn(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(Ne,{to:`${l}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:Nn(e.assignmentSlug),children:Nn(e.assignmentSlug)}):e.assignmentSlug?r.jsx(Ne,{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(wd,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"block min-w-0 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:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:c}),r.jsx(Ar,{value:e.sessionId})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:Dr(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:"block min-w-0 truncate text-xs text-muted-foreground",title:e.path,children:u}),e.path&&r.jsx(Ar,{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:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:p}),r.jsx(Ar,{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(gN,{session:e,onMarkStopped:i}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(Kn,{className:"h-3.5 w-3.5"})})]})})]})}function H6(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"),i=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${i}`}function Pu(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 W6(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 Pu(e)-Pu(t);case"duration_desc":return Pu(t)-Pu(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 K6(){const{data:e,loading:t,error:n,refetch:s}=E0(),[i,l]=f.useState(""),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(null),y=f.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!i.trim())return e.playbooks;const k=i.toLowerCase();return e.playbooks.filter(v=>v.name.toLowerCase().includes(k)||v.description.toLowerCase().includes(k)||v.slug.toLowerCase().includes(k)||v.tags.some(j=>j.toLowerCase().includes(k)))},[e,i]);async function b(k,v,j){if(k.preventDefault(),k.stopPropagation(),!c){u(v);try{const C=j?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(v)}/${C}`,{method:"POST"});if(!N.ok){const T=await N.json().catch(()=>({}));throw new Error(T.error||`Failed to ${C} playbook`)}s()}catch(C){console.error(C),alert(C instanceof Error?C.message:"Failed to update playbook")}finally{u(null)}}}async function E(){if(p){x(p.slug);try{const k=await fetch(`/api/playbooks/${encodeURIComponent(p.slug)}`,{method:"DELETE"});if(!k.ok){const v=await k.json().catch(()=>({}));throw new Error(v.error||"Failed to delete playbook")}m(null),s()}catch(k){console.error(k),alert(k instanceof Error?k.message:"Failed to delete playbook")}finally{x(null)}}}return t?r.jsx(ft,{label:"Loading playbooks..."}):n?r.jsx(mt,{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(lo,{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:i,onChange:k=>l(k.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(Ne,{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(en,{className:"h-4 w-4"}),"Create Playbook"]})]}),r.jsxs(Ne,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[r.jsx(Xj,{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(ct,{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(Ne,{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(en,{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(k=>{const v=c===k.slug,j=[{key:"delete",label:"Delete",icon:Kn,destructive:!0,onSelect:()=>m({slug:k.slug,name:k.name})}];return r.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${k.enabled?"":"opacity-75"}`,children:[r.jsx("div",{className:"absolute right-3 top-3 z-10",children:r.jsx(Lg,{items:j})}),r.jsxs(Ne,{to:`/playbooks/${k.slug}`,className:"group flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(Gj,{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:k.name}),k.description?r.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:k.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:[k.tags.slice(0,3).map(C=>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(e0,{className:"h-2.5 w-2.5"}),C]},C)),k.tags.length>3?r.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",k.tags.length-3]}):null]})})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":k.enabled,"aria-label":k.enabled?"Disable playbook":"Enable playbook",onClick:C=>b(C,k.slug,k.enabled),disabled:v,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 ${k.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 ${k.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},k.slug)})}),r.jsx(va,{open:p!==null,title:"Delete playbook?",description:p?`"${p.name}" will be removed from disk and the playbook manifest will be regenerated. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:h!==null,onConfirm:E,onOpenChange:k=>{k||m(null)}})]})}function q6(){const{slug:e}=Lt(),t=$t(),{data:n,loading:s,error:i,refetch:l}=VP(e),[c,u]=f.useState(!1),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,b]=f.useState(!1),[E,k]=f.useState(""),[v,j]=f.useState(!1),[C,N]=f.useState(null),T=e==="manifest";f.useEffect(()=>{y&&(k(e??""),N(null))},[y,e]);const L=mr(E),P=L.length>0&&Ou(L)&&L!=="manifest",$=L!==e;async function D(){if(!(!e||!P||!$)){j(!0),N(null);try{const M=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:L})});if(!M.ok){const U=await M.json().catch(()=>({}));throw new Error(U.error||"Failed to rename playbook")}b(!1),t(`/playbooks/${L}`)}catch(M){N(M instanceof Error?M.message:"Failed to rename playbook")}finally{j(!1)}}}async function J(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function ee(){if(!(!e||!n)){x(!0);try{const M=n.enabled?"disable":"enable",U=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${M}`,{method:"POST"});if(!U.ok){const X=await U.json().catch(()=>({}));throw new Error(X.error||`Failed to ${M} playbook`)}l()}catch(M){console.error(M),alert(M instanceof Error?M.message:"Failed to update playbook")}finally{x(!1)}}}return s?r.jsx(ft,{label:"Loading playbook..."}):i?r.jsx(mt,{error:i}):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:T?"Playbook Manifest":n.name}),T?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]}),!T&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,T?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,!T&&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 ",Dr(n.created)]}),r.jsxs("span",{children:["Updated ",Dr(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(M=>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(e0,{className:"h-3 w-3"}),M]},M))}):null]}),T?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:ee,disabled:h,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(Ne,{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(Uo,{className:"h-3 w-3"}),"Edit"]}),r.jsxs("button",{type:"button",onClick:()=>b(!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(WT,{className:"h-3 w-3"}),"Rename"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:J,disabled:p,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:p?"Deleting...":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!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:()=>u(!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(Kn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:n.body})}),r.jsx(ir,{open:y,onOpenChange:M=>v?void 0:b(M),children:r.jsxs(qn,{children:[r.jsxs(Yr,{children:[r.jsx(Gn,{children:"Rename playbook"}),r.jsx(ps,{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:E,onChange:M=>k(M.target.value),disabled:v,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"}),E&&L!==E?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:L||"—"})]}):null,E&&!P?r.jsx("p",{className:"text-xs text-destructive",children:'Slugs must be lowercase, hyphen-separated, with no special characters, and cannot be "manifest".'}):null]}),C?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:C}):null,r.jsxs(As,{children:[r.jsx("button",{type:"button",onClick:()=>b(!1),disabled:v,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:D,disabled:v||!P||!$,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:v?"Renaming…":"Rename"})]})]})})]}):null}function G6(){const e=$t(),[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(!1),[u,p]=f.useState(null);f.useEffect(()=>{fetch("/api/playbooks/template/new").then(h=>h.json()).then(h=>{n(h.content),i(!1)}).catch(h=>{p(h.message),i(!1)})},[]);async function m(h){c(!0),p(null);try{const x=await fetch("/api/playbooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})}),y=await x.json();if(!x.ok){p(y.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${y.slug}`)}catch(x){p(x.message),c(!1);return}c(!1)}return s?r.jsx(ft,{label:"Loading playbook template..."}):u&&!t?r.jsx(mt,{error:u}):r.jsx(ja,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:u,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 Y6(){const{slug:e}=Lt(),t=$t(),[n,s]=f.useState(null),[i,l]=f.useState(!0),[c,u]=f.useState(!1),[p,m]=f.useState(null);f.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 h(x){if(e){u(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),b=await y.json();if(!y.ok){m(b.error||`HTTP ${y.status}`),u(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),u(!1);return}u(!1)}}return i?r.jsx(ft,{label:"Loading playbook..."}):p&&!n?r.jsx(mt,{error:p}):r.jsx(ja,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function J6(){const{data:e,loading:t,error:n}=HP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[u,p]=f.useState("all"),[m,h]=f.useState("all"),x=(e==null?void 0:e.memories)??[],y=f.useMemo(()=>Array.from(new Set(x.map(v=>v.projectSlug))).sort(),[x]),b=f.useMemo(()=>Array.from(new Set(x.map(v=>v.scope).filter(Boolean))).sort(),[x]),E=f.useMemo(()=>Array.from(new Set(x.map(v=>v.source).filter(Boolean))).sort(),[x]),k=f.useMemo(()=>x.filter(v=>{if(l!=="all"&&v.projectSlug!==l||u!=="all"&&v.scope!==u||m!=="all"&&v.source!==m)return!1;if(s.trim()){const j=s.toLowerCase();if(!v.name.toLowerCase().includes(j)&&!v.slug.toLowerCase().includes(j)&&!v.projectTitle.toLowerCase().includes(j))return!1}return!0}),[x,s,l,u,m]);return t?r.jsx(ft,{label:"Loading memories…"}):n?r.jsx(mt,{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(lo,{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:v=>i(v.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:v=>c(v.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(v=>r.jsx("option",{value:v,children:v},v))]}),r.jsxs("select",{value:u,onChange:v=>p(v.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),b.map(v=>r.jsx("option",{value:v,children:v},v))]}),r.jsxs("select",{value:m,onChange:v=>h(v.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),E.map(v=>r.jsx("option",{value:v,children:v},v))]})]}),r.jsxs(Ne,{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(en,{className:"h-4 w-4"}),"New Memory"]})]}),k.length===0?r.jsx(ct,{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(Ne,{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(en,{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:k.map(v=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ne,{to:`/projects/${v.projectSlug}/memories/${v.slug}`,className:"font-semibold text-foreground hover:text-primary",children:v.name||v.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ne,{to:`/projects/${v.projectSlug}`,className:"hover:text-foreground hover:underline",children:v.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.scope||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Mn(v.updated)})]},`${v.projectSlug}/${v.slug}`))})]})})]})}function X6(){const{slug:e,itemSlug:t}=Lt(),n=$t(),{data:s,loading:i,error:l}=WP(e,t),[c,u]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/memories/${t}`,{method:"DELETE"})).ok&&n("/memories")}finally{m(!1)}}}return i?r.jsx(ft,{label:"Loading memory…"}):l?r.jsx(mt,{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(Ne,{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 ",Dr(s.created)]}),r.jsxs("span",{children:["Updated ",Dr(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(Ne,{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(Uo,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,disabled:p,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:p?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!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:()=>u(!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(Kn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:s.body})})]}):null}function Q6(){const e=$t(),[t]=fs(),n=t.get("project"),{data:s,loading:i,error:l}=Vo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(!1),[E,k]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function v(j){if(j.preventDefault(),!(!c||!p.trim())){b(!0),k(null);try{const C=await fetch(`/api/projects/${c}/memories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await C.json();if(!C.ok){k(N.error||`HTTP ${C.status}`),b(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(C){k(C.message),b(!1)}}}return i?r.jsx(ft,{label:"Loading projects…"}):l?r.jsx(mt,{error:l}):!s||s.length===0?r.jsx(mt,{error:"You need at least one project before you can create a memory. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:v,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:j=>u(j.target.value),className:"editor-input",required:!0,children:s.map(j=>r.jsx("option",{value:j.slug,children:j.title},j.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:p,onChange:j=>m(j.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:h,onChange:j=>x(j.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"})]}),E?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:E}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.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 Z6(){const{slug:e,itemSlug:t}=Lt();return r.jsx(ka,{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 ez(){const{data:e,loading:t,error:n}=KP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[u,p]=f.useState("all"),[m,h]=f.useState("all"),x=(e==null?void 0:e.resources)??[],y=f.useMemo(()=>Array.from(new Set(x.map(v=>v.projectSlug))).sort(),[x]),b=f.useMemo(()=>Array.from(new Set(x.map(v=>v.category).filter(Boolean))).sort(),[x]),E=f.useMemo(()=>Array.from(new Set(x.map(v=>v.source).filter(Boolean))).sort(),[x]),k=f.useMemo(()=>x.filter(v=>{if(l!=="all"&&v.projectSlug!==l||u!=="all"&&v.category!==u||m!=="all"&&v.source!==m)return!1;if(s.trim()){const j=s.toLowerCase();if(!v.name.toLowerCase().includes(j)&&!v.slug.toLowerCase().includes(j)&&!v.projectTitle.toLowerCase().includes(j))return!1}return!0}),[x,s,l,u,m]);return t?r.jsx(ft,{label:"Loading resources…"}):n?r.jsx(mt,{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(lo,{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:v=>i(v.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:v=>c(v.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(v=>r.jsx("option",{value:v,children:v},v))]}),r.jsxs("select",{value:u,onChange:v=>p(v.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),b.map(v=>r.jsx("option",{value:v,children:v},v))]}),r.jsxs("select",{value:m,onChange:v=>h(v.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),E.map(v=>r.jsx("option",{value:v,children:v},v))]})]}),r.jsxs(Ne,{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(en,{className:"h-4 w-4"}),"New Resource"]})]}),k.length===0?r.jsx(ct,{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(Ne,{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(en,{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:k.map(v=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ne,{to:`/projects/${v.projectSlug}/resources/${v.slug}`,className:"font-semibold text-foreground hover:text-primary",children:v.name||v.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ne,{to:`/projects/${v.projectSlug}`,className:"hover:text-foreground hover:underline",children:v.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.category||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:v.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Mn(v.updated)})]},`${v.projectSlug}/${v.slug}`))})]})})]})}function tz(){const{slug:e,itemSlug:t}=Lt(),n=$t(),{data:s,loading:i,error:l}=qP(e,t),[c,u]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/resources/${t}`,{method:"DELETE"})).ok&&n("/resources")}finally{m(!1)}}}return i?r.jsx(ft,{label:"Loading resource…"}):l?r.jsx(mt,{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(Ne,{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 ",Dr(s.created)]}),r.jsxs("span",{children:["Updated ",Dr(s.updated)]})]})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(Ne,{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(Uo,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,disabled:p,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:p?"Deleting…":"Confirm"}),r.jsx("button",{type:"button",onClick:()=>u(!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:()=>u(!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(Kn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(fn,{content:s.body})})]}):null}function nz(){const e=$t(),[t]=fs(),n=t.get("project"),{data:s,loading:i,error:l}=Vo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(!1),[E,k]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function v(j){if(j.preventDefault(),!(!c||!p.trim())){b(!0),k(null);try{const C=await fetch(`/api/projects/${c}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await C.json();if(!C.ok){k(N.error||`HTTP ${C.status}`),b(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(C){k(C.message),b(!1)}}}return i?r.jsx(ft,{label:"Loading projects…"}):l?r.jsx(mt,{error:l}):!s||s.length===0?r.jsx(mt,{error:"You need at least one project before you can create a resource. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:v,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:j=>u(j.target.value),className:"editor-input",required:!0,children:s.map(j=>r.jsx("option",{value:j.slug,children:j.title},j.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:p,onChange:j=>m(j.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:h,onChange:j=>x(j.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"})]}),E?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:E}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.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 rz(){const{slug:e,itemSlug:t}=Lt();return r.jsx(ka,{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 sz({value:e,onChange:t,ariaLabel:n}){const s=n??"Pick a color",i=n?`${n} (hex)`:"Color hex value";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"color",value:e||"#64748b",onChange:l=>t(l.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","aria-label":s}),r.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs","aria-label":i})]})}const Oh=["projects","playbooks","todos","servers","config"];function oz(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))Oh.includes(n)&&t.add(n);return t}function vj(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function iz(){const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(""),[c,u]=f.useState(new Set(Oh)),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,b]=f.useState(null),[E,k]=f.useState(null),v=f.useCallback(async()=>{try{const P=await fetch("/api/backup");if(!P.ok)throw new Error(`HTTP ${P.status}`);const $=await P.json();s($),l($.repo??""),u(oz($.categories)),m(!1)}catch(P){k({type:"error",message:`Failed to load backup config: ${P instanceof Error?P.message:String(P)}`})}finally{t(!1)}},[]);f.useEffect(()=>{v()},[v]);function j(P){u($=>{const D=new Set($);return D.has(P)?D.delete(P):D.add(P),D}),m(!0)}async function C(){x(!0),k(null);try{const P=Array.from(c),$=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:i.trim()||null,categories:P})}),D=await $.json();if(!$.ok)throw new Error(D.error||`HTTP ${$.status}`);s(D),m(!1),k({type:"success",message:"Backup configuration saved."})}catch(P){k({type:"error",message:`Save failed: ${P instanceof Error?P.message:String(P)}`})}finally{x(!1)}}async function N(){b("push"),k(null);try{const P=await fetch("/api/backup/push",{method:"POST"}),$=await P.json();if(!P.ok||$.success===!1)throw new Error($.error||$.message||`HTTP ${P.status}`);k({type:"success",message:$.message||"Backup complete."}),await v()}catch(P){k({type:"error",message:`Backup failed: ${P instanceof Error?P.message:String(P)}`})}finally{b(null)}}async function T(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){b("pull"),k(null);try{const $=await fetch("/api/backup/pull",{method:"POST"}),D=await $.json();if(!$.ok||D.success===!1)throw new Error(D.error||D.message||`HTTP ${$.status}`);k({type:"success",message:D.message||"Restore complete."}),await v()}catch($){k({type:"error",message:`Restore failed: ${$ instanceof Error?$.message:String($)}`})}finally{b(null)}}}if(e)return r.jsx(Me,{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 L=!!i.trim()&&c.size>0&&!y&&!p;return r.jsx(Me,{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:[E&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${E.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:E.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:i,onChange:P=>{l(P.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:Oh.map(P=>{const $=c.has(P);return r.jsxs("button",{type:"button",onClick:()=>j(P),className:`shell-action text-xs ${$?"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 ${$?"bg-primary":"bg-muted-foreground/40"}`}),P]},P)})})]}),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: "}),vj((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),vj((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:C,disabled:h||!p,children:[r.jsx(Cd,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Config"]}),r.jsxs("button",{className:"shell-action",onClick:N,disabled:!L,title:L?"Back up now":p?"Save config first":"Set repo and pick categories",children:[r.jsx(KT,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:T,disabled:!L,title:L?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[r.jsx(kT,{className:"h-3.5 w-3.5"}),y==="pull"?"Restoring...":"Restore"]}),p&&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(wT,{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 az({open:e,affected:t,remaining:n,onResolve:s,onCancel:i}){var k;const[l,c]=f.useState(n.length>0?"remap":"delete"),[u,p]=f.useState(((k=n[0])==null?void 0:k.id)??""),[m,h]=f.useState(!1);f.useEffect(()=>{var v;e&&(c(n.length>0?"remap":"delete"),p(((v=n[0])==null?void 0:v.id)??""),h(!1))},[e,n]);const x=l==="remap"&&n.length>0&&u!==""&&u!==t.id||l==="delete"&&m;function y(){x&&s(l==="remap"?{id:t.id,mode:"remap",target:u}:{id:t.id,mode:"delete"})}const b=t.assignments.slice(0,10),E=t.count-b.length;return r.jsx(ir,{open:e,onOpenChange:v=>v?void 0:i(),children:r.jsxs(qn,{className:"max-w-xl",children:[r.jsxs(Yr,{children:[r.jsxs(Gn,{children:['Delete status "',t.label,'" — ',t.count," assignment",t.count===1?"":"s"," reference it"]}),r.jsx(ps,{children:"Choose how to resolve the affected assignments before this status is removed from the workflow."})]}),r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("ul",{className:"space-y-1 text-sm",children:[b.map(v=>r.jsx("li",{children:r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:v.display})},`${v.projectSlug??"standalone"}/${v.assignmentSlug}`)),E>0&&r.jsxs("li",{className:"text-xs italic text-muted-foreground",children:["+",E," more not shown"]})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="remap",onChange:()=>c("remap"),disabled:n.length===0,className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium",children:"Remap to another status"}),r.jsxs("select",{value:u,onChange:v=>p(v.target.value),onClick:()=>c("remap"),disabled:l!=="remap"||n.length===0,className:"mt-2 block w-full rounded-md border border-border/60 bg-background px-2 py-1 text-sm",children:[n.length===0&&r.jsx("option",{value:"",children:"(no other statuses)"}),n.map(v=>r.jsxs("option",{value:v.id,children:[v.label," (",v.id,")"]},v.id))]}),n.length===0&&r.jsx("span",{className:"block text-xs text-muted-foreground mt-1",children:"No other saved statuses to remap to. Add another status first, or use Delete."})]})]}),r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="delete",onChange:()=>c("delete"),className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium text-error-foreground",children:"Delete these assignments"}),r.jsxs("span",{className:"block text-xs text-muted-foreground mt-1",children:["Permanently removes ",t.count," assignment",t.count===1?"":"s"," from disk. This cannot be undone."]}),l==="delete"&&r.jsxs("label",{className:"mt-2 flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:v=>h(v.target.checked)}),r.jsxs("span",{className:"text-xs",children:["I understand this will permanently delete ",t.count," assignment",t.count===1?"":"s","."]})]})]})]})]}),r.jsxs(As,{children:[r.jsx("button",{type:"button",onClick:i,className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:y,disabled:!x,className:`shell-action ${l==="delete"?"bg-error text-error-foreground hover:opacity-90":"bg-foreground text-background hover:opacity-90"} disabled:cursor-not-allowed disabled:opacity-50`,children:l==="remap"?`Remap ${t.count} → ${u||"..."}`:`Delete ${t.count}`})]})]})})}function lz(e){const t=Array.from(e.pendingResolutions.values());return{body:{statuses:e.statuses.map(s=>({id:s.id,label:s.label,...s.description?{description:s.description}:{},...s.color?{color:s.color}:{},...s.terminal?{terminal:!0}:{}})),order:e.order,transitions:[],resolutions:t},resolutions:t}}function cz(e,t){const n=new Map;t.forEach((i,l)=>{n.has(i)||n.set(i,l)});const s=t.length;return e.map((i,l)=>({s:i,originalIndex:l,r:n.get(i.id)??s})).sort((i,l)=>i.r-l.r||i.originalIndex-l.originalIndex).map(i=>i.s)}function wj(e,t){const n=new Map;for(const[s,i]of e.entries())t.has(i.id)||i.mode==="remap"&&!t.has(i.target)||n.set(s,i);return n}function uz(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:i,unbindAction:l}=co(),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(!1),y=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function b(N,T){m({type:N,message:T}),setTimeout(()=>m(null),2500)}function E(N){u({kind:N,combo:null,conflict:null,saving:!1,error:null})}function k(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),v();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const T=T0(N.nativeEvent);if(!T)return;const L=s(T,c.kind);u({...c,combo:T,conflict:L,error:null})}async function v(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){u({...c,error:`Reserved: ${c.conflict.description}`});return}u({...c,saving:!0,error:null});try{await i(c.kind,c.combo),u(null),b("success",`Bound ${cl[c.kind]}`)}catch(T){u({...c,saving:!1,error:T instanceof Error?T.message:"Failed to save"})}}}async function j(N){try{await l(N),b("success",`Cleared ${cl[N]} binding`)}catch(T){b("error",T instanceof Error?T.message:"Failed to clear binding")}}async function C(){if(!h){x(!0);try{await pA(),b("success","All hotkey bindings cleared")}catch(N){b("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return r.jsxs(Me,{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 C(),disabled:h,children:[r.jsx(ea,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[p?r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${p.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:p.message}):null,r.jsx("ul",{className:"space-y-2",children:Pd.map(N=>{var D,J;const T=n.find(ee=>ee.bindableKind===N),L=e[N],P=typeof t[N]=="string"&&!!t[N],$=(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(rh,{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:(T==null?void 0:T.title)??cl[N]}),T!=null&&T.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:T.subtitle}):null]}),L?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:as(L)}),r.jsx("span",{className:`text-[10px] uppercase tracking-wide ${P?"text-primary":"text-muted-foreground"}`,children:P?"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:()=>E(N),children:L?"Rebind":"Bind"}),P?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void j(N),"aria-label":`Restore default ${cl[N]} binding`,children:[r.jsx(eg,{className:"h-3 w-3"}),"Restore default"]}):null]}),$?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:k,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&u(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:as(c.combo)}),(D=c.conflict)!=null&&D.description?r.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(J=c.conflict)!=null&&J.kind?r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',cl[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 dz={kanban:"Kanban",list:"List",table:"Table"},fz={comfortable:"Comfortable",compact:"Compact"},pz={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"},mz={asc:"Ascending",desc:"Descending"};function hz(){const e=$F(),t=e.global,[n,s]=f.useState(!1),[i,l]=f.useState(null);function c(m,h){l({type:m,message:h}),setTimeout(()=>l(null),2e3)}async function u(m,h){if(t[m]!==h){s(!0);try{await cN({[m]:h}),c("success","Saved")}catch(x){c("error",x instanceof Error?x.message:"Failed to save")}finally{s(!1)}}}async function p(){if(e.custom){s(!0);try{await LF(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(Me,{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:p,disabled:n,children:[r.jsx(ea,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[i&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${i.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:i.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:vg.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:dz[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:UA.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:fz[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=>u("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:Ok.map(m=>r.jsx("option",{value:m,children:pz[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:BA.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:mz[m]},m))})]})]})]})}const gz=/^[a-z0-9][a-z0-9_-]*$/,$N=["first","last","none"];class LN extends Error{constructor(n,s){super(n);Fb(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const vx={agents:[],custom:!1};let Fi=null,Oi=null,hd=0;const _h=new Set;function IN(e){Fi=e;for(const t of _h)t(e)}function xz(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"&&$N.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 wx(e){if(!e||typeof e!="object")return vx;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const i of n){const l=xz(i);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function yz(){if(Fi)return Promise.resolve(Fi);if(Oi)return Oi;const e=++hd;return Oi=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Oi=null;const n=wx(t);return e!==hd?Fi??n:(Fi=n,n)}).catch(()=>(Oi=null,vx)),Oi}function bz(){const[e,t]=f.useState(()=>Fi??vx);return f.useEffect(()=>{let n=!1;return yz().then(s=>{n||t(s)}),_h.add(t),()=>{n=!0,_h.delete(t)}},[]),e}async function ON(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new LN(n,t==null?void 0:t.fieldErrors)}async function vz(e){++hd;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await ON(t);const n=wx(await t.json());return IN(n),n}async function wz(){++hd;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await ON(e);const t=wx(await e.json());return IN(t),t}const jz={first:"first",last:"last",none:"none"};function _N(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function gl(e){return e.map(t=>({rowKey:_N(),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 kz(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 Sz(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 Nz(e,t){return!t||t.length===0?e:e.map((n,s)=>{const i={};for(const l of t){if(l.index!==void 0){l.index===s&&(i[l.field]=l.message);continue}if(l.id!==void 0){l.id===n.id&&(i[l.field]=l.message);continue}i[l.field]=l.message}return{...n,fieldErrors:i}})}function Cz(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function Ez(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const s=e[n],i=t[n];if(s.id!==i.id||s.label!==i.label||s.command!==i.command||s.argsText!==i.argsText||s.promptArgPosition!==i.promptArgPosition||s.resolveFromShellAliases!==i.resolveFromShellAliases||s.default!==i.default)return!1}return!0}function Tz({row:e,index:t,canRemove:n,onPatch:s,onSetDefault:i,onRemove:l}){const{attributes:c,listeners:u,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:x,isDragging:y}=lf({id:e.rowKey}),b={transform:io.Transform.toString(h),transition:x,zIndex:y?50:void 0,position:y?"relative":void 0};function E(j){const C={label:j};if(e.autoSlugFromLabel){const N=mr(j);N&&gz.test(N)?C.id=N:C.id=`agent-${t+1}`}s(C)}function k(j){s({id:j,autoSlugFromLabel:!1})}const v=j=>e.fieldErrors[j]?"border-error-foreground/60":"";return r.jsxs("div",{ref:p,style:b,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,...u,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(Nd,{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:i,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:j=>k(j.target.value),className:`editor-input w-32 font-mono text-xs ${v("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(Kn,{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:j=>E(j.target.value),className:`editor-input mt-0.5 w-full ${v("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:j=>s({command:j.target.value}),className:`editor-input mt-0.5 w-full font-mono ${v("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:j=>s({argsText:j.target.value}),className:`editor-input mt-0.5 w-full font-mono ${v("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:j=>s({promptArgPosition:j.target.value}),className:`editor-input mt-0.5 w-full ${v("promptArgPosition")}`,children:$N.map(j=>r.jsx("option",{value:j,children:jz[j]},j))}),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:j=>s({resolveFromShellAliases:j.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 Pz(){const e=bz(),[t,n]=f.useState(()=>gl(e.agents)),[s,i]=f.useState(()=>gl(e.agents)),[l,c]=f.useState(!1),[u,p]=f.useState(null),[m,h]=f.useState(null);f.useEffect(()=>{const P=gl(e.agents);n(P),i(P),p(null)},[e.agents]);const x=f.useMemo(()=>!Ez(t,s),[t,s]),y=Zd(ao(ya,{activationConstraint:{distance:8}}),ao(xa));function b(P,$){h({type:P,message:$}),setTimeout(()=>h(null),2500)}function E(P,$){n(D=>D.map(J=>J.rowKey===P?{...J,...$,fieldErrors:Rz(J.fieldErrors,$)}:J))}function k(P){n($=>$.map(D=>({...D,default:D.rowKey===P})))}function v(){n(P=>{const $=new Set(P.map(X=>X.id)),D="new-agent";let J=D,ee=1;for(;$.has(J);)ee+=1,J=`${D}-${ee}`;const M=ee===1?"New Agent":`New Agent ${ee}`,U={rowKey:_N(),id:J,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:M,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!0,default:!1,fieldErrors:{}};return[...P,U]})}function j(P){n($=>$.filter(D=>D.rowKey!==P))}async function C(){c(!0),p(null);try{const P=Sz(t),$=kz(P),D=await vz($),J=gl(D.agents);n(J),i(J),b("success","Agents saved")}catch(P){if(P instanceof LN)p(P.message),n($=>Nz(Cz($),P.fieldErrors)),b("error",P.message);else{const $=P instanceof Error?P.message:"Failed to save";p($),b("error",$)}}finally{c(!1)}}function N(){n(s),p(null)}async function T(){if(e.custom&&window.confirm("Reset agents to built-in defaults? Any custom agents will be deleted from your config.")){c(!0),p(null);try{const P=await wz(),$=gl(P.agents);n($),i($),b("success","Reset to defaults")}catch(P){const $=P instanceof Error?P.message:"Failed to reset";p($),b("error",$)}finally{c(!1)}}}function L(P){const{active:$,over:D}=P;!D||$.id===D.id||n(J=>{const ee=J.findIndex(U=>U.rowKey===$.id),M=J.findIndex(U=>U.rowKey===D.id);return ee===-1||M===-1?J:ba(J,ee,M)})}return r.jsxs(Me,{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:T,disabled:l,children:[r.jsx(ea,{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(Yh,{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}),u&&(!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:u}),r.jsx(sf,{sensors:y,collisionDetection:ef,onDragEnd:L,children:r.jsx(af,{items:t.map(P=>P.rowKey),strategy:of,children:r.jsx("div",{className:"space-y-2",children:t.map((P,$)=>r.jsx(Tz,{row:P,index:$,canRemove:t.length>1,onPatch:D=>E(P.rowKey,D),onSetDefault:()=>k(P.rowKey),onRemove:()=>j(P.rowKey)},P.rowKey))})})}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("button",{type:"button",onClick:v,disabled:l,className:"shell-action text-xs",children:[r.jsx(en,{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:C,disabled:!x||l,className:"shell-action text-xs",children:[r.jsx(Cd,{className:"h-3 w-3"}),"Save"]})]})]})]})}function Rz(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 MN=["terminal-app","iterm","ghostty","alacritty","warp","kitty"],gd={terminal:"terminal-app",custom:!1};let zi=null,_i=null,xd=0;const Mh=new Set;function FN(e){zi=e;for(const t of Mh)t(e)}function jx(e){if(!e||typeof e!="object")return gd;const t=e;return{terminal:typeof t.terminal=="string"&&MN.includes(t.terminal)?t.terminal:gd.terminal,custom:t.custom===!0}}function Az(){if(zi)return Promise.resolve(zi);if(_i)return _i;const e=++xd;return _i=fetch("/api/config/terminal").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{_i=null;const n=jx(t);return e!==xd?zi??n:(zi=n,n)}).catch(()=>(_i=null,gd)),_i}function Dz(){const[e,t]=f.useState(()=>zi??gd);return f.useEffect(()=>{let n=!1;return Az().then(s=>{n||t(s)}),Mh.add(t),()=>{n=!0,Mh.delete(t)}},[]),e}async function $z(e){++xd;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=jx(await t.json());return FN(n),n}async function Lz(){++xd;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=jx(await e.json());return FN(t),t}const Ru={"terminal-app":"Terminal (macOS built-in)",iterm:"iTerm2",ghostty:"Ghostty",alacritty:"Alacritty",warp:"Warp",kitty:"kitty"};function Iz(){const{terminal:e,custom:t}=Dz(),[n,s]=f.useState(!1),[i,l]=f.useState(null);function c(m){l(m),setTimeout(()=>l(null),2500)}async function u(m){if(!(m===e&&t)){s(!0);try{await $z(m),c({type:"success",message:`Terminal set to ${Ru[m]}.`})}catch(h){c({type:"error",message:h instanceof Error?h.message:"Save failed."})}finally{s(!1)}}}async function p(){s(!0);try{const m=await Lz();c({type:"success",message:`Reset to OS default (${Ru[m.terminal]}).`})}catch(m){c({type:"error",message:m instanceof Error?m.message:"Reset failed."})}finally{s(!1)}}return r.jsxs(Me,{title:"Terminal",description:`Which terminal "Open in agent" launches. Defaults to the OS choice (currently ${Ru[e]}) when unset.`,actions:t?r.jsxs("button",{className:"shell-action text-xs",onClick:p,disabled:n,type:"button",children:[r.jsx(ea,{className:"h-3 w-3"}),"Reset to OS default"]}):void 0,children:[i&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${i.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:i.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=>u(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:MN.map(m=>r.jsx("option",{value:m,children:Ru[m]},m))})]})]})}function zN(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Xm(e){const t=e.statuses.map(n=>({rowKey:zN(),id:n.id,label:n.label,description:n.description??"",color:n.color??"",terminal:n.terminal??!1}));return cz(t,e.order)}function Oz({row:e,isSaved:t,onUpdate:n,onRemove:s}){const{attributes:i,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:p,transition:m,isDragging:h}=lf({id:e.rowKey}),x={transform:io.Transform.toString(p),transition:m,zIndex:h?50:void 0,position:h?"relative":void 0};return r.jsxs("div",{ref:c,style:x,className:`surface-panel flex flex-wrap items-center gap-3 px-3 py-2 ${h?"opacity-60 shadow-lg":""}`,children:[r.jsx("button",{ref:u,...i,...l,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(Nd,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:t?r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsx("input",{type:"text",value:e.id,readOnly:!0,"aria-label":"Status ID",className:"editor-input w-full text-sm cursor-not-allowed opacity-60"})}),r.jsx(gr,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:"To rename a saved status, delete the row and create a new one (this triggers the orphan-resolution flow if assignments still reference it)."})]}):r.jsx("input",{type:"text",value:e.id,onChange:y=>n("id",y.target.value),"aria-label":"Status ID",className:"editor-input w-full text-sm"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:r.jsx("input",{type:"text",value:e.label,onChange:y=>n("label",y.target.value),"aria-label":"Status label",className:"editor-input w-full text-sm"})}),r.jsx(sz,{value:e.color,onChange:y=>n("color",y),ariaLabel:`Color for ${e.label||e.id}`}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Tr,{children:[r.jsx(Pr,{asChild:!0,children:r.jsx("span",{className:"cursor-help text-xs text-muted-foreground underline decoration-dotted underline-offset-4",children:"Done"})}),r.jsx(gr,{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("button",{type:"button",role:"switch","aria-checked":e.terminal,"aria-label":`Done state for ${e.label||e.id}`,onClick:()=>n("terminal",!e.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 ${e.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 ${e.terminal?"translate-x-4":"translate-x-0"}`})})]}),r.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:s,title:"Remove status","aria-label":`Remove status ${e.id}`,children:r.jsx(Kn,{className:"h-3.5 w-3.5"})})]})}function _z(){var me;const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(!1),[c,u]=f.useState([]),[p,m]=f.useState(!1),[h,x]=f.useState(null),[y,b]=f.useState(!1),[E,k]=f.useState(new Set),[v,j]=f.useState(new Map),[C,N]=f.useState({open:!1}),T=Zd(ao(ya,{activationConstraint:{distance:8}}),ao(xa,{coordinateGetter:cF})),{preset:L,setPreset:P,resetPreset:$}=rg(),[D,J]=f.useState(!1),[ee,M]=f.useState(null);async function U(V){if(!(V===L||D)){J(!0),M(null);try{await P(V),M({type:"success",message:"Theme updated"}),setTimeout(()=>M(null),2e3)}catch(ne){M({type:"error",message:ne instanceof Error?ne.message:"Failed to save theme"})}finally{J(!1)}}}async function X(){J(!0),M(null);try{await $(),M({type:"success",message:"Theme reset to default"}),setTimeout(()=>M(null),2e3)}catch(V){M({type:"error",message:V instanceof Error?V.message:"Failed to reset theme"})}finally{J(!1)}}const B=f.useCallback(async()=>{try{const V=await fetch("/api/config/statuses");if(!V.ok)throw new Error(`HTTP ${V.status}`);const ne=await V.json(),de=Xm(ne);u(de),l(ne.custom),k(new Set(de.map(ye=>ye.id))),j(new Map),b(!1),s(null)}catch(V){s(V instanceof Error?V.message:"Failed to load config")}finally{t(!1)}},[]);f.useEffect(()=>{B()},[B]);function q(){setTimeout(()=>x(null),3e3)}async function Z(){m(!0),x(null);try{const{body:V}=lz({statuses:c,order:c.map(fe=>fe.id),pendingResolutions:v}),ne=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ne.ok){const fe=await ne.json().catch(()=>null);if(ne.status===409&&(fe==null?void 0:fe.error)==="unresolved-orphans"){const Ve=Array.isArray(fe.unresolved)?fe.unresolved.map(pe=>pe.id).join(", "):"";throw new Error(`Cannot save — these statuses have assignments that need a resolution: ${Ve}. Click the trash icon on each row to choose remap or delete.`)}if(ne.status===409&&(fe==null?void 0:fe.error)==="concurrent-edit"){const Ve=fe.applied?` (${fe.applied.remapped} remapped, ${fe.applied.deleted} deleted before the conflict)`:"";x({type:"error",message:`Concurrent edit detected${Ve}: ${fe.cause??"an assignment moved to a still-dropped status during save"}. Refreshing — please re-resolve.`}),await B();return}if(ne.status===500&&(fe==null?void 0:fe.error)==="config-write-failed"&&(fe!=null&&fe.applied)){const{remapped:Ve,deleted:pe}=fe.applied,Re=fe.message?`: ${fe.message}`:"";x({type:"error",message:`Resolutions applied (${Ve} remapped, ${pe} deleted) but the status config write failed${Re}. Click Save again to retry.`}),await B();return}throw(fe==null?void 0:fe.error)==="invalid-remap-target"?new Error(`Invalid remap target (${fe.reason}): ${fe.id} → ${fe.target}.`):(fe==null?void 0:fe.error)==="duplicate-resolution-ids"?new Error(`Duplicate resolution ids: ${(fe.ids??[]).join(", ")}`):(fe==null?void 0:fe.error)==="stale-resolution"?new Error(`Stale resolution for id "${fe.id??"?"}".`):(fe==null?void 0:fe.error)==="malformed-resolutions"?new Error(`Malformed resolutions: ${fe.message??"unknown"}`):(fe==null?void 0:fe.error)==="remap-write-failed"||(fe==null?void 0:fe.error)==="delete-failed"||(fe==null?void 0:fe.error)==="scan-failed"?new Error(`${fe.error}: ${fe.cause??"unknown"}`):new Error((fe==null?void 0:fe.error)??`Save failed (HTTP ${ne.status})`)}const de=await ne.json(),ye=Xm(de);u(ye),l(de.custom),k(new Set(ye.map(fe=>fe.id))),j(new Map),b(!1),Uv();const ke=de.applied?` (${de.applied.remapped} remapped, ${de.applied.deleted} deleted)`:"";x({type:"success",message:`Status config saved${ke}`}),q()}catch(V){x({type:"error",message:V instanceof Error?V.message:"Save failed"})}finally{m(!1)}}async function le(){m(!0),x(null);try{const V=await fetch("/api/config/statuses",{method:"DELETE"});if(!V.ok)throw new Error("Reset failed");const ne=await V.json(),de=Xm(ne);u(de),l(ne.custom),k(new Set(de.map(ye=>ye.id))),j(new Map),b(!1),Uv(),x({type:"success",message:"Reset to defaults"}),q()}catch(V){x({type:"error",message:V instanceof Error?V.message:"Reset failed"})}finally{m(!1)}}function _(V,ne,de){u(ye=>{const ke=[...ye];return ke[V]={...ke[V],[ne]:de},ke}),b(!0)}function G(){const V=`status_${c.length+1}`;u(ne=>[...ne,{rowKey:zN(),id:V,label:"New Status",description:"",color:"",terminal:!1}]),b(!0)}function A(V){u(ne=>{const de=ne.filter(ke=>ke.id!==V),ye=new Set(de.map(ke=>ke.id));return j(ke=>wj(ke,ye)),de}),b(!0)}async function z(V){const ne=c[V].id;if(!E.has(ne)){A(ne);return}try{const de=await fetch(`/api/config/statuses/affected/${encodeURIComponent(ne)}`);if(!de.ok)throw new Error(`HTTP ${de.status}`);const ye=await de.json();if(ye.count===0){A(ne);return}N({open:!0,affected:ye,pendingId:ne})}catch(de){x({type:"error",message:`Could not check affected assignments for "${ne}": ${de instanceof Error?de.message:String(de)}`})}}function Q(V){if(!C.open)return;const{pendingId:ne}=C;if(ne!==V.id){N({open:!1});return}if(!c.some(de=>de.id===ne)){x({type:"error",message:`Row for "${ne}" was already removed — modal action ignored.`}),N({open:!1});return}u(de=>{const ye=de.filter(fe=>fe.id!==ne),ke=new Set(ye.map(fe=>fe.id));return j(fe=>{const Ve=wj(fe,ke),pe=new Map(Ve);return pe.set(ne,V),pe}),ye}),b(!0),N({open:!1})}function I(){N({open:!1})}function ue(V){const{active:ne,over:de}=V;!de||ne.id===de.id||(u(ye=>{const ke=ye.findIndex(Ve=>Ve.rowKey===ne.id),fe=ye.findIndex(Ve=>Ve.rowKey===de.id);return ke===-1||fe===-1?ye:ba(ye,ke,fe)}),b(!0))}return e?r.jsx(ft,{label:"Loading settings..."}):n?r.jsx(mt,{error:n}):r.jsx(Mo,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Me,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:L!=="default"?r.jsxs("button",{className:"shell-action text-xs",onClick:X,disabled:D,children:[r.jsx(ea,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[ee&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${ee.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:ee.message}),r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:p0.map(V=>{const ne=V.slug===L;return r.jsxs("button",{type:"button",onClick:()=>U(V.slug),disabled:D,"aria-pressed":ne,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${ne?"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}}),ne&&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(Rs,{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(uz,{}),r.jsx(Iz,{}),r.jsx(Pz,{}),r.jsx(hz,{}),r.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${i?"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(Yh,{className:"h-4 w-4"}),i?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),r.jsxs("button",{className:"shell-action text-xs",onClick:le,disabled:p||!i&&!y,children:[r.jsx(ea,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),h&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${h.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:h.message}),r.jsx(Me,{title:"Status Definitions",description:"Define the statuses assignments can have. Drag rows to set the display order used by Kanban columns, progress bars, and dropdowns.",actions:r.jsxs("button",{className:"shell-action text-xs",onClick:G,children:[r.jsx(en,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx(sf,{sensors:T,collisionDetection:ef,onDragEnd:ue,children:r.jsx(af,{items:c.map(V=>V.rowKey),strategy:of,children:r.jsx("div",{className:"space-y-2",children:c.map((V,ne)=>r.jsx(Oz,{row:V,isSaved:E.has(V.id),onUpdate:(de,ye)=>_(ne,de,ye),onRemove:()=>z(ne)},V.rowKey))})})})}),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:Z,disabled:p||!y,children:[r.jsx(Cd,{className:"h-3.5 w-3.5"}),p?"Saving...":"Save Configuration"]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),B()},disabled:p,children:"Discard Changes"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),r.jsx(iz,{}),C.open&&r.jsx(az,{open:C.open,affected:{...C.affected,label:((me=c.find(V=>V.id===C.affected.id))==null?void 0:me.label)??C.affected.id},remaining:c.filter(V=>V.id!==C.affected.id&&E.has(V.id)).map(V=>({id:V.id,label:V.label})),onResolve:Q,onCancel:I})]})})}const Mi=e=>`${e.workspace}::${e.id}`;function jj(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function Mz(){var O;const{data:e,loading:t,error:n,refetch:s}=P0(),i=$t(),[l,c]=f.useState(""),u=f.useRef(null);uo("list:todos");const[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(""),[E,k]=f.useState("_global"),[v,j]=f.useState(null),[C,N]=f.useState(new Set),[T,L]=f.useState(!1),P=f.useRef(null),[$,D]=f.useState(null);f.useEffect(()=>{let W=!1;return(async()=>{try{const te=await fetch("/api/projects");if(!te.ok)return;const xe=await te.json();W||D(xe.filter(Ae=>!Ae.archived))}catch{}})(),()=>{W=!0}},[]);function J(W,te){W.stopPropagation(),navigator.clipboard.writeText(te),j(te),setTimeout(()=>j(xe=>xe===te?null:xe),1500)}const ee=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const W=[];for(const te of e.workspaces)for(const xe of te.items)W.push({...xe,workspace:te.workspace});return W},[e]),M=f.useMemo(()=>{const W=new Set;for(const te of ee)for(const xe of te.tags)W.add(xe);return Array.from(W).sort()},[ee]),U=f.useMemo(()=>{let W=ee;if(l.trim()){const te=l.toLowerCase();W=W.filter(xe=>xe.description.toLowerCase().includes(te)||xe.tags.some(Ae=>Ae.toLowerCase().includes(te))||xe.id.includes(te))}return p&&(W=W.filter(te=>te.status===p)),h&&(W=W.filter(te=>te.tags.includes(h))),W},[ee,l,p,h]);f.useEffect(()=>{N(new Set),P.current=null},[l,p,h]);const X=f.useMemo(()=>U.filter(W=>C.has(Mi(W))),[U,C]),B=U.length>0&&X.length===U.length,q=X.length>0&&!B,Z=f.useMemo(()=>{if(X.length===0)return null;const W=new Set(X.map(te=>te.workspace));return W.size===1?[...W][0]:null},[X]),le=f.useMemo(()=>{if(!Z||!$)return;const W=$.filter(te=>te.workspace===Z);return W.length===1?W[0].slug:void 0},[Z,$]),_=((O=X[0])==null?void 0:O.description)??"",G=f.useMemo(()=>{if(Z)return null;const W=new Map;for(const te of X)W.has(te.workspace)||W.set(te.workspace,[]),W.get(te.workspace).push(te.id);return Array.from(W,([te,xe])=>({workspace:te,todoIds:xe}))},[X,Z]),A=Z?{kind:"workspace",workspace:Z}:{kind:"aggregate",groups:G??[]};function z(W,te,xe){const Ae=Mi(W);if(!!(xe&&"shiftKey"in xe&&xe.shiftKey)&&P.current!=null){const et=Math.min(P.current,te),Ye=Math.max(P.current,te);N(St=>{const Bt=new Set(St);for(let st=et;st<=Ye;st++){const ae=U[st];ae&&Bt.add(Mi(ae))}return Bt})}else N(et=>{const Ye=new Set(et);return Ye.has(Ae)?Ye.delete(Ae):Ye.add(Ae),Ye});P.current=te}function Q(){N(W=>{const te=new Set(W);if(B)for(const xe of U)te.delete(Mi(xe));else for(const xe of U)te.add(Mi(xe));return te})}function I(){N(new Set),P.current=null}function ue(W){I(),s(),W!=null&&W.assignmentRef&&i(jj(W.assignmentRef))}const me=f.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 te of e.workspaces)W.open+=te.counts.open,W.in_progress+=te.counts.in_progress,W.completed+=te.counts.completed,W.blocked+=te.counts.blocked,W.total+=te.counts.total;return W},[e]);async function V(){y.trim()&&(await og(E,y.trim()),b(""),s())}const ne={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function de(W,te,xe){ye(W,te,ne[xe]||"open")}async function ye(W,te,xe){switch(xe){case"open":await $0(W,te);break;case"in_progress":await D0(W,te);break;case"completed":await R0(W,te);break;case"blocked":await A0(W,te);break}s()}async function ke(W,te){await L0(W,te),s()}const{hotkeyRowProps:fe}=Xl(U,{scope:"list:todos",bindO:!1,onOpen:W=>de(W.workspace,W.id,W.status)});zt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var W;return(W=u.current)==null?void 0:W.focus()}}),zt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[Ve,pe]=fs(),Re=Ve.get("focus");return f.useEffect(()=>{if(!Re)return;const W=document.querySelector(`[data-todo-id="${CSS.escape(Re)}"]`);if(!W)return;W.scrollIntoView({block:"nearest"}),W.classList.add("ring-2","ring-primary/60");const te=window.setTimeout(()=>{W.classList.remove("ring-2","ring-primary/60"),pe(xe=>{const Ae=new URLSearchParams(xe);return Ae.delete("focus"),Ae})},1500);return()=>window.clearTimeout(te)},[Re,U.length,pe]),t?r.jsx(ft,{label:"Loading todos..."}):n?r.jsx(mt,{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(Rn,{label:"Open",value:me.open,icon:Rr}),r.jsx(Rn,{label:"In Progress",value:me.in_progress,icon:Jh,tone:"info"}),r.jsx(Rn,{label:"Blocked",value:me.blocked,icon:Zh,tone:"warn"}),r.jsx(Rn,{label:"Completed",value:me.completed,icon:Rr,tone:"default"})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("select",{value:E,onChange:W=>k(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=>b(W.target.value),onKeyDown:W=>W.key==="Enter"&&V(),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:V,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(en,{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(lo,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:u,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:p,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"})]}),M.length>0&&r.jsxs("select",{value:h,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"}),M.map(W=>r.jsxs("option",{value:W,children:["#",W]},W))]})]}),X.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:[X.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(X.map(W=>W.workspace)).size," workspaces"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>L(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote to assignment"}),r.jsx("button",{type:"button",onClick:I,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,U.length===0?r.jsx(ct,{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:B,ref:W=>{W&&(W.indeterminate=q)},onChange:Q,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-1",children:U.map((W,te)=>{const xe=Mi(W),Ae=C.has(xe);return r.jsxs("div",{"data-todo-id":W.id,...fe(te),className:`surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition ${Ae?"ring-1 ring-foreground/20":""}`,onClick:()=>de(W.workspace,W.id,W.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${W.id}`,checked:Ae,onChange:()=>{},onClick:Ee=>{Ee.stopPropagation(),z(W,te,Ee)},className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsx(lx,{status:W.status,onChange:Ee=>ye(W.workspace,W.id,Ee)}),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(Ee=>`#${Ee}`).join(" ")}),W.linkedAssignmentRef?r.jsxs(Ne,{to:jj(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:Ee=>Ee.stopPropagation(),children:[r.jsx(qj,{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(Ne,{to:`/w/${W.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:Ee=>Ee.stopPropagation(),children:W.workspace})}),v===W.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Rs,{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:Ee=>J(Ee,W.id),children:["t:",W.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:Ee=>J(Ee,W.id),children:r.jsx(Al,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:Ee=>{Ee.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(cx,{open:T,selectedIds:X.map(W=>W.id),scope:A,onOpenChange:L,onDone:ue,defaultProject:le,defaultTitle:_,allowOneOff:!0})]})}const kj=80,Fz={kanban:"Kanban",list:"List",table:"Table"},zz={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",created:"Created",updated:"Updated"};function Bz({open:e,onOpenChange:t,workspace:n,initialView:s,onSubmit:i}){const l=!!s,c=Ko(),u=qd(),{data:p}=Vo(),{data:m}=Td(),[h,x]=f.useState(""),[y,b]=f.useState(Ii.viewMode),[E,k]=f.useState([]),[v,j]=f.useState([]),[C,N]=f.useState([]),[T,L]=f.useState([]),[P,$]=f.useState([]),[D,J]=f.useState([]),[ee,M]=f.useState("all"),[U,X]=f.useState(null),[B,q]=f.useState(""),[Z,le]=f.useState(Ii.sortField),[_,G]=f.useState(Ii.sortDirection),[A,z]=f.useState(!1),[Q,I]=f.useState(null);function ue(){b(Ii.viewMode),k([]),j([]),N([]),L([]),$([]),J([]),M("all"),X(null),q(""),le(Ii.sortField),G(Ii.sortDirection)}f.useEffect(()=>{if(e)if(I(null),z(!1),s){const O=s.config.filters;x(s.name),b(s.config.viewMode),k(qe(O.status)),j(qe(O.priority)),N(qe(O.type)),L(qe(O.project)),$(qe(O.assignee)),J(qe(O.tags)),M(O.activity??"all"),X(pN(O.dateRange)),q(O.search??""),le(s.config.sortField),G(s.config.sortDirection)}else x(""),ue()},[e,s]);const me=O=>W=>O?O==="_ungrouped"?W.projectWorkspace===null:W.projectWorkspace===O:!0,V=f.useMemo(()=>{const O=te=>n?n==="_ungrouped"?te.workspace===null:te.workspace===n:!0,W=(p??[]).filter(O);return[{value:"__standalone__",label:"No project"},...W.map(te=>({value:te.slug,label:te.title}))]},[p,n]),ne=f.useMemo(()=>{const O=new Set,W=me(n);for(const xe of(m==null?void 0:m.assignments)??[])W(xe)&&xe.assignee&&O.add(xe.assignee);const te=[{value:"__unassigned__",label:"Unassigned"}];for(const xe of Array.from(O).sort())te.push({value:xe,label:xe});return te},[m,n]),de=f.useMemo(()=>{const O=new Set,W=me(n);for(const te of(m==null?void 0:m.assignments)??[])if(W(te))for(const xe of te.tags??[])O.add(xe);return Array.from(O).sort().map(te=>({value:te,label:te}))},[m,n]),ye=f.useMemo(()=>c.order.map(O=>({value:O,label:ec(c,O)})),[c]),ke=f.useMemo(()=>zF.map(O=>({value:O,label:O[0].toUpperCase()+O.slice(1)})),[]),fe=f.useMemo(()=>u.definitions.map(O=>({value:O.id,label:Yi(u,O.id)})),[u]),Ve=vg.map(O=>({value:O,label:Fz[O]})),pe=h.trim(),Re=pe.length>0&&pe.length<=kj;return r.jsx(ir,{open:e,onOpenChange:t,children:r.jsx(qn,{className:"max-w-lg",children:r.jsxs("form",{className:"space-y-4",onSubmit:async O=>{if(O.preventDefault(),!Re||A)return;z(!0),I(null);const W={viewMode:y,filters:{status:E,priority:v,type:C,project:T,assignee:P,tags:D,activity:ee,dateRange:Hl(U),search:B},sortField:Z,sortDirection:_};try{await i(pe,W)}catch(te){I(te instanceof Error?te.message:String(te)),z(!1)}},children:[r.jsx(Yr,{children:r.jsx(Gn,{children:l?"Edit view":"Create view"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium text-muted-foreground",htmlFor:"create-view-name",children:"Name"}),r.jsx("input",{id:"create-view-name",type:"text",value:h,autoFocus:!0,required:!0,maxLength:kj,onChange:O=>x(O.target.value),placeholder:"View name",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("div",{className:"space-y-2",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"View mode"}),r.jsx(Kd,{value:y,onChange:O=>b(O),options:Ve})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[r.jsx(ts,{label:"Status",children:r.jsx(Pn,{ariaLabel:"Status filter",className:"w-full",allLabel:"All statuses",options:ye,value:E,onChange:k})}),r.jsx(ts,{label:"Priority",children:r.jsx(Pn,{ariaLabel:"Priority filter",className:"w-full",allLabel:"All priorities",options:ke,value:v,onChange:j})}),r.jsx(ts,{label:"Type",children:r.jsx(Pn,{ariaLabel:"Type filter",className:"w-full",allLabel:"All types",options:fe,value:C,onChange:N})}),r.jsx(ts,{label:"Project",children:r.jsx(Pn,{ariaLabel:"Project filter",className:"w-full",allLabel:"All projects",options:V,value:T,onChange:L})}),r.jsx(ts,{label:"Assignee",children:r.jsx(Pn,{ariaLabel:"Assignee filter",className:"w-full",allLabel:"All assignees",options:ne,value:P,onChange:$})}),r.jsx(ts,{label:"Tags",children:r.jsx(Pn,{ariaLabel:"Tags filter",className:"w-full",allLabel:"Any tags",options:de,value:D,onChange:J})}),r.jsx(ts,{label:"Activity",children:r.jsxs("select",{value:ee,onChange:O=>M(O.target.value),className:"editor-input w-full",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(ts,{label:"Date range",children:r.jsx(hx,{className:"w-full",value:U,onChange:X})}),r.jsx(ts,{label:"Search",className:"sm:col-span-2",children:r.jsx("input",{type:"text",value:B,onChange:O=>q(O.target.value),placeholder:"Title / slug / project contains…",className:"editor-input w-full"})}),r.jsx(ts,{label:"Sort by",className:"sm:col-span-2",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("select",{value:Z,onChange:O=>le(O.target.value),className:"editor-input w-full",children:Ok.map(O=>r.jsx("option",{value:O,children:zz[O]},O))}),r.jsx("button",{type:"button",onClick:()=>G(O=>O==="asc"?"desc":"asc"),className:"shell-action shrink-0",title:_==="asc"?"Ascending":"Descending",children:_==="asc"?"Asc":"Desc"})]})})]}),Q?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:Q}):null,r.jsxs(As,{className:"sm:justify-between",children:[r.jsx("button",{type:"button",onClick:ue,className:"shell-action",disabled:A,children:"Clear all"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:A,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!Re||A,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:A?"Saving…":l?"Save changes":"Create view"})]})]})]})})})}function ts({label:e,className:t,children:n}){return r.jsxs("label",{className:`space-y-1 ${t??""}`,children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:e}),n]})}const Uz={kanban:"Kanban",list:"List",table:"Table"};function Sj(){const{workspace:e}=Lt(),{views:t,loading:n}=kg(),{toast:s,showToast:i,dismissToast:l}=xx(),[c,u]=f.useState(null),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,b]=f.useState(null);async function E(){if(c){m(!0);try{await ZA(c.id),u(null)}catch(N){i(N instanceof Error?N.message:"Failed to delete saved view")}finally{m(!1)}}}async function k(N,T){const{workspace:L,config:P}=rj(T,e??null);try{await td({name:N,workspace:L,config:P}),x(!1),i(`Created view "${N}"`)}catch($){throw i($ instanceof Error?$.message:"Failed to create saved view"),$}}async function v(N,T,L){const P=t.find(J=>J.id===N.id)??N,$=rj(L,P.workspace).config,D=gx(P.config,$,P.config);try{await Od(N.id,{name:T,config:D}),b(null),i(`Updated view "${T}"`)}catch(J){throw i(J instanceof Error?J.message:"Failed to update saved view"),J}}async function j(N){try{await td({name:`${N.name} (copy)`,workspace:N.workspace,config:N.config}),i(`Duplicated "${N.name}"`)}catch(T){i(T instanceof Error?T.message:"Failed to duplicate saved view")}}const C=r.jsxs("button",{type:"button",onClick:()=>x(!0),className:"shell-action inline-flex items-center gap-1.5 bg-foreground text-background hover:opacity-90",children:[r.jsx(en,{className:"h-4 w-4"}),"Create view"]});return r.jsxs("div",{className:"space-y-4",children:[r.jsx(P1,{title:"Saved Views",description:"Create a view here, or browse, rename, and apply views captured from any board.",actions:C}),n?r.jsx(ft,{label:"Loading saved views…"}):t.length===0?r.jsx(ct,{title:"No saved views yet",description:"Create your first view here, or capture one from any assignments board.",actions:C}):r.jsx(Me,{children:r.jsx("ul",{className:"divide-y divide-border/60",children:t.map(N=>r.jsx(Vz,{view:N,onRenameError:T=>i(T),onRequestDelete:()=>u(N),onRequestEdit:()=>b(N),onRequestDuplicate:()=>void j(N)},N.id))})}),r.jsx(Bz,{open:h||y!==null,onOpenChange:N=>{N||(x(!1),b(null))},workspace:y?y.workspace:e??null,initialView:y,onSubmit:y?(N,T)=>v(y,N,T):k}),r.jsx(va,{open:c!==null,title:"Delete saved view?",description:c?`Delete '${c.name}'? Any Overview widgets referencing this view will become empty.`:"",confirmLabel:"Delete",loading:p,destructive:!0,onConfirm:E,onOpenChange:N=>{!N&&!p&&u(null)}}),r.jsx(yx,{toast:s,onDismiss:l})]})}function Vz({view:e,onRenameError:t,onRequestDelete:n,onRequestEdit:s,onRequestDuplicate:i}){const l=$t(),[c,u]=f.useState(!1),[p,m]=f.useState(e.name),[h,x]=f.useState(!1),y=f.useRef(null);f.useEffect(()=>{var j,C;c&&((j=y.current)==null||j.focus(),(C=y.current)==null||C.select())},[c]),f.useEffect(()=>{c||m(e.name)},[e.name,c]);async function b(){const j=p.trim();if(!j||j===e.name){m(e.name),u(!1);return}x(!0);try{await Od(e.id,{name:j}),u(!1)}catch(C){t(C instanceof Error?C.message:"Failed to rename saved view")}finally{x(!1)}}function E(){m(e.name),u(!1)}const k=VF(e.config.filters),v=e.workspace?Nn(e.workspace):null;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[c?r.jsx("input",{ref:y,type:"text",value:p,onChange:j=>m(j.target.value),onBlur:()=>{h||b()},onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),b()):j.key==="Escape"&&(j.preventDefault(),E())},disabled:h,className:"editor-input max-w-xs text-sm font-semibold","aria-label":"Rename saved view"}):r.jsxs("button",{type:"button",onClick:()=>u(!0),className:"group inline-flex items-center gap-1.5 rounded-md text-left text-sm font-semibold text-foreground hover:text-foreground/80",title:"Click to rename",children:[r.jsx("span",{className:"truncate",children:e.name}),r.jsx(Uo,{className:"h-3 w-3 text-muted-foreground/50 opacity-0 transition group-hover:opacity-100"})]}),r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:Uz[e.config.viewMode]}),v?r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted/60 px-2 py-0.5 text-xs text-muted-foreground",children:v}):null]}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:k})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>l(hN(e)),className:"shell-action",children:"Apply"}),r.jsx("button",{type:"button",onClick:s,className:"shell-action",children:"Edit"}),r.jsx("button",{type:"button",onClick:i,className:"shell-action",children:"Duplicate"}),r.jsx("button",{type:"button",onClick:n,className:"shell-action border-destructive/40 text-destructive hover:bg-destructive/10",children:"Delete"})]})]})}function Hz(){return r.jsx(Z2,{children:r.jsx(hA,{children:r.jsx(T2,{children:r.jsxs(ze,{element:r.jsx(OA,{}),children:[r.jsx(ze,{path:"/",element:r.jsx(y$,{})}),r.jsx(ze,{path:"/projects",element:r.jsx(Wv,{})}),r.jsx(ze,{path:"/archive",element:r.jsx($$,{})}),r.jsx(ze,{path:"/assignments",element:r.jsx(uj,{})}),r.jsx(ze,{path:"/assignments/new",element:r.jsx(mj,{})}),r.jsx(ze,{path:"/assignments/:id",element:r.jsx(m6,{})}),r.jsx(ze,{path:"/assignments/:id/edit",element:r.jsx(Km,{})}),r.jsx(ze,{path:"/assignments/:id/plan/edit",element:r.jsx(qm,{})}),r.jsx(ze,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(Gm,{})}),r.jsx(ze,{path:"/assignments/:id/handoff/edit",element:r.jsx(Ym,{})}),r.jsx(ze,{path:"/assignments/:id/decision-record/edit",element:r.jsx(Jm,{})}),r.jsx(ze,{path:"/servers",element:r.jsx(gj,{})}),r.jsx(ze,{path:"/inventories",element:r.jsx(xj,{})}),r.jsx(ze,{path:"/usage",element:r.jsx(yj,{})}),r.jsx(ze,{path:"/agent-sessions",element:r.jsx(bj,{})}),r.jsx(ze,{path:"/playbooks",element:r.jsx(K6,{})}),r.jsx(ze,{path:"/playbooks/create",element:r.jsx(G6,{})}),r.jsx(ze,{path:"/playbooks/:slug",element:r.jsx(q6,{})}),r.jsx(ze,{path:"/playbooks/:slug/edit",element:r.jsx(Y6,{})}),r.jsx(ze,{path:"/memories",element:r.jsx(J6,{})}),r.jsx(ze,{path:"/memories/new",element:r.jsx(Q6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(X6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(Z6,{})}),r.jsx(ze,{path:"/resources",element:r.jsx(ez,{})}),r.jsx(ze,{path:"/resources/new",element:r.jsx(nz,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(tz,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(rz,{})}),r.jsx(ze,{path:"/todos",element:r.jsx(Mz,{})}),r.jsx(ze,{path:"/views",element:r.jsx(Sj,{})}),r.jsx(ze,{path:"/help",element:r.jsx(v$,{})}),r.jsx(ze,{path:"/settings",element:r.jsx(_z,{})}),r.jsx(ze,{path:"/create/project",element:r.jsx(fj,{})}),r.jsx(ze,{path:"/projects/:slug",element:r.jsx(oj,{})}),r.jsx(ze,{path:"/projects/:slug/edit",element:r.jsx(hj,{})}),r.jsx(ze,{path:"/projects/:slug/create/assignment",element:r.jsx(pj,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(aj,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(Km,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(qm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Gm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Ym,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Jm,{})}),r.jsx(ze,{path:"/w/:workspace/projects",element:r.jsx(Wv,{})}),r.jsx(ze,{path:"/w/:workspace/assignments",element:r.jsx(uj,{})}),r.jsx(ze,{path:"/w/:workspace/assignments/new",element:r.jsx(mj,{})}),r.jsx(ze,{path:"/w/:workspace/servers",element:r.jsx(gj,{})}),r.jsx(ze,{path:"/w/:workspace/inventories",element:r.jsx(xj,{})}),r.jsx(ze,{path:"/w/:workspace/usage",element:r.jsx(yj,{})}),r.jsx(ze,{path:"/w/:workspace/agent-sessions",element:r.jsx(bj,{})}),r.jsx(ze,{path:"/w/:workspace/todos",element:r.jsx(EF,{})}),r.jsx(ze,{path:"/w/:workspace/views",element:r.jsx(Sj,{})}),r.jsx(ze,{path:"/w/:workspace/create/project",element:r.jsx(fj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug",element:r.jsx(oj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(hj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(pj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(aj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(Km,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(qm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Gm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Ym,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Jm,{})})]})})})})}DP();TE.createRoot(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx($P,{children:r.jsx(Hz,{})})}));export{iL as _,Kz as a,yd as g};
|