syntaur 0.8.0 → 0.12.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/.claude-plugin/plugin.json +9 -1
- package/dashboard/dist/assets/{_basePickBy-CIZortGD.js → _basePickBy-XOV2F7dX.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-BHP5NBQ7.js → _baseUniq-Dccfk3fK.js} +1 -1
- package/dashboard/dist/assets/{arc-BLtQy7Cl.js → arc-TwJ5RF-H.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-0mhIBjWy.js → architectureDiagram-2XIMDMQ5-CpkVJudw.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-CM7K5Tf5.js → blockDiagram-WCTKOSBZ-Ck6VQ4Fh.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-gsbeygvS.js → c4Diagram-IC4MRINW-B5V7YG03.js} +1 -1
- package/dashboard/dist/assets/channel-AEMTX70R.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-CneRz9Nd.js → chunk-4BX2VUAB-rBdyOxAe.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-uetANWHd.js → chunk-55IACEB6-DKlNXjYt.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-3-tNszoF.js → chunk-FMBD7UC4-Cqm0PtUI.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-DOO88rZD.js → chunk-JSJVCQXG-CQyXQcG3.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-Bnc1CFy2.js → chunk-KX2RTZJC-DmqjHPpJ.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-BfViC1Ms.js → chunk-NQ4KR5QH-CHXoBcYa.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-CgjyAt2l.js → chunk-QZHKN3VN-Dd4sChBS.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-BYFermSR.js → chunk-WL4C6EOR-D-QLnkY8.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-LzuOAGzu.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-LzuOAGzu.js +1 -0
- package/dashboard/dist/assets/clone-Cw63QGUJ.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-CE-k5SLv.js → cose-bilkent-S5V4N54A-VZi6uV56.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-CX7Br8LQ.js → dagre-KLK3FWXG-CtT97Qhx.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-t-xhWjCU.js → diagram-E7M64L7V-BjYTNNHb.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-BVhcTXsJ.js → diagram-IFDJBPK2-qj8_r6fb.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-fxt8ZSca.js → diagram-P4PSJMXO-DlfWo7Vt.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-C20k2bxX.js → erDiagram-INFDFZHY-Ch_nApTv.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-CdeygexM.js → flowDiagram-PKNHOUZH-EOVsqNyi.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-CPsoOAV-.js → ganttDiagram-A5KZAMGK-CS-lx0B-.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-t0tCTIZy.js → gitGraphDiagram-K3NZZRJ6-Ba6RDzPy.js} +1 -1
- package/dashboard/dist/assets/{graph-Bcqd31wL.js → graph-BKaAyLk-.js} +1 -1
- package/dashboard/dist/assets/index-BTWPZaIA.css +1 -0
- package/dashboard/dist/assets/index-Dk9PBm5B.js +510 -0
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-DgoKvH3N.js → infoDiagram-LFFYTUFH-Cr20xEsd.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-CGr4P8do.js → ishikawaDiagram-PHBUUO56-CuILV9ph.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-CHYRi6wF.js → journeyDiagram-4ABVD52K-CO-l7Mpm.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-kwzqrFcW.js → kanban-definition-K7BYSVSG-CcirPw_S.js} +1 -1
- package/dashboard/dist/assets/{layout-wud47qGs.js → layout-BXvr8dMw.js} +1 -1
- package/dashboard/dist/assets/{linear-DG5js90X.js → linear-B85hgYnX.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-BDw69uC2.js → mermaid.core-DcZN9Xp2.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-Dw_uyg1-.js → mindmap-definition-YRQLILUH-Bxi6p5_3.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-C7NBi6tK.js → pieDiagram-SKSYHLDU-DOSvU0UD.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-_N_BSBd4.js → quadrantDiagram-337W2JSQ-Cmo-5tW9.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-BqUiqfP1.js → requirementDiagram-Z7DCOOCP-Dw8alwuI.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-C2Qq5ULW.js → sankeyDiagram-WA2Y5GQK-ZPB-rzOg.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-BOCF2z8f.js → sequenceDiagram-2WXFIKYE-Ct8bkK2h.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-BvDyTxC5.js → stateDiagram-RAJIS63D-DnGOXlmx.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-COGzlZxn.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-DNNZxSrG.js → timeline-definition-YZTLITO2-AUFmbJjr.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-C6hOdiGH.js → treemap-KZPCXAKY-Dw5FDFAV.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-FmXl6puP.js → vennDiagram-LZ73GAT5-DfxicU4N.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-Bjav12WG.js → xychartDiagram-JWTSCODW--9N0V1r_.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/syntaur-logo.svg +5 -13
- package/dist/dashboard/server.js +363 -3
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +2140 -153
- package/dist/index.js.map +1 -1
- package/examples/playbooks/keep-records-updated.md +2 -1
- package/package.json +1 -1
- package/platforms/claude-code/.claude-plugin/plugin.json +9 -1
- package/platforms/claude-code/agents/syntaur-expert.md +1 -1
- package/platforms/claude-code/commands/add-memory/add-memory.md +18 -0
- package/platforms/claude-code/commands/add-resource/add-resource.md +16 -0
- package/platforms/claude-code/commands/list-assignments/list-assignments.md +16 -0
- package/platforms/claude-code/commands/log-progress/log-progress.md +16 -0
- package/platforms/claude-code/commands/replan/replan.md +16 -0
- package/platforms/claude-code/commands/resume-session/resume-session.md +16 -0
- package/platforms/claude-code/commands/set-workspace/set-workspace.md +16 -0
- package/platforms/claude-code/commands/syntaur-worktree/syntaur-worktree.md +16 -0
- package/platforms/claude-code/references/protocol-summary.md +8 -0
- package/platforms/claude-code/skills/add-memory/SKILL.md +96 -0
- package/platforms/claude-code/skills/add-resource/SKILL.md +85 -0
- package/platforms/claude-code/skills/capture-artifacts/SKILL.md +84 -0
- package/platforms/claude-code/skills/complete-assignment/SKILL.md +2 -1
- package/platforms/claude-code/skills/list-assignments/SKILL.md +73 -0
- package/platforms/claude-code/skills/log-progress/SKILL.md +128 -0
- package/platforms/claude-code/skills/plan-assignment/SKILL.md +29 -8
- package/platforms/claude-code/skills/replan/SKILL.md +113 -0
- package/platforms/claude-code/skills/resume-session/SKILL.md +83 -0
- package/platforms/claude-code/skills/set-workspace/SKILL.md +109 -0
- package/platforms/claude-code/skills/syntaur-protocol/SKILL.md +4 -0
- package/platforms/claude-code/skills/syntaur-protocol/references/protocol-summary.md +8 -0
- package/platforms/claude-code/skills/syntaur-worktree/SKILL.md +117 -0
- package/platforms/codex/README.md +2 -2
- package/platforms/codex/agents/syntaur-operator.md +7 -0
- package/platforms/codex/commands/add-memory.md +16 -0
- package/platforms/codex/commands/add-resource.md +14 -0
- package/platforms/codex/commands/list-assignments.md +13 -0
- package/platforms/codex/commands/log-progress.md +14 -0
- package/platforms/codex/commands/replan.md +15 -0
- package/platforms/codex/commands/resume-session.md +15 -0
- package/platforms/codex/commands/set-workspace.md +15 -0
- package/platforms/codex/commands/syntaur-worktree.md +15 -0
- package/platforms/codex/references/protocol-summary.md +8 -0
- package/platforms/codex/skills/add-memory/SKILL.md +96 -0
- package/platforms/codex/skills/add-resource/SKILL.md +85 -0
- package/platforms/codex/skills/capture-artifacts/SKILL.md +84 -0
- package/platforms/codex/skills/complete-assignment/SKILL.md +2 -1
- package/platforms/codex/skills/list-assignments/SKILL.md +73 -0
- package/platforms/codex/skills/log-progress/SKILL.md +128 -0
- package/platforms/codex/skills/plan-assignment/SKILL.md +29 -8
- package/platforms/codex/skills/replan/SKILL.md +113 -0
- package/platforms/codex/skills/resume-session/SKILL.md +83 -0
- package/platforms/codex/skills/set-workspace/SKILL.md +109 -0
- package/platforms/codex/skills/syntaur-protocol/SKILL.md +4 -0
- package/platforms/codex/skills/syntaur-protocol/references/protocol-summary.md +8 -0
- package/platforms/codex/skills/syntaur-worktree/SKILL.md +117 -0
- package/skills/add-memory/SKILL.md +96 -0
- package/skills/add-resource/SKILL.md +85 -0
- package/skills/capture-artifacts/SKILL.md +84 -0
- package/skills/complete-assignment/SKILL.md +2 -1
- package/skills/list-assignments/SKILL.md +73 -0
- package/skills/log-progress/SKILL.md +128 -0
- package/skills/plan-assignment/SKILL.md +29 -8
- package/skills/replan/SKILL.md +113 -0
- package/skills/resume-session/SKILL.md +83 -0
- package/skills/set-workspace/SKILL.md +109 -0
- package/skills/syntaur-protocol/SKILL.md +4 -0
- package/skills/syntaur-protocol/references/protocol-summary.md +8 -0
- package/skills/syntaur-worktree/SKILL.md +117 -0
- package/dashboard/dist/assets/channel-FWLgstBg.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-BAvQTSn_.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-BAvQTSn_.js +0 -1
- package/dashboard/dist/assets/clone-rSEllQ1P.js +0 -1
- package/dashboard/dist/assets/index-bLWoSCLL.css +0 -1
- package/dashboard/dist/assets/index-eS0wtDO0.js +0 -500
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-TaLLhLWD.js +0 -1
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
function vS(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(s,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Dc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function I_(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),n}var qd={exports:{}},Vi={},Kd={exports:{}},Ke={};/**
|
|
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 Sx;function bS(){if(Sx)return Ke;Sx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),x=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function j(M,Q,L){this.props=M,this.context=Q,this.refs=k,this.updater=L||b}j.prototype.isReactComponent={},j.prototype.setState=function(M,Q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,Q,"setState")},j.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=j.prototype;function T(M,Q,L){this.props=M,this.context=Q,this.refs=k,this.updater=L||b}var N=T.prototype=new S;N.constructor=T,C(N,j.prototype),N.isPureReactComponent=!0;var A=Array.isArray,I=Object.prototype.hasOwnProperty,R={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function O(M,Q,L){var ge,Ne={},te=null,fe=null;if(Q!=null)for(ge in Q.ref!==void 0&&(fe=Q.ref),Q.key!==void 0&&(te=""+Q.key),Q)I.call(Q,ge)&&!D.hasOwnProperty(ge)&&(Ne[ge]=Q[ge]);var be=arguments.length-2;if(be===1)Ne.children=L;else if(1<be){for(var je=Array(be),we=0;we<be;we++)je[we]=arguments[we+2];Ne.children=je}if(M&&M.defaultProps)for(ge in be=M.defaultProps,be)Ne[ge]===void 0&&(Ne[ge]=be[ge]);return{$$typeof:e,type:M,key:te,ref:fe,props:Ne,_owner:R.current}}function G(M,Q){return{$$typeof:e,type:M.type,key:Q,ref:M.ref,props:M.props,_owner:M._owner}}function re(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function z(M){var Q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(L){return Q[L]})}var K=/\/+/g;function q(M,Q){return typeof M=="object"&&M!==null&&M.key!=null?z(""+M.key):Q.toString(36)}function J(M,Q,L,ge,Ne){var te=typeof M;(te==="undefined"||te==="boolean")&&(M=null);var fe=!1;if(M===null)fe=!0;else switch(te){case"string":case"number":fe=!0;break;case"object":switch(M.$$typeof){case e:case t:fe=!0}}if(fe)return fe=M,Ne=Ne(fe),M=ge===""?"."+q(fe,0):ge,A(Ne)?(L="",M!=null&&(L=M.replace(K,"$&/")+"/"),J(Ne,Q,L,"",function(we){return we})):Ne!=null&&(re(Ne)&&(Ne=G(Ne,L+(!Ne.key||fe&&fe.key===Ne.key?"":(""+Ne.key).replace(K,"$&/")+"/")+M)),Q.push(Ne)),1;if(fe=0,ge=ge===""?".":ge+":",A(M))for(var be=0;be<M.length;be++){te=M[be];var je=ge+q(te,be);fe+=J(te,Q,L,je,Ne)}else if(je=v(M),typeof je=="function")for(M=je.call(M),be=0;!(te=M.next()).done;)te=te.value,je=ge+q(te,be++),fe+=J(te,Q,L,je,Ne);else if(te==="object")throw Q=String(M),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return fe}function _(M,Q,L){if(M==null)return M;var ge=[],Ne=0;return J(M,ge,"","",function(te){return Q.call(L,te,Ne++)}),ge}function F(M){if(M._status===-1){var Q=M._result;Q=Q(),Q.then(function(L){(M._status===0||M._status===-1)&&(M._status=1,M._result=L)},function(L){(M._status===0||M._status===-1)&&(M._status=2,M._result=L)}),M._status===-1&&(M._status=0,M._result=Q)}if(M._status===1)return M._result.default;throw M._result}var B={current:null},U={transition:null},Z={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:U,ReactCurrentOwner:R};function P(){throw Error("act(...) is not supported in production builds of React.")}return Ke.Children={map:_,forEach:function(M,Q,L){_(M,function(){Q.apply(this,arguments)},L)},count:function(M){var Q=0;return _(M,function(){Q++}),Q},toArray:function(M){return _(M,function(Q){return Q})||[]},only:function(M){if(!re(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ke.Component=j,Ke.Fragment=n,Ke.Profiler=a,Ke.PureComponent=T,Ke.StrictMode=s,Ke.Suspense=p,Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ke.act=P,Ke.cloneElement=function(M,Q,L){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ge=C({},M.props),Ne=M.key,te=M.ref,fe=M._owner;if(Q!=null){if(Q.ref!==void 0&&(te=Q.ref,fe=R.current),Q.key!==void 0&&(Ne=""+Q.key),M.type&&M.type.defaultProps)var be=M.type.defaultProps;for(je in Q)I.call(Q,je)&&!D.hasOwnProperty(je)&&(ge[je]=Q[je]===void 0&&be!==void 0?be[je]:Q[je])}var je=arguments.length-2;if(je===1)ge.children=L;else if(1<je){be=Array(je);for(var we=0;we<je;we++)be[we]=arguments[we+2];ge.children=be}return{$$typeof:e,type:M.type,key:Ne,ref:te,props:ge,_owner:fe}},Ke.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:l,_context:M},M.Consumer=M},Ke.createElement=O,Ke.createFactory=function(M){var Q=O.bind(null,M);return Q.type=M,Q},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(M){return{$$typeof:d,render:M}},Ke.isValidElement=re,Ke.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:F}},Ke.memo=function(M,Q){return{$$typeof:m,type:M,compare:Q===void 0?null:Q}},Ke.startTransition=function(M){var Q=U.transition;U.transition={};try{M()}finally{U.transition=Q}},Ke.unstable_act=P,Ke.useCallback=function(M,Q){return B.current.useCallback(M,Q)},Ke.useContext=function(M){return B.current.useContext(M)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(M){return B.current.useDeferredValue(M)},Ke.useEffect=function(M,Q){return B.current.useEffect(M,Q)},Ke.useId=function(){return B.current.useId()},Ke.useImperativeHandle=function(M,Q,L){return B.current.useImperativeHandle(M,Q,L)},Ke.useInsertionEffect=function(M,Q){return B.current.useInsertionEffect(M,Q)},Ke.useLayoutEffect=function(M,Q){return B.current.useLayoutEffect(M,Q)},Ke.useMemo=function(M,Q){return B.current.useMemo(M,Q)},Ke.useReducer=function(M,Q,L){return B.current.useReducer(M,Q,L)},Ke.useRef=function(M){return B.current.useRef(M)},Ke.useState=function(M){return B.current.useState(M)},Ke.useSyncExternalStore=function(M,Q,L){return B.current.useSyncExternalStore(M,Q,L)},Ke.useTransition=function(){return B.current.useTransition()},Ke.version="18.3.1",Ke}var Nx;function Cp(){return Nx||(Nx=1,Kd.exports=bS()),Kd.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 Cx;function wS(){if(Cx)return Vi;Cx=1;var e=Cp(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(d,p,m){var h,x={},v=null,b=null;m!==void 0&&(v=""+m),p.key!==void 0&&(v=""+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(d&&d.defaultProps)for(h in p=d.defaultProps,p)x[h]===void 0&&(x[h]=p[h]);return{$$typeof:t,type:d,key:v,ref:b,props:x,_owner:a.current}}return Vi.Fragment=n,Vi.jsx=c,Vi.jsxs=c,Vi}var Ex;function jS(){return Ex||(Ex=1,qd.exports=wS()),qd.exports}var o=jS(),g=Cp();const Pt=Dc(g),Kv=vS({__proto__:null,default:Pt},[g]);var Hl={},Gd={exports:{}},Cn={},Yd={exports:{}},Xd={};/**
|
|
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 Px;function kS(){return Px||(Px=1,(function(e){function t(U,Z){var P=U.length;U.push(Z);e:for(;0<P;){var M=P-1>>>1,Q=U[M];if(0<a(Q,Z))U[M]=Z,U[P]=Q,P=M;else break e}}function n(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var Z=U[0],P=U.pop();if(P!==Z){U[0]=P;e:for(var M=0,Q=U.length,L=Q>>>1;M<L;){var ge=2*(M+1)-1,Ne=U[ge],te=ge+1,fe=U[te];if(0>a(Ne,P))te<Q&&0>a(fe,Ne)?(U[M]=fe,U[te]=P,M=te):(U[M]=Ne,U[ge]=P,M=ge);else if(te<Q&&0>a(fe,P))U[M]=fe,U[te]=P,M=te;else break e}}return Z}function a(U,Z){var P=U.sortIndex-Z.sortIndex;return P!==0?P:U.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],m=[],h=1,x=null,v=3,b=!1,C=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(U){for(var Z=n(m);Z!==null;){if(Z.callback===null)s(m);else if(Z.startTime<=U)s(m),Z.sortIndex=Z.expirationTime,t(p,Z);else break;Z=n(m)}}function A(U){if(k=!1,N(U),!C)if(n(p)!==null)C=!0,F(I);else{var Z=n(m);Z!==null&&B(A,Z.startTime-U)}}function I(U,Z){C=!1,k&&(k=!1,S(O),O=-1),b=!0;var P=v;try{for(N(Z),x=n(p);x!==null&&(!(x.expirationTime>Z)||U&&!z());){var M=x.callback;if(typeof M=="function"){x.callback=null,v=x.priorityLevel;var Q=M(x.expirationTime<=Z);Z=e.unstable_now(),typeof Q=="function"?x.callback=Q:x===n(p)&&s(p),N(Z)}else s(p);x=n(p)}if(x!==null)var L=!0;else{var ge=n(m);ge!==null&&B(A,ge.startTime-Z),L=!1}return L}finally{x=null,v=P,b=!1}}var R=!1,D=null,O=-1,G=5,re=-1;function z(){return!(e.unstable_now()-re<G)}function K(){if(D!==null){var U=e.unstable_now();re=U;var Z=!0;try{Z=D(!0,U)}finally{Z?q():(R=!1,D=null)}}else R=!1}var q;if(typeof T=="function")q=function(){T(K)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,_=J.port2;J.port1.onmessage=K,q=function(){_.postMessage(null)}}else q=function(){j(K,0)};function F(U){D=U,R||(R=!0,q())}function B(U,Z){O=j(function(){U(e.unstable_now())},Z)}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(U){U.callback=null},e.unstable_continueExecution=function(){C||b||(C=!0,F(I))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(U){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var P=v;v=Z;try{return U()}finally{v=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,Z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var P=v;v=U;try{return Z()}finally{v=P}},e.unstable_scheduleCallback=function(U,Z,P){var M=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?M+P:M):P=M,U){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=P+Q,U={id:h++,callback:Z,priorityLevel:U,startTime:P,expirationTime:Q,sortIndex:-1},P>M?(U.sortIndex=P,t(m,U),n(p)===null&&U===n(m)&&(k?(S(O),O=-1):k=!0,B(A,P-M))):(U.sortIndex=Q,t(p,U),C||b||(C=!0,F(I))),U},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(U){var Z=v;return function(){var P=v;v=Z;try{return U.apply(this,arguments)}finally{v=P}}}})(Xd)),Xd}var Tx;function SS(){return Tx||(Tx=1,Yd.exports=kS()),Yd.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 Rx;function NS(){if(Rx)return Cn;Rx=1;var e=Cp(),t=SS();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(a[r]=i,r=0;r<i.length;r++)s.add(i[r])}var d=!(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 v(r){return p.call(x,r)?!0:p.call(h,r)?!1:m.test(r)?x[r]=!0:(h[r]=!0,!1)}function b(r,i,u,f){if(u!==null&&u.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return f?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function C(r,i,u,f){if(i===null||typeof i>"u"||b(r,i,u,f))return!0;if(f)return!1;if(u!==null)switch(u.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function k(r,i,u,f,y,w,E){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=f,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=i,this.sanitizeURL=w,this.removeEmptyString=E}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){j[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];j[i]=new k(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){j[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){j[r]=new k(r,2,!1,r,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(r){j[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){j[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){j[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){j[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){j[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function T(r){return r[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(r){var i=r.replace(S,T);j[i]=new k(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(S,T);j[i]=new k(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(S,T);j[i]=new k(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){j[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),j.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){j[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function N(r,i,u,f){var y=j.hasOwnProperty(i)?j[i]:null;(y!==null?y.type!==0:f||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(C(i,u,y,f)&&(u=null),f||y===null?v(i)&&(u===null?r.removeAttribute(i):r.setAttribute(i,""+u)):y.mustUseProperty?r[y.propertyName]=u===null?y.type===3?!1:"":u:(i=y.attributeName,f=y.attributeNamespace,u===null?r.removeAttribute(i):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,f?r.setAttributeNS(f,i,u):r.setAttribute(i,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),R=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),re=Symbol.for("react.provider"),z=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),U=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=U&&r[U]||r["@@iterator"],typeof r=="function"?r:null)}var P=Object.assign,M;function Q(r){if(M===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);M=i&&i[1]||""}return`
|
|
34
|
+
`+M+r}var L=!1;function ge(r,i){if(!r||L)return"";L=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(se){var f=se}Reflect.construct(r,[],i)}else{try{i.call()}catch(se){f=se}r.call(i.prototype)}else{try{throw Error()}catch(se){f=se}r()}}catch(se){if(se&&f&&typeof se.stack=="string"){for(var y=se.stack.split(`
|
|
35
|
+
`),w=f.stack.split(`
|
|
36
|
+
`),E=y.length-1,$=w.length-1;1<=E&&0<=$&&y[E]!==w[$];)$--;for(;1<=E&&0<=$;E--,$--)if(y[E]!==w[$]){if(E!==1||$!==1)do if(E--,$--,0>$||y[E]!==w[$]){var H=`
|
|
37
|
+
`+y[E].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),H}while(1<=E&&0<=$);break}}}finally{L=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?Q(r):""}function Ne(r){switch(r.tag){case 5:return Q(r.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return r=ge(r.type,!1),r;case 11:return r=ge(r.type.render,!1),r;case 1:return r=ge(r.type,!0),r;default:return""}}function te(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case D:return"Fragment";case R:return"Portal";case G:return"Profiler";case O:return"StrictMode";case q:return"Suspense";case J:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case z:return(r.displayName||"Context")+".Consumer";case re:return(r._context.displayName||"Context")+".Provider";case K:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case _:return i=r.displayName||null,i!==null?i:te(r.type)||"Memo";case F:i=r._payload,r=r._init;try{return te(r(i))}catch{}}return null}function fe(r){var i=r.type;switch(r.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=i.render,r=r.displayName||r.name||"",i.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(i);case 8:return i===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function be(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function je(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function we(r){var i=je(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),f=""+r[i];if(!r.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,w=u.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return y.call(this)},set:function(E){f=""+E,w.call(this,E)}}),Object.defineProperty(r,i,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(E){f=""+E},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ye(r){r._valueTracker||(r._valueTracker=we(r))}function Xe(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return r&&(f=je(r)?r.checked?"true":"false":r.value),r=f,r!==u?(i.setValue(r),!0):!1}function ne(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Y(r,i){var u=i.checked;return P({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function ae(r,i){var u=i.defaultValue==null?"":i.defaultValue,f=i.checked!=null?i.checked:i.defaultChecked;u=be(i.value!=null?i.value:u),r._wrapperState={initialChecked:f,initialValue:u,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function xe(r,i){i=i.checked,i!=null&&N(r,"checked",i,!1)}function qe(r,i){xe(r,i);var u=be(i.value),f=i.type;if(u!=null)f==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}i.hasOwnProperty("value")?Ue(r,i.type,u):i.hasOwnProperty("defaultValue")&&Ue(r,i.type,be(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function Oe(r,i,u){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var f=i.type;if(!(f!=="submit"&&f!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+r._wrapperState.initialValue,u||i===r.value||(r.value=i),r.defaultValue=i}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Ue(r,i,u){(i!=="number"||ne(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Ge=Array.isArray;function Nt(r,i,u,f){if(r=r.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=i.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&f&&(r[u].defaultSelected=!0)}else{for(u=""+be(u),i=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,f&&(r[y].defaultSelected=!0);return}i!==null||r[y].disabled||(i=r[y])}i!==null&&(i.selected=!0)}}function Ct(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return P({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Lt(r,i){var u=i.value;if(u==null){if(u=i.children,i=i.defaultValue,u!=null){if(i!=null)throw Error(n(92));if(Ge(u)){if(1<u.length)throw Error(n(93));u=u[0]}i=u}i==null&&(i=""),u=i}r._wrapperState={initialValue:be(u)}}function en(r,i){var u=be(i.value),f=be(i.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),i.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),f!=null&&(r.defaultValue=""+f)}function Tt(r){var i=r.textContent;i===r._wrapperState.initialValue&&i!==""&&i!==null&&(r.value=i)}function ie(r){switch(r){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 ce(r,i){return r==null||r==="http://www.w3.org/1999/xhtml"?ie(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var ve,oe=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,u,f,y){MSApp.execUnsafeLocalFunction(function(){return r(i,u,f,y)})}:r})(function(r,i){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=i;else{for(ve=ve||document.createElement("div"),ve.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=ve.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;i.firstChild;)r.appendChild(i.firstChild)}});function Ce(r,i){if(i){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=i;return}}r.textContent=i}var Ae={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},qt=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(r){qt.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Ae[i]=Ae[r]})});function an(r,i,u){return i==null||typeof i=="boolean"||i===""?"":u||typeof i!="number"||i===0||Ae.hasOwnProperty(r)&&Ae[r]?(""+i).trim():i+"px"}function tn(r,i){r=r.style;for(var u in i)if(i.hasOwnProperty(u)){var f=u.indexOf("--")===0,y=an(u,i[u],f);u==="float"&&(u="cssFloat"),f?r.setProperty(u,y):r[u]=y}}var V=P({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 pe(r,i){if(i){if(V[r]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function Ee(r,i){if(r.indexOf("-")===-1)return typeof i.is=="string";switch(r){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 ze=null;function Wn(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ln=null,vt=null,Ve=null;function it(r){if(r=Ri(r)){if(typeof ln!="function")throw Error(n(280));var i=r.stateNode;i&&(i=sl(i),ln(r.stateNode,r.type,i))}}function Rt(r){vt?Ve?Ve.push(r):Ve=[r]:vt=r}function Kt(){if(vt){var r=vt,i=Ve;if(Ve=vt=null,it(r),i)for(r=0;r<i.length;r++)it(i[r])}}function nn(r,i){return r(i)}function cn(){}var bn=!1;function $r(r,i,u){if(bn)return r(i,u);bn=!0;try{return nn(r,i,u)}finally{bn=!1,(vt!==null||Ve!==null)&&(cn(),Kt())}}function bt(r,i){var u=r.stateNode;if(u===null)return null;var f=sl(u);if(f===null)return null;u=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var Vn=!1;if(d)try{var un={};Object.defineProperty(un,"passive",{get:function(){Vn=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{Vn=!1}function nr(r,i,u,f,y,w,E,$,H){var se=Array.prototype.slice.call(arguments,3);try{i.apply(u,se)}catch(ue){this.onError(ue)}}var rr=!1,yr=null,In=!1,Fr=null,di={onError:function(r){rr=!0,yr=r}};function E1(r,i,u,f,y,w,E,$,H){rr=!1,yr=null,nr.apply(di,arguments)}function P1(r,i,u,f,y,w,E,$,H){if(E1.apply(this,arguments),rr){if(rr){var se=yr;rr=!1,yr=null}else throw Error(n(198));In||(In=!0,Fr=se)}}function Ls(r){var i=r,u=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(u=i.return),r=i.return;while(r)}return i.tag===3?u:null}function Kh(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function Gh(r){if(Ls(r)!==r)throw Error(n(188))}function T1(r){var i=r.alternate;if(!i){if(i=Ls(r),i===null)throw Error(n(188));return i!==r?null:r}for(var u=r,f=i;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return Gh(y),r;if(w===f)return Gh(y),i;w=w.sibling}throw Error(n(188))}if(u.return!==f.return)u=y,f=w;else{for(var E=!1,$=y.child;$;){if($===u){E=!0,u=y,f=w;break}if($===f){E=!0,f=y,u=w;break}$=$.sibling}if(!E){for($=w.child;$;){if($===u){E=!0,u=w,f=y;break}if($===f){E=!0,f=w,u=y;break}$=$.sibling}if(!E)throw Error(n(189))}}if(u.alternate!==f)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:i}function Yh(r){return r=T1(r),r!==null?Xh(r):null}function Xh(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var i=Xh(r);if(i!==null)return i;r=r.sibling}return null}var Qh=t.unstable_scheduleCallback,Jh=t.unstable_cancelCallback,R1=t.unstable_shouldYield,A1=t.unstable_requestPaint,At=t.unstable_now,D1=t.unstable_getCurrentPriorityLevel,fu=t.unstable_ImmediatePriority,Zh=t.unstable_UserBlockingPriority,$a=t.unstable_NormalPriority,L1=t.unstable_LowPriority,em=t.unstable_IdlePriority,Fa=null,vr=null;function I1(r){if(vr&&typeof vr.onCommitFiberRoot=="function")try{vr.onCommitFiberRoot(Fa,r,void 0,(r.current.flags&128)===128)}catch{}}var sr=Math.clz32?Math.clz32:_1,O1=Math.log,M1=Math.LN2;function _1(r){return r>>>=0,r===0?32:31-(O1(r)/M1|0)|0}var za=64,Ba=4194304;function fi(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Ua(r,i){var u=r.pendingLanes;if(u===0)return 0;var f=0,y=r.suspendedLanes,w=r.pingedLanes,E=u&268435455;if(E!==0){var $=E&~y;$!==0?f=fi($):(w&=E,w!==0&&(f=fi(w)))}else E=u&~y,E!==0?f=fi(E):w!==0&&(f=fi(w));if(f===0)return 0;if(i!==0&&i!==f&&(i&y)===0&&(y=f&-f,w=i&-i,y>=w||y===16&&(w&4194240)!==0))return i;if((f&4)!==0&&(f|=u&16),i=r.entangledLanes,i!==0)for(r=r.entanglements,i&=f;0<i;)u=31-sr(i),y=1<<u,f|=r[u],i&=~y;return f}function $1(r,i){switch(r){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function F1(r,i){for(var u=r.suspendedLanes,f=r.pingedLanes,y=r.expirationTimes,w=r.pendingLanes;0<w;){var E=31-sr(w),$=1<<E,H=y[E];H===-1?(($&u)===0||($&f)!==0)&&(y[E]=$1($,i)):H<=i&&(r.expiredLanes|=$),w&=~$}}function pu(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function tm(){var r=za;return za<<=1,(za&4194240)===0&&(za=64),r}function hu(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function pi(r,i,u){r.pendingLanes|=i,i!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,i=31-sr(i),r[i]=u}function z1(r,i){var u=r.pendingLanes&~i;r.pendingLanes=i,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=i,r.mutableReadLanes&=i,r.entangledLanes&=i,i=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0<u;){var y=31-sr(u),w=1<<y;i[y]=0,f[y]=-1,r[y]=-1,u&=~w}}function mu(r,i){var u=r.entangledLanes|=i;for(r=r.entanglements;u;){var f=31-sr(u),y=1<<f;y&i|r[f]&i&&(r[f]|=i),u&=~y}}var rt=0;function nm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var rm,gu,sm,om,im,xu=!1,Ha=[],ts=null,ns=null,rs=null,hi=new Map,mi=new Map,ss=[],B1="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 am(r,i){switch(r){case"focusin":case"focusout":ts=null;break;case"dragenter":case"dragleave":ns=null;break;case"mouseover":case"mouseout":rs=null;break;case"pointerover":case"pointerout":hi.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":mi.delete(i.pointerId)}}function gi(r,i,u,f,y,w){return r===null||r.nativeEvent!==w?(r={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:w,targetContainers:[y]},i!==null&&(i=Ri(i),i!==null&&gu(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),r)}function U1(r,i,u,f,y){switch(i){case"focusin":return ts=gi(ts,r,i,u,f,y),!0;case"dragenter":return ns=gi(ns,r,i,u,f,y),!0;case"mouseover":return rs=gi(rs,r,i,u,f,y),!0;case"pointerover":var w=y.pointerId;return hi.set(w,gi(hi.get(w)||null,r,i,u,f,y)),!0;case"gotpointercapture":return w=y.pointerId,mi.set(w,gi(mi.get(w)||null,r,i,u,f,y)),!0}return!1}function lm(r){var i=Is(r.target);if(i!==null){var u=Ls(i);if(u!==null){if(i=u.tag,i===13){if(i=Kh(u),i!==null){r.blockedOn=i,im(r.priority,function(){sm(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Wa(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var u=vu(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var f=new u.constructor(u.type,u);ze=f,u.target.dispatchEvent(f),ze=null}else return i=Ri(u),i!==null&&gu(i),r.blockedOn=u,!1;i.shift()}return!0}function cm(r,i,u){Wa(r)&&u.delete(i)}function H1(){xu=!1,ts!==null&&Wa(ts)&&(ts=null),ns!==null&&Wa(ns)&&(ns=null),rs!==null&&Wa(rs)&&(rs=null),hi.forEach(cm),mi.forEach(cm)}function xi(r,i){r.blockedOn===i&&(r.blockedOn=null,xu||(xu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,H1)))}function yi(r){function i(y){return xi(y,r)}if(0<Ha.length){xi(Ha[0],r);for(var u=1;u<Ha.length;u++){var f=Ha[u];f.blockedOn===r&&(f.blockedOn=null)}}for(ts!==null&&xi(ts,r),ns!==null&&xi(ns,r),rs!==null&&xi(rs,r),hi.forEach(i),mi.forEach(i),u=0;u<ss.length;u++)f=ss[u],f.blockedOn===r&&(f.blockedOn=null);for(;0<ss.length&&(u=ss[0],u.blockedOn===null);)lm(u),u.blockedOn===null&&ss.shift()}var oo=A.ReactCurrentBatchConfig,Va=!0;function W1(r,i,u,f){var y=rt,w=oo.transition;oo.transition=null;try{rt=1,yu(r,i,u,f)}finally{rt=y,oo.transition=w}}function V1(r,i,u,f){var y=rt,w=oo.transition;oo.transition=null;try{rt=4,yu(r,i,u,f)}finally{rt=y,oo.transition=w}}function yu(r,i,u,f){if(Va){var y=vu(r,i,u,f);if(y===null)Mu(r,i,f,qa,u),am(r,f);else if(U1(y,r,i,u,f))f.stopPropagation();else if(am(r,f),i&4&&-1<B1.indexOf(r)){for(;y!==null;){var w=Ri(y);if(w!==null&&rm(w),w=vu(r,i,u,f),w===null&&Mu(r,i,f,qa,u),w===y)break;y=w}y!==null&&f.stopPropagation()}else Mu(r,i,f,null,u)}}var qa=null;function vu(r,i,u,f){if(qa=null,r=Wn(f),r=Is(r),r!==null)if(i=Ls(r),i===null)r=null;else if(u=i.tag,u===13){if(r=Kh(i),r!==null)return r;r=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null);return qa=r,null}function um(r){switch(r){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(D1()){case fu:return 1;case Zh:return 4;case $a:case L1:return 16;case em:return 536870912;default:return 16}default:return 16}}var os=null,bu=null,Ka=null;function dm(){if(Ka)return Ka;var r,i=bu,u=i.length,f,y="value"in os?os.value:os.textContent,w=y.length;for(r=0;r<u&&i[r]===y[r];r++);var E=u-r;for(f=1;f<=E&&i[u-f]===y[w-f];f++);return Ka=y.slice(r,1<f?1-f:void 0)}function Ga(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Ya(){return!0}function fm(){return!1}function On(r){function i(u,f,y,w,E){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=w,this.target=E,this.currentTarget=null;for(var $ in r)r.hasOwnProperty($)&&(u=r[$],this[$]=u?u(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Ya:fm,this.isPropagationStopped=fm,this}return P(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),i}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wu=On(io),vi=P({},io,{view:0,detail:0}),q1=On(vi),ju,ku,bi,Xa=P({},vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==bi&&(bi&&r.type==="mousemove"?(ju=r.screenX-bi.screenX,ku=r.screenY-bi.screenY):ku=ju=0,bi=r),ju)},movementY:function(r){return"movementY"in r?r.movementY:ku}}),pm=On(Xa),K1=P({},Xa,{dataTransfer:0}),G1=On(K1),Y1=P({},vi,{relatedTarget:0}),Su=On(Y1),X1=P({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),Q1=On(X1),J1=P({},io,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Z1=On(J1),ek=P({},io,{data:0}),hm=On(ek),tk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nk={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"},rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sk(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=rk[r])?!!i[r]:!1}function Nu(){return sk}var ok=P({},vi,{key:function(r){if(r.key){var i=tk[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ga(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?nk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(r){return r.type==="keypress"?Ga(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ga(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ik=On(ok),ak=P({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mm=On(ak),lk=P({},vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),ck=On(lk),uk=P({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),dk=On(uk),fk=P({},Xa,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),pk=On(fk),hk=[9,13,27,32],Cu=d&&"CompositionEvent"in window,wi=null;d&&"documentMode"in document&&(wi=document.documentMode);var mk=d&&"TextEvent"in window&&!wi,gm=d&&(!Cu||wi&&8<wi&&11>=wi),xm=" ",ym=!1;function vm(r,i){switch(r){case"keyup":return hk.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ao=!1;function gk(r,i){switch(r){case"compositionend":return bm(i);case"keypress":return i.which!==32?null:(ym=!0,xm);case"textInput":return r=i.data,r===xm&&ym?null:r;default:return null}}function xk(r,i){if(ao)return r==="compositionend"||!Cu&&vm(r,i)?(r=dm(),Ka=bu=os=null,ao=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return gm&&i.locale!=="ko"?null:i.data;default:return null}}var yk={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 wm(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!yk[r.type]:i==="textarea"}function jm(r,i,u,f){Rt(f),i=tl(i,"onChange"),0<i.length&&(u=new wu("onChange","change",null,u,f),r.push({event:u,listeners:i}))}var ji=null,ki=null;function vk(r){zm(r,0)}function Qa(r){var i=po(r);if(Xe(i))return r}function bk(r,i){if(r==="change")return i}var km=!1;if(d){var Eu;if(d){var Pu="oninput"in document;if(!Pu){var Sm=document.createElement("div");Sm.setAttribute("oninput","return;"),Pu=typeof Sm.oninput=="function"}Eu=Pu}else Eu=!1;km=Eu&&(!document.documentMode||9<document.documentMode)}function Nm(){ji&&(ji.detachEvent("onpropertychange",Cm),ki=ji=null)}function Cm(r){if(r.propertyName==="value"&&Qa(ki)){var i=[];jm(i,ki,r,Wn(r)),$r(vk,i)}}function wk(r,i,u){r==="focusin"?(Nm(),ji=i,ki=u,ji.attachEvent("onpropertychange",Cm)):r==="focusout"&&Nm()}function jk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Qa(ki)}function kk(r,i){if(r==="click")return Qa(i)}function Sk(r,i){if(r==="input"||r==="change")return Qa(i)}function Nk(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var or=typeof Object.is=="function"?Object.is:Nk;function Si(r,i){if(or(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var u=Object.keys(r),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!p.call(i,y)||!or(r[y],i[y]))return!1}return!0}function Em(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Pm(r,i){var u=Em(r);r=0;for(var f;u;){if(u.nodeType===3){if(f=r+u.textContent.length,r<=i&&f>=i)return{node:u,offset:i-r};r=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Em(u)}}function Tm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Tm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Rm(){for(var r=window,i=ne();i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=ne(r.document)}return i}function Tu(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function Ck(r){var i=Rm(),u=r.focusedElem,f=r.selectionRange;if(i!==u&&u&&u.ownerDocument&&Tm(u.ownerDocument.documentElement,u)){if(f!==null&&Tu(u)){if(i=f.start,r=f.end,r===void 0&&(r=i),"selectionStart"in u)u.selectionStart=i,u.selectionEnd=Math.min(r,u.value.length);else if(r=(i=u.ownerDocument||document)&&i.defaultView||window,r.getSelection){r=r.getSelection();var y=u.textContent.length,w=Math.min(f.start,y);f=f.end===void 0?w:Math.min(f.end,y),!r.extend&&w>f&&(y=f,f=w,w=y),y=Pm(u,w);var E=Pm(u,f);y&&E&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==E.node||r.focusOffset!==E.offset)&&(i=i.createRange(),i.setStart(y.node,y.offset),r.removeAllRanges(),w>f?(r.addRange(i),r.extend(E.node,E.offset)):(i.setEnd(E.node,E.offset),r.addRange(i)))}}for(i=[],r=u;r=r.parentNode;)r.nodeType===1&&i.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<i.length;u++)r=i[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var Ek=d&&"documentMode"in document&&11>=document.documentMode,lo=null,Ru=null,Ni=null,Au=!1;function Am(r,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Au||lo==null||lo!==ne(f)||(f=lo,"selectionStart"in f&&Tu(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Ni&&Si(Ni,f)||(Ni=f,f=tl(Ru,"onSelect"),0<f.length&&(i=new wu("onSelect","select",null,i,u),r.push({event:i,listeners:f}),i.target=lo)))}function Ja(r,i){var u={};return u[r.toLowerCase()]=i.toLowerCase(),u["Webkit"+r]="webkit"+i,u["Moz"+r]="moz"+i,u}var co={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionend:Ja("Transition","TransitionEnd")},Du={},Dm={};d&&(Dm=document.createElement("div").style,"AnimationEvent"in window||(delete co.animationend.animation,delete co.animationiteration.animation,delete co.animationstart.animation),"TransitionEvent"in window||delete co.transitionend.transition);function Za(r){if(Du[r])return Du[r];if(!co[r])return r;var i=co[r],u;for(u in i)if(i.hasOwnProperty(u)&&u in Dm)return Du[r]=i[u];return r}var Lm=Za("animationend"),Im=Za("animationiteration"),Om=Za("animationstart"),Mm=Za("transitionend"),_m=new Map,$m="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(r,i){_m.set(r,i),l(i,[r])}for(var Lu=0;Lu<$m.length;Lu++){var Iu=$m[Lu],Pk=Iu.toLowerCase(),Tk=Iu[0].toUpperCase()+Iu.slice(1);is(Pk,"on"+Tk)}is(Lm,"onAnimationEnd"),is(Im,"onAnimationIteration"),is(Om,"onAnimationStart"),is("dblclick","onDoubleClick"),is("focusin","onFocus"),is("focusout","onBlur"),is(Mm,"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 Ci="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(" "),Rk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Fm(r,i,u){var f=r.type||"unknown-event";r.currentTarget=u,P1(f,i,void 0,r),r.currentTarget=null}function zm(r,i){i=(i&4)!==0;for(var u=0;u<r.length;u++){var f=r[u],y=f.event;f=f.listeners;e:{var w=void 0;if(i)for(var E=f.length-1;0<=E;E--){var $=f[E],H=$.instance,se=$.currentTarget;if($=$.listener,H!==w&&y.isPropagationStopped())break e;Fm(y,$,se),w=H}else for(E=0;E<f.length;E++){if($=f[E],H=$.instance,se=$.currentTarget,$=$.listener,H!==w&&y.isPropagationStopped())break e;Fm(y,$,se),w=H}}}if(In)throw r=Fr,In=!1,Fr=null,r}function dt(r,i){var u=i[Uu];u===void 0&&(u=i[Uu]=new Set);var f=r+"__bubble";u.has(f)||(Bm(i,r,2,!1),u.add(f))}function Ou(r,i,u){var f=0;i&&(f|=4),Bm(u,r,f,i)}var el="_reactListening"+Math.random().toString(36).slice(2);function Ei(r){if(!r[el]){r[el]=!0,s.forEach(function(u){u!=="selectionchange"&&(Rk.has(u)||Ou(u,!1,r),Ou(u,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[el]||(i[el]=!0,Ou("selectionchange",!1,i))}}function Bm(r,i,u,f){switch(um(i)){case 1:var y=W1;break;case 4:y=V1;break;default:y=yu}u=y.bind(null,i,u,r),y=void 0,!Vn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?r.addEventListener(i,u,{capture:!0,passive:y}):r.addEventListener(i,u,!0):y!==void 0?r.addEventListener(i,u,{passive:y}):r.addEventListener(i,u,!1)}function Mu(r,i,u,f,y){var w=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var $=f.stateNode.containerInfo;if($===y||$.nodeType===8&&$.parentNode===y)break;if(E===4)for(E=f.return;E!==null;){var H=E.tag;if((H===3||H===4)&&(H=E.stateNode.containerInfo,H===y||H.nodeType===8&&H.parentNode===y))return;E=E.return}for(;$!==null;){if(E=Is($),E===null)return;if(H=E.tag,H===5||H===6){f=w=E;continue e}$=$.parentNode}}f=f.return}$r(function(){var se=w,ue=Wn(u),de=[];e:{var le=_m.get(r);if(le!==void 0){var ke=wu,Te=r;switch(r){case"keypress":if(Ga(u)===0)break e;case"keydown":case"keyup":ke=ik;break;case"focusin":Te="focus",ke=Su;break;case"focusout":Te="blur",ke=Su;break;case"beforeblur":case"afterblur":ke=Su;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=pm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=G1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=ck;break;case Lm:case Im:case Om:ke=Q1;break;case Mm:ke=dk;break;case"scroll":ke=q1;break;case"wheel":ke=pk;break;case"copy":case"cut":case"paste":ke=Z1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=mm}var Re=(i&4)!==0,Dt=!Re&&r==="scroll",X=Re?le!==null?le+"Capture":null:le;Re=[];for(var W=se,ee;W!==null;){ee=W;var me=ee.stateNode;if(ee.tag===5&&me!==null&&(ee=me,X!==null&&(me=bt(W,X),me!=null&&Re.push(Pi(W,me,ee)))),Dt)break;W=W.return}0<Re.length&&(le=new ke(le,Te,null,u,ue),de.push({event:le,listeners:Re}))}}if((i&7)===0){e:{if(le=r==="mouseover"||r==="pointerover",ke=r==="mouseout"||r==="pointerout",le&&u!==ze&&(Te=u.relatedTarget||u.fromElement)&&(Is(Te)||Te[zr]))break e;if((ke||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ke?(Te=u.relatedTarget||u.toElement,ke=se,Te=Te?Is(Te):null,Te!==null&&(Dt=Ls(Te),Te!==Dt||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(ke=null,Te=se),ke!==Te)){if(Re=pm,me="onMouseLeave",X="onMouseEnter",W="mouse",(r==="pointerout"||r==="pointerover")&&(Re=mm,me="onPointerLeave",X="onPointerEnter",W="pointer"),Dt=ke==null?le:po(ke),ee=Te==null?le:po(Te),le=new Re(me,W+"leave",ke,u,ue),le.target=Dt,le.relatedTarget=ee,me=null,Is(ue)===se&&(Re=new Re(X,W+"enter",Te,u,ue),Re.target=ee,Re.relatedTarget=Dt,me=Re),Dt=me,ke&&Te)t:{for(Re=ke,X=Te,W=0,ee=Re;ee;ee=uo(ee))W++;for(ee=0,me=X;me;me=uo(me))ee++;for(;0<W-ee;)Re=uo(Re),W--;for(;0<ee-W;)X=uo(X),ee--;for(;W--;){if(Re===X||X!==null&&Re===X.alternate)break t;Re=uo(Re),X=uo(X)}Re=null}else Re=null;ke!==null&&Um(de,le,ke,Re,!1),Te!==null&&Dt!==null&&Um(de,Dt,Te,Re,!0)}}e:{if(le=se?po(se):window,ke=le.nodeName&&le.nodeName.toLowerCase(),ke==="select"||ke==="input"&&le.type==="file")var De=bk;else if(wm(le))if(km)De=Sk;else{De=jk;var Me=wk}else(ke=le.nodeName)&&ke.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(De=kk);if(De&&(De=De(r,se))){jm(de,De,u,ue);break e}Me&&Me(r,le,se),r==="focusout"&&(Me=le._wrapperState)&&Me.controlled&&le.type==="number"&&Ue(le,"number",le.value)}switch(Me=se?po(se):window,r){case"focusin":(wm(Me)||Me.contentEditable==="true")&&(lo=Me,Ru=se,Ni=null);break;case"focusout":Ni=Ru=lo=null;break;case"mousedown":Au=!0;break;case"contextmenu":case"mouseup":case"dragend":Au=!1,Am(de,u,ue);break;case"selectionchange":if(Ek)break;case"keydown":case"keyup":Am(de,u,ue)}var _e;if(Cu)e:{switch(r){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else ao?vm(r,u)&&($e="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&($e="onCompositionStart");$e&&(gm&&u.locale!=="ko"&&(ao||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&ao&&(_e=dm()):(os=ue,bu="value"in os?os.value:os.textContent,ao=!0)),Me=tl(se,$e),0<Me.length&&($e=new hm($e,r,null,u,ue),de.push({event:$e,listeners:Me}),_e?$e.data=_e:(_e=bm(u),_e!==null&&($e.data=_e)))),(_e=mk?gk(r,u):xk(r,u))&&(se=tl(se,"onBeforeInput"),0<se.length&&(ue=new hm("onBeforeInput","beforeinput",null,u,ue),de.push({event:ue,listeners:se}),ue.data=_e))}zm(de,i)})}function Pi(r,i,u){return{instance:r,listener:i,currentTarget:u}}function tl(r,i){for(var u=i+"Capture",f=[];r!==null;){var y=r,w=y.stateNode;y.tag===5&&w!==null&&(y=w,w=bt(r,u),w!=null&&f.unshift(Pi(r,w,y)),w=bt(r,i),w!=null&&f.push(Pi(r,w,y))),r=r.return}return f}function uo(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Um(r,i,u,f,y){for(var w=i._reactName,E=[];u!==null&&u!==f;){var $=u,H=$.alternate,se=$.stateNode;if(H!==null&&H===f)break;$.tag===5&&se!==null&&($=se,y?(H=bt(u,w),H!=null&&E.unshift(Pi(u,H,$))):y||(H=bt(u,w),H!=null&&E.push(Pi(u,H,$)))),u=u.return}E.length!==0&&r.push({event:i,listeners:E})}var Ak=/\r\n?/g,Dk=/\u0000|\uFFFD/g;function Hm(r){return(typeof r=="string"?r:""+r).replace(Ak,`
|
|
38
|
+
`).replace(Dk,"")}function nl(r,i,u){if(i=Hm(i),Hm(r)!==i&&u)throw Error(n(425))}function rl(){}var _u=null,$u=null;function Fu(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var zu=typeof setTimeout=="function"?setTimeout:void 0,Lk=typeof clearTimeout=="function"?clearTimeout:void 0,Wm=typeof Promise=="function"?Promise:void 0,Ik=typeof queueMicrotask=="function"?queueMicrotask:typeof Wm<"u"?function(r){return Wm.resolve(null).then(r).catch(Ok)}:zu;function Ok(r){setTimeout(function(){throw r})}function Bu(r,i){var u=i,f=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(f===0){r.removeChild(y),yi(i);return}f--}else u!=="$"&&u!=="$?"&&u!=="$!"||f++;u=y}while(u);yi(i)}function as(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return r}function Vm(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return r;i--}else u==="/$"&&i++}r=r.previousSibling}return null}var fo=Math.random().toString(36).slice(2),br="__reactFiber$"+fo,Ti="__reactProps$"+fo,zr="__reactContainer$"+fo,Uu="__reactEvents$"+fo,Mk="__reactListeners$"+fo,_k="__reactHandles$"+fo;function Is(r){var i=r[br];if(i)return i;for(var u=r.parentNode;u;){if(i=u[zr]||u[br]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(r=Vm(r);r!==null;){if(u=r[br])return u;r=Vm(r)}return i}r=u,u=r.parentNode}return null}function Ri(r){return r=r[br]||r[zr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function po(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function sl(r){return r[Ti]||null}var Hu=[],ho=-1;function ls(r){return{current:r}}function ft(r){0>ho||(r.current=Hu[ho],Hu[ho]=null,ho--)}function lt(r,i){ho++,Hu[ho]=r.current,r.current=i}var cs={},dn=ls(cs),wn=ls(!1),Os=cs;function mo(r,i){var u=r.type.contextTypes;if(!u)return cs;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===i)return f.__reactInternalMemoizedMaskedChildContext;var y={},w;for(w in u)y[w]=i[w];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=i,r.__reactInternalMemoizedMaskedChildContext=y),y}function jn(r){return r=r.childContextTypes,r!=null}function ol(){ft(wn),ft(dn)}function qm(r,i,u){if(dn.current!==cs)throw Error(n(168));lt(dn,i),lt(wn,u)}function Km(r,i,u){var f=r.stateNode;if(i=i.childContextTypes,typeof f.getChildContext!="function")return u;f=f.getChildContext();for(var y in f)if(!(y in i))throw Error(n(108,fe(r)||"Unknown",y));return P({},u,f)}function il(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||cs,Os=dn.current,lt(dn,r),lt(wn,wn.current),!0}function Gm(r,i,u){var f=r.stateNode;if(!f)throw Error(n(169));u?(r=Km(r,i,Os),f.__reactInternalMemoizedMergedChildContext=r,ft(wn),ft(dn),lt(dn,r)):ft(wn),lt(wn,u)}var Br=null,al=!1,Wu=!1;function Ym(r){Br===null?Br=[r]:Br.push(r)}function $k(r){al=!0,Ym(r)}function us(){if(!Wu&&Br!==null){Wu=!0;var r=0,i=rt;try{var u=Br;for(rt=1;r<u.length;r++){var f=u[r];do f=f(!0);while(f!==null)}Br=null,al=!1}catch(y){throw Br!==null&&(Br=Br.slice(r+1)),Qh(fu,us),y}finally{rt=i,Wu=!1}}return null}var go=[],xo=0,ll=null,cl=0,qn=[],Kn=0,Ms=null,Ur=1,Hr="";function _s(r,i){go[xo++]=cl,go[xo++]=ll,ll=r,cl=i}function Xm(r,i,u){qn[Kn++]=Ur,qn[Kn++]=Hr,qn[Kn++]=Ms,Ms=r;var f=Ur;r=Hr;var y=32-sr(f)-1;f&=~(1<<y),u+=1;var w=32-sr(i)+y;if(30<w){var E=y-y%5;w=(f&(1<<E)-1).toString(32),f>>=E,y-=E,Ur=1<<32-sr(i)+y|u<<y|f,Hr=w+r}else Ur=1<<w|u<<y|f,Hr=r}function Vu(r){r.return!==null&&(_s(r,1),Xm(r,1,0))}function qu(r){for(;r===ll;)ll=go[--xo],go[xo]=null,cl=go[--xo],go[xo]=null;for(;r===Ms;)Ms=qn[--Kn],qn[Kn]=null,Hr=qn[--Kn],qn[Kn]=null,Ur=qn[--Kn],qn[Kn]=null}var Mn=null,_n=null,gt=!1,ir=null;function Qm(r,i){var u=Qn(5,null,null,0);u.elementType="DELETED",u.stateNode=i,u.return=r,i=r.deletions,i===null?(r.deletions=[u],r.flags|=16):i.push(u)}function Jm(r,i){switch(r.tag){case 5:var u=r.type;return i=i.nodeType!==1||u.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(r.stateNode=i,Mn=r,_n=as(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,Mn=r,_n=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(u=Ms!==null?{id:Ur,overflow:Hr}:null,r.memoizedState={dehydrated:i,treeContext:u,retryLane:1073741824},u=Qn(18,null,null,0),u.stateNode=i,u.return=r,r.child=u,Mn=r,_n=null,!0):!1;default:return!1}}function Ku(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Gu(r){if(gt){var i=_n;if(i){var u=i;if(!Jm(r,i)){if(Ku(r))throw Error(n(418));i=as(u.nextSibling);var f=Mn;i&&Jm(r,i)?Qm(f,u):(r.flags=r.flags&-4097|2,gt=!1,Mn=r)}}else{if(Ku(r))throw Error(n(418));r.flags=r.flags&-4097|2,gt=!1,Mn=r}}}function Zm(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Mn=r}function ul(r){if(r!==Mn)return!1;if(!gt)return Zm(r),gt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!Fu(r.type,r.memoizedProps)),i&&(i=_n)){if(Ku(r))throw eg(),Error(n(418));for(;i;)Qm(r,i),i=as(i.nextSibling)}if(Zm(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(i===0){_n=as(r.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++}r=r.nextSibling}_n=null}}else _n=Mn?as(r.stateNode.nextSibling):null;return!0}function eg(){for(var r=_n;r;)r=as(r.nextSibling)}function yo(){_n=Mn=null,gt=!1}function Yu(r){ir===null?ir=[r]:ir.push(r)}var Fk=A.ReactCurrentBatchConfig;function Ai(r,i,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var f=u.stateNode}if(!f)throw Error(n(147,r));var y=f,w=""+r;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===w?i.ref:(i=function(E){var $=y.refs;E===null?delete $[w]:$[w]=E},i._stringRef=w,i)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function dl(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function tg(r){var i=r._init;return i(r._payload)}function ng(r){function i(X,W){if(r){var ee=X.deletions;ee===null?(X.deletions=[W],X.flags|=16):ee.push(W)}}function u(X,W){if(!r)return null;for(;W!==null;)i(X,W),W=W.sibling;return null}function f(X,W){for(X=new Map;W!==null;)W.key!==null?X.set(W.key,W):X.set(W.index,W),W=W.sibling;return X}function y(X,W){return X=ys(X,W),X.index=0,X.sibling=null,X}function w(X,W,ee){return X.index=ee,r?(ee=X.alternate,ee!==null?(ee=ee.index,ee<W?(X.flags|=2,W):ee):(X.flags|=2,W)):(X.flags|=1048576,W)}function E(X){return r&&X.alternate===null&&(X.flags|=2),X}function $(X,W,ee,me){return W===null||W.tag!==6?(W=zd(ee,X.mode,me),W.return=X,W):(W=y(W,ee),W.return=X,W)}function H(X,W,ee,me){var De=ee.type;return De===D?ue(X,W,ee.props.children,me,ee.key):W!==null&&(W.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===F&&tg(De)===W.type)?(me=y(W,ee.props),me.ref=Ai(X,W,ee),me.return=X,me):(me=Ol(ee.type,ee.key,ee.props,null,X.mode,me),me.ref=Ai(X,W,ee),me.return=X,me)}function se(X,W,ee,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=Bd(ee,X.mode,me),W.return=X,W):(W=y(W,ee.children||[]),W.return=X,W)}function ue(X,W,ee,me,De){return W===null||W.tag!==7?(W=Vs(ee,X.mode,me,De),W.return=X,W):(W=y(W,ee),W.return=X,W)}function de(X,W,ee){if(typeof W=="string"&&W!==""||typeof W=="number")return W=zd(""+W,X.mode,ee),W.return=X,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case I:return ee=Ol(W.type,W.key,W.props,null,X.mode,ee),ee.ref=Ai(X,null,W),ee.return=X,ee;case R:return W=Bd(W,X.mode,ee),W.return=X,W;case F:var me=W._init;return de(X,me(W._payload),ee)}if(Ge(W)||Z(W))return W=Vs(W,X.mode,ee,null),W.return=X,W;dl(X,W)}return null}function le(X,W,ee,me){var De=W!==null?W.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return De!==null?null:$(X,W,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case I:return ee.key===De?H(X,W,ee,me):null;case R:return ee.key===De?se(X,W,ee,me):null;case F:return De=ee._init,le(X,W,De(ee._payload),me)}if(Ge(ee)||Z(ee))return De!==null?null:ue(X,W,ee,me,null);dl(X,ee)}return null}function ke(X,W,ee,me,De){if(typeof me=="string"&&me!==""||typeof me=="number")return X=X.get(ee)||null,$(W,X,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case I:return X=X.get(me.key===null?ee:me.key)||null,H(W,X,me,De);case R:return X=X.get(me.key===null?ee:me.key)||null,se(W,X,me,De);case F:var Me=me._init;return ke(X,W,ee,Me(me._payload),De)}if(Ge(me)||Z(me))return X=X.get(ee)||null,ue(W,X,me,De,null);dl(W,me)}return null}function Te(X,W,ee,me){for(var De=null,Me=null,_e=W,$e=W=0,Xt=null;_e!==null&&$e<ee.length;$e++){_e.index>$e?(Xt=_e,_e=null):Xt=_e.sibling;var Je=le(X,_e,ee[$e],me);if(Je===null){_e===null&&(_e=Xt);break}r&&_e&&Je.alternate===null&&i(X,_e),W=w(Je,W,$e),Me===null?De=Je:Me.sibling=Je,Me=Je,_e=Xt}if($e===ee.length)return u(X,_e),gt&&_s(X,$e),De;if(_e===null){for(;$e<ee.length;$e++)_e=de(X,ee[$e],me),_e!==null&&(W=w(_e,W,$e),Me===null?De=_e:Me.sibling=_e,Me=_e);return gt&&_s(X,$e),De}for(_e=f(X,_e);$e<ee.length;$e++)Xt=ke(_e,X,$e,ee[$e],me),Xt!==null&&(r&&Xt.alternate!==null&&_e.delete(Xt.key===null?$e:Xt.key),W=w(Xt,W,$e),Me===null?De=Xt:Me.sibling=Xt,Me=Xt);return r&&_e.forEach(function(vs){return i(X,vs)}),gt&&_s(X,$e),De}function Re(X,W,ee,me){var De=Z(ee);if(typeof De!="function")throw Error(n(150));if(ee=De.call(ee),ee==null)throw Error(n(151));for(var Me=De=null,_e=W,$e=W=0,Xt=null,Je=ee.next();_e!==null&&!Je.done;$e++,Je=ee.next()){_e.index>$e?(Xt=_e,_e=null):Xt=_e.sibling;var vs=le(X,_e,Je.value,me);if(vs===null){_e===null&&(_e=Xt);break}r&&_e&&vs.alternate===null&&i(X,_e),W=w(vs,W,$e),Me===null?De=vs:Me.sibling=vs,Me=vs,_e=Xt}if(Je.done)return u(X,_e),gt&&_s(X,$e),De;if(_e===null){for(;!Je.done;$e++,Je=ee.next())Je=de(X,Je.value,me),Je!==null&&(W=w(Je,W,$e),Me===null?De=Je:Me.sibling=Je,Me=Je);return gt&&_s(X,$e),De}for(_e=f(X,_e);!Je.done;$e++,Je=ee.next())Je=ke(_e,X,$e,Je.value,me),Je!==null&&(r&&Je.alternate!==null&&_e.delete(Je.key===null?$e:Je.key),W=w(Je,W,$e),Me===null?De=Je:Me.sibling=Je,Me=Je);return r&&_e.forEach(function(yS){return i(X,yS)}),gt&&_s(X,$e),De}function Dt(X,W,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===D&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case I:e:{for(var De=ee.key,Me=W;Me!==null;){if(Me.key===De){if(De=ee.type,De===D){if(Me.tag===7){u(X,Me.sibling),W=y(Me,ee.props.children),W.return=X,X=W;break e}}else if(Me.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===F&&tg(De)===Me.type){u(X,Me.sibling),W=y(Me,ee.props),W.ref=Ai(X,Me,ee),W.return=X,X=W;break e}u(X,Me);break}else i(X,Me);Me=Me.sibling}ee.type===D?(W=Vs(ee.props.children,X.mode,me,ee.key),W.return=X,X=W):(me=Ol(ee.type,ee.key,ee.props,null,X.mode,me),me.ref=Ai(X,W,ee),me.return=X,X=me)}return E(X);case R:e:{for(Me=ee.key;W!==null;){if(W.key===Me)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){u(X,W.sibling),W=y(W,ee.children||[]),W.return=X,X=W;break e}else{u(X,W);break}else i(X,W);W=W.sibling}W=Bd(ee,X.mode,me),W.return=X,X=W}return E(X);case F:return Me=ee._init,Dt(X,W,Me(ee._payload),me)}if(Ge(ee))return Te(X,W,ee,me);if(Z(ee))return Re(X,W,ee,me);dl(X,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,W!==null&&W.tag===6?(u(X,W.sibling),W=y(W,ee),W.return=X,X=W):(u(X,W),W=zd(ee,X.mode,me),W.return=X,X=W),E(X)):u(X,W)}return Dt}var vo=ng(!0),rg=ng(!1),fl=ls(null),pl=null,bo=null,Xu=null;function Qu(){Xu=bo=pl=null}function Ju(r){var i=fl.current;ft(fl),r._currentValue=i}function Zu(r,i,u){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===u)break;r=r.return}}function wo(r,i){pl=r,Xu=bo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&i)!==0&&(kn=!0),r.firstContext=null)}function Gn(r){var i=r._currentValue;if(Xu!==r)if(r={context:r,memoizedValue:i,next:null},bo===null){if(pl===null)throw Error(n(308));bo=r,pl.dependencies={lanes:0,firstContext:r}}else bo=bo.next=r;return i}var $s=null;function ed(r){$s===null?$s=[r]:$s.push(r)}function sg(r,i,u,f){var y=i.interleaved;return y===null?(u.next=u,ed(i)):(u.next=y.next,y.next=u),i.interleaved=u,Wr(r,f)}function Wr(r,i){r.lanes|=i;var u=r.alternate;for(u!==null&&(u.lanes|=i),u=r,r=r.return;r!==null;)r.childLanes|=i,u=r.alternate,u!==null&&(u.childLanes|=i),u=r,r=r.return;return u.tag===3?u.stateNode:null}var ds=!1;function td(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function og(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Vr(r,i){return{eventTime:r,lane:i,tag:0,payload:null,callback:null,next:null}}function fs(r,i,u){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Qe&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,Wr(r,u)}return y=f.interleaved,y===null?(i.next=i,ed(f)):(i.next=y.next,y.next=i),f.interleaved=i,Wr(r,u)}function hl(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194240)!==0)){var f=i.lanes;f&=r.pendingLanes,u|=f,i.lanes=u,mu(r,u)}}function ig(r,i){var u=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var E={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};w===null?y=w=E:w=w.next=E,u=u.next}while(u!==null);w===null?y=w=i:w=w.next=i}else y=w=i;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:f.shared,effects:f.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}function ml(r,i,u,f){var y=r.updateQueue;ds=!1;var w=y.firstBaseUpdate,E=y.lastBaseUpdate,$=y.shared.pending;if($!==null){y.shared.pending=null;var H=$,se=H.next;H.next=null,E===null?w=se:E.next=se,E=H;var ue=r.alternate;ue!==null&&(ue=ue.updateQueue,$=ue.lastBaseUpdate,$!==E&&($===null?ue.firstBaseUpdate=se:$.next=se,ue.lastBaseUpdate=H))}if(w!==null){var de=y.baseState;E=0,ue=se=H=null,$=w;do{var le=$.lane,ke=$.eventTime;if((f&le)===le){ue!==null&&(ue=ue.next={eventTime:ke,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Te=r,Re=$;switch(le=i,ke=u,Re.tag){case 1:if(Te=Re.payload,typeof Te=="function"){de=Te.call(ke,de,le);break e}de=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Re.payload,le=typeof Te=="function"?Te.call(ke,de,le):Te,le==null)break e;de=P({},de,le);break e;case 2:ds=!0}}$.callback!==null&&$.lane!==0&&(r.flags|=64,le=y.effects,le===null?y.effects=[$]:le.push($))}else ke={eventTime:ke,lane:le,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ue===null?(se=ue=ke,H=de):ue=ue.next=ke,E|=le;if($=$.next,$===null){if($=y.shared.pending,$===null)break;le=$,$=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);if(ue===null&&(H=de),y.baseState=H,y.firstBaseUpdate=se,y.lastBaseUpdate=ue,i=y.shared.interleaved,i!==null){y=i;do E|=y.lane,y=y.next;while(y!==i)}else w===null&&(y.shared.lanes=0);Bs|=E,r.lanes=E,r.memoizedState=de}}function ag(r,i,u){if(r=i.effects,i.effects=null,r!==null)for(i=0;i<r.length;i++){var f=r[i],y=f.callback;if(y!==null){if(f.callback=null,f=u,typeof y!="function")throw Error(n(191,y));y.call(f)}}}var Di={},wr=ls(Di),Li=ls(Di),Ii=ls(Di);function Fs(r){if(r===Di)throw Error(n(174));return r}function nd(r,i){switch(lt(Ii,i),lt(Li,r),lt(wr,Di),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:ce(null,"");break;default:r=r===8?i.parentNode:i,i=r.namespaceURI||null,r=r.tagName,i=ce(i,r)}ft(wr),lt(wr,i)}function jo(){ft(wr),ft(Li),ft(Ii)}function lg(r){Fs(Ii.current);var i=Fs(wr.current),u=ce(i,r.type);i!==u&&(lt(Li,r),lt(wr,u))}function rd(r){Li.current===r&&(ft(wr),ft(Li))}var wt=ls(0);function gl(r){for(var i=r;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var sd=[];function od(){for(var r=0;r<sd.length;r++)sd[r]._workInProgressVersionPrimary=null;sd.length=0}var xl=A.ReactCurrentDispatcher,id=A.ReactCurrentBatchConfig,zs=0,jt=null,Ft=null,Gt=null,yl=!1,Oi=!1,Mi=0,zk=0;function fn(){throw Error(n(321))}function ad(r,i){if(i===null)return!1;for(var u=0;u<i.length&&u<r.length;u++)if(!or(r[u],i[u]))return!1;return!0}function ld(r,i,u,f,y,w){if(zs=w,jt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,xl.current=r===null||r.memoizedState===null?Wk:Vk,r=u(f,y),Oi){w=0;do{if(Oi=!1,Mi=0,25<=w)throw Error(n(301));w+=1,Gt=Ft=null,i.updateQueue=null,xl.current=qk,r=u(f,y)}while(Oi)}if(xl.current=wl,i=Ft!==null&&Ft.next!==null,zs=0,Gt=Ft=jt=null,yl=!1,i)throw Error(n(300));return r}function cd(){var r=Mi!==0;return Mi=0,r}function jr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?jt.memoizedState=Gt=r:Gt=Gt.next=r,Gt}function Yn(){if(Ft===null){var r=jt.alternate;r=r!==null?r.memoizedState:null}else r=Ft.next;var i=Gt===null?jt.memoizedState:Gt.next;if(i!==null)Gt=i,Ft=r;else{if(r===null)throw Error(n(310));Ft=r,r={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Gt===null?jt.memoizedState=Gt=r:Gt=Gt.next=r}return Gt}function _i(r,i){return typeof i=="function"?i(r):i}function ud(r){var i=Yn(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=Ft,y=f.baseQueue,w=u.pending;if(w!==null){if(y!==null){var E=y.next;y.next=w.next,w.next=E}f.baseQueue=y=w,u.pending=null}if(y!==null){w=y.next,f=f.baseState;var $=E=null,H=null,se=w;do{var ue=se.lane;if((zs&ue)===ue)H!==null&&(H=H.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),f=se.hasEagerState?se.eagerState:r(f,se.action);else{var de={lane:ue,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};H===null?($=H=de,E=f):H=H.next=de,jt.lanes|=ue,Bs|=ue}se=se.next}while(se!==null&&se!==w);H===null?E=f:H.next=$,or(f,i.memoizedState)||(kn=!0),i.memoizedState=f,i.baseState=E,i.baseQueue=H,u.lastRenderedState=f}if(r=u.interleaved,r!==null){y=r;do w=y.lane,jt.lanes|=w,Bs|=w,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[i.memoizedState,u.dispatch]}function dd(r){var i=Yn(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=u.dispatch,y=u.pending,w=i.memoizedState;if(y!==null){u.pending=null;var E=y=y.next;do w=r(w,E.action),E=E.next;while(E!==y);or(w,i.memoizedState)||(kn=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),u.lastRenderedState=w}return[w,f]}function cg(){}function ug(r,i){var u=jt,f=Yn(),y=i(),w=!or(f.memoizedState,y);if(w&&(f.memoizedState=y,kn=!0),f=f.queue,fd(pg.bind(null,u,f,r),[r]),f.getSnapshot!==i||w||Gt!==null&&Gt.memoizedState.tag&1){if(u.flags|=2048,$i(9,fg.bind(null,u,f,y,i),void 0,null),Yt===null)throw Error(n(349));(zs&30)!==0||dg(u,i,y)}return y}function dg(r,i,u){r.flags|=16384,r={getSnapshot:i,value:u},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.stores=[r]):(u=i.stores,u===null?i.stores=[r]:u.push(r))}function fg(r,i,u,f){i.value=u,i.getSnapshot=f,hg(i)&&mg(r)}function pg(r,i,u){return u(function(){hg(i)&&mg(r)})}function hg(r){var i=r.getSnapshot;r=r.value;try{var u=i();return!or(r,u)}catch{return!0}}function mg(r){var i=Wr(r,1);i!==null&&ur(i,r,1,-1)}function gg(r){var i=jr();return typeof r=="function"&&(r=r()),i.memoizedState=i.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:r},i.queue=r,r=r.dispatch=Hk.bind(null,jt,r),[i.memoizedState,r]}function $i(r,i,u,f){return r={tag:r,create:i,destroy:u,deps:f,next:null},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.lastEffect=r.next=r):(u=i.lastEffect,u===null?i.lastEffect=r.next=r:(f=u.next,u.next=r,r.next=f,i.lastEffect=r)),r}function xg(){return Yn().memoizedState}function vl(r,i,u,f){var y=jr();jt.flags|=r,y.memoizedState=$i(1|i,u,void 0,f===void 0?null:f)}function bl(r,i,u,f){var y=Yn();f=f===void 0?null:f;var w=void 0;if(Ft!==null){var E=Ft.memoizedState;if(w=E.destroy,f!==null&&ad(f,E.deps)){y.memoizedState=$i(i,u,w,f);return}}jt.flags|=r,y.memoizedState=$i(1|i,u,w,f)}function yg(r,i){return vl(8390656,8,r,i)}function fd(r,i){return bl(2048,8,r,i)}function vg(r,i){return bl(4,2,r,i)}function bg(r,i){return bl(4,4,r,i)}function wg(r,i){if(typeof i=="function")return r=r(),i(r),function(){i(null)};if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function jg(r,i,u){return u=u!=null?u.concat([r]):null,bl(4,4,wg.bind(null,i,r),u)}function pd(){}function kg(r,i){var u=Yn();i=i===void 0?null:i;var f=u.memoizedState;return f!==null&&i!==null&&ad(i,f[1])?f[0]:(u.memoizedState=[r,i],r)}function Sg(r,i){var u=Yn();i=i===void 0?null:i;var f=u.memoizedState;return f!==null&&i!==null&&ad(i,f[1])?f[0]:(r=r(),u.memoizedState=[r,i],r)}function Ng(r,i,u){return(zs&21)===0?(r.baseState&&(r.baseState=!1,kn=!0),r.memoizedState=u):(or(u,i)||(u=tm(),jt.lanes|=u,Bs|=u,r.baseState=!0),i)}function Bk(r,i){var u=rt;rt=u!==0&&4>u?u:4,r(!0);var f=id.transition;id.transition={};try{r(!1),i()}finally{rt=u,id.transition=f}}function Cg(){return Yn().memoizedState}function Uk(r,i,u){var f=gs(r);if(u={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null},Eg(r))Pg(i,u);else if(u=sg(r,i,u,f),u!==null){var y=yn();ur(u,r,f,y),Tg(u,i,f)}}function Hk(r,i,u){var f=gs(r),y={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null};if(Eg(r))Pg(i,y);else{var w=r.alternate;if(r.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var E=i.lastRenderedState,$=w(E,u);if(y.hasEagerState=!0,y.eagerState=$,or($,E)){var H=i.interleaved;H===null?(y.next=y,ed(i)):(y.next=H.next,H.next=y),i.interleaved=y;return}}catch{}finally{}u=sg(r,i,y,f),u!==null&&(y=yn(),ur(u,r,f,y),Tg(u,i,f))}}function Eg(r){var i=r.alternate;return r===jt||i!==null&&i===jt}function Pg(r,i){Oi=yl=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function Tg(r,i,u){if((u&4194240)!==0){var f=i.lanes;f&=r.pendingLanes,u|=f,i.lanes=u,mu(r,u)}}var wl={readContext:Gn,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useInsertionEffect:fn,useLayoutEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useMutableSource:fn,useSyncExternalStore:fn,useId:fn,unstable_isNewReconciler:!1},Wk={readContext:Gn,useCallback:function(r,i){return jr().memoizedState=[r,i===void 0?null:i],r},useContext:Gn,useEffect:yg,useImperativeHandle:function(r,i,u){return u=u!=null?u.concat([r]):null,vl(4194308,4,wg.bind(null,i,r),u)},useLayoutEffect:function(r,i){return vl(4194308,4,r,i)},useInsertionEffect:function(r,i){return vl(4,2,r,i)},useMemo:function(r,i){var u=jr();return i=i===void 0?null:i,r=r(),u.memoizedState=[r,i],r},useReducer:function(r,i,u){var f=jr();return i=u!==void 0?u(i):i,f.memoizedState=f.baseState=i,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:i},f.queue=r,r=r.dispatch=Uk.bind(null,jt,r),[f.memoizedState,r]},useRef:function(r){var i=jr();return r={current:r},i.memoizedState=r},useState:gg,useDebugValue:pd,useDeferredValue:function(r){return jr().memoizedState=r},useTransition:function(){var r=gg(!1),i=r[0];return r=Bk.bind(null,r[1]),jr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,u){var f=jt,y=jr();if(gt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),Yt===null)throw Error(n(349));(zs&30)!==0||dg(f,i,u)}y.memoizedState=u;var w={value:u,getSnapshot:i};return y.queue=w,yg(pg.bind(null,f,w,r),[r]),f.flags|=2048,$i(9,fg.bind(null,f,w,u,i),void 0,null),u},useId:function(){var r=jr(),i=Yt.identifierPrefix;if(gt){var u=Hr,f=Ur;u=(f&~(1<<32-sr(f)-1)).toString(32)+u,i=":"+i+"R"+u,u=Mi++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=zk++,i=":"+i+"r"+u.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},Vk={readContext:Gn,useCallback:kg,useContext:Gn,useEffect:fd,useImperativeHandle:jg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Sg,useReducer:ud,useRef:xg,useState:function(){return ud(_i)},useDebugValue:pd,useDeferredValue:function(r){var i=Yn();return Ng(i,Ft.memoizedState,r)},useTransition:function(){var r=ud(_i)[0],i=Yn().memoizedState;return[r,i]},useMutableSource:cg,useSyncExternalStore:ug,useId:Cg,unstable_isNewReconciler:!1},qk={readContext:Gn,useCallback:kg,useContext:Gn,useEffect:fd,useImperativeHandle:jg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Sg,useReducer:dd,useRef:xg,useState:function(){return dd(_i)},useDebugValue:pd,useDeferredValue:function(r){var i=Yn();return Ft===null?i.memoizedState=r:Ng(i,Ft.memoizedState,r)},useTransition:function(){var r=dd(_i)[0],i=Yn().memoizedState;return[r,i]},useMutableSource:cg,useSyncExternalStore:ug,useId:Cg,unstable_isNewReconciler:!1};function ar(r,i){if(r&&r.defaultProps){i=P({},i),r=r.defaultProps;for(var u in r)i[u]===void 0&&(i[u]=r[u]);return i}return i}function hd(r,i,u,f){i=r.memoizedState,u=u(f,i),u=u==null?i:P({},i,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var jl={isMounted:function(r){return(r=r._reactInternals)?Ls(r)===r:!1},enqueueSetState:function(r,i,u){r=r._reactInternals;var f=yn(),y=gs(r),w=Vr(f,y);w.payload=i,u!=null&&(w.callback=u),i=fs(r,w,y),i!==null&&(ur(i,r,y,f),hl(i,r,y))},enqueueReplaceState:function(r,i,u){r=r._reactInternals;var f=yn(),y=gs(r),w=Vr(f,y);w.tag=1,w.payload=i,u!=null&&(w.callback=u),i=fs(r,w,y),i!==null&&(ur(i,r,y,f),hl(i,r,y))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var u=yn(),f=gs(r),y=Vr(u,f);y.tag=2,i!=null&&(y.callback=i),i=fs(r,y,f),i!==null&&(ur(i,r,f,u),hl(i,r,f))}};function Rg(r,i,u,f,y,w,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,w,E):i.prototype&&i.prototype.isPureReactComponent?!Si(u,f)||!Si(y,w):!0}function Ag(r,i,u){var f=!1,y=cs,w=i.contextType;return typeof w=="object"&&w!==null?w=Gn(w):(y=jn(i)?Os:dn.current,f=i.contextTypes,w=(f=f!=null)?mo(r,y):cs),i=new i(u,w),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=jl,r.stateNode=i,i._reactInternals=r,f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=w),i}function Dg(r,i,u,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==r&&jl.enqueueReplaceState(i,i.state,null)}function md(r,i,u,f){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},td(r);var w=i.contextType;typeof w=="object"&&w!==null?y.context=Gn(w):(w=jn(i)?Os:dn.current,y.context=mo(r,w)),y.state=r.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(hd(r,i,w,u),y.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(i=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),i!==y.state&&jl.enqueueReplaceState(y,y.state,null),ml(r,u,y,f),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function ko(r,i){try{var u="",f=i;do u+=Ne(f),f=f.return;while(f);var y=u}catch(w){y=`
|
|
39
|
+
Error generating stack: `+w.message+`
|
|
40
|
+
`+w.stack}return{value:r,source:i,stack:y,digest:null}}function gd(r,i,u){return{value:r,source:null,stack:u??null,digest:i??null}}function xd(r,i){try{console.error(i.value)}catch(u){setTimeout(function(){throw u})}}var Kk=typeof WeakMap=="function"?WeakMap:Map;function Lg(r,i,u){u=Vr(-1,u),u.tag=3,u.payload={element:null};var f=i.value;return u.callback=function(){Tl||(Tl=!0,Dd=f),xd(r,i)},u}function Ig(r,i,u){u=Vr(-1,u),u.tag=3;var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var y=i.value;u.payload=function(){return f(y)},u.callback=function(){xd(r,i)}}var w=r.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(u.callback=function(){xd(r,i),typeof f!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})}),u}function Og(r,i,u){var f=r.pingCache;if(f===null){f=r.pingCache=new Kk;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(u)||(y.add(u),r=aS.bind(null,r,i,u),i.then(r,r))}function Mg(r){do{var i;if((i=r.tag===13)&&(i=r.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return r;r=r.return}while(r!==null);return null}function _g(r,i,u,f,y){return(r.mode&1)===0?(r===i?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(i=Vr(-1,1),i.tag=2,fs(u,i,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var Gk=A.ReactCurrentOwner,kn=!1;function xn(r,i,u,f){i.child=r===null?rg(i,null,u,f):vo(i,r.child,u,f)}function $g(r,i,u,f,y){u=u.render;var w=i.ref;return wo(i,y),f=ld(r,i,u,f,w,y),u=cd(),r!==null&&!kn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~y,qr(r,i,y)):(gt&&u&&Vu(i),i.flags|=1,xn(r,i,f,y),i.child)}function Fg(r,i,u,f,y){if(r===null){var w=u.type;return typeof w=="function"&&!Fd(w)&&w.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(i.tag=15,i.type=w,zg(r,i,w,f,y)):(r=Ol(u.type,null,f,i,i.mode,y),r.ref=i.ref,r.return=i,i.child=r)}if(w=r.child,(r.lanes&y)===0){var E=w.memoizedProps;if(u=u.compare,u=u!==null?u:Si,u(E,f)&&r.ref===i.ref)return qr(r,i,y)}return i.flags|=1,r=ys(w,f),r.ref=i.ref,r.return=i,i.child=r}function zg(r,i,u,f,y){if(r!==null){var w=r.memoizedProps;if(Si(w,f)&&r.ref===i.ref)if(kn=!1,i.pendingProps=f=w,(r.lanes&y)!==0)(r.flags&131072)!==0&&(kn=!0);else return i.lanes=r.lanes,qr(r,i,y)}return yd(r,i,u,f,y)}function Bg(r,i,u){var f=i.pendingProps,y=f.children,w=r!==null?r.memoizedState:null;if(f.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(No,$n),$n|=u;else{if((u&1073741824)===0)return r=w!==null?w.baseLanes|u:u,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:r,cachePool:null,transitions:null},i.updateQueue=null,lt(No,$n),$n|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:u,lt(No,$n),$n|=f}else w!==null?(f=w.baseLanes|u,i.memoizedState=null):f=u,lt(No,$n),$n|=f;return xn(r,i,y,u),i.child}function Ug(r,i){var u=i.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(i.flags|=512,i.flags|=2097152)}function yd(r,i,u,f,y){var w=jn(u)?Os:dn.current;return w=mo(i,w),wo(i,y),u=ld(r,i,u,f,w,y),f=cd(),r!==null&&!kn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~y,qr(r,i,y)):(gt&&f&&Vu(i),i.flags|=1,xn(r,i,u,y),i.child)}function Hg(r,i,u,f,y){if(jn(u)){var w=!0;il(i)}else w=!1;if(wo(i,y),i.stateNode===null)Sl(r,i),Ag(i,u,f),md(i,u,f,y),f=!0;else if(r===null){var E=i.stateNode,$=i.memoizedProps;E.props=$;var H=E.context,se=u.contextType;typeof se=="object"&&se!==null?se=Gn(se):(se=jn(u)?Os:dn.current,se=mo(i,se));var ue=u.getDerivedStateFromProps,de=typeof ue=="function"||typeof E.getSnapshotBeforeUpdate=="function";de||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($!==f||H!==se)&&Dg(i,E,f,se),ds=!1;var le=i.memoizedState;E.state=le,ml(i,f,E,y),H=i.memoizedState,$!==f||le!==H||wn.current||ds?(typeof ue=="function"&&(hd(i,u,ue,f),H=i.memoizedState),($=ds||Rg(i,u,$,f,le,H,se))?(de||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(i.flags|=4194308)):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=H),E.props=f,E.state=H,E.context=se,f=$):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{E=i.stateNode,og(r,i),$=i.memoizedProps,se=i.type===i.elementType?$:ar(i.type,$),E.props=se,de=i.pendingProps,le=E.context,H=u.contextType,typeof H=="object"&&H!==null?H=Gn(H):(H=jn(u)?Os:dn.current,H=mo(i,H));var ke=u.getDerivedStateFromProps;(ue=typeof ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($!==de||le!==H)&&Dg(i,E,f,H),ds=!1,le=i.memoizedState,E.state=le,ml(i,f,E,y);var Te=i.memoizedState;$!==de||le!==Te||wn.current||ds?(typeof ke=="function"&&(hd(i,u,ke,f),Te=i.memoizedState),(se=ds||Rg(i,u,se,f,le,Te,H)||!1)?(ue||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(f,Te,H),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(f,Te,H)),typeof E.componentDidUpdate=="function"&&(i.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof E.componentDidUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=Te),E.props=f,E.state=Te,E.context=H,f=se):(typeof E.componentDidUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(i.flags|=1024),f=!1)}return vd(r,i,u,f,w,y)}function vd(r,i,u,f,y,w){Ug(r,i);var E=(i.flags&128)!==0;if(!f&&!E)return y&&Gm(i,u,!1),qr(r,i,w);f=i.stateNode,Gk.current=i;var $=E&&typeof u.getDerivedStateFromError!="function"?null:f.render();return i.flags|=1,r!==null&&E?(i.child=vo(i,r.child,null,w),i.child=vo(i,null,$,w)):xn(r,i,$,w),i.memoizedState=f.state,y&&Gm(i,u,!0),i.child}function Wg(r){var i=r.stateNode;i.pendingContext?qm(r,i.pendingContext,i.pendingContext!==i.context):i.context&&qm(r,i.context,!1),nd(r,i.containerInfo)}function Vg(r,i,u,f,y){return yo(),Yu(y),i.flags|=256,xn(r,i,u,f),i.child}var bd={dehydrated:null,treeContext:null,retryLane:0};function wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function qg(r,i,u){var f=i.pendingProps,y=wt.current,w=!1,E=(i.flags&128)!==0,$;if(($=E)||($=r!==null&&r.memoizedState===null?!1:(y&2)!==0),$?(w=!0,i.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),lt(wt,y&1),r===null)return Gu(i),r=i.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((i.mode&1)===0?i.lanes=1:r.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(E=f.children,r=f.fallback,w?(f=i.mode,w=i.child,E={mode:"hidden",children:E},(f&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=E):w=Ml(E,f,0,null),r=Vs(r,f,u,null),w.return=i,r.return=i,w.sibling=r,i.child=w,i.child.memoizedState=wd(u),i.memoizedState=bd,r):jd(i,E));if(y=r.memoizedState,y!==null&&($=y.dehydrated,$!==null))return Yk(r,i,E,f,$,y,u);if(w){w=f.fallback,E=i.mode,y=r.child,$=y.sibling;var H={mode:"hidden",children:f.children};return(E&1)===0&&i.child!==y?(f=i.child,f.childLanes=0,f.pendingProps=H,i.deletions=null):(f=ys(y,H),f.subtreeFlags=y.subtreeFlags&14680064),$!==null?w=ys($,w):(w=Vs(w,E,u,null),w.flags|=2),w.return=i,f.return=i,f.sibling=w,i.child=f,f=w,w=i.child,E=r.child.memoizedState,E=E===null?wd(u):{baseLanes:E.baseLanes|u,cachePool:null,transitions:E.transitions},w.memoizedState=E,w.childLanes=r.childLanes&~u,i.memoizedState=bd,f}return w=r.child,r=w.sibling,f=ys(w,{mode:"visible",children:f.children}),(i.mode&1)===0&&(f.lanes=u),f.return=i,f.sibling=null,r!==null&&(u=i.deletions,u===null?(i.deletions=[r],i.flags|=16):u.push(r)),i.child=f,i.memoizedState=null,f}function jd(r,i){return i=Ml({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function kl(r,i,u,f){return f!==null&&Yu(f),vo(i,r.child,null,u),r=jd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Yk(r,i,u,f,y,w,E){if(u)return i.flags&256?(i.flags&=-257,f=gd(Error(n(422))),kl(r,i,E,f)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(w=f.fallback,y=i.mode,f=Ml({mode:"visible",children:f.children},y,0,null),w=Vs(w,y,E,null),w.flags|=2,f.return=i,w.return=i,f.sibling=w,i.child=f,(i.mode&1)!==0&&vo(i,r.child,null,E),i.child.memoizedState=wd(E),i.memoizedState=bd,w);if((i.mode&1)===0)return kl(r,i,E,null);if(y.data==="$!"){if(f=y.nextSibling&&y.nextSibling.dataset,f)var $=f.dgst;return f=$,w=Error(n(419)),f=gd(w,f,void 0),kl(r,i,E,f)}if($=(E&r.childLanes)!==0,kn||$){if(f=Yt,f!==null){switch(E&-E){case 4:y=2;break;case 16:y=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:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(f.suspendedLanes|E))!==0?0:y,y!==0&&y!==w.retryLane&&(w.retryLane=y,Wr(r,y),ur(f,r,y,-1))}return $d(),f=gd(Error(n(421))),kl(r,i,E,f)}return y.data==="$?"?(i.flags|=128,i.child=r.child,i=lS.bind(null,r),y._reactRetry=i,null):(r=w.treeContext,_n=as(y.nextSibling),Mn=i,gt=!0,ir=null,r!==null&&(qn[Kn++]=Ur,qn[Kn++]=Hr,qn[Kn++]=Ms,Ur=r.id,Hr=r.overflow,Ms=i),i=jd(i,f.children),i.flags|=4096,i)}function Kg(r,i,u){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),Zu(r.return,i,u)}function kd(r,i,u,f,y){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=y)}function Gg(r,i,u){var f=i.pendingProps,y=f.revealOrder,w=f.tail;if(xn(r,i,f.children,u),f=wt.current,(f&2)!==0)f=f&1|2,i.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Kg(r,u,i);else if(r.tag===19)Kg(r,u,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}if(lt(wt,f),(i.mode&1)===0)i.memoizedState=null;else switch(y){case"forwards":for(u=i.child,y=null;u!==null;)r=u.alternate,r!==null&&gl(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),kd(i,!1,y,u,w);break;case"backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(r=y.alternate,r!==null&&gl(r)===null){i.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}kd(i,!0,u,null,w);break;case"together":kd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Sl(r,i){(i.mode&1)===0&&r!==null&&(r.alternate=null,i.alternate=null,i.flags|=2)}function qr(r,i,u){if(r!==null&&(i.dependencies=r.dependencies),Bs|=i.lanes,(u&i.childLanes)===0)return null;if(r!==null&&i.child!==r.child)throw Error(n(153));if(i.child!==null){for(r=i.child,u=ys(r,r.pendingProps),i.child=u,u.return=i;r.sibling!==null;)r=r.sibling,u=u.sibling=ys(r,r.pendingProps),u.return=i;u.sibling=null}return i.child}function Xk(r,i,u){switch(i.tag){case 3:Wg(i),yo();break;case 5:lg(i);break;case 1:jn(i.type)&&il(i);break;case 4:nd(i,i.stateNode.containerInfo);break;case 10:var f=i.type._context,y=i.memoizedProps.value;lt(fl,f._currentValue),f._currentValue=y;break;case 13:if(f=i.memoizedState,f!==null)return f.dehydrated!==null?(lt(wt,wt.current&1),i.flags|=128,null):(u&i.child.childLanes)!==0?qg(r,i,u):(lt(wt,wt.current&1),r=qr(r,i,u),r!==null?r.sibling:null);lt(wt,wt.current&1);break;case 19:if(f=(u&i.childLanes)!==0,(r.flags&128)!==0){if(f)return Gg(r,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),lt(wt,wt.current),f)break;return null;case 22:case 23:return i.lanes=0,Bg(r,i,u)}return qr(r,i,u)}var Yg,Sd,Xg,Qg;Yg=function(r,i){for(var u=i.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)break;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Sd=function(){},Xg=function(r,i,u,f){var y=r.memoizedProps;if(y!==f){r=i.stateNode,Fs(wr.current);var w=null;switch(u){case"input":y=Y(r,y),f=Y(r,f),w=[];break;case"select":y=P({},y,{value:void 0}),f=P({},f,{value:void 0}),w=[];break;case"textarea":y=Ct(r,y),f=Ct(r,f),w=[];break;default:typeof y.onClick!="function"&&typeof f.onClick=="function"&&(r.onclick=rl)}pe(u,f);var E;u=null;for(se in y)if(!f.hasOwnProperty(se)&&y.hasOwnProperty(se)&&y[se]!=null)if(se==="style"){var $=y[se];for(E in $)$.hasOwnProperty(E)&&(u||(u={}),u[E]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(a.hasOwnProperty(se)?w||(w=[]):(w=w||[]).push(se,null));for(se in f){var H=f[se];if($=y!=null?y[se]:void 0,f.hasOwnProperty(se)&&H!==$&&(H!=null||$!=null))if(se==="style")if($){for(E in $)!$.hasOwnProperty(E)||H&&H.hasOwnProperty(E)||(u||(u={}),u[E]="");for(E in H)H.hasOwnProperty(E)&&$[E]!==H[E]&&(u||(u={}),u[E]=H[E])}else u||(w||(w=[]),w.push(se,u)),u=H;else se==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,$=$?$.__html:void 0,H!=null&&$!==H&&(w=w||[]).push(se,H)):se==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(se,""+H):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(a.hasOwnProperty(se)?(H!=null&&se==="onScroll"&&dt("scroll",r),w||$===H||(w=[])):(w=w||[]).push(se,H))}u&&(w=w||[]).push("style",u);var se=w;(i.updateQueue=se)&&(i.flags|=4)}},Qg=function(r,i,u,f){u!==f&&(i.flags|=4)};function Fi(r,i){if(!gt)switch(r.tailMode){case"hidden":i=r.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function pn(r){var i=r.alternate!==null&&r.alternate.child===r.child,u=0,f=0;if(i)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&14680064,f|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=f,r.childLanes=u,i}function Qk(r,i,u){var f=i.pendingProps;switch(qu(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(i),null;case 1:return jn(i.type)&&ol(),pn(i),null;case 3:return f=i.stateNode,jo(),ft(wn),ft(dn),od(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(r===null||r.child===null)&&(ul(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ir!==null&&(Od(ir),ir=null))),Sd(r,i),pn(i),null;case 5:rd(i);var y=Fs(Ii.current);if(u=i.type,r!==null&&i.stateNode!=null)Xg(r,i,u,f,y),r.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!f){if(i.stateNode===null)throw Error(n(166));return pn(i),null}if(r=Fs(wr.current),ul(i)){f=i.stateNode,u=i.type;var w=i.memoizedProps;switch(f[br]=i,f[Ti]=w,r=(i.mode&1)!==0,u){case"dialog":dt("cancel",f),dt("close",f);break;case"iframe":case"object":case"embed":dt("load",f);break;case"video":case"audio":for(y=0;y<Ci.length;y++)dt(Ci[y],f);break;case"source":dt("error",f);break;case"img":case"image":case"link":dt("error",f),dt("load",f);break;case"details":dt("toggle",f);break;case"input":ae(f,w),dt("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},dt("invalid",f);break;case"textarea":Lt(f,w),dt("invalid",f)}pe(u,w),y=null;for(var E in w)if(w.hasOwnProperty(E)){var $=w[E];E==="children"?typeof $=="string"?f.textContent!==$&&(w.suppressHydrationWarning!==!0&&nl(f.textContent,$,r),y=["children",$]):typeof $=="number"&&f.textContent!==""+$&&(w.suppressHydrationWarning!==!0&&nl(f.textContent,$,r),y=["children",""+$]):a.hasOwnProperty(E)&&$!=null&&E==="onScroll"&&dt("scroll",f)}switch(u){case"input":Ye(f),Oe(f,w,!0);break;case"textarea":Ye(f),Tt(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=rl)}f=y,i.updateQueue=f,f!==null&&(i.flags|=4)}else{E=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=ie(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=E.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=E.createElement(u,{is:f.is}):(r=E.createElement(u),u==="select"&&(E=r,f.multiple?E.multiple=!0:f.size&&(E.size=f.size))):r=E.createElementNS(r,u),r[br]=i,r[Ti]=f,Yg(r,i,!1,!1),i.stateNode=r;e:{switch(E=Ee(u,f),u){case"dialog":dt("cancel",r),dt("close",r),y=f;break;case"iframe":case"object":case"embed":dt("load",r),y=f;break;case"video":case"audio":for(y=0;y<Ci.length;y++)dt(Ci[y],r);y=f;break;case"source":dt("error",r),y=f;break;case"img":case"image":case"link":dt("error",r),dt("load",r),y=f;break;case"details":dt("toggle",r),y=f;break;case"input":ae(r,f),y=Y(r,f),dt("invalid",r);break;case"option":y=f;break;case"select":r._wrapperState={wasMultiple:!!f.multiple},y=P({},f,{value:void 0}),dt("invalid",r);break;case"textarea":Lt(r,f),y=Ct(r,f),dt("invalid",r);break;default:y=f}pe(u,y),$=y;for(w in $)if($.hasOwnProperty(w)){var H=$[w];w==="style"?tn(r,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&oe(r,H)):w==="children"?typeof H=="string"?(u!=="textarea"||H!=="")&&Ce(r,H):typeof H=="number"&&Ce(r,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(a.hasOwnProperty(w)?H!=null&&w==="onScroll"&&dt("scroll",r):H!=null&&N(r,w,H,E))}switch(u){case"input":Ye(r),Oe(r,f,!1);break;case"textarea":Ye(r),Tt(r);break;case"option":f.value!=null&&r.setAttribute("value",""+be(f.value));break;case"select":r.multiple=!!f.multiple,w=f.value,w!=null?Nt(r,!!f.multiple,w,!1):f.defaultValue!=null&&Nt(r,!!f.multiple,f.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=rl)}switch(u){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return pn(i),null;case 6:if(r&&i.stateNode!=null)Qg(r,i,r.memoizedProps,f);else{if(typeof f!="string"&&i.stateNode===null)throw Error(n(166));if(u=Fs(Ii.current),Fs(wr.current),ul(i)){if(f=i.stateNode,u=i.memoizedProps,f[br]=i,(w=f.nodeValue!==u)&&(r=Mn,r!==null))switch(r.tag){case 3:nl(f.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&nl(f.nodeValue,u,(r.mode&1)!==0)}w&&(i.flags|=4)}else f=(u.nodeType===9?u:u.ownerDocument).createTextNode(f),f[br]=i,i.stateNode=f}return pn(i),null;case 13:if(ft(wt),f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(gt&&_n!==null&&(i.mode&1)!==0&&(i.flags&128)===0)eg(),yo(),i.flags|=98560,w=!1;else if(w=ul(i),f!==null&&f.dehydrated!==null){if(r===null){if(!w)throw Error(n(318));if(w=i.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[br]=i}else yo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;pn(i),w=!1}else ir!==null&&(Od(ir),ir=null),w=!0;if(!w)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=u,i):(f=f!==null,f!==(r!==null&&r.memoizedState!==null)&&f&&(i.child.flags|=8192,(i.mode&1)!==0&&(r===null||(wt.current&1)!==0?zt===0&&(zt=3):$d())),i.updateQueue!==null&&(i.flags|=4),pn(i),null);case 4:return jo(),Sd(r,i),r===null&&Ei(i.stateNode.containerInfo),pn(i),null;case 10:return Ju(i.type._context),pn(i),null;case 17:return jn(i.type)&&ol(),pn(i),null;case 19:if(ft(wt),w=i.memoizedState,w===null)return pn(i),null;if(f=(i.flags&128)!==0,E=w.rendering,E===null)if(f)Fi(w,!1);else{if(zt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(E=gl(r),E!==null){for(i.flags|=128,Fi(w,!1),f=E.updateQueue,f!==null&&(i.updateQueue=f,i.flags|=4),i.subtreeFlags=0,f=u,u=i.child;u!==null;)w=u,r=f,w.flags&=14680066,E=w.alternate,E===null?(w.childLanes=0,w.lanes=r,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=E.childLanes,w.lanes=E.lanes,w.child=E.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=E.memoizedProps,w.memoizedState=E.memoizedState,w.updateQueue=E.updateQueue,w.type=E.type,r=E.dependencies,w.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return lt(wt,wt.current&1|2),i.child}r=r.sibling}w.tail!==null&&At()>Co&&(i.flags|=128,f=!0,Fi(w,!1),i.lanes=4194304)}else{if(!f)if(r=gl(E),r!==null){if(i.flags|=128,f=!0,u=r.updateQueue,u!==null&&(i.updateQueue=u,i.flags|=4),Fi(w,!0),w.tail===null&&w.tailMode==="hidden"&&!E.alternate&&!gt)return pn(i),null}else 2*At()-w.renderingStartTime>Co&&u!==1073741824&&(i.flags|=128,f=!0,Fi(w,!1),i.lanes=4194304);w.isBackwards?(E.sibling=i.child,i.child=E):(u=w.last,u!==null?u.sibling=E:i.child=E,w.last=E)}return w.tail!==null?(i=w.tail,w.rendering=i,w.tail=i.sibling,w.renderingStartTime=At(),i.sibling=null,u=wt.current,lt(wt,f?u&1|2:u&1),i):(pn(i),null);case 22:case 23:return _d(),f=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(i.flags|=8192),f&&(i.mode&1)!==0?($n&1073741824)!==0&&(pn(i),i.subtreeFlags&6&&(i.flags|=8192)):pn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function Jk(r,i){switch(qu(i),i.tag){case 1:return jn(i.type)&&ol(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return jo(),ft(wn),ft(dn),od(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return rd(i),null;case 13:if(ft(wt),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));yo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return ft(wt),null;case 4:return jo(),null;case 10:return Ju(i.type._context),null;case 22:case 23:return _d(),null;case 24:return null;default:return null}}var Nl=!1,hn=!1,Zk=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function So(r,i){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(f){Et(r,i,f)}else u.current=null}function Nd(r,i,u){try{u()}catch(f){Et(r,i,f)}}var Jg=!1;function eS(r,i){if(_u=Va,r=Rm(),Tu(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var E=0,$=-1,H=-1,se=0,ue=0,de=r,le=null;t:for(;;){for(var ke;de!==u||y!==0&&de.nodeType!==3||($=E+y),de!==w||f!==0&&de.nodeType!==3||(H=E+f),de.nodeType===3&&(E+=de.nodeValue.length),(ke=de.firstChild)!==null;)le=de,de=ke;for(;;){if(de===r)break t;if(le===u&&++se===y&&($=E),le===w&&++ue===f&&(H=E),(ke=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=ke}u=$===-1||H===-1?null:{start:$,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for($u={focusedElem:r,selectionRange:u},Va=!1,Pe=i;Pe!==null;)if(i=Pe,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Pe=r;else for(;Pe!==null;){i=Pe;try{var Te=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Re=Te.memoizedProps,Dt=Te.memoizedState,X=i.stateNode,W=X.getSnapshotBeforeUpdate(i.elementType===i.type?Re:ar(i.type,Re),Dt);X.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ee=i.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(me){Et(i,i.return,me)}if(r=i.sibling,r!==null){r.return=i.return,Pe=r;break}Pe=i.return}return Te=Jg,Jg=!1,Te}function zi(r,i,u){var f=i.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&r)===r){var w=y.destroy;y.destroy=void 0,w!==void 0&&Nd(i,u,w)}y=y.next}while(y!==f)}}function Cl(r,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&r)===r){var f=u.create;u.destroy=f()}u=u.next}while(u!==i)}}function Cd(r){var i=r.ref;if(i!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof i=="function"?i(r):i.current=r}}function Zg(r){var i=r.alternate;i!==null&&(r.alternate=null,Zg(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[br],delete i[Ti],delete i[Uu],delete i[Mk],delete i[_k])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function ex(r){return r.tag===5||r.tag===3||r.tag===4}function tx(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ex(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ed(r,i,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(r,i):u.insertBefore(r,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(r,u)):(i=u,i.appendChild(r)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=rl));else if(f!==4&&(r=r.child,r!==null))for(Ed(r,i,u),r=r.sibling;r!==null;)Ed(r,i,u),r=r.sibling}function Pd(r,i,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(Pd(r,i,u),r=r.sibling;r!==null;)Pd(r,i,u),r=r.sibling}var rn=null,lr=!1;function ps(r,i,u){for(u=u.child;u!==null;)nx(r,i,u),u=u.sibling}function nx(r,i,u){if(vr&&typeof vr.onCommitFiberUnmount=="function")try{vr.onCommitFiberUnmount(Fa,u)}catch{}switch(u.tag){case 5:hn||So(u,i);case 6:var f=rn,y=lr;rn=null,ps(r,i,u),rn=f,lr=y,rn!==null&&(lr?(r=rn,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):rn.removeChild(u.stateNode));break;case 18:rn!==null&&(lr?(r=rn,u=u.stateNode,r.nodeType===8?Bu(r.parentNode,u):r.nodeType===1&&Bu(r,u),yi(r)):Bu(rn,u.stateNode));break;case 4:f=rn,y=lr,rn=u.stateNode.containerInfo,lr=!0,ps(r,i,u),rn=f,lr=y;break;case 0:case 11:case 14:case 15:if(!hn&&(f=u.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){y=f=f.next;do{var w=y,E=w.destroy;w=w.tag,E!==void 0&&((w&2)!==0||(w&4)!==0)&&Nd(u,i,E),y=y.next}while(y!==f)}ps(r,i,u);break;case 1:if(!hn&&(So(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=u.memoizedProps,f.state=u.memoizedState,f.componentWillUnmount()}catch($){Et(u,i,$)}ps(r,i,u);break;case 21:ps(r,i,u);break;case 22:u.mode&1?(hn=(f=hn)||u.memoizedState!==null,ps(r,i,u),hn=f):ps(r,i,u);break;default:ps(r,i,u)}}function rx(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Zk),i.forEach(function(f){var y=cS.bind(null,r,f);u.has(f)||(u.add(f),f.then(y,y))})}}function cr(r,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f];try{var w=r,E=i,$=E;e:for(;$!==null;){switch($.tag){case 5:rn=$.stateNode,lr=!1;break e;case 3:rn=$.stateNode.containerInfo,lr=!0;break e;case 4:rn=$.stateNode.containerInfo,lr=!0;break e}$=$.return}if(rn===null)throw Error(n(160));nx(w,E,y),rn=null,lr=!1;var H=y.alternate;H!==null&&(H.return=null),y.return=null}catch(se){Et(y,i,se)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)sx(i,r),i=i.sibling}function sx(r,i){var u=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(cr(i,r),kr(r),f&4){try{zi(3,r,r.return),Cl(3,r)}catch(Re){Et(r,r.return,Re)}try{zi(5,r,r.return)}catch(Re){Et(r,r.return,Re)}}break;case 1:cr(i,r),kr(r),f&512&&u!==null&&So(u,u.return);break;case 5:if(cr(i,r),kr(r),f&512&&u!==null&&So(u,u.return),r.flags&32){var y=r.stateNode;try{Ce(y,"")}catch(Re){Et(r,r.return,Re)}}if(f&4&&(y=r.stateNode,y!=null)){var w=r.memoizedProps,E=u!==null?u.memoizedProps:w,$=r.type,H=r.updateQueue;if(r.updateQueue=null,H!==null)try{$==="input"&&w.type==="radio"&&w.name!=null&&xe(y,w),Ee($,E);var se=Ee($,w);for(E=0;E<H.length;E+=2){var ue=H[E],de=H[E+1];ue==="style"?tn(y,de):ue==="dangerouslySetInnerHTML"?oe(y,de):ue==="children"?Ce(y,de):N(y,ue,de,se)}switch($){case"input":qe(y,w);break;case"textarea":en(y,w);break;case"select":var le=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!w.multiple;var ke=w.value;ke!=null?Nt(y,!!w.multiple,ke,!1):le!==!!w.multiple&&(w.defaultValue!=null?Nt(y,!!w.multiple,w.defaultValue,!0):Nt(y,!!w.multiple,w.multiple?[]:"",!1))}y[Ti]=w}catch(Re){Et(r,r.return,Re)}}break;case 6:if(cr(i,r),kr(r),f&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,w=r.memoizedProps;try{y.nodeValue=w}catch(Re){Et(r,r.return,Re)}}break;case 3:if(cr(i,r),kr(r),f&4&&u!==null&&u.memoizedState.isDehydrated)try{yi(i.containerInfo)}catch(Re){Et(r,r.return,Re)}break;case 4:cr(i,r),kr(r);break;case 13:cr(i,r),kr(r),y=r.child,y.flags&8192&&(w=y.memoizedState!==null,y.stateNode.isHidden=w,!w||y.alternate!==null&&y.alternate.memoizedState!==null||(Ad=At())),f&4&&rx(r);break;case 22:if(ue=u!==null&&u.memoizedState!==null,r.mode&1?(hn=(se=hn)||ue,cr(i,r),hn=se):cr(i,r),kr(r),f&8192){if(se=r.memoizedState!==null,(r.stateNode.isHidden=se)&&!ue&&(r.mode&1)!==0)for(Pe=r,ue=r.child;ue!==null;){for(de=Pe=ue;Pe!==null;){switch(le=Pe,ke=le.child,le.tag){case 0:case 11:case 14:case 15:zi(4,le,le.return);break;case 1:So(le,le.return);var Te=le.stateNode;if(typeof Te.componentWillUnmount=="function"){f=le,u=le.return;try{i=f,Te.props=i.memoizedProps,Te.state=i.memoizedState,Te.componentWillUnmount()}catch(Re){Et(f,u,Re)}}break;case 5:So(le,le.return);break;case 22:if(le.memoizedState!==null){ax(de);continue}}ke!==null?(ke.return=le,Pe=ke):ax(de)}ue=ue.sibling}e:for(ue=null,de=r;;){if(de.tag===5){if(ue===null){ue=de;try{y=de.stateNode,se?(w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):($=de.stateNode,H=de.memoizedProps.style,E=H!=null&&H.hasOwnProperty("display")?H.display:null,$.style.display=an("display",E))}catch(Re){Et(r,r.return,Re)}}}else if(de.tag===6){if(ue===null)try{de.stateNode.nodeValue=se?"":de.memoizedProps}catch(Re){Et(r,r.return,Re)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===r)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===r)break e;for(;de.sibling===null;){if(de.return===null||de.return===r)break e;ue===de&&(ue=null),de=de.return}ue===de&&(ue=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:cr(i,r),kr(r),f&4&&rx(r);break;case 21:break;default:cr(i,r),kr(r)}}function kr(r){var i=r.flags;if(i&2){try{e:{for(var u=r.return;u!==null;){if(ex(u)){var f=u;break e}u=u.return}throw Error(n(160))}switch(f.tag){case 5:var y=f.stateNode;f.flags&32&&(Ce(y,""),f.flags&=-33);var w=tx(r);Pd(r,w,y);break;case 3:case 4:var E=f.stateNode.containerInfo,$=tx(r);Ed(r,$,E);break;default:throw Error(n(161))}}catch(H){Et(r,r.return,H)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function tS(r,i,u){Pe=r,ox(r)}function ox(r,i,u){for(var f=(r.mode&1)!==0;Pe!==null;){var y=Pe,w=y.child;if(y.tag===22&&f){var E=y.memoizedState!==null||Nl;if(!E){var $=y.alternate,H=$!==null&&$.memoizedState!==null||hn;$=Nl;var se=hn;if(Nl=E,(hn=H)&&!se)for(Pe=y;Pe!==null;)E=Pe,H=E.child,E.tag===22&&E.memoizedState!==null?lx(y):H!==null?(H.return=E,Pe=H):lx(y);for(;w!==null;)Pe=w,ox(w),w=w.sibling;Pe=y,Nl=$,hn=se}ix(r)}else(y.subtreeFlags&8772)!==0&&w!==null?(w.return=y,Pe=w):ix(r)}}function ix(r){for(;Pe!==null;){var i=Pe;if((i.flags&8772)!==0){var u=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:hn||Cl(5,i);break;case 1:var f=i.stateNode;if(i.flags&4&&!hn)if(u===null)f.componentDidMount();else{var y=i.elementType===i.type?u.memoizedProps:ar(i.type,u.memoizedProps);f.componentDidUpdate(y,u.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=i.updateQueue;w!==null&&ag(i,w,f);break;case 3:var E=i.updateQueue;if(E!==null){if(u=null,i.child!==null)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}ag(i,E,u)}break;case 5:var $=i.stateNode;if(u===null&&i.flags&4){u=$;var H=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&u.focus();break;case"img":H.src&&(u.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var se=i.alternate;if(se!==null){var ue=se.memoizedState;if(ue!==null){var de=ue.dehydrated;de!==null&&yi(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}hn||i.flags&512&&Cd(i)}catch(le){Et(i,i.return,le)}}if(i===r){Pe=null;break}if(u=i.sibling,u!==null){u.return=i.return,Pe=u;break}Pe=i.return}}function ax(r){for(;Pe!==null;){var i=Pe;if(i===r){Pe=null;break}var u=i.sibling;if(u!==null){u.return=i.return,Pe=u;break}Pe=i.return}}function lx(r){for(;Pe!==null;){var i=Pe;try{switch(i.tag){case 0:case 11:case 15:var u=i.return;try{Cl(4,i)}catch(H){Et(i,u,H)}break;case 1:var f=i.stateNode;if(typeof f.componentDidMount=="function"){var y=i.return;try{f.componentDidMount()}catch(H){Et(i,y,H)}}var w=i.return;try{Cd(i)}catch(H){Et(i,w,H)}break;case 5:var E=i.return;try{Cd(i)}catch(H){Et(i,E,H)}}}catch(H){Et(i,i.return,H)}if(i===r){Pe=null;break}var $=i.sibling;if($!==null){$.return=i.return,Pe=$;break}Pe=i.return}}var nS=Math.ceil,El=A.ReactCurrentDispatcher,Td=A.ReactCurrentOwner,Xn=A.ReactCurrentBatchConfig,Qe=0,Yt=null,It=null,sn=0,$n=0,No=ls(0),zt=0,Bi=null,Bs=0,Pl=0,Rd=0,Ui=null,Sn=null,Ad=0,Co=1/0,Kr=null,Tl=!1,Dd=null,hs=null,Rl=!1,ms=null,Al=0,Hi=0,Ld=null,Dl=-1,Ll=0;function yn(){return(Qe&6)!==0?At():Dl!==-1?Dl:Dl=At()}function gs(r){return(r.mode&1)===0?1:(Qe&2)!==0&&sn!==0?sn&-sn:Fk.transition!==null?(Ll===0&&(Ll=tm()),Ll):(r=rt,r!==0||(r=window.event,r=r===void 0?16:um(r.type)),r)}function ur(r,i,u,f){if(50<Hi)throw Hi=0,Ld=null,Error(n(185));pi(r,u,f),((Qe&2)===0||r!==Yt)&&(r===Yt&&((Qe&2)===0&&(Pl|=u),zt===4&&xs(r,sn)),Nn(r,f),u===1&&Qe===0&&(i.mode&1)===0&&(Co=At()+500,al&&us()))}function Nn(r,i){var u=r.callbackNode;F1(r,i);var f=Ua(r,r===Yt?sn:0);if(f===0)u!==null&&Jh(u),r.callbackNode=null,r.callbackPriority=0;else if(i=f&-f,r.callbackPriority!==i){if(u!=null&&Jh(u),i===1)r.tag===0?$k(ux.bind(null,r)):Ym(ux.bind(null,r)),Ik(function(){(Qe&6)===0&&us()}),u=null;else{switch(nm(f)){case 1:u=fu;break;case 4:u=Zh;break;case 16:u=$a;break;case 536870912:u=em;break;default:u=$a}u=yx(u,cx.bind(null,r))}r.callbackPriority=i,r.callbackNode=u}}function cx(r,i){if(Dl=-1,Ll=0,(Qe&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Eo()&&r.callbackNode!==u)return null;var f=Ua(r,r===Yt?sn:0);if(f===0)return null;if((f&30)!==0||(f&r.expiredLanes)!==0||i)i=Il(r,f);else{i=f;var y=Qe;Qe|=2;var w=fx();(Yt!==r||sn!==i)&&(Kr=null,Co=At()+500,Hs(r,i));do try{oS();break}catch($){dx(r,$)}while(!0);Qu(),El.current=w,Qe=y,It!==null?i=0:(Yt=null,sn=0,i=zt)}if(i!==0){if(i===2&&(y=pu(r),y!==0&&(f=y,i=Id(r,y))),i===1)throw u=Bi,Hs(r,0),xs(r,f),Nn(r,At()),u;if(i===6)xs(r,f);else{if(y=r.current.alternate,(f&30)===0&&!rS(y)&&(i=Il(r,f),i===2&&(w=pu(r),w!==0&&(f=w,i=Id(r,w))),i===1))throw u=Bi,Hs(r,0),xs(r,f),Nn(r,At()),u;switch(r.finishedWork=y,r.finishedLanes=f,i){case 0:case 1:throw Error(n(345));case 2:Ws(r,Sn,Kr);break;case 3:if(xs(r,f),(f&130023424)===f&&(i=Ad+500-At(),10<i)){if(Ua(r,0)!==0)break;if(y=r.suspendedLanes,(y&f)!==f){yn(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=zu(Ws.bind(null,r,Sn,Kr),i);break}Ws(r,Sn,Kr);break;case 4:if(xs(r,f),(f&4194240)===f)break;for(i=r.eventTimes,y=-1;0<f;){var E=31-sr(f);w=1<<E,E=i[E],E>y&&(y=E),f&=~w}if(f=y,f=At()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*nS(f/1960))-f,10<f){r.timeoutHandle=zu(Ws.bind(null,r,Sn,Kr),f);break}Ws(r,Sn,Kr);break;case 5:Ws(r,Sn,Kr);break;default:throw Error(n(329))}}}return Nn(r,At()),r.callbackNode===u?cx.bind(null,r):null}function Id(r,i){var u=Ui;return r.current.memoizedState.isDehydrated&&(Hs(r,i).flags|=256),r=Il(r,i),r!==2&&(i=Sn,Sn=u,i!==null&&Od(i)),r}function Od(r){Sn===null?Sn=r:Sn.push.apply(Sn,r)}function rS(r){for(var i=r;;){if(i.flags&16384){var u=i.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var f=0;f<u.length;f++){var y=u[f],w=y.getSnapshot;y=y.value;try{if(!or(w(),y))return!1}catch{return!1}}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function xs(r,i){for(i&=~Rd,i&=~Pl,r.suspendedLanes|=i,r.pingedLanes&=~i,r=r.expirationTimes;0<i;){var u=31-sr(i),f=1<<u;r[u]=-1,i&=~f}}function ux(r){if((Qe&6)!==0)throw Error(n(327));Eo();var i=Ua(r,0);if((i&1)===0)return Nn(r,At()),null;var u=Il(r,i);if(r.tag!==0&&u===2){var f=pu(r);f!==0&&(i=f,u=Id(r,f))}if(u===1)throw u=Bi,Hs(r,0),xs(r,i),Nn(r,At()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Ws(r,Sn,Kr),Nn(r,At()),null}function Md(r,i){var u=Qe;Qe|=1;try{return r(i)}finally{Qe=u,Qe===0&&(Co=At()+500,al&&us())}}function Us(r){ms!==null&&ms.tag===0&&(Qe&6)===0&&Eo();var i=Qe;Qe|=1;var u=Xn.transition,f=rt;try{if(Xn.transition=null,rt=1,r)return r()}finally{rt=f,Xn.transition=u,Qe=i,(Qe&6)===0&&us()}}function _d(){$n=No.current,ft(No)}function Hs(r,i){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Lk(u)),It!==null)for(u=It.return;u!==null;){var f=u;switch(qu(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ol();break;case 3:jo(),ft(wn),ft(dn),od();break;case 5:rd(f);break;case 4:jo();break;case 13:ft(wt);break;case 19:ft(wt);break;case 10:Ju(f.type._context);break;case 22:case 23:_d()}u=u.return}if(Yt=r,It=r=ys(r.current,null),sn=$n=i,zt=0,Bi=null,Rd=Pl=Bs=0,Sn=Ui=null,$s!==null){for(i=0;i<$s.length;i++)if(u=$s[i],f=u.interleaved,f!==null){u.interleaved=null;var y=f.next,w=u.pending;if(w!==null){var E=w.next;w.next=y,f.next=E}u.pending=f}$s=null}return r}function dx(r,i){do{var u=It;try{if(Qu(),xl.current=wl,yl){for(var f=jt.memoizedState;f!==null;){var y=f.queue;y!==null&&(y.pending=null),f=f.next}yl=!1}if(zs=0,Gt=Ft=jt=null,Oi=!1,Mi=0,Td.current=null,u===null||u.return===null){zt=1,Bi=i,It=null;break}e:{var w=r,E=u.return,$=u,H=i;if(i=sn,$.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var se=H,ue=$,de=ue.tag;if((ue.mode&1)===0&&(de===0||de===11||de===15)){var le=ue.alternate;le?(ue.updateQueue=le.updateQueue,ue.memoizedState=le.memoizedState,ue.lanes=le.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var ke=Mg(E);if(ke!==null){ke.flags&=-257,_g(ke,E,$,w,i),ke.mode&1&&Og(w,se,i),i=ke,H=se;var Te=i.updateQueue;if(Te===null){var Re=new Set;Re.add(H),i.updateQueue=Re}else Te.add(H);break e}else{if((i&1)===0){Og(w,se,i),$d();break e}H=Error(n(426))}}else if(gt&&$.mode&1){var Dt=Mg(E);if(Dt!==null){(Dt.flags&65536)===0&&(Dt.flags|=256),_g(Dt,E,$,w,i),Yu(ko(H,$));break e}}w=H=ko(H,$),zt!==4&&(zt=2),Ui===null?Ui=[w]:Ui.push(w),w=E;do{switch(w.tag){case 3:w.flags|=65536,i&=-i,w.lanes|=i;var X=Lg(w,H,i);ig(w,X);break e;case 1:$=H;var W=w.type,ee=w.stateNode;if((w.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(hs===null||!hs.has(ee)))){w.flags|=65536,i&=-i,w.lanes|=i;var me=Ig(w,$,i);ig(w,me);break e}}w=w.return}while(w!==null)}hx(u)}catch(De){i=De,It===u&&u!==null&&(It=u=u.return);continue}break}while(!0)}function fx(){var r=El.current;return El.current=wl,r===null?wl:r}function $d(){(zt===0||zt===3||zt===2)&&(zt=4),Yt===null||(Bs&268435455)===0&&(Pl&268435455)===0||xs(Yt,sn)}function Il(r,i){var u=Qe;Qe|=2;var f=fx();(Yt!==r||sn!==i)&&(Kr=null,Hs(r,i));do try{sS();break}catch(y){dx(r,y)}while(!0);if(Qu(),Qe=u,El.current=f,It!==null)throw Error(n(261));return Yt=null,sn=0,zt}function sS(){for(;It!==null;)px(It)}function oS(){for(;It!==null&&!R1();)px(It)}function px(r){var i=xx(r.alternate,r,$n);r.memoizedProps=r.pendingProps,i===null?hx(r):It=i,Td.current=null}function hx(r){var i=r;do{var u=i.alternate;if(r=i.return,(i.flags&32768)===0){if(u=Qk(u,i,$n),u!==null){It=u;return}}else{if(u=Jk(u,i),u!==null){u.flags&=32767,It=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{zt=6,It=null;return}}if(i=i.sibling,i!==null){It=i;return}It=i=r}while(i!==null);zt===0&&(zt=5)}function Ws(r,i,u){var f=rt,y=Xn.transition;try{Xn.transition=null,rt=1,iS(r,i,u,f)}finally{Xn.transition=y,rt=f}return null}function iS(r,i,u,f){do Eo();while(ms!==null);if((Qe&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var w=u.lanes|u.childLanes;if(z1(r,w),r===Yt&&(It=Yt=null,sn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Rl||(Rl=!0,yx($a,function(){return Eo(),null})),w=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||w){w=Xn.transition,Xn.transition=null;var E=rt;rt=1;var $=Qe;Qe|=4,Td.current=null,eS(r,u),sx(u,r),Ck($u),Va=!!_u,$u=_u=null,r.current=u,tS(u),A1(),Qe=$,rt=E,Xn.transition=w}else r.current=u;if(Rl&&(Rl=!1,ms=r,Al=y),w=r.pendingLanes,w===0&&(hs=null),I1(u.stateNode),Nn(r,At()),i!==null)for(f=r.onRecoverableError,u=0;u<i.length;u++)y=i[u],f(y.value,{componentStack:y.stack,digest:y.digest});if(Tl)throw Tl=!1,r=Dd,Dd=null,r;return(Al&1)!==0&&r.tag!==0&&Eo(),w=r.pendingLanes,(w&1)!==0?r===Ld?Hi++:(Hi=0,Ld=r):Hi=0,us(),null}function Eo(){if(ms!==null){var r=nm(Al),i=Xn.transition,u=rt;try{if(Xn.transition=null,rt=16>r?16:r,ms===null)var f=!1;else{if(r=ms,ms=null,Al=0,(Qe&6)!==0)throw Error(n(331));var y=Qe;for(Qe|=4,Pe=r.current;Pe!==null;){var w=Pe,E=w.child;if((Pe.flags&16)!==0){var $=w.deletions;if($!==null){for(var H=0;H<$.length;H++){var se=$[H];for(Pe=se;Pe!==null;){var ue=Pe;switch(ue.tag){case 0:case 11:case 15:zi(8,ue,w)}var de=ue.child;if(de!==null)de.return=ue,Pe=de;else for(;Pe!==null;){ue=Pe;var le=ue.sibling,ke=ue.return;if(Zg(ue),ue===se){Pe=null;break}if(le!==null){le.return=ke,Pe=le;break}Pe=ke}}}var Te=w.alternate;if(Te!==null){var Re=Te.child;if(Re!==null){Te.child=null;do{var Dt=Re.sibling;Re.sibling=null,Re=Dt}while(Re!==null)}}Pe=w}}if((w.subtreeFlags&2064)!==0&&E!==null)E.return=w,Pe=E;else e:for(;Pe!==null;){if(w=Pe,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:zi(9,w,w.return)}var X=w.sibling;if(X!==null){X.return=w.return,Pe=X;break e}Pe=w.return}}var W=r.current;for(Pe=W;Pe!==null;){E=Pe;var ee=E.child;if((E.subtreeFlags&2064)!==0&&ee!==null)ee.return=E,Pe=ee;else e:for(E=W;Pe!==null;){if($=Pe,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:Cl(9,$)}}catch(De){Et($,$.return,De)}if($===E){Pe=null;break e}var me=$.sibling;if(me!==null){me.return=$.return,Pe=me;break e}Pe=$.return}}if(Qe=y,us(),vr&&typeof vr.onPostCommitFiberRoot=="function")try{vr.onPostCommitFiberRoot(Fa,r)}catch{}f=!0}return f}finally{rt=u,Xn.transition=i}}return!1}function mx(r,i,u){i=ko(u,i),i=Lg(r,i,1),r=fs(r,i,1),i=yn(),r!==null&&(pi(r,1,i),Nn(r,i))}function Et(r,i,u){if(r.tag===3)mx(r,r,u);else for(;i!==null;){if(i.tag===3){mx(i,r,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(hs===null||!hs.has(f))){r=ko(u,r),r=Ig(i,r,1),i=fs(i,r,1),r=yn(),i!==null&&(pi(i,1,r),Nn(i,r));break}}i=i.return}}function aS(r,i,u){var f=r.pingCache;f!==null&&f.delete(i),i=yn(),r.pingedLanes|=r.suspendedLanes&u,Yt===r&&(sn&u)===u&&(zt===4||zt===3&&(sn&130023424)===sn&&500>At()-Ad?Hs(r,0):Rd|=u),Nn(r,i)}function gx(r,i){i===0&&((r.mode&1)===0?i=1:(i=Ba,Ba<<=1,(Ba&130023424)===0&&(Ba=4194304)));var u=yn();r=Wr(r,i),r!==null&&(pi(r,i,u),Nn(r,u))}function lS(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),gx(r,u)}function cS(r,i){var u=0;switch(r.tag){case 13:var f=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(i),gx(r,u)}var xx;xx=function(r,i,u){if(r!==null)if(r.memoizedProps!==i.pendingProps||wn.current)kn=!0;else{if((r.lanes&u)===0&&(i.flags&128)===0)return kn=!1,Xk(r,i,u);kn=(r.flags&131072)!==0}else kn=!1,gt&&(i.flags&1048576)!==0&&Xm(i,cl,i.index);switch(i.lanes=0,i.tag){case 2:var f=i.type;Sl(r,i),r=i.pendingProps;var y=mo(i,dn.current);wo(i,u),y=ld(null,i,f,r,y,u);var w=cd();return i.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,jn(f)?(w=!0,il(i)):w=!1,i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,td(i),y.updater=jl,i.stateNode=y,y._reactInternals=i,md(i,f,r,u),i=vd(null,i,f,!0,w,u)):(i.tag=0,gt&&w&&Vu(i),xn(null,i,y,u),i=i.child),i;case 16:f=i.elementType;e:{switch(Sl(r,i),r=i.pendingProps,y=f._init,f=y(f._payload),i.type=f,y=i.tag=dS(f),r=ar(f,r),y){case 0:i=yd(null,i,f,r,u);break e;case 1:i=Hg(null,i,f,r,u);break e;case 11:i=$g(null,i,f,r,u);break e;case 14:i=Fg(null,i,f,ar(f.type,r),u);break e}throw Error(n(306,f,""))}return i;case 0:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:ar(f,y),yd(r,i,f,y,u);case 1:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:ar(f,y),Hg(r,i,f,y,u);case 3:e:{if(Wg(i),r===null)throw Error(n(387));f=i.pendingProps,w=i.memoizedState,y=w.element,og(r,i),ml(i,f,null,u);var E=i.memoizedState;if(f=E.element,w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){y=ko(Error(n(423)),i),i=Vg(r,i,f,u,y);break e}else if(f!==y){y=ko(Error(n(424)),i),i=Vg(r,i,f,u,y);break e}else for(_n=as(i.stateNode.containerInfo.firstChild),Mn=i,gt=!0,ir=null,u=rg(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(yo(),f===y){i=qr(r,i,u);break e}xn(r,i,f,u)}i=i.child}return i;case 5:return lg(i),r===null&&Gu(i),f=i.type,y=i.pendingProps,w=r!==null?r.memoizedProps:null,E=y.children,Fu(f,y)?E=null:w!==null&&Fu(f,w)&&(i.flags|=32),Ug(r,i),xn(r,i,E,u),i.child;case 6:return r===null&&Gu(i),null;case 13:return qg(r,i,u);case 4:return nd(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=vo(i,null,f,u):xn(r,i,f,u),i.child;case 11:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:ar(f,y),$g(r,i,f,y,u);case 7:return xn(r,i,i.pendingProps,u),i.child;case 8:return xn(r,i,i.pendingProps.children,u),i.child;case 12:return xn(r,i,i.pendingProps.children,u),i.child;case 10:e:{if(f=i.type._context,y=i.pendingProps,w=i.memoizedProps,E=y.value,lt(fl,f._currentValue),f._currentValue=E,w!==null)if(or(w.value,E)){if(w.children===y.children&&!wn.current){i=qr(r,i,u);break e}}else for(w=i.child,w!==null&&(w.return=i);w!==null;){var $=w.dependencies;if($!==null){E=w.child;for(var H=$.firstContext;H!==null;){if(H.context===f){if(w.tag===1){H=Vr(-1,u&-u),H.tag=2;var se=w.updateQueue;if(se!==null){se=se.shared;var ue=se.pending;ue===null?H.next=H:(H.next=ue.next,ue.next=H),se.pending=H}}w.lanes|=u,H=w.alternate,H!==null&&(H.lanes|=u),Zu(w.return,u,i),$.lanes|=u;break}H=H.next}}else if(w.tag===10)E=w.type===i.type?null:w.child;else if(w.tag===18){if(E=w.return,E===null)throw Error(n(341));E.lanes|=u,$=E.alternate,$!==null&&($.lanes|=u),Zu(E,u,i),E=w.sibling}else E=w.child;if(E!==null)E.return=w;else for(E=w;E!==null;){if(E===i){E=null;break}if(w=E.sibling,w!==null){w.return=E.return,E=w;break}E=E.return}w=E}xn(r,i,y.children,u),i=i.child}return i;case 9:return y=i.type,f=i.pendingProps.children,wo(i,u),y=Gn(y),f=f(y),i.flags|=1,xn(r,i,f,u),i.child;case 14:return f=i.type,y=ar(f,i.pendingProps),y=ar(f.type,y),Fg(r,i,f,y,u);case 15:return zg(r,i,i.type,i.pendingProps,u);case 17:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:ar(f,y),Sl(r,i),i.tag=1,jn(f)?(r=!0,il(i)):r=!1,wo(i,u),Ag(i,f,y),md(i,f,y,u),vd(null,i,f,!0,r,u);case 19:return Gg(r,i,u);case 22:return Bg(r,i,u)}throw Error(n(156,i.tag))};function yx(r,i){return Qh(r,i)}function uS(r,i,u,f){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(r,i,u,f){return new uS(r,i,u,f)}function Fd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function dS(r){if(typeof r=="function")return Fd(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===_)return 14}return 2}function ys(r,i){var u=r.alternate;return u===null?(u=Qn(r.tag,i,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=i,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,i=r.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Ol(r,i,u,f,y,w){var E=2;if(f=r,typeof r=="function")Fd(r)&&(E=1);else if(typeof r=="string")E=5;else e:switch(r){case D:return Vs(u.children,y,w,i);case O:E=8,y|=8;break;case G:return r=Qn(12,u,i,y|2),r.elementType=G,r.lanes=w,r;case q:return r=Qn(13,u,i,y),r.elementType=q,r.lanes=w,r;case J:return r=Qn(19,u,i,y),r.elementType=J,r.lanes=w,r;case B:return Ml(u,y,w,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case re:E=10;break e;case z:E=9;break e;case K:E=11;break e;case _:E=14;break e;case F:E=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return i=Qn(E,u,i,y),i.elementType=r,i.type=f,i.lanes=w,i}function Vs(r,i,u,f){return r=Qn(7,r,f,i),r.lanes=u,r}function Ml(r,i,u,f){return r=Qn(22,r,f,i),r.elementType=B,r.lanes=u,r.stateNode={isHidden:!1},r}function zd(r,i,u){return r=Qn(6,r,null,i),r.lanes=u,r}function Bd(r,i,u){return i=Qn(4,r.children!==null?r.children:[],r.key,i),i.lanes=u,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}function fS(r,i,u,f,y){this.tag=i,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hu(0),this.expirationTimes=hu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hu(0),this.identifierPrefix=f,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Ud(r,i,u,f,y,w,E,$,H){return r=new fS(r,i,u,$,H),i===1?(i=1,w===!0&&(i|=8)):i=0,w=Qn(3,null,null,i),r.current=w,w.stateNode=r,w.memoizedState={element:f,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(w),r}function pS(r,i,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:f==null?null:""+f,children:r,containerInfo:i,implementation:u}}function vx(r){if(!r)return cs;r=r._reactInternals;e:{if(Ls(r)!==r||r.tag!==1)throw Error(n(170));var i=r;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(jn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(jn(u))return Km(r,u,i)}return i}function bx(r,i,u,f,y,w,E,$,H){return r=Ud(u,f,!0,r,y,w,E,$,H),r.context=vx(null),u=r.current,f=yn(),y=gs(u),w=Vr(f,y),w.callback=i??null,fs(u,w,y),r.current.lanes=y,pi(r,y,f),Nn(r,f),r}function _l(r,i,u,f){var y=i.current,w=yn(),E=gs(y);return u=vx(u),i.context===null?i.context=u:i.pendingContext=u,i=Vr(w,E),i.payload={element:r},f=f===void 0?null:f,f!==null&&(i.callback=f),r=fs(y,i,E),r!==null&&(ur(r,y,E,w),hl(r,y,E)),E}function $l(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function wx(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<i?u:i}}function Hd(r,i){wx(r,i),(r=r.alternate)&&wx(r,i)}function hS(){return null}var jx=typeof reportError=="function"?reportError:function(r){console.error(r)};function Wd(r){this._internalRoot=r}Fl.prototype.render=Wd.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));_l(r,i,null,null)},Fl.prototype.unmount=Wd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Us(function(){_l(null,r,null,null)}),i[zr]=null}};function Fl(r){this._internalRoot=r}Fl.prototype.unstable_scheduleHydration=function(r){if(r){var i=om();r={blockedOn:null,target:r,priority:i};for(var u=0;u<ss.length&&i!==0&&i<ss[u].priority;u++);ss.splice(u,0,r),u===0&&lm(r)}};function Vd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function zl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function kx(){}function mS(r,i,u,f,y){if(y){if(typeof f=="function"){var w=f;f=function(){var se=$l(E);w.call(se)}}var E=bx(i,f,r,0,null,!1,!1,"",kx);return r._reactRootContainer=E,r[zr]=E.current,Ei(r.nodeType===8?r.parentNode:r),Us(),E}for(;y=r.lastChild;)r.removeChild(y);if(typeof f=="function"){var $=f;f=function(){var se=$l(H);$.call(se)}}var H=Ud(r,0,!1,null,null,!1,!1,"",kx);return r._reactRootContainer=H,r[zr]=H.current,Ei(r.nodeType===8?r.parentNode:r),Us(function(){_l(i,H,u,f)}),H}function Bl(r,i,u,f,y){var w=u._reactRootContainer;if(w){var E=w;if(typeof y=="function"){var $=y;y=function(){var H=$l(E);$.call(H)}}_l(i,E,r,y)}else E=mS(u,i,r,y,f);return $l(E)}rm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var u=fi(i.pendingLanes);u!==0&&(mu(i,u|1),Nn(i,At()),(Qe&6)===0&&(Co=At()+500,us()))}break;case 13:Us(function(){var f=Wr(r,1);if(f!==null){var y=yn();ur(f,r,1,y)}}),Hd(r,1)}},gu=function(r){if(r.tag===13){var i=Wr(r,134217728);if(i!==null){var u=yn();ur(i,r,134217728,u)}Hd(r,134217728)}},sm=function(r){if(r.tag===13){var i=gs(r),u=Wr(r,i);if(u!==null){var f=yn();ur(u,r,i,f)}Hd(r,i)}},om=function(){return rt},im=function(r,i){var u=rt;try{return rt=r,i()}finally{rt=u}},ln=function(r,i,u){switch(i){case"input":if(qe(r,u),i=u.name,u.type==="radio"&&i!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==r&&f.form===r.form){var y=sl(f);if(!y)throw Error(n(90));Xe(f),qe(f,y)}}}break;case"textarea":en(r,u);break;case"select":i=u.value,i!=null&&Nt(r,!!u.multiple,i,!1)}},nn=Md,cn=Us;var gS={usingClientEntryPoint:!1,Events:[Ri,po,sl,Rt,Kt,Md]},Wi={findFiberByHostInstance:Is,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xS={bundleType:Wi.bundleType,version:Wi.version,rendererPackageName:Wi.rendererPackageName,rendererConfig:Wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Yh(r),r===null?null:r.stateNode},findFiberByHostInstance:Wi.findFiberByHostInstance||hS,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 Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{Fa=Ul.inject(xS),vr=Ul}catch{}}return Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gS,Cn.createPortal=function(r,i){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vd(i))throw Error(n(200));return pS(r,i,null,u)},Cn.createRoot=function(r,i){if(!Vd(r))throw Error(n(299));var u=!1,f="",y=jx;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=Ud(r,1,!1,null,null,u,!1,f,y),r[zr]=i.current,Ei(r.nodeType===8?r.parentNode:r),new Wd(i)},Cn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Yh(i),r=r===null?null:r.stateNode,r},Cn.flushSync=function(r){return Us(r)},Cn.hydrate=function(r,i,u){if(!zl(i))throw Error(n(200));return Bl(null,r,i,!0,u)},Cn.hydrateRoot=function(r,i,u){if(!Vd(r))throw Error(n(405));var f=u!=null&&u.hydratedSources||null,y=!1,w="",E=jx;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),i=bx(i,null,r,1,u??null,y,!1,w,E),r[zr]=i.current,Ei(r),f)for(r=0;r<f.length;r++)u=f[r],y=u._getVersion,y=y(u._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[u,y]:i.mutableSourceEagerHydrationData.push(u,y);return new Fl(i)},Cn.render=function(r,i,u){if(!zl(i))throw Error(n(200));return Bl(null,r,i,!1,u)},Cn.unmountComponentAtNode=function(r){if(!zl(r))throw Error(n(40));return r._reactRootContainer?(Us(function(){Bl(null,null,r,!1,function(){r._reactRootContainer=null,r[zr]=null})}),!0):!1},Cn.unstable_batchedUpdates=Md,Cn.unstable_renderSubtreeIntoContainer=function(r,i,u,f){if(!zl(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Bl(r,i,u,!1,f)},Cn.version="18.3.1-next-f1338f8080-20240426",Cn}var Ax;function Gv(){if(Ax)return Gd.exports;Ax=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(),Gd.exports=NS(),Gd.exports}var Dx;function CS(){if(Dx)return Hl;Dx=1;var e=Gv();return Hl.createRoot=e.createRoot,Hl.hydrateRoot=e.hydrateRoot,Hl}var ES=CS();/**
|
|
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 Lx="popstate";function Ix(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function PS(e={}){function t(s,a){var m;let l=(m=a.state)==null?void 0:m.masked,{pathname:c,search:d,hash:p}=l||s.location;return Uf("",{pathname:c,search:d,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,a){return typeof a=="string"?a:xa(a)}return RS(t,n,null,e)}function kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TS(){return Math.random().toString(36).substring(2,10)}function Ox(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 Uf(e,t,n=null,s,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Yo(t):t,state:n,key:t&&t.key||s||TS(),unstable_mask:a}}function xa({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 Yo(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 RS(e,t,n,s={}){let{window:a=document.defaultView,v5Compat:l=!1}=s,c=a.history,d="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(){d="POP";let j=h(),S=j==null?null:j-m;m=j,p&&p({action:d,location:k.location,delta:S})}function v(j,S){d="PUSH";let T=Ix(j)?j:Uf(k.location,j,S);m=h()+1;let N=Ox(T,m),A=k.createHref(T.unstable_mask||T);try{c.pushState(N,"",A)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;a.location.assign(A)}l&&p&&p({action:d,location:k.location,delta:1})}function b(j,S){d="REPLACE";let T=Ix(j)?j:Uf(k.location,j,S);m=h();let N=Ox(T,m),A=k.createHref(T.unstable_mask||T);c.replaceState(N,"",A),l&&p&&p({action:d,location:k.location,delta:0})}function C(j){return AS(j)}let k={get action(){return d},get location(){return e(a,c)},listen(j){if(p)throw new Error("A history only accepts one active listener");return a.addEventListener(Lx,x),p=j,()=>{a.removeEventListener(Lx,x),p=null}},createHref(j){return t(a,j)},createURL:C,encodeLocation(j){let S=C(j);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:b,go(j){return c.go(j)}};return k}function AS(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),kt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:xa(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Yv(e,t,n="/"){return DS(e,t,n,!1)}function DS(e,t,n,s){let a=typeof t=="string"?Yo(t):t,l=Xr(a.pathname||"/",n);if(l==null)return null;let c=Xv(e);LS(c);let d=null;for(let p=0;d==null&&p<c.length;++p){let m=WS(l);d=US(c[p],m,s)}return d}function Xv(e,t=[],n=[],s="",a=!1){let l=(c,d,p=a,m)=>{let h={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(s)&&p)return;kt(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=Pr([s,h.relativePath]),v=n.concat(h);c.children&&c.children.length>0&&(kt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Xv(c.children,t,v,x,p)),!(c.path==null&&!c.index)&&t.push({path:x,score:zS(x,c.index),routesMeta:v})};return e.forEach((c,d)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,d);else for(let m of Qv(c.path))l(c,d,!0,m)}),t}function Qv(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return a?[l,""]:[l];let c=Qv(s.join("/")),d=[];return d.push(...c.map(p=>p===""?l:[l,p].join("/"))),a&&d.push(...c),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function LS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:BS(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var IS=/^:[\w-]+$/,OS=3,MS=2,_S=1,$S=10,FS=-2,Mx=e=>e==="*";function zS(e,t){let n=e.split("/"),s=n.length;return n.some(Mx)&&(s+=FS),t&&(s+=MS),n.filter(a=>!Mx(a)).reduce((a,l)=>a+(IS.test(l)?OS:l===""?_S:$S),s)}function BS(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function US(e,t,n=!1){let{routesMeta:s}=e,a={},l="/",c=[];for(let d=0;d<s.length;++d){let p=s[d],m=d===s.length-1,h=l==="/"?t:t.slice(l.length)||"/",x=mc({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),v=p.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=mc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(a,x.params),c.push({params:a,pathname:Pr([l,x.pathname]),pathnameBase:GS(Pr([l,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(l=Pr([l,x.pathnameBase]))}return c}function mc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=HS(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:s.reduce((m,{paramName:h,isOptional:x},v)=>{if(h==="*"){let C=d[v]||"";c=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const b=d[v];return x&&!b?m[h]=void 0:m[h]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function HS(e,t=!1,n=!0){fr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,p,m,h)=>{if(s.push({paramName:d,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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function WS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fr(!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 Xr(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 VS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qS(e,t="/"){let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?Yo(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=_x(n.substring(1),"/"):l=_x(n,t)):l=t,{pathname:l,search:YS(s),hash:XS(a)}}function _x(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Qd(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 KS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jv(e){let t=KS(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Ep(e,t,n,s=!1){let a;typeof e=="string"?a=Yo(e):(a={...e},kt(!a.pathname||!a.pathname.includes("?"),Qd("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),Qd("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),Qd("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let x=t.length-1;if(!s&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),x-=1;a.pathname=v.join("/")}d=x>=0?t[x]:"/"}let p=qS(a,d),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var Pr=e=>e.join("/").replace(/\/\/+/g,"/"),GS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),YS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,XS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,QS=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 JS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ZS(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eb(e,t){let n=e;if(typeof n!="string"||!VS.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,a=!1;if(Zv)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=Xr(c.pathname,t);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{fr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tb=["POST","PUT","PATCH","DELETE"];new Set(tb);var eN=["GET",...tb];new Set(eN);var Xo=g.createContext(null);Xo.displayName="DataRouter";var Lc=g.createContext(null);Lc.displayName="DataRouterState";var tN=g.createContext(!1),nb=g.createContext({isTransitioning:!1});nb.displayName="ViewTransition";var nN=g.createContext(new Map);nN.displayName="Fetchers";var rN=g.createContext(null);rN.displayName="Await";var er=g.createContext(null);er.displayName="Navigation";var Sa=g.createContext(null);Sa.displayName="Location";var gr=g.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var Pp=g.createContext(null);Pp.displayName="RouteError";var rb="REACT_ROUTER_ERROR",sN="REDIRECT",oN="ROUTE_ERROR_RESPONSE";function iN(e){if(e.startsWith(`${rb}:${sN}:{`))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 aN(e){if(e.startsWith(`${rb}:${oN}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new QS(t.status,t.statusText,t.data)}catch{}}function lN(e,{relative:t}={}){kt(Na(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=g.useContext(er),{hash:a,pathname:l,search:c}=Ca(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Pr([n,l])),s.createHref({pathname:d,search:c,hash:a})}function Na(){return g.useContext(Sa)!=null}function vn(){return kt(Na(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Sa).location}var sb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ob(e){g.useContext(er).static||g.useLayoutEffect(e)}function St(){let{isDataRoute:e}=g.useContext(gr);return e?kN():cN()}function cN(){kt(Na(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(Xo),{basename:t,navigator:n}=g.useContext(er),{matches:s}=g.useContext(gr),{pathname:a}=vn(),l=JSON.stringify(Jv(s)),c=g.useRef(!1);return ob(()=>{c.current=!0}),g.useCallback((p,m={})=>{if(fr(c.current,sb),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=Ep(p,JSON.parse(l),a,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Pr([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,a,e])}var uN=g.createContext(null);function dN(e){let t=g.useContext(gr).outlet;return g.useMemo(()=>t&&g.createElement(uN.Provider,{value:e},t),[t,e])}function mt(){let{matches:e}=g.useContext(gr),t=e[e.length-1];return t?t.params:{}}function Ca(e,{relative:t}={}){let{matches:n}=g.useContext(gr),{pathname:s}=vn(),a=JSON.stringify(Jv(n));return g.useMemo(()=>Ep(e,JSON.parse(a),s,t==="path"),[e,a,s,t])}function fN(e,t){return ib(e,t)}function ib(e,t,n){var j;kt(Na(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=g.useContext(er),{matches:a}=g.useContext(gr),l=a[a.length-1],c=l?l.params:{},d=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";lb(d,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=vn(),x;if(t){let S=typeof t=="string"?Yo(t):t;kt(p==="/"||((j=S.pathname)==null?void 0:j.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 "${S.pathname}" was given in the \`location\` prop.`),x=S}else x=h;let v=x.pathname||"/",b=v;if(p!=="/"){let S=p.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=Yv(e,{pathname:b});fr(m||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),fr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=xN(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Pr([p,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?p:Pr([p,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&k?g.createElement(Sa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},k):k}function pN(){let e=jN(),t=JS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:l},"ErrorBoundary")," or"," ",g.createElement("code",{style:l},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:a},n):null,c)}var hN=g.createElement(pN,null),ab=class extends g.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=aN(e.digest);n&&(e=n)}let t=e!==void 0?g.createElement(gr.Provider,{value:this.props.routeContext},g.createElement(Pp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(mN,{error:e},t):t}};ab.contextType=tN;var Jd=new WeakMap;function mN({children:e,error:t}){let{basename:n}=g.useContext(er);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=iN(t.digest);if(s){let a=Jd.get(t);if(a)throw a;let l=eb(s.location,n);if(Zv&&!Jd.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 Jd.set(t,c),c}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function gN({routeContext:e,match:t,children:n}){let s=g.useContext(Xo);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(gr.Provider,{value:e},n)}function xN(e,t=[],n){let s=n==null?void 0:n.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let a=e,l=s==null?void 0:s.errors;if(l!=null){let h=a.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);kt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let c=!1,d=-1;if(n&&s){c=s.renderFallback;for(let h=0;h<a.length;h++){let x=a[h];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(d=h),x.route.id){let{loaderData:v,errors:b}=s,C=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!b||b[x.route.id]===void 0);if(x.route.lazy||C){n.isStatic&&(c=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let p=n==null?void 0:n.onError,m=s&&p?(h,x)=>{var v,b;p(h,{location:s.location,params:((b=(v=s.matches)==null?void 0:v[0])==null?void 0:b.params)??{},unstable_pattern:ZS(s.matches),errorInfo:x})}:void 0;return a.reduceRight((h,x,v)=>{let b,C=!1,k=null,j=null;s&&(b=l&&x.route.id?l[x.route.id]:void 0,k=x.route.errorElement||hN,c&&(d<0&&v===0?(lb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):d===v&&(C=!0,j=x.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),T=()=>{let N;return b?N=k:C?N=j:x.route.Component?N=g.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=h,g.createElement(gN,{match:x,routeContext:{outlet:h,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?g.createElement(ab,{location:s.location,revalidation:s.revalidation,component:k,error:b,children:T(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):T()},null)}function Tp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yN(e){let t=g.useContext(Xo);return kt(t,Tp(e)),t}function vN(e){let t=g.useContext(Lc);return kt(t,Tp(e)),t}function bN(e){let t=g.useContext(gr);return kt(t,Tp(e)),t}function Rp(e){let t=bN(e),n=t.matches[t.matches.length-1];return kt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function wN(){return Rp("useRouteId")}function jN(){var s;let e=g.useContext(Pp),t=vN("useRouteError"),n=Rp("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function kN(){let{router:e}=yN("useNavigate"),t=Rp("useNavigate"),n=g.useRef(!1);return ob(()=>{n.current=!0}),g.useCallback(async(a,l={})=>{fr(n.current,sb),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var $x={};function lb(e,t,n){!t&&!$x[e]&&($x[e]=!0,fr(!1,n))}g.memo(SN);function SN({routes:e,future:t,state:n,isStatic:s,onError:a}){return ib(e,void 0,{state:n,isStatic:s,onError:a})}function NN(e){return dN(e.context)}function Le(e){kt(!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 CN({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){kt(!Na(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=g.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[d,a,l,c]);typeof n=="string"&&(n=Yo(n));let{pathname:m="/",search:h="",hash:x="",state:v=null,key:b="default",unstable_mask:C}=n,k=g.useMemo(()=>{let j=Xr(m,d);return j==null?null:{location:{pathname:j,search:h,hash:x,state:v,key:b,unstable_mask:C},navigationType:s}},[d,m,h,x,v,b,s,C]);return fr(k!=null,`<Router basename="${d}"> 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:g.createElement(er.Provider,{value:p},g.createElement(Sa.Provider,{children:t,value:k}))}function EN({children:e,location:t}){return fN(Hf(e),t)}function Hf(e,t=[]){let n=[];return g.Children.forEach(e,(s,a)=>{if(!g.isValidElement(s))return;let l=[...t,a];if(s.type===g.Fragment){n.push.apply(n,Hf(s.props.children,l));return}kt(s.type===Le,`[${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>`),kt(!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=Hf(s.props.children,l)),n.push(c)}),n}var sc="get",oc="application/x-www-form-urlencoded";function Ic(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PN(e){return Ic(e)&&e.tagName.toLowerCase()==="button"}function TN(e){return Ic(e)&&e.tagName.toLowerCase()==="form"}function RN(e){return Ic(e)&&e.tagName.toLowerCase()==="input"}function AN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function DN(e,t){return e.button===0&&(!t||t==="_self")&&!AN(e)}function Wf(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function LN(e,t){let n=Wf(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var Wl=null;function IN(){if(Wl===null)try{new FormData(document.createElement("form"),0),Wl=!1}catch{Wl=!0}return Wl}var ON=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zd(e){return e!=null&&!ON.has(e)?(fr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oc}"`),null):e}function MN(e,t){let n,s,a,l,c;if(TN(e)){let d=e.getAttribute("action");s=d?Xr(d,t):null,n=e.getAttribute("method")||sc,a=Zd(e.getAttribute("enctype"))||oc,l=new FormData(e)}else if(PN(e)||RN(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(s=p?Xr(p,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||sc,a=Zd(e.getAttribute("formenctype"))||Zd(d.getAttribute("enctype"))||oc,l=new FormData(d,e),!IN()){let{name:m,type:h,value:x}=e;if(h==="image"){let v=m?`${m}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else m&&l.append(m,x)}}else{if(Ic(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sc,s=null,a=oc,c=e}return l&&a==="text/plain"&&(c=l,l=void 0),{action:s,method:n.toLowerCase(),encType:a,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ap(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _N(e,t,n,s){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${s}`:a.pathname=`${a.pathname}.${s}`:a.pathname==="/"?a.pathname=`_root.${s}`:t&&Xr(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${s}`,a}async function $N(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 FN(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 zN(e,t,n){let s=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let c=await $N(l,n);return c.links?c.links():[]}return[]}));return WN(s.flat(1).filter(FN).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Fx(e,t,n,s,a,l){let c=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,d=(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)||d(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)||d(p,m))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function BN(e,t,{includeHydrateFallback:n}={}){return UN(e.map(s=>{let a=t.routes[s.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function UN(e){return[...new Set(e)]}function HN(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function WN(e,t){let n=new Set;return new Set(t),e.reduce((s,a)=>{let l=JSON.stringify(HN(a));return n.has(l)||(n.add(l),s.push({key:l,link:a})),s},[])}function cb(){let e=g.useContext(Xo);return Ap(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function VN(){let e=g.useContext(Lc);return Ap(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Dp=g.createContext(void 0);Dp.displayName="FrameworkContext";function ub(){let e=g.useContext(Dp);return Ap(e,"You must render this element inside a <HydratedRouter> element"),e}function qN(e,t){let n=g.useContext(Dp),[s,a]=g.useState(!1),[l,c]=g.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:x}=t,v=g.useRef(null);g.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let k=S=>{S.forEach(T=>{c(T.isIntersecting)})},j=new IntersectionObserver(k,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),g.useEffect(()=>{if(s){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[s]);let b=()=>{a(!0)},C=()=>{a(!1),c(!1)};return n?e!=="intent"?[l,v,{}]:[l,v,{onFocus:qi(d,b),onBlur:qi(p,C),onMouseEnter:qi(m,b),onMouseLeave:qi(h,C),onTouchStart:qi(x,b)}]:[!1,v,{}]}function qi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function KN({page:e,...t}){let{router:n}=cb(),s=g.useMemo(()=>Yv(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?g.createElement(YN,{page:e,matches:s,...t}):null}function GN(e){let{manifest:t,routeModules:n}=ub(),[s,a]=g.useState([]);return g.useEffect(()=>{let l=!1;return zN(e,t,n).then(c=>{l||a(c)}),()=>{l=!0}},[e,t,n]),s}function YN({page:e,matches:t,...n}){let s=vn(),{future:a,manifest:l,routeModules:c}=ub(),{basename:d}=cb(),{loaderData:p,matches:m}=VN(),h=g.useMemo(()=>Fx(e,t,m,l,s,"data"),[e,t,m,l,s]),x=g.useMemo(()=>Fx(e,t,m,l,s,"assets"),[e,t,m,l,s]),v=g.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let k=new Set,j=!1;if(t.forEach(T=>{var A;let N=l.routes[T.route.id];!N||!N.hasLoader||(!h.some(I=>I.route.id===T.route.id)&&T.route.id in p&&((A=c[T.route.id])!=null&&A.shouldRevalidate)||N.hasClientLoader?j=!0:k.add(T.route.id))}),k.size===0)return[];let S=_N(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return j&&k.size>0&&S.searchParams.set("_routes",t.filter(T=>k.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[d,a.unstable_trailingSlashAwareDataRequests,p,s,l,h,t,e,c]),b=g.useMemo(()=>BN(x,l),[x,l]),C=GN(x);return g.createElement(g.Fragment,null,v.map(k=>g.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),b.map(k=>g.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),C.map(({key:k,link:j})=>g.createElement("link",{key:k,nonce:n.nonce,...j,crossOrigin:j.crossOrigin??n.crossOrigin})))}function XN(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var QN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{QN&&(window.__reactRouterVersion="7.13.1")}catch{}function JN({basename:e,children:t,unstable_useTransitions:n,window:s}){let a=g.useRef();a.current==null&&(a.current=PS({window:s,v5Compat:!0}));let l=a.current,[c,d]=g.useState({action:l.action,location:l.location}),p=g.useCallback(m=>{n===!1?d(m):g.startTransition(()=>d(m))},[n]);return g.useLayoutEffect(()=>l.listen(p),[l,p]),g.createElement(CN,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var db=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=g.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:a,reloadDocument:l,replace:c,unstable_mask:d,state:p,target:m,to:h,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:b,...C},k){let{basename:j,navigator:S,unstable_useTransitions:T}=g.useContext(er),N=typeof h=="string"&&db.test(h),A=eb(h,j);h=A.to;let I=lN(h,{relative:a}),R=vn(),D=null;if(d){let _=Ep(d,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);j!=="/"&&(_.pathname=_.pathname==="/"?j:Pr([j,_.pathname])),D=S.createHref(_)}let[O,G,re]=qN(s,C),z=nC(h,{replace:c,unstable_mask:d,state:p,target:m,preventScrollReset:x,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:T});function K(_){t&&t(_),_.defaultPrevented||z(_)}let q=!(A.isExternal||l),J=g.createElement("a",{...C,...re,href:(q?D:void 0)||A.absoluteURL||I,onClick:q?K:t,ref:XN(k,G),target:m,"data-discover":!N&&n==="render"?"true":void 0});return O&&!N?g.createElement(g.Fragment,null,J,g.createElement(KN,{page:I})):J});ye.displayName="Link";var ZN=g.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:a=!1,style:l,to:c,viewTransition:d,children:p,...m},h){let x=Ca(c,{relative:m.relative}),v=vn(),b=g.useContext(Lc),{navigator:C,basename:k}=g.useContext(er),j=b!=null&&aC(x)&&d===!0,S=C.encodeLocation?C.encodeLocation(x).pathname:x.pathname,T=v.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&k&&(N=Xr(N,k)||N);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let I=T===S||!a&&T.startsWith(S)&&T.charAt(A)==="/",R=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),D={isActive:I,isPending:R,isTransitioning:j},O=I?t:void 0,G;typeof s=="function"?G=s(D):G=[s,I?"active":null,R?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let re=typeof l=="function"?l(D):l;return g.createElement(ye,{...m,"aria-current":O,className:G,ref:h,style:re,to:c,viewTransition:d},typeof p=="function"?p(D):p)});ZN.displayName="NavLink";var eC=g.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:a,state:l,method:c=sc,action:d,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:v,...b},C)=>{let{unstable_useTransitions:k}=g.useContext(er),j=oC(),S=iC(d,{relative:m}),T=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&db.test(d),A=I=>{if(p&&p(I),I.defaultPrevented)return;I.preventDefault();let R=I.nativeEvent.submitter,D=(R==null?void 0:R.getAttribute("formmethod"))||c,O=()=>j(R||I.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:l,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:v});k&&n!==!1?g.startTransition(()=>O()):O()};return g.createElement("form",{ref:C,method:T,action:S,onSubmit:s?p:A,...b,"data-discover":!N&&e==="render"?"true":void 0})});eC.displayName="Form";function tC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fb(e){let t=g.useContext(Xo);return kt(t,tC(e)),t}function nC(e,{target:t,replace:n,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=St(),x=vn(),v=Ca(e,{relative:c});return g.useCallback(b=>{if(DN(b,t)){b.preventDefault();let C=n!==void 0?n:xa(x)===xa(v),k=()=>h(e,{replace:C,unstable_mask:s,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p});m?g.startTransition(()=>k()):k()}},[x,h,v,n,s,a,t,e,l,c,d,p,m])}function Ir(e){fr(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=g.useRef(Wf(e)),n=g.useRef(!1),s=vn(),a=g.useMemo(()=>LN(s.search,n.current?null:t.current),[s.search]),l=St(),c=g.useCallback((d,p)=>{const m=Wf(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+m,p)},[l,a]);return[a,c]}var rC=0,sC=()=>`__${String(++rC)}__`;function oC(){let{router:e}=fb("useSubmit"),{basename:t}=g.useContext(er),n=wN(),s=e.fetch,a=e.navigate;return g.useCallback(async(l,c={})=>{let{action:d,method:p,encType:m,formData:h,body:x}=MN(l,t);if(c.navigate===!1){let v=c.fetcherKey||sC();await s(v,n,c.action||d,{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 a(c.action||d,{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,a,t,n])}function iC(e,{relative:t}={}){let{basename:n}=g.useContext(er),s=g.useContext(gr);kt(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),l={...Ca(e||".",{relative:t})},c=vn();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),p=d.getAll("index");if(p.some(h=>h==="")){d.delete("index"),p.filter(x=>x).forEach(x=>d.append("index",x));let h=d.toString();l.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Pr([n,l.pathname])),xa(l)}function aC(e,{relative:t}={}){let n=g.useContext(nb);kt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=fb("useViewTransitionState"),a=Ca(e,{relative:t});if(!n.isTransitioning)return!1;let l=Xr(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=Xr(n.nextLocation.pathname,s)||n.nextLocation.pathname;return mc(a.pathname,c)!=null||mc(a.pathname,l)!=null}var Cs=Gv();const lC=Dc(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 cC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pb=(...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 uC={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 dC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...d},p)=>g.createElement("svg",{ref:p,...uC,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:pb("lucide",a),...d},[...c.map(([m,h])=>g.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 Se=(e,t)=>{const n=g.forwardRef(({className:s,...a},l)=>g.createElement(dC,{ref:l,iconNode:t,className:pb(`lucide-${cC(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
|
|
72
|
+
* @license lucide-react v0.460.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Oc=Se("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 hb=Se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
82
|
+
* @license lucide-react v0.460.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const mb=Se("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
|
87
|
+
* @license lucide-react v0.460.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const fC=Se("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
92
|
+
* @license lucide-react v0.460.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const gc=Se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
97
|
+
* @license lucide-react v0.460.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const pC=Se("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
|
|
102
|
+
* @license lucide-react v0.460.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const gb=Se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
107
|
+
* @license lucide-react v0.460.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const hC=Se("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"}]]);/**
|
|
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 Ea=Se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 ya=Se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 mC=Se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 xb=Se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 Vf=Se("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"}]]);/**
|
|
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 Lp=Se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 qf=Se("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
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 gC=Se("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
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 xC=Se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 yC=Se("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
|
|
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 vC=Se("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
|
167
|
+
* @license lucide-react v0.460.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const bC=Se("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 wC=Se("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"}]]);/**
|
|
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 Mc=Se("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"}]]);/**
|
|
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 jC=Se("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"}]]);/**
|
|
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 kC=Se("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"}]]);/**
|
|
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 Ip=Se("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"}]]);/**
|
|
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 zx=Se("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"}]]);/**
|
|
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 SC=Se("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"}]]);/**
|
|
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 NC=Se("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"}]]);/**
|
|
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 yb=Se("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"}]]);/**
|
|
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 CC=Se("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
|
|
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 Op=Se("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
|
|
227
|
+
* @license lucide-react v0.460.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const EC=Se("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 Mp=Se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
237
|
+
* @license lucide-react v0.460.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const vb=Se("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"}]]);/**
|
|
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 PC=Se("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"}]]);/**
|
|
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 TC=Se("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
|
|
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 bb=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
257
|
+
* @license lucide-react v0.460.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Kf=Se("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
262
|
+
* @license lucide-react v0.460.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const RC=Se("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
267
|
+
* @license lucide-react v0.460.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const AC=Se("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
|
|
272
|
+
* @license lucide-react v0.460.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const DC=Se("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
277
|
+
* @license lucide-react v0.460.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const LC=Se("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
282
|
+
* @license lucide-react v0.460.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const wb=Se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
287
|
+
* @license lucide-react v0.460.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const IC=Se("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
292
|
+
* @license lucide-react v0.460.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const _p=Se("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
297
|
+
* @license lucide-react v0.460.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const OC=Se("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/**
|
|
302
|
+
* @license lucide-react v0.460.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const ef=Se("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
|
|
307
|
+
* @license lucide-react v0.460.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const MC=Se("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
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 $p=Se("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"}]]);/**
|
|
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 Wt=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
322
|
+
* @license lucide-react v0.460.0 - ISC
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the ISC license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const jb=Se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
327
|
+
* @license lucide-react v0.460.0 - ISC
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the ISC license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const _C=Se("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
|
|
332
|
+
* @license lucide-react v0.460.0 - ISC
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the ISC license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const Gf=Se("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
337
|
+
* @license lucide-react v0.460.0 - ISC
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the ISC license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const Fp=Se("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
342
|
+
* @license lucide-react v0.460.0 - ISC
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the ISC license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const $C=Se("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
347
|
+
* @license lucide-react v0.460.0 - ISC
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the ISC license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/const Rs=Se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
352
|
+
* @license lucide-react v0.460.0 - ISC
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the ISC license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/const FC=Se("SendToBack",[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1",key:"pao6x6"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1",key:"19tdru"}]]);/**
|
|
357
|
+
* @license lucide-react v0.460.0 - ISC
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the ISC license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/const zC=Se("ServerOff",[["path",{d:"M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5",key:"bt2siv"}],["path",{d:"M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z",key:"1hjrv1"}],["path",{d:"M22 17v-1a2 2 0 0 0-2-2h-1",key:"1iynyr"}],["path",{d:"M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z",key:"161ggg"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
362
|
+
* @license lucide-react v0.460.0 - ISC
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the ISC license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/const BC=Se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
367
|
+
* @license lucide-react v0.460.0 - ISC
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the ISC license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/const UC=Se("ShieldX",[["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:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
|
|
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 Un=Se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
377
|
+
* @license lucide-react v0.460.0 - ISC
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the ISC license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/const Bx=Se("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
382
|
+
* @license lucide-react v0.460.0 - ISC
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the ISC license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/const kb=Se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
387
|
+
* @license lucide-react v0.460.0 - ISC
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the ISC license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/const HC=Se("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
|
|
392
|
+
* @license lucide-react v0.460.0 - ISC
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the ISC license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/const Sb=Se("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
397
|
+
* @license lucide-react v0.460.0 - ISC
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the ISC license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/const WC=Se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
402
|
+
* @license lucide-react v0.460.0 - ISC
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the ISC license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/const Or=Se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
407
|
+
* @license lucide-react v0.460.0 - ISC
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the ISC license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/const Qo=Se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
412
|
+
* @license lucide-react v0.460.0 - ISC
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the ISC license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const VC=Se("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"}]]);/**
|
|
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 zp=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Nb(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Nb(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function qC(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Nb(e))&&(s&&(s+=" "),s+=t);return s}const Bp="-",KC=e=>{const t=YC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const d=c.split(Bp);return d[0]===""&&d.length!==1&&d.shift(),Cb(d,t)||GC(c)},getConflictingClassGroupIds:(c,d)=>{const p=n[c]||[];return d&&s[c]?[...p,...s[c]]:p}}},Cb=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?Cb(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Bp);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},Ux=/^\[(.+)\]$/,GC=e=>{if(Ux.test(e)){const t=Ux.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},YC=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return QC(Object.entries(e.classGroups),n).forEach(([l,c])=>{Yf(c,s,l,t)}),s},Yf=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:Hx(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(XC(a)){Yf(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Yf(c,Hx(t,l),n,s)})})},Hx=(e,t)=>{let n=e;return t.split(Bp).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},XC=e=>e.isThemeGetter,QC=(e,t)=>t?e.map(([n,s])=>{const a=s.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,a]}):e,JC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,s=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=s.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},Eb="!",ZC=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],l=t.length,c=d=>{const p=[];let m=0,h=0,x;for(let j=0;j<d.length;j++){let S=d[j];if(m===0){if(S===a&&(s||d.slice(j,j+l)===t)){p.push(d.slice(h,j)),h=j+l;continue}if(S==="/"){x=j;continue}}S==="["?m++:S==="]"&&m--}const v=p.length===0?d:d.substring(h),b=v.startsWith(Eb),C=b?v.substring(1):v,k=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:k}};return n?d=>n({className:d,parseClassName:c}):c},e2=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},t2=e=>({cache:JC(e.cacheSize),parseClassName:ZC(e),...KC(e)}),n2=/\s+/,r2=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(n2);let d="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}=n(m);let C=!!b,k=s(C?v.substring(0,b):v);if(!k){if(!C){d=m+(d.length>0?" "+d:d);continue}if(k=s(v),!k){d=m+(d.length>0?" "+d:d);continue}C=!1}const j=e2(h).join(":"),S=x?j+Eb:j,T=S+k;if(l.includes(T))continue;l.push(T);const N=a(k,C);for(let A=0;A<N.length;++A){const I=N[A];l.push(S+I)}d=m+(d.length>0?" "+d:d)}return d};function s2(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Pb(t))&&(s&&(s+=" "),s+=n);return s}const Pb=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Pb(e[s]))&&(n&&(n+=" "),n+=t);return n};function o2(e,...t){let n,s,a,l=c;function c(p){const m=t.reduce((h,x)=>x(h),e());return n=t2(m),s=n.cache.get,a=n.cache.set,l=d,d(p)}function d(p){const m=s(p);if(m)return m;const h=r2(p,n);return a(p,h),h}return function(){return l(s2.apply(null,arguments))}}const pt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Tb=/^\[(?:([a-z-]+):)?(.+)\]$/i,i2=/^\d+\/\d+$/,a2=new Set(["px","full","screen"]),l2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,c2=/\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$/,u2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,d2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,f2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gr=e=>Mo(e)||a2.has(e)||i2.test(e),bs=e=>Jo(e,"length",b2),Mo=e=>!!e&&!Number.isNaN(Number(e)),tf=e=>Jo(e,"number",Mo),Ki=e=>!!e&&Number.isInteger(Number(e)),p2=e=>e.endsWith("%")&&Mo(e.slice(0,-1)),He=e=>Tb.test(e),ws=e=>l2.test(e),h2=new Set(["length","size","percentage"]),m2=e=>Jo(e,h2,Rb),g2=e=>Jo(e,"position",Rb),x2=new Set(["image","url"]),y2=e=>Jo(e,x2,j2),v2=e=>Jo(e,"",w2),Gi=()=>!0,Jo=(e,t,n)=>{const s=Tb.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},b2=e=>c2.test(e)&&!u2.test(e),Rb=()=>!1,w2=e=>d2.test(e),j2=e=>f2.test(e),k2=()=>{const e=pt("colors"),t=pt("spacing"),n=pt("blur"),s=pt("brightness"),a=pt("borderColor"),l=pt("borderRadius"),c=pt("borderSpacing"),d=pt("borderWidth"),p=pt("contrast"),m=pt("grayscale"),h=pt("hueRotate"),x=pt("invert"),v=pt("gap"),b=pt("gradientColorStops"),C=pt("gradientColorStopPositions"),k=pt("inset"),j=pt("margin"),S=pt("opacity"),T=pt("padding"),N=pt("saturate"),A=pt("scale"),I=pt("sepia"),R=pt("skew"),D=pt("space"),O=pt("translate"),G=()=>["auto","contain","none"],re=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",He,t],K=()=>[He,t],q=()=>["",Gr,bs],J=()=>["auto",Mo,He],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",He],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Mo,He];return{cacheSize:500,separator:":",theme:{colors:[Gi],spacing:[Gr,bs],blur:["none","",ws,He],brightness:M(),borderColor:[e],borderRadius:["none","","full",ws,He],borderSpacing:K(),borderWidth:q(),contrast:M(),grayscale:Z(),hueRotate:M(),invert:Z(),gap:K(),gradientColorStops:[e],gradientColorStopPositions:[p2,bs],inset:z(),margin:z(),opacity:M(),padding:K(),saturate:M(),scale:M(),sepia:Z(),skew:M(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[ws]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:[..._(),He]}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],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",Ki,He]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",Ki,He]}],"grid-cols":[{"grid-cols":[Gi]}],"col-start-end":[{col:["auto",{span:["full",Ki,He]},He]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Gi]}],"row-start-end":[{row:["auto",{span:[Ki,He]},He]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[ws]},ws]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ws,bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tf]}],"font-family":[{font:[Gi]}],"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",He]}],"line-clamp":[{"line-clamp":["none",Mo,tf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gr,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gr,bs]}],"underline-offset":[{"underline-offset":["auto",Gr,He]}],"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:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],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",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),g2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",m2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},y2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"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:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:F()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[Gr,He]}],"outline-w":[{outline:[Gr,bs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Gr,bs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ws,v2]}],"shadow-color":[{shadow:[Gi]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",ws,He]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[I]}],"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":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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",He]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Ki,He]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],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",He]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"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",He]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Gr,bs,tf]}],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"]}}},S2=o2(k2);function Be(...e){return S2(qC(e))}function Ar(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 Rn(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 N2(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function C2(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 E2(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Qt(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ab(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function P2(e){let t=Ab(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/attention")?"/attention":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function Db(e,t){return P2(e)===t}function Lb(e){let n=Ab(e).split("/").filter(Boolean);const s=[];let a="Overview",l=null,c="";if(n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,s.push({label:Qt(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0)return{title:a,breadcrumbs:s,projectSlug:l};if(n[0]==="projects"){if(s.push({label:"Projects",path:`${c}/projects`}),a="Projects",n[1]&&(l=n[1],s.push({label:Qt(n[1]),path:`${c}/projects/${n[1]}`}),a=Qt(n[1])),n[2]==="edit")a="Edit Project";else if(n[2]==="create"&&n[3]==="assignment")a="Create Assignment";else if(n[2]==="assignments"&&n[3])s.push({label:Qt(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),a=Qt(n[3]),n[4]==="edit"?a="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?a="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?a="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?a="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(a="Append Decision");else if((n[2]==="memories"||n[2]==="resources")&&n[3]){const d=n[2]==="memories"?"Memories":"Resources",p=n[2]==="memories"?"/memories":"/resources";s.push({label:d,path:p}),s.push({label:Qt(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),a=Qt(n[3]),n[4]==="edit"&&(a=n[2]==="memories"?"Edit Memory":"Edit Resource")}}else n[0]==="servers"?(a="Servers",s.push({label:"Servers",path:`${c}/servers`})):n[0]==="agent-sessions"?(a="Agent Sessions",s.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="attention"?(a="Attention",s.push({label:"Attention",path:"/attention"})):n[0]==="assignments"?(a="Assignments",s.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),a="Playbooks",n[1]==="create"?a="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:Qt(n[1]),path:`/playbooks/${n[1]}`}),a="Edit Playbook"):n[1]&&(s.push({label:Qt(n[1]),path:`/playbooks/${n[1]}`}),a=Qt(n[1]))):n[0]==="memories"?(s.push({label:"Memories",path:"/memories"}),a="Memories",n[1]==="new"&&(a="New Memory")):n[0]==="resources"?(s.push({label:"Resources",path:"/resources"}),a="Resources",n[1]==="new"&&(a="New Resource")):n[0]==="todos"?(a="Todos",s.push({label:"Todos",path:`${c}/todos`})):n[0]==="help"?(a="Help",s.push({label:"Help",path:"/help"})):n[0]==="settings"?(a="Settings",s.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(a="Create Project",s.push({label:"Create Project",path:`${c}/create/project`}));return{title:a,breadcrumbs:s,projectSlug:l}}function Wx({items:e,onNavigate:t}){const n=vn();return o.jsx("nav",{className:"space-y-1",children:e.map(s=>{const a=s.icon,l=Db(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return o.jsxs(ye,{to:s.to,onClick:t,className:Be("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:[o.jsx(a,{className:"h-4 w-4"}),o.jsx("span",{children:s.label})]},s.to)})})}const Ib=[{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)"}}],T2=Ib.map(e=>e.slug),xc="default";function Ob(e){return typeof e=="string"&&T2.includes(e)}const Mb={preset:xc,custom:!1};let na=null,Po=null;function Up(e){if(!e||typeof e!="object")return Mb;const t=e;return{preset:Ob(t.preset)?t.preset:xc,custom:t.custom===!0}}function R2(){return na?Promise.resolve(na):Po||(Po=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Up(e);return na=t,Po=null,t}).catch(()=>(Po=null,Mb)),Po)}async function A2(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=Up(await t.json());return na=n,n}async function D2(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Up(await e.json());return na=t,t}const Xf="syntaur-theme",ic="syntaur-preset",_b=g.createContext(null);function Qf(){try{const e=window.localStorage.getItem(Xf);return e==="light"||e==="dark"?e:null}catch{return null}}function $b(){try{const e=window.localStorage.getItem(ic);return Ob(e)?e:xc}catch{return xc}}function Fb(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function zb(e){document.documentElement.classList.toggle("dark",e==="dark")}function Bb(e){document.documentElement.dataset.theme=e}function L2(){typeof document>"u"||(zb(Qf()??Fb()),Bb($b()))}function I2({children:e}){const[t,n]=g.useState(()=>Qf()),[s,a]=g.useState(()=>Qf()??Fb()),[l,c]=g.useState(()=>$b());g.useEffect(()=>{zb(s)},[s]),g.useEffect(()=>{Bb(l)},[l]),g.useEffect(()=>{let h=!1;return R2().then(x=>{if(!h&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(ic,x.preset)}catch{}}}),()=>{h=!0}},[]),g.useEffect(()=>{if(!window.matchMedia)return;const h=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||a(h.matches?"dark":"light")};return x(),h.addEventListener("change",x),()=>{h.removeEventListener("change",x)}},[t]);async function d(h){c(h);try{window.localStorage.setItem(ic,h)}catch{}await A2(h)}async function p(){const h=await D2();c(h.preset);try{window.localStorage.setItem(ic,h.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(Xf,h),n(h),a(h)},toggleTheme:()=>{const h=s==="dark"?"light":"dark";window.localStorage.setItem(Xf,h),n(h),a(h)},preset:l,setPreset:d,resetPreset:p};return o.jsx(_b.Provider,{value:m,children:e})}function Hp(){const e=g.useContext(_b);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const ac=new Set;let Pn=null,_o=null;function O2(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ub(){Pn&&(Pn.readyState===WebSocket.OPEN||Pn.readyState===WebSocket.CONNECTING)||(Pn=new WebSocket(O2()),Pn.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of ac)n(t)}catch{}},Pn.onclose=()=>{Pn=null,_o&&clearTimeout(_o),_o=setTimeout(Ub,2e3)},Pn.onerror=()=>{Pn==null||Pn.close()})}function _c(e){const t=g.useRef(e);t.current=e,g.useEffect(()=>{const n=s=>t.current(s);return ac.add(n),Ub(),()=>{ac.delete(n),ac.size===0&&Pn&&(_o&&clearTimeout(_o),_o=null,Pn.close(),Pn=null)}},[])}function Vt(e,t){const[n,s]=g.useState(null),[a,l]=g.useState(!0),[c,d]=g.useState(null),[p,m]=g.useState(0),h=g.useCallback(()=>{m(x=>x+1)},[]);return g.useEffect(()=>{if(!e){l(!1),s(null);return}let x=!1;return l(!0),d(null),fetch(e).then(async v=>{if(!v.ok){const b=await v.json().catch(()=>null);throw new Error((b==null?void 0:b.error)||`HTTP ${v.status}`)}return v.json()}).then(v=>{x||(s(v),l(!1))}).catch(v=>{x||(d(v.message),l(!1))}),()=>{x=!0}},[e,p]),_c(x=>{t&&((x.type==="project-updated"||x.type==="assignment-updated")&&h(),x.type==="servers-updated"&&t==="servers"&&h(),x.type==="agent-sessions-updated"&&t==="agent-sessions"&&h(),x.type==="playbooks-updated"&&t==="playbooks"&&h())}),{data:n,loading:a,error:c,refetch:h}}function Zo(){return Vt("/api/projects","projects")}function Wp(){return Vt("/api/workspaces","projects")}function _t(){const{workspace:e}=mt();return e?`/w/${e}`:""}function M2(){return Vt("/api/overview","overview")}function Hb(){return Vt("/api/assignments","assignments")}function _2(){return Vt("/api/attention","attention")}function Wb(){return Vt("/api/help")}function Vb(e){const t=e?`/api/projects/${e}`:null;return Vt(t,"project")}function $2(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return Vt(n,"assignment")}function F2(e){const t=e?`/api/assignments/${e}`:null;return Vt(t,"assignment")}function qb(e){return Vt(e)}function Vp(){return Vt("/api/servers","servers")}function z2(){return Vt("/api/agent-sessions","agent-sessions")}function B2(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return Vt(n,"agent-sessions")}function Kb(){return Vt("/api/playbooks","playbooks")}function U2(e){const t=e?`/api/playbooks/${e}`:null;return Vt(t,"playbooks")}function H2(){return Vt("/api/memories","project")}function W2(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return Vt(n,"project")}function V2(){return Vt("/api/resources","project")}function q2(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return Vt(n,"project")}const $c=["new-workspace","new-project","new-todo","new-assignment"];function K2(e){return typeof e=="string"&&$c.includes(e)}const G2=["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","[","]"],Y2=["mod","ctrl","alt","shift"];function Tn(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(Tn).filter(d=>d.length>0).join(" ");const n=t.split("+").map(d=>d.trim()).filter(d=>d.length>0);if(n.length===0)return"";if(n.length===1)return n[0].toLowerCase();const s=n[n.length-1].toLowerCase(),a=n.slice(0,-1).map(d=>d.toLowerCase()),l=new Set,c=[];for(const d of Y2)a.includes(d)&&!l.has(d)&&(c.push(d),l.add(d));for(const d of a)l.has(d)||(c.push(d),l.add(d));return[...c,s].join("+")}function X2(e){const t=Tn(e);return t?G2.includes(t):!1}const Q2={"new-workspace":Tn("Mod+Shift+Alt+w"),"new-project":Tn("Mod+Shift+Alt+p"),"new-todo":Tn("Mod+Shift+Alt+t"),"new-assignment":Tn("Mod+Shift+Alt+a")};function J2(e){const t={...Q2};for(const n of $c){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function Ys(){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 Z2(e){const t=e.split("+").map(a=>a.trim()),n=t[t.length-1]??"",s=new Set(t.slice(0,-1).map(a=>a.toLowerCase()));return{key:n.toLowerCase(),mod:s.has("mod"),shift:s.has("shift"),alt:s.has("alt"),ctrl:s.has("ctrl")}}function Vl(e,t){const n=Z2(t);if(e.key.toLowerCase()!==n.key)return!1;const a=Ys()?e.metaKey:e.ctrlKey;return!(n.mod&&!a||!n.mod&&!n.ctrl&&a||n.ctrl&&!e.ctrlKey||n.shift&&!e.shiftKey||!n.shift&&!(n.key.length===1&&!/^[a-z0-9]$/.test(n.key))&&e.shiftKey||n.alt&&!e.altKey||!n.alt&&e.altKey)}function Gb(e){const t=[],n=Ys()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const s=e.key;let a;s===" "||s==="Spacebar"?a="space":(s.length,a=s.toLowerCase());const l=a.length===1&&/^[a-z0-9]$/.test(a);e.shiftKey&&l&&t.push("shift");const c=[...t,a].join("+");return Tn(c)}function Tr(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?Ys()?"⌘":"Ctrl":s==="shift"?Ys()?"⇧":"Shift":s==="alt"?Ys()?"⌥":"Alt":s==="ctrl"?Ys()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(Ys()?"":"+")}function eE(e){const[t,n]=g.useState(null),[s,a]=g.useState(!0),[l,c]=g.useState(null),d=g.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{a(!1)}},[e]);return g.useEffect(()=>{d()},[d]),_c(p=>{p.type==="todos-updated"&&!p.projectSlug&&d()}),{data:t,loading:s,error:l,refetch:d}}function qp(){const[e,t]=g.useState(null),[n,s]=g.useState(!0),[a,l]=g.useState(null),c=g.useCallback(async()=>{try{const d=await fetch("/api/todos");if(!d.ok)throw new Error(`HTTP ${d.status}`);t(await d.json()),l(null)}catch(d){l(d instanceof Error?d.message:"Failed to fetch todos")}finally{s(!1)}},[]);return g.useEffect(()=>{c()},[c]),_c(d=>{d.type==="todos-updated"&&!d.projectSlug&&c()}),{data:e,loading:n,error:a,refetch:c}}async function Kp(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 Yb(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 Xb(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 Qb(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 Jb(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function tE(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function Zb(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function ew(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function nE(e,t){await ew(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function rE(e,t,n){await ew(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const sE=new Set(["/projects","/assignments","/servers","/todos"]);function lc(e,t){return sE.has(e)?`${t}${e}`:e}const oE=[{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-attention",title:"Attention",basePath:"/attention",keywords:["alerts"]},{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 iE(e){const t=[];for(const n of oE)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:lc(n.basePath,e.wsPrefix)});for(const n of e.projects??[]){const s=n.workspace?`/w/${n.workspace}`:"";t.push({type:"project",id:`project-${n.slug}`,title:n.title,subtitle:n.slug,keywords:n.tags,route:`${s}/projects/${n.slug}`}),t.push({type:"todo",id:`project-todos-${n.slug}`,title:`${n.title} todos`,subtitle:`${n.slug} · project`,keywords:[...n.tags??[],"project","todos"],route:`${s}/projects/${n.slug}?tab=todos`})}for(const n of e.assignments??[]){const s=n.projectWorkspace?`/w/${n.projectWorkspace}`:"";t.push({type:"assignment",id:n.projectSlug===null?`assignment-standalone-${n.id}`:`assignment-${n.projectSlug}-${n.slug}`,title:n.title,subtitle:`${n.projectTitle} · ${n.status}`,keywords:[n.projectSlug??"standalone",n.assignee??""].filter(a=>!!a),route:n.projectSlug===null?`/assignments/${n.id}`:`${s}/projects/${n.projectSlug}/assignments/${n.slug}`})}for(const n of e.playbooks??[])t.push({type:"playbook",id:`playbook-${n.slug}`,title:n.name,subtitle:n.description,keywords:n.tags,route:`/playbooks/${n.slug}`});for(const n of e.servers??[])t.push({type:"server",id:`server-${n.name}`,title:n.name,subtitle:n.alive?"alive":"dead",route:`${lc("/servers",e.wsPrefix)}#server-${encodeURIComponent(n.name)}`});for(const n of e.todos??[]){const s=n.workspace&&n.workspace!=="_ungrouped"?`/w/${n.workspace}`:e.wsPrefix,a=lc("/todos",s);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${a}?focus=${encodeURIComponent(n.id)}`})}return t}function dr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function nf(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function aE(e,t,n){const s=t?"disable":"enable",a=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${s}`,{method:"POST"});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to ${s} playbook`)}n()}async function rf(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 Vx(){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 qx(){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 sf(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 qs(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
|
|
422
|
+
${t}: ${JSON.stringify(n)}
|
|
423
|
+
---
|
|
424
|
+
${e}`;const a=s[1],l=s[2],c=s[3],d=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}
|
|
425
|
+
${t}: ${p}`,`${a}${h}${c}${d}`}const lE=/^[a-z0-9][a-z0-9-]*$/;function cE(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:a,wsPrefix:l,refetchPlaybooks:c,navigate:d,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:lE,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(h,x)=>{const v=(h.name??"").trim();if(!v)throw new Error("Name is required");const b=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v})});if(!b.ok){const C=await b.json().catch(()=>({}));throw new Error(C.error||`Failed to create workspace (HTTP ${b.status})`)}x.navigate(`/w/${v}/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 Vx(),v=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const b of h)v.push({value:b,label:b,hint:"workspace"});return v}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(h,x)=>{const v=(h.workspace??"").trim(),b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=dr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");let k=await sf("/api/templates/project");k=qs(k,"slug",C),k=qs(k,"title",b),v&&v!=="_ungrouped"&&(k=qs(k,"workspace",v));const j=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.error||`Failed to create project (HTTP ${j.status})`);const T=v&&v!=="_ungrouped"?`/w/${v}/projects/${S.slug??C}`:`/projects/${S.slug??C}`;x.navigate(T)}}}),m.push({id:"new-todo",title:"New Todo",subtitle:"Pick scope (global / workspace / project)",group:"Create",keywords:["new","create","todo","task"],bindableKind:"new-todo",flow:{steps:[{kind:"picker",id:"scope",label:"Scope",loadOptions:async()=>{const[{workspaces:h},x]=await Promise.all([Vx(),qx()]),v=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const b of h)v.push({value:b,label:b,hint:"workspace"});for(const b of x){const C=b.workspace??"_ungrouped";v.push({value:C,label:`${b.title}`,hint:`project · ${b.workspace??"ungrouped"}`})}return v}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async h=>{const x=(h.scope??"_ungrouped").trim()||"_ungrouped",v=(h.description??"").trim();if(!v)throw new Error("Description is required");await Kp(x,v)}}}),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 qx(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const v of h)x.push({value:v.slug,label:v.title,hint:v.workspace?`workspace · ${v.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 v=(h.project??"_standalone").trim()||"_standalone",b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=dr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");if(v==="_standalone"){let A=await sf("/api/templates/assignment?standalone=1");A=qs(A,"slug",C),A=qs(A,"title",b);const I=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:A})}),R=await I.json().catch(()=>({}));if(!I.ok)throw new Error(R.error||`Failed to create assignment (HTTP ${I.status})`);const D=((N=R==null?void 0:R.assignment)==null?void 0:N.id)??(R==null?void 0:R.id);D?x.navigate(`/assignments/${D}`):x.navigate("/assignments");return}let k=await sf("/api/templates/assignment");k=qs(k,"slug",C),k=qs(k,"title",b);const j=await fetch(`/api/projects/${encodeURIComponent(v)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.error||`Failed to create assignment (HTTP ${j.status})`);const T=S.slug??C;x.navigate(`/projects/${v}/assignments/${T}`)}}}),m.push({id:"create-project-route",title:"New Project (advanced editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","project","advanced","editor"],run:()=>d(`${l}/create/project`)}),m.push({id:"create-standalone-assignment",title:"New Standalone Assignment (editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","assignment","standalone","one-off","editor"],run:()=>d(`${l}/assignments/new`)}),n&&m.push({id:`create-assignment-in-${n}`,title:`New Assignment in ${s??n}`,subtitle:n,group:"Create",keywords:["new","create","assignment",n],run:()=>d(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>d("/playbooks/create")}),m.push({id:"create-todo-global",title:"New Todo (global, quick)",subtitle:"Ungrouped, single-step",group:"Create",keywords:["new","create","todo","global","ungrouped","quick"],requiresInput:{placeholder:"Describe the todo…",runWithInput:async h=>{const x=h.trim();x&&await rf("_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 v=x.trim();v&&await rf(h,v)}}})}n&&a&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${s??n}`,subtitle:`${n} · workspace ${a}`,group:"Create",keywords:["new","create","todo","project",n,a],requiresInput:{placeholder:`Describe the todo for project ${s??n}…`,runWithInput:async h=>{const x=h.trim();x&&await rf(a,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:()=>aE(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 yt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Kx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fc(...e){return t=>{let n=!1;const s=e.map(a=>{const l=Kx(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<s.length;a++){const l=s[a];typeof l=="function"?l():Kx(e[a],null)}}}}function mn(...e){return g.useCallback(Fc(...e),e)}function uE(e,t){const n=g.createContext(t),s=l=>{const{children:c,...d}=l,p=g.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:p,children:c})};s.displayName=e+"Provider";function a(l){const c=g.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,a]}function Zs(e,t=[]){let n=[];function s(l,c){const d=g.createContext(c),p=n.length;n=[...n,c];const m=x=>{var S;const{scope:v,children:b,...C}=x,k=((S=v==null?void 0:v[e])==null?void 0:S[p])||d,j=g.useMemo(()=>C,Object.values(C));return o.jsx(k.Provider,{value:j,children:b})};m.displayName=l+"Provider";function h(x,v){var k;const b=((k=v==null?void 0:v[e])==null?void 0:k[p])||d,C=g.useContext(b);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,h]}const a=()=>{const l=n.map(c=>g.createContext(c));return function(d){const p=(d==null?void 0:d[e])||l;return g.useMemo(()=>({[`__scope${e}`]:{...d,[e]:p}}),[d,p])}};return a.scopeName=e,[s,dE(a,...t)]}function dE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(l){const c=s.reduce((d,{useScope:p,scopeName:m})=>{const x=p(l)[`__scope${m}`];return{...d,...x}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Es=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},fE=Kv[" useId ".trim().toString()]||(()=>{}),pE=0;function $o(e){const[t,n]=g.useState(fE());return Es(()=>{n(s=>s??String(pE++))},[e]),t?`radix-${t}`:""}var hE=Kv[" useInsertionEffect ".trim().toString()]||Es;function zc({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[a,l,c]=mE({defaultProp:t,onChange:n}),d=e!==void 0,p=d?e:a;{const h=g.useRef(e!==void 0);g.useEffect(()=>{const x=h.current;x!==d&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=d},[d,s])}const m=g.useCallback(h=>{var x;if(d){const v=gE(h)?h(e):h;v!==e&&((x=c.current)==null||x.call(c,v))}else l(h)},[d,e,l,c]);return[p,m]}function mE({defaultProp:e,onChange:t}){const[n,s]=g.useState(e),a=g.useRef(n),l=g.useRef(t);return hE(()=>{l.current=t},[t]),g.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,s,l]}function gE(e){return typeof e=="function"}function xE(e){const t=yE(e),n=g.forwardRef((s,a)=>{const{children:l,...c}=s,d=g.Children.toArray(l),p=d.find(bE);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return o.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return o.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function yE(e){const t=g.forwardRef((n,s)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=jE(a),d=wE(l,a.props);return a.type!==g.Fragment&&(d.ref=s?Fc(s,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vE=Symbol("radix.slottable");function bE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vE}function wE(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function jE(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$t=kE.reduce((e,t)=>{const n=xE(`Primitive.${t}`),s=g.forwardRef((a,l)=>{const{asChild:c,...d}=a,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(p,{...d,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function SE(e,t){e&&Cs.flushSync(()=>e.dispatchEvent(t))}function Xs(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function NE(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e);g.useEffect(()=>{const s=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var CE="DismissableLayer",Jf="dismissableLayer.update",EE="dismissableLayer.pointerDownOutside",PE="dismissableLayer.focusOutside",Gx,tw=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gp=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...p}=e,m=g.useContext(tw),[h,x]=g.useState(null),v=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=g.useState({}),C=mn(t,D=>x(D)),k=Array.from(m.layers),[j]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=k.indexOf(j),T=h?k.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,A=T>=S,I=AE(D=>{const O=D.target,G=[...m.branches].some(re=>re.contains(O));!A||G||(a==null||a(D),c==null||c(D),D.defaultPrevented||d==null||d())},v),R=DE(D=>{const O=D.target;[...m.branches].some(re=>re.contains(O))||(l==null||l(D),c==null||c(D),D.defaultPrevented||d==null||d())},v);return NE(D=>{T===m.layers.size-1&&(s==null||s(D),!D.defaultPrevented&&d&&(D.preventDefault(),d()))},v),g.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Gx=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Yx(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Gx)}},[h,v,n,m]),g.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Yx())},[h,m]),g.useEffect(()=>{const D=()=>b({});return document.addEventListener(Jf,D),()=>document.removeEventListener(Jf,D)},[]),o.jsx($t.div,{...p,ref:C,style:{pointerEvents:N?A?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,R.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,I.onPointerDownCapture)})});Gp.displayName=CE;var TE="DismissableLayerBranch",RE=g.forwardRef((e,t)=>{const n=g.useContext(tw),s=g.useRef(null),a=mn(t,s);return g.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx($t.div,{...e,ref:a})});RE.displayName=TE;function AE(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e),s=g.useRef(!1),a=g.useRef(()=>{});return g.useEffect(()=>{const l=d=>{if(d.target&&!s.current){let p=function(){nw(EE,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function DE(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e),s=g.useRef(!1);return g.useEffect(()=>{const a=l=>{l.target&&!s.current&&nw(PE,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Yx(){const e=new CustomEvent(Jf);document.dispatchEvent(e)}function nw(e,t,n,{discrete:s}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?SE(a,l):a.dispatchEvent(l)}var of="focusScope.autoFocusOnMount",af="focusScope.autoFocusOnUnmount",Xx={bubbles:!1,cancelable:!0},LE="FocusScope",rw=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[d,p]=g.useState(null),m=Xs(a),h=Xs(l),x=g.useRef(null),v=mn(t,k=>p(k)),b=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let k=function(N){if(b.paused||!d)return;const A=N.target;d.contains(A)?x.current=A:Ss(x.current,{select:!0})},j=function(N){if(b.paused||!d)return;const A=N.relatedTarget;A!==null&&(d.contains(A)||Ss(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const I of N)I.removedNodes.length>0&&Ss(d)};document.addEventListener("focusin",k),document.addEventListener("focusout",j);const T=new MutationObserver(S);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",j),T.disconnect()}}},[s,d,b.paused]),g.useEffect(()=>{if(d){Jx.add(b);const k=document.activeElement;if(!d.contains(k)){const S=new CustomEvent(of,Xx);d.addEventListener(of,m),d.dispatchEvent(S),S.defaultPrevented||(IE(FE(sw(d)),{select:!0}),document.activeElement===k&&Ss(d))}return()=>{d.removeEventListener(of,m),setTimeout(()=>{const S=new CustomEvent(af,Xx);d.addEventListener(af,h),d.dispatchEvent(S),S.defaultPrevented||Ss(k??document.body,{select:!0}),d.removeEventListener(af,h),Jx.remove(b)},0)}}},[d,m,h,b]);const C=g.useCallback(k=>{if(!n&&!s||b.paused)return;const j=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,S=document.activeElement;if(j&&S){const T=k.currentTarget,[N,A]=OE(T);N&&A?!k.shiftKey&&S===A?(k.preventDefault(),n&&Ss(N,{select:!0})):k.shiftKey&&S===N&&(k.preventDefault(),n&&Ss(A,{select:!0})):S===T&&k.preventDefault()}},[n,s,b.paused]);return o.jsx($t.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});rw.displayName=LE;function IE(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Ss(s,{select:t}),document.activeElement!==n)return}function OE(e){const t=sw(e),n=Qx(t,e),s=Qx(t.reverse(),e);return[n,s]}function sw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qx(e,t){for(const n of e)if(!ME(n,{upTo:t}))return n}function ME(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 _E(e){return e instanceof HTMLInputElement&&"select"in e}function Ss(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_E(e)&&t&&e.select()}}var Jx=$E();function $E(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Zx(e,t),e.unshift(t)},remove(t){var n;e=Zx(e,t),(n=e[0])==null||n.resume()}}}function Zx(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function FE(e){return e.filter(t=>t.tagName!=="A")}var zE="Portal",Yp=g.forwardRef((e,t)=>{var d;const{container:n,...s}=e,[a,l]=g.useState(!1);Es(()=>l(!0),[]);const c=n||a&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?lC.createPortal(o.jsx($t.div,{...s,ref:t}),c):null});Yp.displayName=zE;function BE(e,t){return g.useReducer((n,s)=>t[n][s]??n,e)}var eo=e=>{const{present:t,children:n}=e,s=UE(t),a=typeof n=="function"?n({present:s.isPresent}):g.Children.only(n),l=mn(s.ref,HE(a));return typeof n=="function"||s.isPresent?g.cloneElement(a,{ref:l}):null};eo.displayName="Presence";function UE(e){const[t,n]=g.useState(),s=g.useRef(null),a=g.useRef(e),l=g.useRef("none"),c=e?"mounted":"unmounted",[d,p]=BE(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const m=ql(s.current);l.current=d==="mounted"?m:"none"},[d]),Es(()=>{const m=s.current,h=a.current;if(h!==e){const v=l.current,b=ql(m);e?p("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&v!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),Es(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,x=b=>{const k=ql(s.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(p("ANIMATION_END"),!a.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},v=b=>{b.target===t&&(l.current=ql(s.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:g.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function ql(e){return(e==null?void 0:e.animationName)||"none"}function HE(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lf=0;function WE(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ey()),document.body.insertAdjacentElement("beforeend",e[1]??ey()),lf++,()=>{lf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lf--}},[])}function ey(){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 Nr=function(){return Nr=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Nr.apply(this,arguments)};function ow(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function VE(e,t,n){if(n||arguments.length===2)for(var s=0,a=t.length,l;s<a;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var cc="right-scroll-bar-position",uc="width-before-scroll-bar",qE="with-scroll-bars-hidden",KE="--removed-body-scroll-bar-size";function cf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GE(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var a=n.value;a!==s&&(n.value=s,n.callback(s,a))}}}})[0];return n.callback=t,n.facade}var YE=typeof window<"u"?g.useLayoutEffect:g.useEffect,ty=new WeakMap;function XE(e,t){var n=GE(null,function(s){return e.forEach(function(a){return cf(a,s)})});return YE(function(){var s=ty.get(n);if(s){var a=new Set(s),l=new Set(e),c=n.current;a.forEach(function(d){l.has(d)||cf(d,null)}),l.forEach(function(d){a.has(d)||cf(d,c)})}ty.set(n,e)},[e]),n}function QE(e){return e}function JE(e,t){t===void 0&&(t=QE);var n=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,s);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var 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 a}function ZE(e){e===void 0&&(e={});var t=JE(null);return t.options=Nr({async:!0,ssr:!1},e),t}var iw=function(e){var t=e.sideCar,n=ow(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 g.createElement(s,Nr({},n))};iw.isSideCarExport=!0;function eP(e,t){return e.useMedium(t),iw}var aw=ZE(),uf=function(){},Bc=g.forwardRef(function(e,t){var n=g.useRef(null),s=g.useState({onScrollCapture:uf,onWheelCapture:uf,onTouchMoveCapture:uf}),a=s[0],l=s[1],c=e.forwardProps,d=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,x=e.shards,v=e.sideCar,b=e.noRelative,C=e.noIsolation,k=e.inert,j=e.allowPinchZoom,S=e.as,T=S===void 0?"div":S,N=e.gapMode,A=ow(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,R=XE([n,t]),D=Nr(Nr({},A),a);return g.createElement(g.Fragment,null,h&&g.createElement(I,{sideCar:aw,removeScrollBar:m,shards:x,noRelative:b,noIsolation:C,inert:k,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:N}),c?g.cloneElement(g.Children.only(d),Nr(Nr({},D),{ref:R})):g.createElement(T,Nr({},D,{className:p,ref:R}),d))});Bc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bc.classNames={fullWidth:uc,zeroRight:cc};var tP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tP();return t&&e.setAttribute("nonce",t),e}function rP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nP())&&(rP(t,n),sP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iP=function(){var e=oP();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lw=function(){var e=iP(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},aP={left:0,top:0,right:0,gap:0},df=function(e){return parseInt(e||"",10)||0},lP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[df(n),df(s),df(a)]},cP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aP;var t=lP(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])}},uP=lw(),Fo="data-scroll-locked",dP=function(e,t,n,s){var a=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
426
|
+
.`.concat(qE,` {
|
|
427
|
+
overflow: hidden `).concat(s,`;
|
|
428
|
+
padding-right: `).concat(d,"px ").concat(s,`;
|
|
429
|
+
}
|
|
430
|
+
body[`).concat(Fo,`] {
|
|
431
|
+
overflow: hidden `).concat(s,`;
|
|
432
|
+
overscroll-behavior: contain;
|
|
433
|
+
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
434
|
+
padding-left: `.concat(a,`px;
|
|
435
|
+
padding-top: `).concat(l,`px;
|
|
436
|
+
padding-right: `).concat(c,`px;
|
|
437
|
+
margin-left:0;
|
|
438
|
+
margin-top:0;
|
|
439
|
+
margin-right: `).concat(d,"px ").concat(s,`;
|
|
440
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.`).concat(cc,` {
|
|
444
|
+
right: `).concat(d,"px ").concat(s,`;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.`).concat(uc,` {
|
|
448
|
+
margin-right: `).concat(d,"px ").concat(s,`;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.`).concat(cc," .").concat(cc,` {
|
|
452
|
+
right: 0 `).concat(s,`;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.`).concat(uc," .").concat(uc,` {
|
|
456
|
+
margin-right: 0 `).concat(s,`;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
body[`).concat(Fo,`] {
|
|
460
|
+
`).concat(KE,": ").concat(d,`px;
|
|
461
|
+
}
|
|
462
|
+
`)},ny=function(){var e=parseInt(document.body.getAttribute(Fo)||"0",10);return isFinite(e)?e:0},fP=function(){g.useEffect(function(){return document.body.setAttribute(Fo,(ny()+1).toString()),function(){var e=ny()-1;e<=0?document.body.removeAttribute(Fo):document.body.setAttribute(Fo,e.toString())}},[])},pP=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;fP();var l=g.useMemo(function(){return cP(a)},[a]);return g.createElement(uP,{styles:dP(l,!t,a,n?"":"!important")})},Zf=!1;if(typeof window<"u")try{var Kl=Object.defineProperty({},"passive",{get:function(){return Zf=!0,!0}});window.addEventListener("test",Kl,Kl),window.removeEventListener("test",Kl,Kl)}catch{Zf=!1}var To=Zf?{passive:!1}:!1,hP=function(e){return e.tagName==="TEXTAREA"},cw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hP(e)&&n[t]==="visible")},mP=function(e){return cw(e,"overflowY")},gP=function(e){return cw(e,"overflowX")},ry=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=uw(e,s);if(a){var l=dw(e,s),c=l[1],d=l[2];if(c>d)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},xP=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},yP=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},uw=function(e,t){return e==="v"?mP(t):gP(t)},dw=function(e,t){return e==="v"?xP(t):yP(t)},vP=function(e,t){return e==="h"&&t==="rtl"?-1:1},bP=function(e,t,n,s,a){var l=vP(e,window.getComputedStyle(t).direction),c=l*s,d=n.target,p=t.contains(d),m=!1,h=c>0,x=0,v=0;do{if(!d)break;var b=dw(e,d),C=b[0],k=b[1],j=b[2],S=k-j-l*C;(C||S)&&uw(e,d)&&(x+=S,v+=C);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!p&&d!==document.body||p&&(t.contains(d)||t===d));return(h&&Math.abs(x)<1||!h&&Math.abs(v)<1)&&(m=!0),m},Gl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sy=function(e){return[e.deltaX,e.deltaY]},oy=function(e){return e&&"current"in e?e.current:e},wP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jP=function(e){return`
|
|
463
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
464
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
465
|
+
`)},kP=0,Ro=[];function SP(e){var t=g.useRef([]),n=g.useRef([0,0]),s=g.useRef(),a=g.useState(kP++)[0],l=g.useState(lw)[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var k=VE([e.lockRef.current],(e.shards||[]).map(oy),!0).filter(Boolean);return k.forEach(function(j){return j.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),k.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=g.useCallback(function(k,j){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!c.current.allowPinchZoom;var S=Gl(k),T=n.current,N="deltaX"in k?k.deltaX:T[0]-S[0],A="deltaY"in k?k.deltaY:T[1]-S[1],I,R=k.target,D=Math.abs(N)>Math.abs(A)?"h":"v";if("touches"in k&&D==="h"&&R.type==="range")return!1;var O=window.getSelection(),G=O&&O.anchorNode,re=G?G===R||G.contains(R):!1;if(re)return!1;var z=ry(D,R);if(!z)return!0;if(z?I=D:(I=D==="v"?"h":"v",z=ry(D,R)),!z)return!1;if(!s.current&&"changedTouches"in k&&(N||A)&&(s.current=I),!I)return!0;var K=s.current||I;return bP(K,j,k,K==="h"?N:A)},[]),p=g.useCallback(function(k){var j=k;if(!(!Ro.length||Ro[Ro.length-1]!==l)){var S="deltaY"in j?sy(j):Gl(j),T=t.current.filter(function(I){return I.name===j.type&&(I.target===j.target||j.target===I.shadowParent)&&wP(I.delta,S)})[0];if(T&&T.should){j.cancelable&&j.preventDefault();return}if(!T){var N=(c.current.shards||[]).map(oy).filter(Boolean).filter(function(I){return I.contains(j.target)}),A=N.length>0?d(j,N[0]):!c.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),m=g.useCallback(function(k,j,S,T){var N={name:k,delta:j,target:S,should:T,shadowParent:NP(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(A){return A!==N})},1)},[]),h=g.useCallback(function(k){n.current=Gl(k),s.current=void 0},[]),x=g.useCallback(function(k){m(k.type,sy(k),k.target,d(k,e.lockRef.current))},[]),v=g.useCallback(function(k){m(k.type,Gl(k),k.target,d(k,e.lockRef.current))},[]);g.useEffect(function(){return Ro.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:v}),document.addEventListener("wheel",p,To),document.addEventListener("touchmove",p,To),document.addEventListener("touchstart",h,To),function(){Ro=Ro.filter(function(k){return k!==l}),document.removeEventListener("wheel",p,To),document.removeEventListener("touchmove",p,To),document.removeEventListener("touchstart",h,To)}},[]);var b=e.removeScrollBar,C=e.inert;return g.createElement(g.Fragment,null,C?g.createElement(l,{styles:jP(a)}):null,b?g.createElement(pP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function NP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CP=eP(aw,SP);var fw=g.forwardRef(function(e,t){return g.createElement(Bc,Nr({},e,{ref:t,sideCar:CP}))});fw.classNames=Bc.classNames;var EP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ao=new WeakMap,Yl=new WeakMap,Xl={},ff=0,pw=function(e){return e&&(e.host||pw(e.parentNode))},PP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=pw(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})},TP=function(e,t,n,s){var a=PP(t,Array.isArray(e)?e:[e]);Xl[n]||(Xl[n]=new WeakMap);var l=Xl[n],c=[],d=new Set,p=new Set(a),m=function(x){!x||d.has(x)||(d.add(x),m(x.parentNode))};a.forEach(m);var h=function(x){!x||p.has(x)||Array.prototype.forEach.call(x.children,function(v){if(d.has(v))h(v);else try{var b=v.getAttribute(s),C=b!==null&&b!=="false",k=(Ao.get(v)||0)+1,j=(l.get(v)||0)+1;Ao.set(v,k),l.set(v,j),c.push(v),k===1&&C&&Yl.set(v,!0),j===1&&v.setAttribute(n,"true"),C||v.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return h(t),d.clear(),ff++,function(){c.forEach(function(x){var v=Ao.get(x)-1,b=l.get(x)-1;Ao.set(x,v),l.set(x,b),v||(Yl.has(x)||x.removeAttribute(s),Yl.delete(x)),b||x.removeAttribute(n)}),ff--,ff||(Ao=new WeakMap,Ao=new WeakMap,Yl=new WeakMap,Xl={})}},RP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=EP(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),TP(s,a,n,"aria-hidden")):function(){return null}};function AP(e){const t=DP(e),n=g.forwardRef((s,a)=>{const{children:l,...c}=s,d=g.Children.toArray(l),p=d.find(IP);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return o.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return o.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function DP(e){const t=g.forwardRef((n,s)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=MP(a),d=OP(l,a.props);return a.type!==g.Fragment&&(d.ref=s?Fc(s,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LP=Symbol("radix.slottable");function IP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LP}function OP(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function MP(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uc="Dialog",[hw,mw]=Zs(Uc),[_P,xr]=hw(Uc),gw=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=g.useRef(null),p=g.useRef(null),[m,h]=zc({prop:s,defaultProp:a??!1,onChange:l,caller:Uc});return o.jsx(_P,{scope:t,triggerRef:d,contentRef:p,contentId:$o(),titleId:$o(),descriptionId:$o(),open:m,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(x=>!x),[h]),modal:c,children:n})};gw.displayName=Uc;var xw="DialogTrigger",yw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=xr(xw,n),l=mn(t,a.triggerRef);return o.jsx($t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Jp(a.open),...s,ref:l,onClick:yt(e.onClick,a.onOpenToggle)})});yw.displayName=xw;var Xp="DialogPortal",[$P,vw]=hw(Xp,{forceMount:void 0}),bw=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,l=xr(Xp,t);return o.jsx($P,{scope:t,forceMount:n,children:g.Children.map(s,c=>o.jsx(eo,{present:n||l.open,children:o.jsx(Yp,{asChild:!0,container:a,children:c})}))})};bw.displayName=Xp;var yc="DialogOverlay",ww=g.forwardRef((e,t)=>{const n=vw(yc,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=xr(yc,e.__scopeDialog);return l.modal?o.jsx(eo,{present:s||l.open,children:o.jsx(zP,{...a,ref:t})}):null});ww.displayName=yc;var FP=AP("DialogOverlay.RemoveScroll"),zP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=xr(yc,n);return o.jsx(fw,{as:FP,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx($t.div,{"data-state":Jp(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Qs="DialogContent",jw=g.forwardRef((e,t)=>{const n=vw(Qs,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,l=xr(Qs,e.__scopeDialog);return o.jsx(eo,{present:s||l.open,children:l.modal?o.jsx(BP,{...a,ref:t}):o.jsx(UP,{...a,ref:t})})});jw.displayName=Qs;var BP=g.forwardRef((e,t)=>{const n=xr(Qs,e.__scopeDialog),s=g.useRef(null),a=mn(t,n.contentRef,s);return g.useEffect(()=>{const l=s.current;if(l)return RP(l)},[]),o.jsx(kw,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:yt(e.onFocusOutside,l=>l.preventDefault())})}),UP=g.forwardRef((e,t)=>{const n=xr(Qs,e.__scopeDialog),s=g.useRef(!1),a=g.useRef(!1);return o.jsx(kw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{var p,m;(p=e.onInteractOutside)==null||p.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),kw=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,d=xr(Qs,n),p=g.useRef(null),m=mn(t,p);return WE(),o.jsxs(o.Fragment,{children:[o.jsx(rw,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:o.jsx(Gp,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Jp(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(WP,{titleId:d.titleId}),o.jsx(qP,{contentRef:p,descriptionId:d.descriptionId})]})]})}),Qp="DialogTitle",Sw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=xr(Qp,n);return o.jsx($t.h2,{id:a.titleId,...s,ref:t})});Sw.displayName=Qp;var Nw="DialogDescription",Cw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=xr(Nw,n);return o.jsx($t.p,{id:a.descriptionId,...s,ref:t})});Cw.displayName=Nw;var Ew="DialogClose",Pw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=xr(Ew,n);return o.jsx($t.button,{type:"button",...s,ref:t,onClick:yt(e.onClick,()=>a.onOpenChange(!1))})});Pw.displayName=Ew;function Jp(e){return e?"open":"closed"}var Tw="DialogTitleWarning",[HP,Rw]=uE(Tw,{contentName:Qs,titleName:Qp,docsSlug:"dialog"}),WP=({titleId:e})=>{const t=Rw(Tw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
466
|
+
|
|
467
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
468
|
+
|
|
469
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},VP="DialogDescriptionWarning",qP=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rw(VP).contentName}}.`;return g.useEffect(()=>{var l;const a=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},Aw=gw,KP=yw,Dw=bw,Zp=ww,eh=jw,th=Sw,nh=Cw,Lw=Pw;const ei=Aw,GP=Dw,Iw=g.forwardRef(({className:e,...t},n)=>o.jsx(Zp,{ref:n,className:Be("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Iw.displayName=Zp.displayName;const to=g.forwardRef(({className:e,children:t,...n},s)=>o.jsxs(GP,{children:[o.jsx(Iw,{}),o.jsx(eh,{ref:s,className:Be("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})]}));to.displayName=eh.displayName;function rh({className:e,...t}){return o.jsx("div",{className:Be("flex flex-col space-y-2 text-left",e),...t})}function sh({className:e,...t}){return o.jsx("div",{className:Be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const no=g.forwardRef(({className:e,...t},n)=>o.jsx(th,{ref:n,className:Be("text-lg font-semibold tracking-tight text-foreground",e),...t}));no.displayName=th.displayName;const Pa=g.forwardRef(({className:e,...t},n)=>o.jsx(nh,{ref:n,className:Be("text-sm leading-6 text-muted-foreground",e),...t}));Pa.displayName=nh.displayName;const YP=-1,XP=-40;function pf(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,s=0,a=-2,l=0;for(let c=0;c<e.length;c++){const d=e[c];let p=!1;for(;s<t.length;)if(t[s]===d){if(n+=100,s===a+1&&(n+=20),s===0)n+=30;else{const m=t[s-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max(XP,l*YP)),a=s,l=0,s++,p=!0;break}else l++,s++;if(!p)return-1/0}return n}const iy={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function oh(e,t,n=50){const s=e.toLowerCase();if(!s)return t.slice(0,n).map(c=>({...c,score:0}));const l=t.map(c=>{var x;const d=pf(s,c.title.toLowerCase())*1,p=c.subtitle?pf(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?pf(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,h=Math.max(d,p,m);return{...c,score:h}}).filter(c=>c.score>-1/0);return l.sort((c,d)=>d.score!==c.score?d.score-c.score:c.title.length!==d.title.length?c.title.length-d.title.length:c.title!==d.title?c.title<d.title?-1:1:(iy[c.type]??99)-(iy[d.type]??99)),l.slice(0,n)}const QP={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function JP({entries:e}){const{paletteOpen:t,closePalette:n}=As(),s=St(),[a,l]=g.useState(""),[c,d]=g.useState(0),p=g.useRef(null),m=g.useMemo(()=>oh(a,e,50),[a,e]);g.useEffect(()=>{d(0)},[a,t]),g.useEffect(()=>{t||l("")},[t]),g.useEffect(()=>{var b;const v=(b=p.current)==null?void 0:b.querySelector(`[data-palette-idx="${c}"]`);v==null||v.scrollIntoView({block:"nearest"})},[c]);function h(v){s(v.route),n()}function x(v){if(v.key==="ArrowDown")v.preventDefault(),d(b=>Math.min(m.length-1,b+1));else if(v.key==="ArrowUp")v.preventDefault(),d(b=>Math.max(0,b-1));else if(v.key==="Enter"){v.preventDefault();const b=m[c];b&&h(b)}}return o.jsx(ei,{open:t,onOpenChange:v=>v?null:n(),children:o.jsxs(to,{className:"max-w-xl p-0 gap-0",children:[o.jsx(no,{className:"sr-only",children:"Command palette"}),o.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:v=>l(v.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"}),o.jsx("div",{ref:p,className:"max-h-[60vh] overflow-y-auto p-1",children:m.length===0?o.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:a?"No matches":"Start typing to search"}):m.map((v,b)=>{const C=b===c;return o.jsxs("button",{type:"button","data-palette-idx":b,onClick:()=>h(v),onMouseEnter:()=>d(b),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${C?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[o.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:QP[v.type]??v.type}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.title}),v.subtitle?o.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:v.subtitle}):null]},v.id)})}),o.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[o.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," open ","·"," Esc close"]}),o.jsxs("span",{children:[m.length," result",m.length===1?"":"s"]})]})]})})}function ZP({label:e,onBack:t,disabled:n,stepCounter:s}){return o.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-3 py-2",children:[o.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:[o.jsx(mC,{className:"h-3.5 w-3.5","aria-hidden":"true"}),o.jsx("span",{children:"Back"})]}),o.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),s?o.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/80",children:["step ",s.current," of ",s.total]}):null]})}function eT({step:e,initialValue:t,disabled:n,onSubmit:s}){const[a,l]=g.useState(t??""),[c,d]=g.useState(!1),p=g.useRef(null);g.useEffect(()=>{var C;(C=p.current)==null||C.focus()},[]);const m=a.trim(),h=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),v=!n&&(!h||m.length>0)&&!x;function b(C){if(C.key==="Enter"){if(C.preventDefault(),!v){d(!0);return}s(m)}}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:p,type:"text",value:a,onChange:C=>{l(C.target.value),d(!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?o.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 tT({step:e,disabled:t,onSubmit:n}){const[s,a]=g.useState({phase:"loading"}),[l,c]=g.useState(""),[d,p]=g.useState(0),[m,h]=g.useState(0),x=g.useRef(null),v=g.useRef(null);g.useEffect(()=>{var k;(k=x.current)==null||k.focus()},[]),g.useEffect(()=>{let k=!1;return a({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(j=>{k||a({phase:"loaded",options:j})}).catch(j=>{if(k)return;const S=j instanceof Error?j.message:"Failed to load options";a({phase:"error",message:S})}),()=>{k=!0}},[e,m]);const b=g.useMemo(()=>{if(s.phase!=="loaded")return[];const k=s.options.map(j=>({type:"option",title:j.label,subtitle:j.hint,keywords:[j.value],option:j}));return oh(l,k,100)},[s,l]);g.useEffect(()=>{p(0)},[b.length]),g.useEffect(()=>{var j;const k=(j=v.current)==null?void 0:j.querySelector(`[data-picker-idx="${d}"]`);k==null||k.scrollIntoView({block:"nearest"})},[d]);function C(k){if(s.phase==="loaded"){if(k.key==="ArrowDown")k.preventDefault(),p(j=>Math.min(b.length-1,j+1));else if(k.key==="ArrowUp")k.preventDefault(),p(j=>Math.max(0,j-1));else if(k.key==="Enter"){k.preventDefault();const j=b[d];j&&n(j.option.value)}}}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:x,type:"text",value:l,onChange:k=>c(k.target.value),onKeyDown:C,placeholder:`Filter ${e.label.toLowerCase()}…`,disabled:t||s.phase==="loading",className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),o.jsx("div",{ref:v,className:"max-h-[60vh] min-h-[120px] overflow-y-auto p-1",children:s.phase==="loading"?o.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):s.phase==="error"?o.jsxs("div",{className:"px-4 py-4 text-sm",children:[o.jsxs("div",{className:"mb-2 text-destructive",children:["Failed to load: ",s.message]}),o.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?o.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,j)=>{const S=j===d;return o.jsxs("button",{type:"button","data-picker-idx":j,onClick:()=>n(k.option.value),onMouseEnter:()=>p(j),disabled:t,className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${S?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.option.label}),k.option.hint?o.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:k.option.hint}):null]},k.option.value)})})]})}function nT({entries:e}){var ge,Ne;const t=St(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:a,bindAction:l,findConflict:c,pendingActionKind:d,consumePendingActionKind:p}=As(),[m,h]=g.useState(""),[x,v]=g.useState(0),[b,C]=g.useState(null),[k,j]=g.useState(""),[S,T]=g.useState(null),[N,A]=g.useState(null),[I,R]=g.useState(!1),[D,O]=g.useState(null),G=g.useRef(null),re=g.useMemo(()=>e.map(te=>({type:te.group.toLowerCase(),title:te.title,subtitle:te.subtitle,keywords:te.keywords,action:te})),[e]),z=g.useMemo(()=>oh(m,re,50),[m,re]);g.useEffect(()=>{v(0)},[m,n]),g.useEffect(()=>{n||(h(""),C(null),j(""),T(null),A(null),R(!1),O(null))},[n]),g.useEffect(()=>{if(!n||!d)return;const te=p();if(!te)return;const fe=e.find(be=>be.bindableKind===te);fe&&K(fe)},[n,d]),g.useEffect(()=>{var fe;const te=(fe=G.current)==null?void 0:fe.querySelector(`[data-palette-idx="${x}"]`);te==null||te.scrollIntoView({block:"nearest"})},[x]);async function K(te){if(!I){if(te.flow&&te.flow.steps.length>0){T({action:te,stepIndex:0,values:{}}),O(null);return}if(te.requiresInput){C(te),j(""),O(null);return}if(te.run){R(!0),O(null);try{await te.run(),s()}catch(fe){O(fe instanceof Error?fe.message:"Action failed")}finally{R(!1)}}}}async function q(te){if(!S)return;const fe=S.action.flow.steps[S.stepIndex],be={...S.values,[fe.id]:te};if(S.stepIndex+1<S.action.flow.steps.length){T({action:S.action,stepIndex:S.stepIndex+1,values:be});return}R(!0),O(null);try{await S.action.flow.submit(be,{navigate:t}),s()}catch(je){O(je instanceof Error?je.message:"Action failed")}finally{R(!1)}}function J(){if(S&&!I){if(S.stepIndex===0){T(null),O(null);return}T({action:S.action,stepIndex:S.stepIndex-1,values:S.values}),O(null)}}async function _(){if(I||!(b!=null&&b.requiresInput))return;const te=k.trim();if(te){R(!0),O(null);try{await b.requiresInput.runWithInput(te),s()}catch(fe){O(fe instanceof Error?fe.message:"Action failed")}finally{R(!1)}}}function F(te){if(te.key==="ArrowDown")te.preventDefault(),v(fe=>Math.min(z.length-1,fe+1));else if(te.key==="ArrowUp")te.preventDefault(),v(fe=>Math.max(0,fe-1));else if(te.key==="Enter"&&(te.metaKey||te.ctrlKey)){te.preventDefault();const fe=z[x];fe!=null&&fe.action.bindableKind&&A({action:fe.action,combo:null,conflict:null,saving:!1,error:null})}else if(te.key==="Enter"){te.preventDefault();const fe=z[x];fe&&K(fe.action)}}function B(te){te.key==="Enter"?(te.preventDefault(),_()):te.key==="Escape"&&(te.preventDefault(),C(null),j(""))}function U(te){if(!N||te.key==="Escape"||te.key==="Enter"&&!N.combo)return;te.preventDefault(),te.stopPropagation();const fe=Gb(te.nativeEvent);if(!fe)return;const be=c(fe,N.action.bindableKind);A({...N,combo:fe,conflict:be,error:null})}async function Z(){var te;if(!(!N||!N.combo||!N.action.bindableKind)){if((te=N.conflict)!=null&&te.description){A({...N,error:`Reserved: ${N.conflict.description}`});return}A({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),A(null)}catch(fe){A({...N,saving:!1,error:fe instanceof Error?fe.message:"Failed to save binding"})}}}const P=b!==null,M=S!==null,Q=N!==null,L=S?S.action.flow.steps[S.stepIndex]:null;return o.jsx(ei,{open:n,onOpenChange:te=>te?null:s(),children:o.jsxs(to,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:te=>{if(!I){if(Q){te.preventDefault(),A(null);return}if(M){te.preventDefault(),J();return}P&&(te.preventDefault(),C(null),j(""),O(null))}},children:[o.jsx(no,{className:"sr-only",children:"Actions palette"}),Q&&N?o.jsxs("div",{onKeyDown:U,tabIndex:-1,autoFocus:!0,children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[o.jsx(Kf,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),o.jsxs("span",{className:"text-sm text-foreground",children:["Bind hotkey for ",N.action.title]})]}),o.jsx("div",{className:"px-4 py-6 text-center",children:N.combo?o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"text-2xl font-semibold tracking-wide text-foreground",children:Tr(N.combo)}),(ge=N.conflict)!=null&&ge.description?o.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(Ne=N.conflict)!=null&&Ne.kind?o.jsxs("div",{className:"text-sm text-amber-500 dark:text-amber-400",children:['Already bound to "',N.conflict.kind,'". Press Enter to overwrite.']}):o.jsx("div",{className:"text-sm text-muted-foreground",children:"Press Enter to save, or another key to retry."}),N.error?o.jsx("div",{className:"text-sm text-destructive",children:N.error}):null]}):o.jsx("div",{className:"text-sm text-muted-foreground",children:"Press the key combination you want to bind…"})}),o.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[o.jsx("span",{children:"any key records · Enter saves · Esc cancels"}),o.jsx("span",{children:N.saving?"Saving…":""})]}),o.jsx("button",{type:"button",className:"sr-only",onClick:()=>void Z(),"data-bind-confirm":!0}),o.jsx("input",{type:"hidden",onKeyDown:te=>{te.key==="Enter"&&Z()}})]}):M&&L&&S?o.jsxs(o.Fragment,{children:[o.jsx(ZP,{label:`${S.action.title} · ${L.label}`,onBack:J,disabled:I,stepCounter:{current:S.stepIndex+1,total:S.action.flow.steps.length}}),L.kind==="text"?o.jsx(eT,{step:L,initialValue:S.values[L.id],disabled:I,onSubmit:q}):o.jsx(tT,{step:L,disabled:I,onSubmit:q}),D?o.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,o.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[o.jsx("span",{children:"↵ next · ← back · Esc back"}),o.jsx("span",{children:I?"Running…":""})]})]}):P?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[o.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}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.title})]}),o.jsx("input",{autoFocus:!0,type:"text",value:k,onChange:te=>j(te.target.value),onKeyDown:B,placeholder:b.requiresInput.placeholder,disabled:I,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"}),D?o.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,o.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[o.jsxs("span",{children:["↵"," submit ","·"," Esc back"]}),o.jsx("span",{children:I?"Running…":""})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:te=>h(te.target.value),onKeyDown:F,placeholder:"Run an action: new project, new todo, toggle…",disabled:I,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"}),D?o.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,o.jsx("div",{ref:G,className:"max-h-[60vh] overflow-y-auto p-1",children:z.length===0?o.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:m?"No matches":"Start typing to search actions"}):z.map((te,fe)=>{const be=fe===x,je=te.action.bindableKind,we=je?a[je]:void 0;return o.jsxs("button",{type:"button","data-palette-idx":fe,onClick:()=>K(te.action),onMouseEnter:()=>v(fe),disabled:I,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${be?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[o.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:te.action.group}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:te.action.title}),te.action.subtitle?o.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:te.action.subtitle}):null,we?o.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:Tr(we)}):null,je?o.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:Ye=>{Ye.preventDefault(),Ye.stopPropagation(),A({action:te.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 ${be?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:o.jsx(Kf,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},te.action.id)})}),o.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[o.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," run ","·"," ⌘↵ bind ","·"," Esc close"]}),o.jsx("span",{children:I?"Running…":`${z.length} action${z.length===1?"":"s"}`})]})]})]})})}const rT=[{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 sT(e){const t=Tn(e);return t?rT.find(n=>n.combo===t)??null:null}const Yi={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},oT={global:"Global","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},iT=["global","list:projects","list:assignments","list:todos","project","assignment"];function ay(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${Tr(t)} then ${Tr(n)}`}return Tr(e)}function aT(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:a}=As(),l=g.useMemo(()=>{const p=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&p.add(Tn(m));return p},[s]),c=g.useMemo(()=>{if(!e)return new Map;const p=n(),m=new Map;for(const h of p){if(l.has(Tn(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]),d=g.useMemo(()=>{const p=[];for(const[m,h]of Object.entries(s)){if(!h)continue;const x=a.find(v=>v.bindableKind===m);p.push({kind:m,combo:h,title:x?x.title:m})}return p},[s,a]);return o.jsx(ei,{open:e,onOpenChange:p=>p?null:t(),children:o.jsxs(to,{className:"max-w-2xl",children:[o.jsx(no,{children:"Keyboard shortcuts"}),o.jsxs(Pa,{children:["Press Esc to close. ",Tr("Mod+k")," opens the command palette. Press g twice to restart the chord timer."]}),o.jsxs("div",{className:"mt-2 max-h-[60vh] space-y-4 overflow-y-auto pr-1",children:[iT.map(p=>{const m=c.get(p);return!m||m.length===0?null:o.jsxs("section",{children:[o.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:oT[p]}),o.jsx("ul",{className:"space-y-1",children:m.map((h,x)=>o.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:[o.jsx("span",{className:"text-foreground",children:h.description}),o.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:ay(h.keys)})]},`${p}-${h.keys}-${x}`))})]},p)}),d.length>0?o.jsxs("section",{children:[o.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom bindings"}),o.jsx("ul",{className:"space-y-1",children:d.map(p=>o.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:[o.jsx("span",{className:"text-foreground",children:p.title}),o.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:ay(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const ih={bindings:{},custom:!1};let ra=null,Do=null;const ep=new Set;function Ow(e){ra=e;for(const t of ep)t(e)}function ah(e){if(!e||typeof e!="object")return ih;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[s,a]of Object.entries(t.bindings)){if(!K2(s)||typeof a!="string"||a.trim()==="")continue;const l=Tn(a);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function lT(){return ra?Promise.resolve(ra):Do||(Do=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=ah(e);return ra=t,Do=null,t}).catch(()=>(Do=null,ih)),Do)}function cT(){const[e,t]=g.useState(()=>ra??ih);return g.useEffect(()=>{let n=!1;return lT().then(s=>{n||t(s)}),ep.add(t),()=>{n=!0,ep.delete(t)}},[]),e}async function ly(e){const t={};for(const a of $c){const l=e[a];if(typeof l!="string")continue;const c=Tn(l);c&&(t[a]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save hotkey bindings")}const s=ah(await n.json());return Ow(s),s}async function uT(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=ah(await e.json());return Ow(t),t}const cy=1500;function dT(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const Mw=g.createContext(null);function fT({children:e}){const{toggleTheme:t}=Hp(),n=vn(),s=St(),a=dT(n.pathname),l=Zo(),c=Hb(),d=Kb(),p=Vp(),m=qp(),h=g.useMemo(()=>{var Ue,Ge,Nt,Ct;const ne=l.data??[],Y=((Ue=c.data)==null?void 0:Ue.assignments)??[],ae=((Ge=d.data)==null?void 0:Ge.playbooks)??[],xe=((Nt=p.data)==null?void 0:Nt.sessions)??[],Oe=(((Ct=m.data)==null?void 0:Ct.workspaces)??[]).flatMap(Lt=>Lt.items.map(en=>({...en,workspace:Lt.workspace})));return iE({projects:ne,assignments:Y,playbooks:ae,servers:xe,todos:Oe,wsPrefix:a})},[l.data,c.data,d.data,p.data,m.data,a]),v=g.useMemo(()=>Lb(n.pathname),[n.pathname]).projectSlug,b=g.useMemo(()=>{var ne;return v?((ne=l.data)==null?void 0:ne.find(Y=>Y.slug===v))??null:null},[l.data,v]),C=(b==null?void 0:b.title)??null,k=(b==null?void 0:b.workspace)??null,j=g.useMemo(()=>{var ne;return cE({playbooks:((ne=d.data)==null?void 0:ne.playbooks)??[],projectSlug:v,currentProjectTitle:C,currentProjectWorkspace:k,wsPrefix:a,refetchPlaybooks:d.refetch,navigate:s,toggleTheme:t})},[d.data,d.refetch,v,C,k,a,s,t]),S=g.useRef(new Map),T=g.useRef(["global"]),N=g.useRef({phase:"idle"}),A=g.useRef(null),I=g.useRef(1),[R,D]=g.useState(!1),[O,G]=g.useState(!1),[re,z]=g.useState(!1),[K,q]=g.useState(null),{bindings:J}=cT(),_=g.useMemo(()=>J2(J),[J]),F=g.useCallback(ne=>{const Y=I.current++;return S.current.set(Y,{...ne,id:Y}),Y},[]),B=g.useCallback(ne=>{S.current.delete(ne)},[]),U=g.useCallback(ne=>{T.current.push(ne)},[]),Z=g.useCallback(ne=>{const Y=T.current;for(let ae=Y.length-1;ae>=0;ae--)if(Y[ae]===ne){Y.splice(ae,1);return}},[]),P=g.useCallback(()=>D(!0),[]),M=g.useCallback(()=>D(!1),[]),Q=g.useCallback(()=>G(!0),[]),L=g.useCallback(()=>G(!1),[]),ge=g.useCallback(()=>z(!0),[]),Ne=g.useCallback(()=>{z(!1),q(null)},[]),te=g.useCallback(()=>Array.from(S.current.values()),[]),fe=g.useCallback(()=>{let ne=null;return q(Y=>(ne=Y,null)),ne},[]),be=g.useCallback(ne=>{q(ne),z(!0)},[]),je=g.useCallback((ne,Y)=>{const ae=Tn(ne);if(!ae)return null;if(X2(ae)){const xe=sT(ae);return{description:(xe==null?void 0:xe.description)??"Reserved built-in shortcut"}}for(const[xe,qe]of Object.entries(_))if(!(Y&&xe===Y)&&qe===ae)return{kind:xe};return null},[_]),we=g.useCallback(async(ne,Y)=>{const ae=Tn(Y);if(!ae)throw new Error("Empty combo");const xe=je(ae,ne);if(xe){const Oe=xe.description?`Reserved: ${xe.description}`:`Already bound to "${xe.kind}"`;throw new Error(Oe)}const qe={...J,[ne]:ae};return await ly(qe),ae},[J,je]),Ye=g.useCallback(async ne=>{if(!J[ne])return;const Y={...J};delete Y[ne],await ly(Y)},[J]);g.useEffect(()=>{N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[n.pathname]),g.useEffect(()=>{function ne(Oe){if(!(Oe instanceof HTMLElement))return!1;const Ue=Oe.tagName;return!!(Ue==="INPUT"||Ue==="TEXTAREA"||Ue==="SELECT"||Oe.isContentEditable||Oe.closest('[role="combobox"], [role="textbox"]'))}function Y(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function ae(){const Oe=T.current;return Oe[Oe.length-1]??"global"}function xe(Oe){return Oe.scope==="global"?!0:Oe.scope===ae()}function qe(Oe){const Ue=Vl(Oe,"Mod+k"),Ge=Vl(Oe,"Mod+Shift+k"),Nt=Oe.key==="Escape",Ct=Ue||Ge||Nt;if(Y()&&!Ct||ne(Oe.target)&&!Ct)return;const Lt=N.current;if(Lt.phase==="awaiting-second")if(Date.now()-Lt.startedAt>cy)N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null);else{const ie=Array.from(S.current.values());for(const ce of ie){if(!xe(ce))continue;const ve=ce.keys.split(" ");if(!(ve.length!==2||ve[0]!=="g")&&Vl(Oe,ve[1])&&!(ce.when&&!ce.when())){Oe.preventDefault(),N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null),ce.handler(Oe);return}}N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)}const en=Array.from(S.current.values());for(const Tt of en){if(!xe(Tt))continue;const ie=Tt.keys.split(" ");if(ie.length===1&&Vl(Oe,ie[0])&&!(Tt.when&&!Tt.when())){Oe.preventDefault(),Tt.handler(Oe);return}}Oe.key==="g"&&!Oe.metaKey&&!Oe.ctrlKey&&!Oe.altKey&&!Oe.shiftKey&&Array.from(S.current.values()).some(ie=>xe(ie)&&ie.keys.startsWith("g "))&&(Oe.preventDefault(),N.current={phase:"awaiting-second",startedAt:Date.now()},A.current!==null&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{N.current={phase:"idle"},A.current=null},cy))}return window.addEventListener("keydown",qe),()=>{window.removeEventListener("keydown",qe),A.current!==null&&(window.clearTimeout(A.current),A.current=null)}},[]),g.useEffect(()=>{const ne=F({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>B(ne)},[F,B,t]),g.useEffect(()=>{const ne=F({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>Q()});return()=>B(ne)},[F,B,Q]),g.useEffect(()=>{const ne=F({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(R){M();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||P()}});return()=>B(ne)},[F,B,P,M,R]),g.useEffect(()=>{const ne=F({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(re){Ne();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||ge()}});return()=>B(ne)},[F,B,ge,Ne,re]),g.useEffect(()=>{const Y=[{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:"/attention",desc:"Go to Attention"},{suffix:",",basePath:"/settings",desc:"Go to Settings"}].map(ae=>F({keys:`g ${ae.suffix}`,scope:"global",description:ae.desc,handler:()=>s(lc(ae.basePath,a))}));return()=>Y.forEach(B)},[F,B,s,a]),g.useEffect(()=>{const ne=[];for(const[Y,ae]of Object.entries(_)){if(!ae)continue;const xe=j.find(Oe=>Oe.bindableKind===Y),qe=xe?`Custom: ${xe.title}`:`Custom: ${Y}`;ne.push(F({keys:ae,scope:"global",description:qe,handler:()=>{q(Y),z(!0)}}))}return()=>ne.forEach(B)},[F,B,_,j]);const Xe=g.useMemo(()=>({register:F,unregister:B,pushScope:U,popScope:Z,openPalette:P,closePalette:M,paletteOpen:R,openCheatsheet:Q,closeCheatsheet:L,cheatsheetOpen:O,openActionsPalette:ge,closeActionsPalette:Ne,actionsPaletteOpen:re,listBindings:te,wsPrefix:a,paletteEntries:h,actionEntries:j,userBindings:J,customBindings:_,bindAction:we,unbindAction:Ye,findConflict:je,openActionsPaletteWithAction:be,pendingActionKind:K,consumePendingActionKind:fe}),[F,B,U,Z,P,M,R,Q,L,O,ge,Ne,re,te,a,h,j,J,_,we,Ye,je,be,K,fe]);return o.jsxs(Mw.Provider,{value:Xe,children:[e,o.jsx(JP,{entries:h}),o.jsx(nT,{entries:j}),o.jsx(aT,{})]})}function As(){const e=g.useContext(Mw);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function xt({keys:e,handler:t,scope:n="global",description:s,when:a,enabled:l=!0}){const{register:c,unregister:d}=As(),p=g.useRef(t),m=g.useRef(a);g.useEffect(()=>{p.current=t,m.current=a},[t,a]),g.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()=>d(h)},[c,d,e,n,s,l])}function ro(e){const{pushScope:t,popScope:n}=As();g.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function Ta(e,t){const[n,s]=g.useState(e.length===0?-1:0),a=vn();g.useEffect(()=>{s(e.length===0?-1:0)},[a.pathname]),g.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),g.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(d=>{const p=Number(d.getAttribute("data-hotkey-row-index"));d.setAttribute("data-hotkey-selected",p===n?"true":"false")}),n>=0){const d=document.querySelector(`[data-hotkey-row-index="${n}"]`);d==null||d.scrollIntoView({block:"nearest"})}},[n,e.length]),xt({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))}),xt({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),xt({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),xt({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=g.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function pT({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const a=_t(),{resolvedTheme:l,toggleTheme:c}=Hp(),{openPalette:d}=As();return o.jsx("header",{className:"sticky top-0 z-30 border-b border-border/70 bg-background/70 backdrop-blur",children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 lg:px-6",children:[o.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:o.jsx(IC,{className:"h-4 w-4"})}),o.jsx("div",{className:"min-w-0 flex-1",children:o.jsxs("div",{className:"flex items-center gap-2",children:[t.length>1?o.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)=>o.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?o.jsx("span",{children:"/"}):null,o.jsx(ye,{to:p.path,className:"hover:text-foreground",children:p.label})]},p.path)),o.jsx("span",{children:"/"})]}):null,o.jsx("h1",{className:"truncate text-base font-semibold text-foreground",children:e})]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:d,className:"shell-action","aria-label":"Open command palette",children:[o.jsx(Rs,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:Tr("Mod+k")})]}),o.jsx(ye,{className:"shell-action",to:"/help",children:"Help"}),o.jsxs(ye,{className:"shell-action",to:`${a}/create/project`,children:[o.jsx(Wt,{className:"h-4 w-4"}),o.jsx("span",{children:"New Project"})]}),n?o.jsxs(ye,{className:"shell-action",to:`${a}/projects/${n}/create/assignment`,children:[o.jsx(Wt,{className:"h-4 w-4"}),o.jsx("span",{children:"New Assignment"})]}):null,o.jsxs("button",{type:"button",onClick:c,className:"shell-action","aria-label":"Toggle theme",children:[l==="dark"?o.jsx(HC,{className:"h-4 w-4"}):o.jsx(OC,{className:"h-4 w-4"}),o.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}const hT=[{to:"/",label:"Overview",icon:wC},{to:"/attention",label:"Attention",icon:Qo},{to:"/playbooks",label:"Playbooks",icon:gb},{to:"/memories",label:"Memories",icon:hC},{to:"/resources",label:"Resources",icon:RC},{to:"/todos",label:"Todos",icon:Un}],mT=[{suffix:"/projects",label:"Projects",icon:Op},{suffix:"/assignments",label:"Assignments",icon:LC},{suffix:"/servers",label:"Servers",icon:_p},{suffix:"/agent-sessions",label:"Agent Sessions",icon:Oc},{suffix:"/todos",label:"Todos",icon:Un}],gT=[{to:"/help",label:"Help",icon:AC},{to:"/settings",label:"Settings",icon:BC}],uy="syntaur.dashboard.sourceFirstNoticeDismissed";function xT({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:a}){const[l,c]=g.useState(!1);xt({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[d,p]=g.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(uy)==="1"}catch{return!1}});function m(){if(p(!0),!(typeof window>"u"))try{window.localStorage.setItem(uy,"1")}catch{}}return o.jsx("div",{className:"min-h-screen bg-background",children:o.jsxs("div",{className:"relative grid min-h-screen lg:grid-cols-[240px_minmax(0,1fr)]",children:[o.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:o.jsx(dy,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s})}),l?o.jsx("div",{className:"fixed inset-0 z-40 bg-overlay/40 lg:hidden",children:o.jsxs("div",{className:"h-full max-w-xs border-r border-border/70 bg-sidebar p-4 shadow-2xl",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx(ye,{to:"/",className:"text-lg font-semibold text-foreground",onClick:()=>c(!1),children:"Syntaur"}),o.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:o.jsx(zp,{className:"h-4 w-4"})})]}),o.jsx(dy,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,o.jsxs("div",{className:"min-w-0",children:[o.jsx(pT,{title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:()=>c(!0)}),o.jsx("main",{className:"mx-auto w-full max-w-[1480px] px-4 py-4 lg:px-6 lg:py-5",children:a})]})]})})}function dy({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:a}=Wp(),l=(a==null?void 0:a.workspaces)??[],c=(a==null?void 0:a.hasUngrouped)??!1,d=vn(),[p,m]=g.useState(new Set),[h,x]=g.useState(!1),[v,b]=g.useState(""),C=St();function k(S){m(T=>{const N=new Set(T);return N.has(S)?N.delete(S):N.add(S),N})}const j=[...l,...c?["_ungrouped"]:[]];return o.jsxs("div",{className:"flex h-full flex-col gap-3",children:[o.jsx("div",{className:"space-y-3",children:o.jsxs(ye,{to:"/",className:"inline-flex items-center gap-3",onClick:s,children:[o.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:o.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:[o.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"}),o.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"}),o.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"}),o.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"})]})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Syntaur"}),o.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Local-first project control"})]})]})}),o.jsx(Wx,{items:hT,onNavigate:s}),o.jsx("div",{className:"border-t border-border/40"}),o.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[j.length===0&&!h&&o.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),j.map(S=>{const T=S==="_ungrouped",N=T?"Ungrouped":Qt(S),A=T?"/w/_ungrouped":`/w/${S}`,I=p.has(S),R=n===S||n===null&&T&&d.pathname.startsWith("/w/_ungrouped");return o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>k(S),className:`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${R?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[o.jsx(ya,{className:`h-3 w-3 transition-transform ${I?"-rotate-90":""}`}),N]}),!I&&o.jsx("nav",{className:"ml-2 space-y-0.5",children:mT.map(D=>{const O=`${A}${D.suffix}`,G=Db(d.pathname,D.suffix)&&d.pathname.startsWith(A),re=D.icon;return o.jsxs(ye,{to:O,onClick:s,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${G?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[o.jsx(re,{className:"h-4 w-4"}),o.jsx("span",{children:D.label})]},O)})})]},S)}),h?o.jsx("form",{className:"px-3 py-1.5",onSubmit:S=>{S.preventDefault();const T=v.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");T&&(x(!1),b(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T})}).then(()=>{s==null||s(),C(`/w/${T}/projects`)}))},children:o.jsx("input",{autoFocus:!0,type:"text",value:v,onChange:S=>b(S.target.value),onKeyDown:S=>{S.key==="Escape"&&(x(!1),b(""))},onBlur:()=>{v.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"})}):o.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:[o.jsx(Wt,{className:"h-3 w-3"}),"New Workspace"]})]}),o.jsx("div",{className:"border-t border-border/40"}),o.jsx(Wx,{items:gT,onNavigate:s}),e?null:o.jsx("div",{className:"chrome-card",children:o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Source-first dashboard"}),o.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."})]}),o.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:o.jsx(zp,{className:"h-4 w-4"})})]})})]})}function yT(){const e=vn(),{workspace:t}=mt(),{title:n,breadcrumbs:s,projectSlug:a}=Lb(e.pathname);return o.jsx(xT,{title:n,breadcrumbs:s,projectSlug:a,workspace:t??null,children:o.jsx(NN,{})})}const tp="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",fy="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",vT="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",bT="border-status-review-foreground/30 bg-status-review text-status-review-foreground",wT="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",jT="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",kT="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",vc={pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:tp,icon:vC},in_progress:{label:"In Progress",description:"Actively being worked on.",className:fy,icon:wb},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:vT,icon:Vf},review:{label:"Review",description:"Ready for inspection or approval.",className:bT,icon:$C},completed:{label:"Completed",description:"Finished successfully.",className:wT,icon:Lp},failed:{label:"Failed",description:"Could not be completed as planned.",className:jT,icon:Vf},active:{label:"Active",description:"The project has active or review work in flight.",className:fy,icon:qf},stopped:{label:"Stopped",description:"Session ended without completing.",className:tp,icon:gC},archived:{label:"Archived",description:"Archived by a human override.",className:kT,icon:qf}};function Zt({status:e,className:t,showIcon:n=!0,progress:s}){const a=vc[e]??{label:e.replace(/_/g," ").replace(/\b\w/g,h=>h.toUpperCase()),description:`Status: ${e}`,className:tp,icon:qf},l=a.icon,c=s&&s.total>0,d=c?Math.min(1,Math.max(0,s.checked/s.total)):0,p=c?`${a.description} (${s.checked}/${s.total} criteria)`:a.description,m=n?c?o.jsxs("span",{className:"relative inline-flex h-3.5 w-3.5 items-center justify-center",children:[o.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"absolute inset-0 h-full w-full -rotate-90",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),o.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:2*Math.PI*7,strokeDashoffset:2*Math.PI*7*(1-d)})]}),o.jsx(l,{className:"h-2.5 w-2.5"})]}):o.jsx(l,{className:"h-3.5 w-3.5"}):null;return o.jsxs("span",{title:p,className:Be("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium tracking-normal","shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0)] dark:shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0.04)]",a.className,t),children:[m,o.jsx("span",{children:a.label})]})}function _w(e){var t;return((t=vc[e])==null?void 0:t.description)??`Status: ${e}`}const ST={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 st({label:e,value:t,description:n,icon:s,tone:a="default",to:l}){const c=o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:e}),o.jsx("p",{className:"text-2xl font-semibold text-foreground",children:t})]}),s?o.jsx("span",{className:"rounded-md border border-border/60 bg-background/80 p-1.5 text-muted-foreground",children:o.jsx(s,{className:"h-5 w-5"})}):null]}),n?o.jsx("p",{className:"mt-2 text-sm leading-5 text-muted-foreground",children:n}):null]}),d=Be(ST[a],l?"block transition hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40":"");return l?o.jsx(ye,{to:l,className:d,children:c}):o.jsx("article",{className:d,children:c})}function Ie({title:e,description:t,children:n,className:s,actions:a}){return o.jsxs("section",{className:Be("surface-panel space-y-3",s),children:[e||a?o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[e?o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,t?o.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),a]}):null,n]})}function ot({label:e="Loading dashboard data…"}){return o.jsx("div",{className:"flex min-h-[240px] items-center justify-center",children:o.jsx("div",{className:"chrome-card !px-4 !py-3",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:e})})})}function Ze({title:e="Something went wrong",error:t,action:n}){return o.jsx("div",{className:"rounded-lg border border-error-foreground/30 bg-error px-4 py-5",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"text-lg font-semibold text-error-foreground",children:e}),o.jsx("p",{className:"text-sm leading-6 text-error-foreground/90",children:t}),n?o.jsx("div",{className:"pt-2",children:n}):null]})})}function tt({title:e,description:t,actions:n}){return o.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/40 px-4 py-6 text-center",children:o.jsxs("div",{className:"mx-auto max-w-xl space-y-2",children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),o.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:t}),n?o.jsx("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:n}):null]})})}function dc({command:e,description:t,example:n}){return o.jsxs("div",{className:"rounded-lg border border-border/70 bg-code px-3 py-3 text-code-foreground shadow-sm",children:[o.jsx("code",{className:"block overflow-x-auto font-mono text-sm",children:e}),t?o.jsx("p",{className:"mt-2 text-sm text-code-foreground/80",children:t}):null,n?o.jsx("p",{className:"mt-2 font-mono text-xs text-code-foreground/60",children:n}):null]})}function NT({help:e,compact:t=!1}){const n=t?(e==null?void 0:e.firstProjectChecklist.slice(0,3))??[]:(e==null?void 0:e.firstProjectChecklist)??[];return o.jsx(Ie,{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:o.jsx(ye,{className:"text-sm font-semibold text-primary hover:underline",to:"/help",children:"Open full help"}),children:o.jsx("div",{className:"space-y-3",children:n.map((s,a)=>o.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:a+1}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:s.title}),o.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:s.detail}),s.command?o.jsx(dc,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}function CT(){var c;const{data:e,loading:t,error:n}=M2(),{data:s}=Wb(),{data:a}=qp(),l=a!=null&&a.workspaces?a.workspaces.reduce((d,p)=>d+p.counts.open+p.counts.in_progress,0):0;return t?o.jsx(ot,{label:"Loading overview…"}):n||!e?o.jsx(Ze,{error:n||"Overview data is unavailable."}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("header",{className:"space-y-2",children:[o.jsx("p",{className:"eyebrow",children:"Workspace Overview"}),o.jsx("h1",{className:"text-4xl font-semibold tracking-display text-foreground md:text-5xl",children:"What needs you today"}),o.jsx("p",{className:"max-w-2xl text-sm leading-6 text-muted-foreground",children:"A live snapshot of every project and assignment in your filesystem — sourced from markdown, not a database."})]}),o.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(160px,1fr))]",children:[o.jsx(st,{label:"Active Projects",value:e.stats.activeProjects,icon:Op,to:"/projects"}),o.jsx(st,{label:"In Progress",value:e.stats.inProgressAssignments,icon:EC,tone:"info",to:"/assignments?status=in_progress"}),o.jsx(st,{label:"Blocked",value:e.stats.blockedAssignments,icon:Qo,tone:"warn",to:"/assignments?status=blocked"}),o.jsx(st,{label:"Review",value:e.stats.reviewAssignments,icon:yC,tone:"info",to:"/assignments?status=review"}),o.jsx(st,{label:"Failed",value:e.stats.failedAssignments,icon:MC,tone:"danger",to:"/assignments?status=failed"}),o.jsx(st,{label:"Stale",value:e.stats.staleAssignments,icon:Oc,to:"/assignments?stale=1"}),o.jsx(st,{label:"Open Todos",value:l,icon:Un,to:"/todos"}),o.jsx(st,{label:"Active Servers",value:e.serverStats?e.serverStats.aliveSessions:"…",description:e.serverStats?`${e.serverStats.totalPorts} ports · ${e.serverStats.deadSessions>0?`${e.serverStats.deadSessions} dead`:"all healthy"}`:"connecting",icon:_p,tone:(c=e.serverStats)!=null&&c.deadSessions?"warn":"default",to:"/servers"})]}),o.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(360px,0.9fr)]",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ie,{title:"Needs Attention Now",description:"Blocked, failed, review, and stale work from the source files.",children:e.attention.length===0?o.jsx(tt,{title:"Nothing urgent right now",description:"The attention queue is empty. Overview will surface blocked, failed, review, and stale assignments here."}):o.jsx("div",{className:"space-y-3",children:e.attention.map(d=>o.jsxs(ye,{to:d.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40 hover:bg-background",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-semibold text-foreground",children:d.assignmentTitle}),o.jsx("p",{className:"text-sm text-muted-foreground",children:d.projectTitle})]}),o.jsx(Zt,{status:d.status})]}),o.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:d.reason}),o.jsxs("p",{className:"mt-2 text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:["Updated ",Rn(d.updated)]})]},d.id))})}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsx(Ie,{title:"Recently Updated Projects",children:e.recentProjects.length===0?o.jsx(tt,{title:"No projects yet",description:"Create your first project to populate the project directory, recent activity, and attention queue.",actions:o.jsx(ye,{className:"shell-action bg-foreground text-background hover:opacity-90",to:"/create/project",children:"Create Project"})}):o.jsx("div",{className:"space-y-3",children:e.recentProjects.map(d=>o.jsx(ye,{to:`/projects/${d.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-foreground",children:d.title}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:Rn(d.updated)})]}),o.jsx(Zt,{status:d.status})]})},d.slug))})}),o.jsx(Ie,{title:"Recent Activity",children:e.recentActivity.length===0?o.jsx(tt,{title:"No activity yet",description:"Once projects and assignments exist, Overview will show activity based on parsed source timestamps instead of file mtimes."}):o.jsx("div",{className:"space-y-3",children:e.recentActivity.map(d=>o.jsxs(ye,{to:d.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"font-semibold text-foreground",children:d.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:d.summary})]}),o.jsx("span",{className:"text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:Qt(d.type)})]}),o.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:Rn(d.updated)})]},d.id))})})]})]}),e.firstRun&&o.jsx(NT,{help:s})]})]})}function ET(){const{data:e,loading:t,error:n}=_2();return t?o.jsx(ot,{label:"Loading attention queue…"}):n||!e?o.jsx(Ze,{error:n||"Attention queue is unavailable."}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("header",{className:"space-y-2",children:[o.jsx("p",{className:"eyebrow",style:{color:"oklch(var(--secondary))"},children:"Needs Attention"}),o.jsx("h1",{className:"text-4xl font-semibold tracking-display text-foreground md:text-5xl",children:"Blocked, failed, and stale"}),o.jsx("p",{className:"max-w-2xl text-sm leading-6 text-muted-foreground",children:"Everything that needs a human or agent in the loop, ranked by severity and freshness."})]}),o.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsx(st,{label:"Critical",value:e.summary.critical,icon:CC,tone:"danger"}),o.jsx(st,{label:"High",value:e.summary.high,icon:Qo,tone:"warn"}),o.jsx(st,{label:"Medium",value:e.summary.medium,icon:UC,tone:"info"}),o.jsx(st,{label:"Low",value:e.summary.low,icon:TC})]}),o.jsx(Ie,{title:"Attention Queue",description:"Ordered by severity, then by the latest parsed source update.",children:e.items.length===0?o.jsx(tt,{title:"Attention queue is clear",description:"No blocked, failed, review, or stale assignments are currently surfacing from the source files."}):o.jsx("div",{className:"space-y-3",children:e.items.map(s=>o.jsxs(ye,{to:s.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:s.assignmentTitle}),o.jsx("p",{className:"text-sm text-muted-foreground",children:s.projectTitle})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:s.severity}),o.jsx(Zt,{status:s.status})]})]}),o.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:s.reason}),o.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Updated ",Rn(s.updated)]})]},s.id))})})]})}function PT({term:e,description:t}){return o.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 TT(){const{data:e,loading:t,error:n}=Wb(),{openCheatsheet:s}=As();return t?o.jsx(ot,{label:"Loading help…"}):n||!e?o.jsx(Ze,{error:n||"Help content is unavailable."}):o.jsxs("div",{className:"space-y-5",children:[o.jsx(Ie,{title:"Keyboard Shortcuts",description:"Navigate the dashboard without reaching for the mouse.",children:o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.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"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["or press ",o.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"?"})," ","anywhere. ",Tr("Mod+k")," opens the command palette."]})]})}),o.jsx(Ie,{title:"What Syntaur Is",description:e.whatIsSyntaur.summary,children:o.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.whatIsSyntaur.bullets.map(a=>o.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:a},a))})}),o.jsx(Ie,{title:"Getting Started",children:o.jsx("div",{className:"space-y-3",children:e.workflow.map((a,l)=>o.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.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}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),o.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?o.jsx(dc,{command:a.command.command,description:a.command.description,example:a.command.example}):null,a.href?o.jsx(ye,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})}),o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(Ie,{title:"Core Concepts",children:[o.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(a=>o.jsx(PT,{term:a.term,description:a.description},a.term))}),o.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(a=>o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.term}),o.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.term))})]}),o.jsx(Ie,{title:"Status Guide",children:o.jsx("div",{className:"space-y-3",children:e.statusGuide.map(a=>o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Zt,{status:a.status}),o.jsx("p",{className:"font-semibold text-foreground",children:a.meaning})]}),o.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:a.useWhen})]},a.status))})})]}),o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsx(Ie,{title:"Ownership And File Rules",children:o.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(a=>o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),o.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description}),o.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.files.map(l=>o.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 font-mono text-xs text-foreground",children:l},l))})]},a.label))})}),o.jsx(Ie,{title:"How To Navigate The Dashboard",children:o.jsx("div",{className:"space-y-3",children:e.navigation.map(a=>o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),o.jsx(ye,{className:"text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open"})]}),o.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.label))})})]}),o.jsx(Ie,{title:"CLI Quick Reference",children:o.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(a=>o.jsx(dc,{command:a.command,description:a.description,example:a.example},a.command))})}),o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsx(Ie,{title:"FAQ",children:o.jsx("div",{className:"space-y-3",children:e.faq.map(a=>o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.question}),o.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.answer})]},a.question))})}),o.jsx(Ie,{title:"First Project Checklist",children:o.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((a,l)=>o.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.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}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),o.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?o.jsx(dc,{command:a.command.command,example:a.command.example}):null,a.href?o.jsx(ye,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})})]})]})}function lh({children:e}){return o.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 Hc=g.forwardRef(({value:e,onChange:t,placeholder:n="Search"},s)=>o.jsxs("label",{className:"relative flex min-w-[220px] flex-1 items-center",children:[o.jsx(Rs,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),o.jsx("input",{ref:s,value:e,onChange:a=>t(a.target.value),placeholder:n,className:"h-9 w-full rounded-md border border-border/60 bg-background/90 pl-9 pr-3 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30"})]}));Hc.displayName="SearchInput";function ch({value:e,options:t,onChange:n}){return o.jsx("div",{className:"inline-flex rounded-md border border-border/60 bg-background/80 p-1",children:t.map(s=>o.jsx("button",{type:"button",onClick:()=>n(s.value),className:Be("rounded-sm px-2.5 py-1.5 text-sm font-medium transition",e===s.value?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}function $w({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:a,canDrop:l,onMove:c,emptyMessage:d="No cards in this column."}){const[p,m]=g.useState(null),[h,x]=g.useState(null),v=g.useRef(null),b=g.useMemo(()=>new Map(t.map(I=>[n(I),I])),[n,t]),C=g.useMemo(()=>e.map(I=>({column:I,items:t.filter(R=>s(R)===I.id)})),[e,s,t]),k=p?b.get(p)??null:null;function j(I){if(!k)return{allowed:!1};const R=s(k);return(l==null?void 0:l({item:k,fromColumnId:R,toColumnId:I}))??{allowed:!0}}function S(){m(null),x(null)}function T(I,R){c&&(I.dataTransfer.effectAllowed="move",I.dataTransfer.setData("text/plain",R),m(R))}function N(I,R,D){!c||!k||!j(R).allowed||(I.preventDefault(),I.dataTransfer.dropEffect="move",x(G=>(G==null?void 0:G.columnId)===R&&G.index===D?G:{columnId:R,index:D}))}async function A(I,R,D){var K;if(I.preventDefault(),!c||!k){S();return}const O=s(k),re=(((K=C.find(q=>q.column.id===O))==null?void 0:K.items)??[]).findIndex(q=>n(q)===n(k));if(!j(R).allowed||re<0){S();return}if(O===R&&(D===re||D===re+1)){S();return}try{await c({item:k,fromColumnId:O,toColumnId:R,fromIndex:re,toIndex:D})}finally{S()}}return o.jsx("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:o.jsx("div",{className:"grid min-w-max auto-cols-[minmax(260px,320px)] grid-flow-col gap-4",children:C.map(({column:I,items:R})=>{const D=j(I.id),O=(h==null?void 0:h.columnId)===I.id;return o.jsxs("section",{className:Be("flex min-h-[320px] flex-col rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",k&&!D.allowed?"border-dashed opacity-65":"",k&&D.allowed?"border-primary/30 bg-accent/30":"",O?"ring-2 ring-ring/30":""),title:k&&!D.allowed?D.reason:void 0,children:[o.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h2",{className:"text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:I.title}),I.description?o.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:I.description}):null]}),o.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs font-semibold text-foreground",children:R.length})]}),o.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:G=>N(G,I.id,R.length),onDrop:G=>A(G,I.id,R.length),children:[R.length===0?o.jsx(RT,{active:(h==null?void 0:h.columnId)===I.id&&h.index===0,disabled:!!k&&!D.allowed,children:typeof d=="function"?d(I):d}):null,R.map((G,re)=>{const z=n(G),K=p===z;return o.jsxs(g.Fragment,{children:[o.jsx("div",{className:Be("h-2 rounded-full transition",(h==null?void 0:h.columnId)===I.id&&h.index===re?"bg-primary/70":"bg-transparent"),onDragOver:q=>N(q,I.id,re),onDrop:q=>A(q,I.id,re)}),o.jsx("div",{draggable:!!c,onMouseDown:q=>{v.current=q.target},onDragStart:q=>{const J=v.current;if(J!=null&&J.closest("a, button")){q.preventDefault();return}T(q,z)},onDragEnd:S,className:Be("transition",c?"cursor-grab active:cursor-grabbing":"",K?"scale-[0.98] opacity-50":""),children:a(G,{dragging:K})})]},z)}),R.length>0?o.jsx("div",{className:Be("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(h==null?void 0:h.columnId)===I.id&&h.index===R.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",k&&!D.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},I.id)})})})}function RT({active:e,disabled:t,children:n}){return o.jsx("div",{className:Be("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 Fw={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 sa=null,Gs=null;function AT(){return sa?Promise.resolve(sa):Gs||(Gs=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(sa=e,Gs=null,e)).catch(()=>(Gs=null,Fw)),Gs)}function Wc(){const[e,t]=g.useState(()=>sa??Fw);return g.useEffect(()=>{AT().then(t)},[]),e}function py(){sa=null,Gs=null}function DT(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 LT={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"},hy=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function bc({progress:e,className:t,showLegend:n=!1}){const s=Wc(),a=g.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(p=>p!=="total")).map(p=>({key:p,className:LT[p]??hy[c++%hy.length]}))},[s.order,e]),l=a.filter(c=>(e[c.key]??0)>0);return o.jsxs("div",{className:Be("space-y-2",t),children:[o.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded-lg border border-border/70 bg-muted/60",children:e.total===0?o.jsx("div",{className:"h-full w-full bg-muted"}):l.map(c=>o.jsx("div",{className:c.className,style:{width:`${(e[c.key]??0)/e.total*100}%`},title:`${Qt(c.key)}: ${e[c.key]??0}`},c.key))}),n?o.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:a.map(c=>o.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-border/60 bg-background/80 px-2 py-1",children:[o.jsx("span",{className:Be("h-2 w-2 rounded-full",c.className)}),o.jsx("span",{children:Qt(c.key)}),o.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const IT=["pending","active","blocked","failed","completed","archived"],uh=IT,OT=["pending","in_progress","blocked","review","completed","failed"];function MT(e){return e&&e.length>0?e:[...OT]}function _T(e,t,n){if(t<0||t>=e.length)return e;const s=[...e],[a]=s.splice(t,1),l=t<n?n-1:n;return s.splice(Math.max(0,Math.min(l,s.length)),0,a),s}function my(){const{workspace:e}=mt(),t=_t(),n=St(),{data:s,loading:a,error:l,refetch:c}=Zo(),d=g.useRef(null);ro("list:projects");const[p,m]=g.useState(""),[h,x]=g.useState("all"),[v,b]=g.useState("active"),[C,k]=g.useState("all"),[j,S]=g.useState("updated"),[T,N]=Ir(),A=T.get("view"),I=A==="table"||A==="kanban"?A:"cards",R=F=>{N(B=>{const U=new URLSearchParams(B);return F==="cards"?U.delete("view"):U.set("view",F),U})},[D,O]=g.useState({}),G=g.useMemo(()=>s?s.filter(F=>{if(e){if(e==="_ungrouped"){if(F.workspace!==null)return!1}else if(F.workspace!==e)return!1}return v==="active"&&F.archived||v==="archived"&&!F.archived||h!=="all"&&F.status!==h||C!=="all"&&!F.tags.includes(C)?!1:p.trim()?`${F.title} ${F.tags.join(" ")} ${F.slug}`.toLowerCase().includes(p.toLowerCase()):!0}).sort((F,B)=>zT(F,B,j)):[],[s,p,h,v,C,j,e]),re=G.map(F=>`${F.slug}:${F.status}`).join("|");g.useEffect(()=>{O(BT(G))},[re,j]);const z=g.useMemo(()=>{const F=new Map(G.map(B=>[B.slug,B]));return uh.flatMap(B=>(D[B]??G.filter(Z=>Z.status===B).map(Z=>Z.slug)).map(Z=>F.get(Z)).filter(Z=>!!Z))},[G,D]),{visibleItems:K,visibleIndexByKey:q}=g.useMemo(()=>{const F=I==="kanban"?z:G,B=new Map;return F.forEach((U,Z)=>B.set(U.slug,Z)),{visibleItems:F,visibleIndexByKey:B}},[I,G,z]),{hotkeyRowProps:J}=Ta(K,{scope:"list:projects",onOpen:F=>n(`${t}/projects/${F.slug}`)});if(xt({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var F;return(F=d.current)==null?void 0:F.focus()}}),xt({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),a)return o.jsx(ot,{label:"Loading projects…"});if(l||!s)return o.jsx(Ze,{error:l||"Project list is unavailable."});const _=Array.from(new Set(s.flatMap(F=>F.tags))).sort();return o.jsxs("div",{className:"space-y-5",children:[o.jsxs(lh,{children:[o.jsx(Hc,{ref:d,value:p,onChange:m,placeholder:"Search by project title or tag"}),o.jsxs("select",{value:h,onChange:F=>x(F.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All statuses"}),o.jsx("option",{value:"pending",children:"Pending"}),o.jsx("option",{value:"active",children:"Active"}),o.jsx("option",{value:"blocked",children:"Blocked"}),o.jsx("option",{value:"failed",children:"Failed"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"archived",children:"Archived"})]}),o.jsxs("select",{value:v,onChange:F=>b(F.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"active",children:"Hide archived"}),o.jsx("option",{value:"all",children:"All projects"}),o.jsx("option",{value:"archived",children:"Archived only"})]}),o.jsxs("select",{value:C,onChange:F=>k(F.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All tags"}),_.map(F=>o.jsx("option",{value:F,children:F},F))]}),o.jsxs("select",{value:j,onChange:F=>S(F.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"updated",children:"Sort: Updated"}),o.jsx("option",{value:"created",children:"Sort: Created"}),o.jsx("option",{value:"title",children:"Sort: Title"}),o.jsx("option",{value:"attention",children:"Sort: Attention"})]}),o.jsx(ch,{value:I,onChange:F=>R(F),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),G.length===0?s.length===0?o.jsxs("div",{className:"rounded-frame border border-border/60 bg-card px-6 py-16 text-center",children:[o.jsx("p",{className:"eyebrow mx-auto justify-center",children:"Start here"}),o.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"}),o.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."}),o.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[o.jsx(ye,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),o.jsx(ye,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):o.jsx(tt,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:o.jsx(ye,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):I==="cards"?o.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:G.map((F,B)=>o.jsxs(ye,{to:`${t}/projects/${F.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...J(B),children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:F.title}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Ar(F.updated)]})]}),o.jsx(Zt,{status:F.status})]}),o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsx(bc,{progress:F.progress,showLegend:!0}),o.jsx("div",{className:"flex flex-wrap gap-2",children:F.tags.map(U=>o.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:U},U))}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsx("p",{className:"text-muted-foreground",children:"Needs attention"}),o.jsx("p",{className:"mt-1 font-semibold text-foreground",children:F.needsAttention.blockedCount+F.needsAttention.failedCount})]}),o.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[o.jsx("p",{className:"text-muted-foreground",children:"Assignments"}),o.jsx("p",{className:"mt-1 font-semibold text-foreground",children:F.progress.total})]})]})]})]},F.slug))}):I==="table"?o.jsx(Ie,{title:`${G.length} project${G.length===1?"":"s"}`,children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[o.jsx("th",{className:"pb-3 font-medium",children:"Project"}),o.jsx("th",{className:"pb-3 font-medium",children:"Status"}),o.jsx("th",{className:"pb-3 font-medium",children:"Progress"}),o.jsx("th",{className:"pb-3 font-medium",children:"Attention"}),o.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),o.jsx("tbody",{children:G.map((F,B)=>o.jsxs("tr",{className:"border-b border-border/50 last:border-0",...J(B),children:[o.jsxs("td",{className:"py-4 pr-4",children:[o.jsx(ye,{to:`${t}/projects/${F.slug}`,className:"font-semibold text-foreground hover:text-primary",children:F.title}),o.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:F.tags.map(U=>o.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:U},U))})]}),o.jsx("td",{className:"py-4 pr-4",children:o.jsx(Zt,{status:F.status})}),o.jsx("td",{className:"py-4 pr-4",children:o.jsx("div",{className:"min-w-[220px]",children:o.jsx(bc,{progress:F.progress})})}),o.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:F.needsAttention.blockedCount+F.needsAttention.failedCount}),o.jsx("td",{className:"py-4 text-muted-foreground",children:Ar(F.updated)})]},F.slug))})]})})}):o.jsx($w,{columns:FT,items:z,getItemId:F=>F.slug,getColumnId:F=>F.status,canDrop:({fromColumnId:F,toColumnId:B})=>({allowed:!0,reason:F===B?void 0:"This will set a manual status override on the project."}),onMove:({item:F,fromColumnId:B,toColumnId:U,fromIndex:Z,toIndex:P})=>{if(B===U){const M=D[B]??G.filter(Q=>Q.status===B).map(Q=>Q.slug);O(Q=>({...Q,[B]:_T(M,Z,P)}));return}fetch(`/api/projects/${F.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:U})}).then(()=>{window.location.reload()})},emptyMessage:F=>`No ${F.title.toLowerCase()} projects.`,renderCard:(F,{dragging:B})=>{const U=q.get(F.slug)??-1;return o.jsx("div",{...U>=0?J(U):{},children:o.jsx(UT,{project:F,dragging:B})})}}),o.jsx("div",{className:"rounded-lg border border-border/60 bg-card/80 p-3 text-sm text-muted-foreground",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(bb,{className:"mt-0.5 h-4 w-4"}),o.jsxs("p",{children:["Project status is derived from assignment state by default.",I==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const $T={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},FT=uh.map(e=>({id:e,title:$T[e],description:_w(e)}));function zT(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return gy(t)-gy(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function gy(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function BT(e){return Object.fromEntries(uh.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function UT({project:e,dragging:t}){const n=_t();return o.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(ye,{to:`${n}/projects/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Ar(e.updated)]})]}),o.jsx(Zt,{status:e.status})]}),o.jsx("div",{className:"mt-4",children:o.jsx(bc,{progress:e.progress})}),o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.tags.map(s=>o.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:s},s)),o.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.progress.total," assignments"]}),o.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"]})]}),o.jsx("div",{className:"mt-4 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:t?"Reordering within status":"Derived project lane"})]})}function Yr({value:e}){const[t,n]=g.useState(!1);function s(){navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}return o.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground",title:t?"Copied!":`Copy: ${e}`,children:t?o.jsx(Ea,{className:"h-3 w-3 text-status-completed-foreground"}):o.jsx(Mc,{className:"h-3 w-3"})})}const xy="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",yy="truncate";function dh({externalIds:e,className:t}){return e.length===0?null:o.jsx("span",{className:Be("flex flex-wrap items-center gap-1.5",t),children:e.map((n,s)=>{const a=`${n.system}:${n.id}`,l=`${n.system}:${n.id}:${s}`;return n.url!=null&&n.url.length>0?o.jsxs("a",{href:n.url??void 0,target:"_blank",rel:"noopener noreferrer",className:Be(xy,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${a} in ${n.system}`,children:[o.jsx("span",{className:yy,children:a}),o.jsx(Ip,{className:"h-2.5 w-2.5 shrink-0"})]},l):o.jsx("span",{className:xy,title:a,children:o.jsx("span",{className:yy,children:a})},l)})})}function vy(e){const t=HT(e),n=g.forwardRef((s,a)=>{const{children:l,...c}=s,d=g.Children.toArray(l),p=d.find(VT);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return o.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return o.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function HT(e){const t=g.forwardRef((n,s)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=KT(a),d=qT(l,a.props);return a.type!==g.Fragment&&(d.ref=s?Fc(s,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WT=Symbol("radix.slottable");function VT(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WT}function qT(e,t){const n={...t};for(const s in t){const a=e[s],l=t[s];/^on[A-Z]/.test(s)?a&&l?n[s]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[s]=a):s==="style"?n[s]={...a,...l}:s==="className"&&(n[s]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function KT(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function GT(e){const t=e+"CollectionProvider",[n,s]=Zs(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=k=>{const{scope:j,children:S}=k,T=Pt.useRef(null),N=Pt.useRef(new Map).current;return o.jsx(a,{scope:j,itemMap:N,collectionRef:T,children:S})};c.displayName=t;const d=e+"CollectionSlot",p=vy(d),m=Pt.forwardRef((k,j)=>{const{scope:S,children:T}=k,N=l(d,S),A=mn(j,N.collectionRef);return o.jsx(p,{ref:A,children:T})});m.displayName=d;const h=e+"CollectionItemSlot",x="data-radix-collection-item",v=vy(h),b=Pt.forwardRef((k,j)=>{const{scope:S,children:T,...N}=k,A=Pt.useRef(null),I=mn(j,A),R=l(h,S);return Pt.useEffect(()=>(R.itemMap.set(A,{ref:A,...N}),()=>void R.itemMap.delete(A))),o.jsx(v,{[x]:"",ref:I,children:T})});b.displayName=h;function C(k){const j=l(e+"CollectionConsumer",k);return Pt.useCallback(()=>{const T=j.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${x}]`));return Array.from(j.itemMap.values()).sort((R,D)=>N.indexOf(R.ref.current)-N.indexOf(D.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},C,s]}var YT=g.createContext(void 0);function zw(e){const t=g.useContext(YT);return e||t||"ltr"}var hf="rovingFocusGroup.onEntryFocus",XT={bubbles:!1,cancelable:!0},Ra="RovingFocusGroup",[np,Bw,QT]=GT(Ra),[JT,Uw]=Zs(Ra,[QT]),[ZT,eR]=JT(Ra),Hw=g.forwardRef((e,t)=>o.jsx(np.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(np.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(tR,{...e,ref:t})})}));Hw.displayName=Ra;var tR=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...x}=e,v=g.useRef(null),b=mn(t,v),C=zw(l),[k,j]=zc({prop:c,defaultProp:d??null,onChange:p,caller:Ra}),[S,T]=g.useState(!1),N=Xs(m),A=Bw(n),I=g.useRef(!1),[R,D]=g.useState(0);return g.useEffect(()=>{const O=v.current;if(O)return O.addEventListener(hf,N),()=>O.removeEventListener(hf,N)},[N]),o.jsx(ZT,{scope:n,orientation:s,dir:C,loop:a,currentTabStopId:k,onItemFocus:g.useCallback(O=>j(O),[j]),onItemShiftTab:g.useCallback(()=>T(!0),[]),onFocusableItemAdd:g.useCallback(()=>D(O=>O+1),[]),onFocusableItemRemove:g.useCallback(()=>D(O=>O-1),[]),children:o.jsx($t.div,{tabIndex:S||R===0?-1:0,"data-orientation":s,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:yt(e.onMouseDown,()=>{I.current=!0}),onFocus:yt(e.onFocus,O=>{const G=!I.current;if(O.target===O.currentTarget&&G&&!S){const re=new CustomEvent(hf,XT);if(O.currentTarget.dispatchEvent(re),!re.defaultPrevented){const z=A().filter(F=>F.focusable),K=z.find(F=>F.active),q=z.find(F=>F.id===k),_=[K,q,...z].filter(Boolean).map(F=>F.ref.current);qw(_,h)}}I.current=!1}),onBlur:yt(e.onBlur,()=>T(!1))})})}),Ww="RovingFocusGroupItem",Vw=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:l,children:c,...d}=e,p=$o(),m=l||p,h=eR(Ww,n),x=h.currentTabStopId===m,v=Bw(n),{onFocusableItemAdd:b,onFocusableItemRemove:C,currentTabStopId:k}=h;return g.useEffect(()=>{if(s)return b(),()=>C()},[s,b,C]),o.jsx(np.ItemSlot,{scope:n,id:m,focusable:s,active:a,children:o.jsx($t.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...d,ref:t,onMouseDown:yt(e.onMouseDown,j=>{s?h.onItemFocus(m):j.preventDefault()}),onFocus:yt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:yt(e.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){h.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const S=sR(j,h.orientation,h.dir);if(S!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let N=v().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const A=N.indexOf(j.currentTarget);N=h.loop?oR(N,A+1):N.slice(A+1)}setTimeout(()=>qw(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});Vw.displayName=Ww;var nR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sR(e,t,n){const s=rR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return nR[s]}function qw(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function oR(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var iR=Hw,aR=Vw,Vc="Tabs",[lR]=Zs(Vc,[Uw]),Kw=Uw(),[cR,fh]=lR(Vc),Gw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:p="automatic",...m}=e,h=zw(d),[x,v]=zc({prop:s,onChange:a,defaultProp:l??"",caller:Vc});return o.jsx(cR,{scope:n,baseId:$o(),value:x,onValueChange:v,orientation:c,dir:h,activationMode:p,children:o.jsx($t.div,{dir:h,"data-orientation":c,...m,ref:t})})});Gw.displayName=Vc;var Yw="TabsList",Xw=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,l=fh(Yw,n),c=Kw(n);return o.jsx(iR,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:o.jsx($t.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:t})})});Xw.displayName=Yw;var Qw="TabsTrigger",Jw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...l}=e,c=fh(Qw,n),d=Kw(n),p=t0(c.baseId,s),m=n0(c.baseId,s),h=s===c.value;return o.jsx(aR,{asChild:!0,...d,focusable:!a,active:h,children:o.jsx($t.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:p,...l,ref:t,onMouseDown:yt(e.onMouseDown,x=>{!a&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:yt(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:yt(e.onFocus,()=>{const x=c.activationMode!=="manual";!h&&!a&&x&&c.onValueChange(s)})})})});Jw.displayName=Qw;var Zw="TabsContent",e0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:a,children:l,...c}=e,d=fh(Zw,n),p=t0(d.baseId,s),m=n0(d.baseId,s),h=s===d.value,x=g.useRef(h);return g.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),o.jsx(eo,{present:a||h,children:({present:v})=>o.jsx($t.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":p,hidden:!v,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:v&&l})})});e0.displayName=Zw;function t0(e,t){return`${e}-trigger-${t}`}function n0(e,t){return`${e}-content-${t}`}var r0=Gw,s0=Xw,rp=Jw,sp=e0;function ph({value:e,onValueChange:t,items:n,className:s}){return o.jsxs(r0,{value:e,onValueChange:t,className:s,children:[o.jsx(s0,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(a=>o.jsxs(rp,{value:a.value,className:Be("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:[o.jsx("span",{children:a.label}),typeof a.count=="number"?o.jsx("span",{className:"rounded-full bg-background/20 px-2 py-0.5 text-xs data-[state=active]:bg-background/20",children:a.count}):null]},a.value))}),n.map(a=>o.jsx(sp,{value:a.value,className:"pt-3",children:a.content},a.value))]})}const uR="modulepreload",dR=function(e){return"/"+e},by={},fR=function(t,n,s){let a=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 d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(m=>{if(m=dR(m),m in by)return;by[m]=!0;const h=m.endsWith(".css"),x=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":uR,h||(v.as="script"),v.crossOrigin="",v.href=m,p&&v.setAttribute("nonce",p),document.head.appendChild(v),h)return new Promise((b,C)=>{v.addEventListener("load",b),v.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function pR({definition:e,className:t,nodeRoutes:n={}}){const s=g.useRef(null),[a,l]=g.useState(null),[c,d]=g.useState(!0),p=St(),m=document.documentElement.classList.contains("dark")?"dark":"default";return g.useEffect(()=>{let h=!1;async function x(){if(s.current)try{const v=(await fR(async()=>{const{default:k}=await import("./mermaid.core-DcZN9Xp2.js").then(j=>j.bF);return{default:k}},[])).default;if(v.initialize({startOnLoad:!1,theme:"base",themeVariables:hR(m==="dark")}),h)return;const b=`mermaid-${Date.now()}`,{svg:C}=await v.render(b,e);if(h||!s.current)return;s.current.innerHTML=C,mR(s.current,n,p),d(!1)}catch(v){h||(l(v instanceof Error?v.message:"Failed to render graph"),d(!1))}}return d(!0),l(null),x(),()=>{h=!0}},[e,p,n,m]),a?o.jsxs("div",{className:Be("rounded-lg border border-border bg-card p-4",t),children:[o.jsxs("p",{className:"text-sm text-error-foreground",children:["Failed to render dependency graph: ",a]}),o.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):o.jsxs("div",{className:Be("rounded-lg border border-border bg-card p-4",t),children:[c&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."}),o.jsx("div",{ref:s,className:"overflow-auto"})]})}function hR(e){const t=document.documentElement,n=x=>{const v=getComputedStyle(t).getPropertyValue(x).trim();return v?`oklch(${v})`:""},s=n("--card"),a=n("--card-foreground"),l=n("--border"),c=n("--primary"),d=n("--primary-foreground"),p=n("--muted"),m=n("--muted-foreground"),h=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:a,primaryBorderColor:l,secondaryColor:p,secondaryTextColor:a,secondaryBorderColor:l,tertiaryColor:p,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:a,mainBkg:s,nodeBkg:s,nodeTextColor:a,nodeBorder:l,clusterBkg:p,clusterBorder:l,edgeLabelBackground:s,titleColor:a,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:p,labelColor:a,errorBkgColor:h,errorTextColor:d}}function mR(e,t,n){var s;for(const a of e.querySelectorAll(".node")){const l=((s=a.textContent)==null?void 0:s.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;a.style.cursor="pointer",a.setAttribute("role","link"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`Open ${l}`);const d=()=>n(c);a.addEventListener("click",d),a.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())})}}function gR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vR={};function wy(e,t){return(vR.jsx?yR:xR).test(e)}const bR=/[ \t\n\f\r]/g;function wR(e){return typeof e=="object"?e.type==="text"?jy(e.value):!1:jy(e)}function jy(e){return e.replace(bR,"")===""}class Aa{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Aa.prototype.normal={};Aa.prototype.property={};Aa.prototype.space=void 0;function o0(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new Aa(n,s,t)}function op(e){return e.toLowerCase()}class Dn{constructor(t,n){this.attribute=n,this.property=t}}Dn.prototype.attribute="";Dn.prototype.booleanish=!1;Dn.prototype.boolean=!1;Dn.prototype.commaOrSpaceSeparated=!1;Dn.prototype.commaSeparated=!1;Dn.prototype.defined=!1;Dn.prototype.mustUseProperty=!1;Dn.prototype.number=!1;Dn.prototype.overloadedBoolean=!1;Dn.prototype.property="";Dn.prototype.spaceSeparated=!1;Dn.prototype.space=void 0;let jR=0;const We=so(),Ot=so(),ip=so(),he=so(),ct=so(),zo=so(),Fn=so();function so(){return 2**++jR}const ap=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:Ot,commaOrSpaceSeparated:Fn,commaSeparated:zo,number:he,overloadedBoolean:ip,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),mf=Object.keys(ap);class hh extends Dn{constructor(t,n,s,a){let l=-1;if(super(t,n),ky(this,"space",a),typeof s=="number")for(;++l<mf.length;){const c=mf[l];ky(this,mf[l],(s&ap[c])===ap[c])}}}hh.prototype.defined=!0;function ky(e,t,n){n&&(e[t]=n)}function ti(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const l=new hh(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[op(s)]=s,n[op(l.attribute)]=s}return new Aa(t,n,e.space)}const i0=ti({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:ct,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:he,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:ct,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Ot,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function a0(e,t){return t in e?e[t]:t}function l0(e,t){return a0(e,t.toLowerCase())}const kR=ti({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zo,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:ct,autoFocus:We,autoPlay:We,blocking:ct,capture:null,charSet:null,checked:We,cite:null,className:ct,cols:he,colSpan:null,content:null,contentEditable:Ot,controls:We,controlsList:ct,coords:he|zo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:ip,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:ct,height:he,hidden:ip,high:he,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:ct,itemRef:ct,itemScope:We,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,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:We,optimum:he,pattern:null,ping:ct,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:ct,required:We,reversed:We,rows:he,rowSpan:he,sandbox:ct,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:Ot,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Ot,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:l0}),SR=ti({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Fn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:ct,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:zo,g2:zo,glyphName:zo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:a0}),c0=ti({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),u0=ti({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:l0}),d0=ti({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NR={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"},CR=/[A-Z]/g,Sy=/-[a-z]/g,ER=/^data[-\w.:]+$/i;function PR(e,t){const n=op(t);let s=t,a=Dn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ER.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Sy,RR);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Sy.test(l)){let c=l.replace(CR,TR);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=hh}return new a(s,t)}function TR(e){return"-"+e.toLowerCase()}function RR(e){return e.charAt(1).toUpperCase()}const AR=o0([i0,kR,c0,u0,d0],"html"),mh=o0([i0,SR,c0,u0,d0],"svg");function DR(e){return e.join(" ").trim()}var Lo={},gf,Ny;function LR(){if(Ny)return gf;Ny=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
|
|
470
|
+
`,m="/",h="*",x="",v="comment",b="declaration";function C(j,S){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];S=S||{};var T=1,N=1;function A(J){var _=J.match(t);_&&(T+=_.length);var F=J.lastIndexOf(p);N=~F?J.length-F:N+J.length}function I(){var J={line:T,column:N};return function(_){return _.position=new R(J),G(),_}}function R(J){this.start=J,this.end={line:T,column:N},this.source=S.source}R.prototype.content=j;function D(J){var _=new Error(S.source+":"+T+":"+N+": "+J);if(_.reason=J,_.filename=S.source,_.line=T,_.column=N,_.source=j,!S.silent)throw _}function O(J){var _=J.exec(j);if(_){var F=_[0];return A(F),j=j.slice(F.length),_}}function G(){O(n)}function re(J){var _;for(J=J||[];_=z();)_!==!1&&J.push(_);return J}function z(){var J=I();if(!(m!=j.charAt(0)||h!=j.charAt(1))){for(var _=2;x!=j.charAt(_)&&(h!=j.charAt(_)||m!=j.charAt(_+1));)++_;if(_+=2,x===j.charAt(_-1))return D("End of comment missing");var F=j.slice(2,_-2);return N+=2,A(F),j=j.slice(_),N+=2,J({type:v,comment:F})}}function K(){var J=I(),_=O(s);if(_){if(z(),!O(a))return D("property missing ':'");var F=O(l),B=J({type:b,property:k(_[0].replace(e,x)),value:F?k(F[0].replace(e,x)):x});return O(c),B}}function q(){var J=[];re(J);for(var _;_=K();)_!==!1&&(J.push(_),re(J));return J}return G(),q()}function k(j){return j?j.replace(d,x):x}return gf=C,gf}var Cy;function IR(){if(Cy)return Lo;Cy=1;var e=Lo&&Lo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=n;const t=e(LR());function n(s,a){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),d=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;d?a(m,h,p):h&&(l=l||{},l[m]=h)}),l}return Lo}var Xi={},Ey;function OR(){if(Ey)return Xi;Ey=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},c=function(m,h){return h.toUpperCase()},d=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(a,d):m=m.replace(s,d),m.replace(t,c))};return Xi.camelCase=p,Xi}var Qi,Py;function MR(){if(Py)return Qi;Py=1;var e=Qi&&Qi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(IR()),n=OR();function s(a,l){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(d,p){d&&p&&(c[(0,n.camelCase)(d,l)]=p)}),c}return s.default=s,Qi=s,Qi}var _R=MR();const $R=Dc(_R),f0=p0("end"),gh=p0("start");function p0(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 FR(e){const t=gh(e),n=f0(e);if(t&&n)return{start:t,end:n}}function oa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ty(e.position):"start"in e||"end"in e?Ty(e):"line"in e||"column"in e?lp(e):""}function lp(e){return Ry(e&&e.line)+":"+Ry(e&&e.column)}function Ty(e){return lp(e&&e.start)+"-"+lp(e&&e.end)}function Ry(e){return e&&typeof e=="number"?e:1}class gn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(c=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const 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 d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=oa(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}}gn.prototype.file="";gn.prototype.name="";gn.prototype.reason="";gn.prototype.message="";gn.prototype.stack="";gn.prototype.column=void 0;gn.prototype.line=void 0;gn.prototype.ancestors=void 0;gn.prototype.cause=void 0;gn.prototype.fatal=void 0;gn.prototype.place=void 0;gn.prototype.ruleId=void 0;gn.prototype.source=void 0;const xh={}.hasOwnProperty,zR=new Map,BR=/[A-Z]/g,UR=new Set(["table","tbody","thead","tfoot","tr"]),HR=new Set(["td","th"]),h0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WR(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=JR(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=QR(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?mh:AR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=m0(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function m0(e,t,n){if(t.type==="element")return VR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return GR(e,t,n);if(t.type==="mdxjsEsm")return KR(e,t);if(t.type==="root")return YR(e,t,n);if(t.type==="text")return XR(e,t)}function VR(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=mh,e.schema=a),e.ancestors.push(t);const l=x0(e,t.tagName,!1),c=ZR(e,t);let d=vh(e,t);return UR.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!wR(p):!0})),g0(e,c,l,t),yh(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function qR(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)}va(e,t.position)}function KR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);va(e,t.position)}function GR(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=mh,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:x0(e,t.name,!0),c=eA(e,t),d=vh(e,t);return g0(e,c,l,t),yh(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function YR(e,t,n){const s={};return yh(s,vh(e,t)),e.create(t,e.Fragment,s,n)}function XR(e,t){return t.value}function g0(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function yh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QR(e,t,n){return s;function s(a,l,c,d){const m=Array.isArray(c.children)?n:t;return d?m(l,c,d):m(l,c)}}function JR(e,t){return n;function n(s,a,l,c){const d=Array.isArray(l.children),p=gh(s);return t(a,l,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function ZR(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&xh.call(t.properties,a)){const l=tA(e,a,t.properties[a]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&HR.has(t.tagName)?s=d:n[c]=d}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function eA(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.data.estree.body[0];l.type;const c=l.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else va(e,t.position);else{const a=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else va(e,t.position);else l=s.value===null?!0:s.value;n[a]=l}return n}function vh(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:zR;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=a.get(p)||0;c=p+"-"+m,a.set(p,m+1)}}const d=m0(e,l,c);d!==void 0&&n.push(d)}return n}function tA(e,t,n){const s=PR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?gR(n):DR(n)),s.property==="style"){let a=typeof n=="object"?n:nA(e,String(n));return e.stylePropertyNameCase==="css"&&(a=rA(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?NR[s.property]||s.property:s.attribute,n]}}function nA(e,t){try{return $R(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=h0+"#cannot-parse-style-attribute",a}}function x0(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,c;for(;++l<a.length;){const d=wy(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}s=c}else s=wy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return xh.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);va(e)}function va(e,t){const n=new gn("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=h0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function rA(e){const t={};let n;for(n in e)xh.call(e,n)&&(t[sA(n)]=e[n]);return t}function sA(e){let t=e.replace(BR,oA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oA(e){return"-"+e.toLowerCase()}const xf={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"]},iA={};function aA(e,t){const n=iA,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return y0(e,s,a)}function y0(e,t,n){if(lA(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 Ay(e.children,t,n)}return Array.isArray(e)?Ay(e,t,n):""}function Ay(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=y0(e[a],t,n);return s.join("")}function lA(e){return!!(e&&typeof e=="object")}const Dy=document.createElement("i");function bh(e){const t="&"+e+";";Dy.innerHTML=t;const n=Dy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dr(e,t,n,s){const a=e.length;let l=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<s.length;)c=s.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function Zn(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const Ly={}.hasOwnProperty;function cA(e){const t={};let n=-1;for(;++n<e.length;)uA(t,e[n]);return t}function uA(e,t){let n;for(n in t){const a=(Ly.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){Ly.call(a,c)||(a[c]=[]);const d=l[c];dA(a[c],Array.isArray(d)?d:d?[d]:[])}}}function dA(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Dr(e,0,0,s)}function v0(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 Bo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cr=Ds(/[A-Za-z]/),Bn=Ds(/[\dA-Za-z]/),fA=Ds(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const up=Ds(/\d/),pA=Ds(/[\dA-Fa-f]/),hA=Ds(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function An(e){return e!==null&&(e<0||e===32)}function nt(e){return e===-2||e===-1||e===32}const mA=Ds(new RegExp("\\p{P}|\\p{S}","u")),gA=Ds(/\s/);function Ds(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ni(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&Bn(e.charCodeAt(n+1))&&Bn(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(c=String.fromCharCode(l,d),a=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function ut(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return nt(p)?(e.enter(n),d(p)):t(p)}function d(p){return nt(p)&&l++<a?(e.consume(p),d):(e.exit(n),t(p))}}const xA={tokenize:yA};function yA(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ut(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),l(d)}function l(d){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Fe(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const vA={tokenize:bA},Iy={tokenize:wA};function bA(e){const t=this,n=[];let s=0,a,l,c;return d;function d(N){if(s<n.length){const A=n[s];return t.containerState=A[1],e.attempt(A[0].continuation,p,m)(N)}return m(N)}function p(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&T();const A=t.events.length;let I=A,R;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){R=t.events[I][1].end;break}S(s);let D=A;for(;D<t.events.length;)t.events[D][1].end={...R},D++;return Dr(t.events,I+1,0,t.events.slice(A)),t.events.length=D,m(N)}return d(N)}function m(N){if(s===n.length){if(!a)return v(N);if(a.currentConstruct&&a.currentConstruct.concrete)return C(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Iy,h,x)(N)}function h(N){return a&&T(),S(s),v(N)}function x(N){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,C(N)}function v(N){return t.containerState={},e.attempt(Iy,b,C)(N)}function b(N){return s++,n.push([t.currentConstruct,t.containerState]),v(N)}function C(N){if(N===null){a&&T(),S(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),k(N)}function k(N){if(N===null){j(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Fe(N)?(e.consume(N),j(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(N),k)}function j(N,A){const I=t.sliceStream(N);if(A&&I.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write(I),t.parser.lazy[N.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<c&&(!a.events[R][1].end||a.events[R][1].end.offset>c))return;const D=t.events.length;let O=D,G,re;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(G){re=t.events[O][1].end;break}G=!0}for(S(s),R=D;R<t.events.length;)t.events[R][1].end={...re},R++;Dr(t.events,O+1,0,t.events.slice(D)),t.events.length=R}}function S(N){let A=n.length;for(;A-- >N;){const I=n[A];t.containerState=I[1],I[0].exit.call(t,e)}n.length=N}function T(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function wA(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oy(e){if(e===null||An(e)||gA(e))return 1;if(mA(e))return 2}function wh(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!s.includes(l)&&(t=l(t,n),s.push(l))}return t}const dp={name:"attention",resolveAll:jA,tokenize:kA};function jA(e,t){let n=-1,s,a,l,c,d,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},v={...e[n][1].start};My(x,-p),My(v,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},l={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[s][1].end={...c.start},e[n][1].start={...d.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Zn(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Zn(m,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Zn(m,wh(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=Zn(m,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Zn(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Dr(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 kA(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Oy(s);let l;return c;function c(p){return l=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===l)return e.consume(p),d;const m=e.exit("attentionSequence"),h=Oy(p),x=!h||h===2&&a||n.includes(p),v=!a||a===2&&h||n.includes(s);return m._open=!!(l===42?x:x&&(a||!v)),m._close=!!(l===42?v:v&&(h||!x)),t(p)}}function My(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const SA={name:"autolink",tokenize:NA};function NA(e,t,n){let s=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Cr(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||Bn(b)?(s=1,d(b)):m(b)}function d(b){return b===58?(e.consume(b),s=0,p):(b===43||b===45||b===46||Bn(b))&&s++<32?(e.consume(b),d):(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||cp(b)?n(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),h):fA(b)?(e.consume(b),m):n(b)}function h(b){return Bn(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):v(b)}function v(b){if((b===45||Bn(b))&&s++<63){const C=b===45?v:x;return e.consume(b),C}return n(b)}}const qc={partial:!0,tokenize:CA};function CA(e,t,n){return s;function s(l){return nt(l)?ut(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Fe(l)?t(l):n(l)}}const b0={continuation:{tokenize:PA},exit:TA,name:"blockQuote",tokenize:EA};function EA(e,t,n){const s=this;return a;function a(c){if(c===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return nt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function PA(e,t,n){const s=this;return a;function a(c){return nt(c)?ut(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(b0,t,n)(c)}}function TA(e){e.exit("blockQuote")}const w0={name:"characterEscape",tokenize:RA};function RA(e,t,n){return s;function s(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return hA(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const j0={name:"characterReference",tokenize:AA};function AA(e,t,n){const s=this;let a=0,l,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),p}function p(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=Bn,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=pA,h):(e.enter("characterReferenceValue"),l=7,c=up,h(x))}function h(x){if(x===59&&a){const v=e.exit("characterReferenceValue");return c===Bn&&!bh(s.sliceSerialize(v))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&a++<l?(e.consume(x),h):n(x)}}const _y={partial:!0,tokenize:LA},$y={concrete:!0,name:"codeFenced",tokenize:DA};function DA(e,t,n){const s=this,a={partial:!0,tokenize:I};let l=0,c=0,d;return p;function p(R){return m(R)}function m(R){const D=s.events[s.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,d=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(R)}function h(R){return R===d?(c++,e.consume(R),h):c<3?n(R):(e.exit("codeFencedFenceSequence"),nt(R)?ut(e,x,"whitespace")(R):x(R))}function x(R){return R===null||Fe(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(_y,k,A)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Fe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(R)):nt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,b,"whitespace")(R)):R===96&&R===d?n(R):(e.consume(R),v)}function b(R){return R===null||Fe(R)?x(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Fe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(R)):R===96&&R===d?n(R):(e.consume(R),C)}function k(R){return e.attempt(a,A,j)(R)}function j(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return l>0&&nt(R)?ut(e,T,"linePrefix",l+1)(R):T(R)}function T(R){return R===null||Fe(R)?e.check(_y,k,A)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Fe(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),N)}function A(R){return e.exit("codeFenced"),t(R)}function I(R,D,O){let G=0;return re;function re(_){return R.enter("lineEnding"),R.consume(_),R.exit("lineEnding"),z}function z(_){return R.enter("codeFencedFence"),nt(_)?ut(R,K,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):K(_)}function K(_){return _===d?(R.enter("codeFencedFenceSequence"),q(_)):O(_)}function q(_){return _===d?(G++,R.consume(_),q):G>=c?(R.exit("codeFencedFenceSequence"),nt(_)?ut(R,J,"whitespace")(_):J(_)):O(_)}function J(_){return _===null||Fe(_)?(R.exit("codeFencedFence"),D(_)):O(_)}}}function LA(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const yf={name:"codeIndented",tokenize:OA},IA={partial:!0,tokenize:MA};function OA(e,t,n){const s=this;return a;function a(m){return e.enter("codeIndented"),ut(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):Fe(m)?e.attempt(IA,c,p)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Fe(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function p(m){return e.exit("codeIndented"),t(m)}}function MA(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):ut(e,l,"linePrefix",5)(c)}function l(c){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Fe(c)?a(c):n(c)}}const _A={name:"codeText",previous:FA,resolve:$A,tokenize:zA};function $A(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function FA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zA(e,t,n){let s=0,a,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),s++,d):(e.exit("codeTextSequence"),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"),a=0,h(x)):Fe(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||Fe(x)?(e.exit("codeTextData"),p(x)):(e.consume(x),m)}function h(x){return x===96?(e.consume(x),a++,h):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class BA{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&Ji(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),Ji(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ji(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);Ji(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ji(this.left,n.reverse())}}}function Ji(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 k0(e){const t={};let n=-1,s,a,l,c,d,p,m;const h=new BA(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,UA(h,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,a=void 0;l--;)if(c=h.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...h.get(a)[1].start},d=h.slice(a,n),d.unshift(s),h.splice(a,n-a+1,d))}}return Dr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function UA(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const l=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,p=[],m={};let h,x,v=-1,b=n,C=0,k=0;const j=[k];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),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;++v<d.length;)d[v][0]==="exit"&&d[v-1][0]==="enter"&&d[v][1].type===d[v-1][1].type&&d[v][1].start.line!==d[v][1].end.line&&(k=v+1,j.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):j.pop(),v=j.length;v--;){const S=d.slice(j[v],j[v+1]),T=l.pop();p.push([T,T+S.length-1]),e.splice(T,2,S)}for(p.reverse(),v=-1;++v<p.length;)m[C+p[v][0]]=C+p[v][1],C+=p[v][1]-p[v][0]-1;return m}const HA={resolve:VA,tokenize:qA},WA={partial:!0,tokenize:KA};function VA(e){return k0(e),e}function qA(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?l(d):Fe(d)?e.check(WA,c,l)(d):(e.consume(d),a)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function KA(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ut(e,l,"linePrefix")}function l(c){if(c===null||Fe(c))return n(c);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function S0(e,t,n,s,a,l,c,d,p){const m=p||Number.POSITIVE_INFINITY;let h=0;return x;function x(S){return S===60?(e.enter(s),e.enter(a),e.enter(l),e.consume(S),e.exit(l),v):S===null||S===32||S===41||cp(S)?n(S):(e.enter(s),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(S))}function v(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(d),v(S)):S===null||S===60||Fe(S)?n(S):(e.consume(S),S===92?C:b)}function C(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function k(S){return!h&&(S===null||S===41||An(S))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(s),t(S)):h<m&&S===40?(e.consume(S),h++,k):S===41?(e.consume(S),h--,k):S===null||S===32||S===40||cp(S)?n(S):(e.consume(S),S===92?j:k)}function j(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function N0(e,t,n,s,a,l){const c=this;let d=0,p;return m;function m(b){return e.enter(s),e.enter(a),e.consume(b),e.exit(a),e.enter(l),h}function h(b){return d>999||b===null||b===91||b===93&&!p||b===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(s),t):Fe(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||Fe(b)||d++>999?(e.exit("chunkString"),h(b)):(e.consume(b),p||(p=!nt(b)),b===92?v:x)}function v(b){return b===91||b===92||b===93?(e.consume(b),d++,x):x(b)}}function C0(e,t,n,s,a,l){let c;return d;function d(v){return v===34||v===39||v===40?(e.enter(s),e.enter(a),e.consume(v),e.exit(a),c=v===40?41:v,p):n(v)}function p(v){return v===c?(e.enter(a),e.consume(v),e.exit(a),e.exit(s),t):(e.enter(l),m(v))}function m(v){return v===c?(e.exit(l),p(c)):v===null?n(v):Fe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),ut(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===c||v===null||Fe(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?x:h)}function x(v){return v===c||v===92?(e.consume(v),h):h(v)}}function ia(e,t){let n;return s;function s(a){return Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):nt(a)?ut(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const GA={name:"definition",tokenize:XA},YA={partial:!0,tokenize:QA};function XA(e,t,n){const s=this;let a;return l;function l(b){return e.enter("definition"),c(b)}function c(b){return N0.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=Bo(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 An(b)?ia(e,m)(b):m(b)}function m(b){return S0(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(YA,x,x)(b)}function x(b){return nt(b)?ut(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Fe(b)?(e.exit("definition"),s.parser.defined.push(a),t(b)):n(b)}}function QA(e,t,n){return s;function s(d){return An(d)?ia(e,a)(d):n(d)}function a(d){return C0(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return nt(d)?ut(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Fe(d)?t(d):n(d)}}const JA={name:"hardBreakEscape",tokenize:ZA};function ZA(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Fe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const e3={name:"headingAtx",resolve:t3,tokenize:n3};function t3(e,t){let n=e.length-2,s=3,a,l;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},l={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Dr(e,s,n-s+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function n3(e,t,n){let s=0;return a;function a(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||An(h)?(e.exit("atxHeadingSequence"),d(h)):n(h)}function d(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||Fe(h)?(e.exit("atxHeading"),t(h)):nt(h)?ut(e,d,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function p(h){return h===35?(e.consume(h),p):(e.exit("atxHeadingSequence"),d(h))}function m(h){return h===null||h===35||An(h)?(e.exit("atxHeadingText"),d(h)):(e.consume(h),m)}}const r3=["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"],Fy=["pre","script","style","textarea"],s3={concrete:!0,name:"htmlFlow",resolveTo:a3,tokenize:l3},o3={partial:!0,tokenize:u3},i3={partial:!0,tokenize:c3};function a3(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 l3(e,t,n){const s=this;let a,l,c,d,p;return m;function m(L){return h(L)}function h(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),x}function x(L){return L===33?(e.consume(L),v):L===47?(e.consume(L),l=!0,k):L===63?(e.consume(L),a=3,s.interrupt?t:P):Cr(L)?(e.consume(L),c=String.fromCharCode(L),j):n(L)}function v(L){return L===45?(e.consume(L),a=2,b):L===91?(e.consume(L),a=5,d=0,C):Cr(L)?(e.consume(L),a=4,s.interrupt?t:P):n(L)}function b(L){return L===45?(e.consume(L),s.interrupt?t:P):n(L)}function C(L){const ge="CDATA[";return L===ge.charCodeAt(d++)?(e.consume(L),d===ge.length?s.interrupt?t:K:C):n(L)}function k(L){return Cr(L)?(e.consume(L),c=String.fromCharCode(L),j):n(L)}function j(L){if(L===null||L===47||L===62||An(L)){const ge=L===47,Ne=c.toLowerCase();return!ge&&!l&&Fy.includes(Ne)?(a=1,s.interrupt?t(L):K(L)):r3.includes(c.toLowerCase())?(a=6,ge?(e.consume(L),S):s.interrupt?t(L):K(L)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(L):l?T(L):N(L))}return L===45||Bn(L)?(e.consume(L),c+=String.fromCharCode(L),j):n(L)}function S(L){return L===62?(e.consume(L),s.interrupt?t:K):n(L)}function T(L){return nt(L)?(e.consume(L),T):re(L)}function N(L){return L===47?(e.consume(L),re):L===58||L===95||Cr(L)?(e.consume(L),A):nt(L)?(e.consume(L),N):re(L)}function A(L){return L===45||L===46||L===58||L===95||Bn(L)?(e.consume(L),A):I(L)}function I(L){return L===61?(e.consume(L),R):nt(L)?(e.consume(L),I):N(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),p=L,D):nt(L)?(e.consume(L),R):O(L)}function D(L){return L===p?(e.consume(L),p=null,G):L===null||Fe(L)?n(L):(e.consume(L),D)}function O(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||An(L)?I(L):(e.consume(L),O)}function G(L){return L===47||L===62||nt(L)?N(L):n(L)}function re(L){return L===62?(e.consume(L),z):n(L)}function z(L){return L===null||Fe(L)?K(L):nt(L)?(e.consume(L),z):n(L)}function K(L){return L===45&&a===2?(e.consume(L),F):L===60&&a===1?(e.consume(L),B):L===62&&a===4?(e.consume(L),M):L===63&&a===3?(e.consume(L),P):L===93&&a===5?(e.consume(L),Z):Fe(L)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(o3,Q,q)(L)):L===null||Fe(L)?(e.exit("htmlFlowData"),q(L)):(e.consume(L),K)}function q(L){return e.check(i3,J,Q)(L)}function J(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),_}function _(L){return L===null||Fe(L)?q(L):(e.enter("htmlFlowData"),K(L))}function F(L){return L===45?(e.consume(L),P):K(L)}function B(L){return L===47?(e.consume(L),c="",U):K(L)}function U(L){if(L===62){const ge=c.toLowerCase();return Fy.includes(ge)?(e.consume(L),M):K(L)}return Cr(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),U):K(L)}function Z(L){return L===93?(e.consume(L),P):K(L)}function P(L){return L===62?(e.consume(L),M):L===45&&a===2?(e.consume(L),P):K(L)}function M(L){return L===null||Fe(L)?(e.exit("htmlFlowData"),Q(L)):(e.consume(L),M)}function Q(L){return e.exit("htmlFlow"),t(L)}}function c3(e,t,n){const s=this;return a;function a(c){return Fe(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 u3(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(qc,t,n)}}const d3={name:"htmlText",tokenize:f3};function f3(e,t,n){const s=this;let a,l,c;return d;function d(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),I):P===63?(e.consume(P),N):Cr(P)?(e.consume(P),O):n(P)}function m(P){return P===45?(e.consume(P),h):P===91?(e.consume(P),l=0,C):Cr(P)?(e.consume(P),T):n(P)}function h(P){return P===45?(e.consume(P),b):n(P)}function x(P){return P===null?n(P):P===45?(e.consume(P),v):Fe(P)?(c=x,B(P)):(e.consume(P),x)}function v(P){return P===45?(e.consume(P),b):x(P)}function b(P){return P===62?F(P):P===45?v(P):x(P)}function C(P){const M="CDATA[";return P===M.charCodeAt(l++)?(e.consume(P),l===M.length?k:C):n(P)}function k(P){return P===null?n(P):P===93?(e.consume(P),j):Fe(P)?(c=k,B(P)):(e.consume(P),k)}function j(P){return P===93?(e.consume(P),S):k(P)}function S(P){return P===62?F(P):P===93?(e.consume(P),S):k(P)}function T(P){return P===null||P===62?F(P):Fe(P)?(c=T,B(P)):(e.consume(P),T)}function N(P){return P===null?n(P):P===63?(e.consume(P),A):Fe(P)?(c=N,B(P)):(e.consume(P),N)}function A(P){return P===62?F(P):N(P)}function I(P){return Cr(P)?(e.consume(P),R):n(P)}function R(P){return P===45||Bn(P)?(e.consume(P),R):D(P)}function D(P){return Fe(P)?(c=D,B(P)):nt(P)?(e.consume(P),D):F(P)}function O(P){return P===45||Bn(P)?(e.consume(P),O):P===47||P===62||An(P)?G(P):n(P)}function G(P){return P===47?(e.consume(P),F):P===58||P===95||Cr(P)?(e.consume(P),re):Fe(P)?(c=G,B(P)):nt(P)?(e.consume(P),G):F(P)}function re(P){return P===45||P===46||P===58||P===95||Bn(P)?(e.consume(P),re):z(P)}function z(P){return P===61?(e.consume(P),K):Fe(P)?(c=z,B(P)):nt(P)?(e.consume(P),z):G(P)}function K(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,q):Fe(P)?(c=K,B(P)):nt(P)?(e.consume(P),K):(e.consume(P),J)}function q(P){return P===a?(e.consume(P),a=void 0,_):P===null?n(P):Fe(P)?(c=q,B(P)):(e.consume(P),q)}function J(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||An(P)?G(P):(e.consume(P),J)}function _(P){return P===47||P===62||An(P)?G(P):n(P)}function F(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function B(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return nt(P)?ut(e,Z,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):Z(P)}function Z(P){return e.enter("htmlTextData"),c(P)}}const jh={name:"labelEnd",resolveAll:g3,resolveTo:x3,tokenize:y3},p3={tokenize:v3},h3={tokenize:b3},m3={tokenize:w3};function g3(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&Dr(e,0,e.length,n),e}function x3(e,t){let n=e.length,s=0,a,l,c,d;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const 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 d=[["enter",p,t],["enter",m,t]],d=Zn(d,e.slice(l+1,l+s+3)),d=Zn(d,[["enter",h,t]]),d=Zn(d,wh(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),d=Zn(d,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),d=Zn(d,e.slice(c+1)),d=Zn(d,[["exit",p,t]]),Dr(e,l,e.length,d),e}function y3(e,t,n){const s=this;let a=s.events.length,l,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){l=s.events[a][1];break}return d;function d(v){return l?l._inactive?x(v):(c=s.parser.defined.includes(Bo(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):n(v)}function p(v){return v===40?e.attempt(p3,h,c?h:x)(v):v===91?e.attempt(h3,h,c?m:x)(v):c?h(v):x(v)}function m(v){return e.attempt(m3,h,x)(v)}function h(v){return t(v)}function x(v){return l._balanced=!0,n(v)}}function v3(e,t,n){return s;function s(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),a}function a(x){return An(x)?ia(e,l)(x):l(x)}function l(x){return x===41?h(x):S0(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return An(x)?ia(e,p)(x):h(x)}function d(x){return n(x)}function p(x){return x===34||x===39||x===40?C0(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):h(x)}function m(x){return An(x)?ia(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 b3(e,t,n){const s=this;return a;function a(d){return N0.call(s,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return s.parser.defined.includes(Bo(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function w3(e,t,n){return s;function s(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const j3={name:"labelStartImage",resolveAll:jh.resolveAll,tokenize:k3};function k3(e,t,n){const s=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):t(d)}}const S3={name:"labelStartLink",resolveAll:jh.resolveAll,tokenize:N3};function N3(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const vf={name:"lineEnding",tokenize:C3};function C3(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const fc={name:"thematicBreak",tokenize:E3};function E3(e,t,n){let s=0,a;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return a=m,d(m)}function d(m){return m===a?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||Fe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===a?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),nt(m)?ut(e,d,"whitespace")(m):d(m))}}const En={continuation:{tokenize:A3},exit:L3,name:"list",tokenize:R3},P3={partial:!0,tokenize:I3},T3={partial:!0,tokenize:D3};function R3(e,t,n){const s=this,a=s.events[s.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return d;function d(b){const C=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:up(b)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(fc,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 up(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(qc,s.interrupt?n:h,e.attempt(P3,v,x))}function h(b){return s.containerState.initialBlankLine=!0,l++,v(b)}function x(b){return nt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function A3(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(qc,a,l);function a(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,ut(e,t,"listItemIndent",s.containerState.size+1)(d)}function l(d){return s.containerState.furtherBlankLines||!nt(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(T3,t,c)(d))}function c(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,ut(e,e.attempt(En,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function D3(e,t,n){const s=this;return ut(e,a,"listItemIndent",s.containerState.size+1);function a(l){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(l):n(l)}}function L3(e){e.exit(this.containerState.type)}function I3(e,t,n){const s=this;return ut(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const c=s.events[s.events.length-1];return!nt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const zy={name:"setextUnderline",resolveTo:O3,tokenize:M3};function O3(e,t){let n=e.length,s,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",c,t]),e.splice(l+1,0,["exit",e[s][1],t]),e[s][1].end={...e[l][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function M3(e,t,n){const s=this;let a;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"),a=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===a?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),nt(m)?ut(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Fe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const _3={tokenize:$3};function $3(e){const t=this,n=e.attempt(qc,s,e.attempt(this.parser.constructs.flowInitial,a,ut(e,e.attempt(this.parser.constructs.flow,a,e.attempt(HA,a)),"linePrefix")));return n;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const F3={resolveAll:P0()},z3=E0("string"),B3=E0("text");function E0(e){return{resolveAll:P0(e==="text"?U3:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],l=n.attempt(a,c,d);return c;function c(h){return m(h)?l(h):d(h)}function d(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=a[h];let v=-1;if(x)for(;++v<x.length;){const b=x[v];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function P0(e){return t;function t(n,s){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,s):n}}function U3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],a=t.sliceStream(s);let l=a.length,c=-1,d=0,p;for(;l--;){const m=a[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)p=!0,d++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const H3={42:En,43:En,45:En,48:En,49:En,50:En,51:En,52:En,53:En,54:En,55:En,56:En,57:En,62:b0},W3={91:GA},V3={[-2]:yf,[-1]:yf,32:yf},q3={35:e3,42:fc,45:[zy,fc],60:s3,61:zy,95:fc,96:$y,126:$y},K3={38:j0,92:w0},G3={[-5]:vf,[-4]:vf,[-3]:vf,33:j3,38:j0,42:dp,60:[SA,d3],91:S3,92:[JA,w0],93:jh,95:dp,96:_A},Y3={null:[dp,F3]},X3={null:[42,95]},Q3={null:[]},J3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:X3,contentInitial:W3,disable:Q3,document:H3,flow:q3,flowInitial:V3,insideSpan:Y3,string:K3,text:G3},Symbol.toStringTag,{value:"Module"}));function Z3(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let c=[],d=[];const p={attempt:D(I),check:D(R),consume:T,enter:N,exit:A,interrupt:D(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:k,events:[],now:C,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:x};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function x(z){return c=Zn(c,z),j(),c[c.length-1]!==null?[]:(O(t,0),m.events=wh(l,m.events,m),m.events)}function v(z,K){return t4(b(z),K)}function b(z){return e4(c,z)}function C(){const{_bufferIndex:z,_index:K,line:q,column:J,offset:_}=s;return{_bufferIndex:z,_index:K,line:q,column:J,offset:_}}function k(z){a[z.line]=z.column,re()}function j(){let z;for(;s._index<c.length;){const K=c[s._index];if(typeof K=="string")for(z=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===z&&s._bufferIndex<K.length;)S(K.charCodeAt(s._bufferIndex));else S(K)}}function S(z){h=h(z)}function T(z){Fe(z)?(s.line++,s.column=1,s.offset+=z===-3?2:1,re()):z!==-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=z}function N(z,K){const q=K||{};return q.type=z,q.start=C(),m.events.push(["enter",q,m]),d.push(q),q}function A(z){const K=d.pop();return K.end=C(),m.events.push(["exit",K,m]),K}function I(z,K){O(z,K.from)}function R(z,K){K.restore()}function D(z,K){return q;function q(J,_,F){let B,U,Z,P;return Array.isArray(J)?Q(J):"tokenize"in J?Q([J]):M(J);function M(te){return fe;function fe(be){const je=be!==null&&te[be],we=be!==null&&te.null,Ye=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(we)?we:we?[we]:[]];return Q(Ye)(be)}}function Q(te){return B=te,U=0,te.length===0?F:L(te[U])}function L(te){return fe;function fe(be){return P=G(),Z=te,te.partial||(m.currentConstruct=te),te.name&&m.parser.constructs.disable.null.includes(te.name)?Ne():te.tokenize.call(K?Object.assign(Object.create(m),K):m,p,ge,Ne)(be)}}function ge(te){return z(Z,P),_}function Ne(te){return P.restore(),++U<B.length?L(B[U]):F}}}function O(z,K){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Dr(m.events,K,m.events.length-K,z.resolve(m.events.slice(K),m)),z.resolveTo&&(m.events=z.resolveTo(m.events,m))}function G(){const z=C(),K=m.previous,q=m.currentConstruct,J=m.events.length,_=Array.from(d);return{from:J,restore:F};function F(){s=z,m.previous=K,m.currentConstruct=q,m.events.length=J,d=_,re()}}function re(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function e4(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,l)];else{if(c=e.slice(n,a),s>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(s):c.shift()}l>0&&c.push(e[a].slice(0,l))}return c}function t4(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const l=e[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
471
|
+
`;break}case-3:{c=`\r
|
|
472
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(l)}a=l===-2,s.push(c)}return s.join("")}function n4(e){const s={constructs:cA([J3,...(e||{}).extensions||[]]),content:a(xA),defined:[],document:a(vA),flow:a(_3),lazy:{},string:a(z3),text:a(B3)};return s;function a(l){return c;function c(d){return Z3(s,l,d)}}}function r4(e){for(;!k0(e););return e}const By=/[\0\t\n\r]/g;function s4(){let e=1,t="",n=!0,s;return a;function a(l,c,d){const p=[];let m,h,x,v,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(By.lastIndex=x,m=By.exec(l),v=m&&m.index!==void 0?m.index:l.length,b=l.charCodeAt(v),!m){t=l.slice(x);break}if(b===10&&x===v&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),x<v&&(p.push(l.slice(x,v)),e+=v-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=v+1}return d&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const o4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function i4(e){return e.replace(o4,a4)}function a4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return v0(n.slice(l?2:1),l?16:10)}return bh(n)||e}const T0={}.hasOwnProperty;function l4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),c4(n)(r4(n4(n).document().write(s4()(e,t,!0))))}function c4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ue),autolinkProtocol:G,autolinkEmail:G,atxHeading:l(ae),blockQuote:l(we),characterEscape:G,characterReference:G,codeFenced:l(Ye),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(Ye,c),codeText:l(Xe,c),codeTextData:G,data:G,codeFlowValue:G,definition:l(ne),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Y),hardBreakEscape:l(xe),hardBreakTrailing:l(xe),htmlFlow:l(qe,c),htmlFlowData:G,htmlText:l(qe,c),htmlTextData:G,image:l(Oe),label:c,link:l(Ue),listItem:l(Nt),listItemValue:v,listOrdered:l(Ge,x),listUnordered:l(Ge),paragraph:l(Ct),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ae),strong:l(Lt),thematicBreak:l(Tt)},exit:{atxHeading:p(),atxHeadingSequence:I,autolink:p(),autolinkEmail:je,autolinkProtocol:be,blockQuote:p(),characterEscapeValue:re,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:te,characterReference:fe,codeFenced:p(j),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:C,codeFlowValue:re,codeIndented:p(S),codeText:p(_),codeTextData:re,data:re,definition:p(),definitionDestinationString:A,definitionLabelString:T,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(K),hardBreakTrailing:p(K),htmlFlow:p(q),htmlFlowData:re,htmlText:p(J),htmlTextData:re,image:p(B),label:Z,labelText:U,lineEnding:z,link:p(F),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ge,resourceDestinationString:P,resourceTitleString:M,resource:Q,setextHeading:p(O),setextHeadingLineSequence:D,setextHeadingText:R,strong:p(),thematicBreak:p()}};R0(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ie){let ce={type:"root",children:[]};const ve={stack:[ce],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:h,data:n},oe=[];let Ce=-1;for(;++Ce<ie.length;)if(ie[Ce][1].type==="listOrdered"||ie[Ce][1].type==="listUnordered")if(ie[Ce][0]==="enter")oe.push(Ce);else{const Ae=oe.pop();Ce=a(ie,Ae,Ce)}for(Ce=-1;++Ce<ie.length;){const Ae=t[ie[Ce][0]];T0.call(Ae,ie[Ce][1].type)&&Ae[ie[Ce][1].type].call(Object.assign({sliceSerialize:ie[Ce][2].sliceSerialize},ve),ie[Ce][1])}if(ve.tokenStack.length>0){const Ae=ve.tokenStack[ve.tokenStack.length-1];(Ae[1]||Uy).call(ve,void 0,Ae[0])}for(ce.position={start:js(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:js(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)ce=t.transforms[Ce](ce)||ce;return ce}function a(ie,ce,ve){let oe=ce-1,Ce=-1,Ae=!1,qt,an,tn,V;for(;++oe<=ve;){const pe=ie[oe];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?Ce++:Ce--,V=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(qt&&!V&&!Ce&&!tn&&(tn=oe),V=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:V=void 0}if(!Ce&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||Ce===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(qt){let Ee=oe;for(an=void 0;Ee--;){const ze=ie[Ee];if(ze[1].type==="lineEnding"||ze[1].type==="lineEndingBlank"){if(ze[0]==="exit")continue;an&&(ie[an][1].type="lineEndingBlank",Ae=!0),ze[1].type="lineEnding",an=Ee}else if(!(ze[1].type==="linePrefix"||ze[1].type==="blockQuotePrefix"||ze[1].type==="blockQuotePrefixWhitespace"||ze[1].type==="blockQuoteMarker"||ze[1].type==="listItemIndent"))break}tn&&(!an||tn<an)&&(qt._spread=!0),qt.end=Object.assign({},an?ie[an][1].start:pe[1].end),ie.splice(an||oe,0,["exit",qt,pe[2]]),oe++,ve++}if(pe[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};qt=Ee,ie.splice(oe,0,["enter",Ee,pe[2]]),oe++,ve++,tn=void 0,V=!0}}}return ie[ce][1]._spread=Ae,ve}function l(ie,ce){return ve;function ve(oe){d.call(this,ie(oe),oe),ce&&ce.call(this,oe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(ie,ce,ve){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ce,ve||void 0]),ie.position={start:js(ce.start),end:void 0}}function p(ie){return ce;function ce(ve){ie&&ie.call(this,ve),m.call(this,ve)}}function m(ie,ce){const ve=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==ie.type&&(ce?ce.call(this,ie,oe[0]):(oe[1]||Uy).call(this,ie,oe[0]));else throw new Error("Cannot close `"+ie.type+"` ("+oa({start:ie.start,end:ie.end})+"): it’s not open");ve.position.end=js(ie.end)}function h(){return aA(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function v(ie){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ie}function C(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ie}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/(\r?\n|\r)$/g,"")}function T(ie){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=Bo(this.sliceSerialize(ie)).toLowerCase()}function N(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function A(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function I(ie){const ce=this.stack[this.stack.length-1];if(!ce.depth){const ve=this.sliceSerialize(ie).length;ce.depth=ve}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ie){const ve=this.stack[this.stack.length-1].children;let oe=ve[ve.length-1];(!oe||oe.type!=="text")&&(oe=en(),oe.position={start:js(ie.start),end:void 0},ve.push(oe)),this.stack.push(oe)}function re(ie){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ie),ce.position.end=js(ie.end)}function z(ie){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=ce.children[ce.children.length-1];ve.position.end=js(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(G.call(this,ie),re.call(this,ie))}function K(){this.data.atHardBreak=!0}function q(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function J(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function _(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function F(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function B(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function U(ie){const ce=this.sliceSerialize(ie),ve=this.stack[this.stack.length-2];ve.label=i4(ce),ve.identifier=Bo(ce).toLowerCase()}function Z(){const ie=this.stack[this.stack.length-1],ce=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const oe=ie.children;ve.children=oe}else ve.alt=ce}function P(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function M(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function Q(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ge(ie){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=Bo(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function Ne(ie){this.data.characterReferenceType=ie.type}function te(ie){const ce=this.sliceSerialize(ie),ve=this.data.characterReferenceType;let oe;ve?(oe=v0(ce,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=bh(ce);const Ce=this.stack[this.stack.length-1];Ce.value+=oe}function fe(ie){const ce=this.stack.pop();ce.position.end=js(ie.end)}function be(ie){re.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ie)}function je(ie){re.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ie)}function we(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function Xe(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function qe(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Ue(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Nt(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ct(){return{type:"paragraph",children:[]}}function Lt(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function Tt(){return{type:"thematicBreak"}}}function js(e){return{line:e.line,column:e.column,offset:e.offset}}function R0(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?R0(e,s):u4(e,s)}}function u4(e,t){let n;for(n in t)if(T0.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 Uy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oa({start:t.start,end:t.end})+") is still open")}function d4(e){const t=this;t.parser=n;function n(s){return l4(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function f4(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 p4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
473
|
+
`}]}function h4(e,t){const n=t.value?t.value+`
|
|
474
|
+
`:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function m4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=ni(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(s,d);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function y4(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 v4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function A0(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=s:a.push({type:"text",value:s}),a}function b4(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return A0(e,t);const a={src:ni(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function w4(e,t){const n={src:ni(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 j4(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 k4(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return A0(e,t);const a={href:ni(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function S4(e,t){const n={href:ni(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 N4(e,t,n){const s=e.all(t),a=n?C4(n):D0(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 d=-1;for(;++d<s.length;){const h=s[d];(a||d!==0||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
475
|
+
`}),h.type==="element"&&h.tagName==="p"&&!a?c.push(...h.children):c.push(h)}const p=s[s.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
476
|
+
`});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function C4(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=D0(n[s])}return t}function D0(e){const t=e.spread;return t??e.children.length>1}function E4(e,t){const n={},s=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<s.length;){const c=s[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function P4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function R4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A4(e,t){const n=e.all(t),s=n.shift(),a=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),a.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=gh(t.children[1]),p=f0(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),a.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function D4(e,t,n){const s=n?n.children:void 0,l=(s?s.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let p=-1;const m=[];for(;++p<d;){const x=t.children[p],v={},b=c?c[p]:void 0;b&&(v.align=b);let C={type:"element",tagName:l,properties:v,children:[]};x&&(C.children=e.all(x),e.patch(x,C),C=e.applyData(x,C)),m.push(C)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,h),e.applyData(t,h)}function L4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Hy=9,Wy=32;function I4(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const l=[];for(;s;)l.push(Vy(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return l.push(Vy(t.slice(a),a>0,!1)),l.join("")}function Vy(e,t,n){let s=0,a=e.length;if(t){let l=e.codePointAt(s);for(;l===Hy||l===Wy;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(a-1);for(;l===Hy||l===Wy;)a--,l=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function O4(e,t){const n={type:"text",value:I4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function M4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _4={blockquote:f4,break:p4,code:h4,delete:m4,emphasis:g4,footnoteReference:x4,heading:y4,html:v4,imageReference:b4,image:w4,inlineCode:j4,linkReference:k4,link:S4,listItem:N4,list:E4,paragraph:P4,root:T4,strong:R4,table:A4,tableCell:L4,tableRow:D4,text:O4,thematicBreak:M4,toml:Ql,yaml:Ql,definition:Ql,footnoteDefinition:Ql};function Ql(){}const L0=-1,Kc=0,aa=1,wc=2,kh=3,Sh=4,Nh=5,Ch=6,I0=7,O0=8,qy=typeof self=="object"?self:globalThis,$4=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),s=a=>{if(e.has(a))return e.get(a);const[l,c]=t[a];switch(l){case Kc:case L0:return n(c,a);case aa:{const d=n([],a);for(const p of c)d.push(s(p));return d}case wc:{const d=n({},a);for(const[p,m]of c)d[s(p)]=s(m);return d}case kh:return n(new Date(c),a);case Sh:{const{source:d,flags:p}=c;return n(new RegExp(d,p),a)}case Nh:{const d=n(new Map,a);for(const[p,m]of c)d.set(s(p),s(m));return d}case Ch:{const d=n(new Set,a);for(const p of c)d.add(s(p));return d}case I0:{const{name:d,message:p}=c;return n(new qy[d](p),a)}case O0:return n(BigInt(c),a);case"BigInt":return n(Object(BigInt(c)),a);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new qy[l](c),a)};return s},Ky=e=>$4(new Map,e)(0),Io="",{toString:F4}={},{keys:z4}=Object,Zi=e=>{const t=typeof e;if(t!=="object"||!e)return[Kc,t];const n=F4.call(e).slice(8,-1);switch(n){case"Array":return[aa,Io];case"Object":return[wc,Io];case"Date":return[kh,Io];case"RegExp":return[Sh,Io];case"Map":return[Nh,Io];case"Set":return[Ch,Io];case"DataView":return[aa,n]}return n.includes("Array")?[aa,n]:n.includes("Error")?[I0,n]:[wc,n]},Jl=([e,t])=>e===Kc&&(t==="function"||t==="symbol"),B4=(e,t,n,s)=>{const a=(c,d)=>{const p=s.push(c)-1;return n.set(d,p),p},l=c=>{if(n.has(c))return n.get(c);let[d,p]=Zi(c);switch(d){case Kc:{let h=c;switch(p){case"bigint":d=O0,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return a([L0],c)}return a([d,h],c)}case aa:{if(p){let v=c;return p==="DataView"?v=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(c)),a([p,[...v]],c)}const h=[],x=a([d,h],c);for(const v of c)h.push(l(v));return x}case wc:{if(p)switch(p){case"BigInt":return a([p,c.toString()],c);case"Boolean":case"Number":case"String":return a([p,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const h=[],x=a([d,h],c);for(const v of z4(c))(e||!Jl(Zi(c[v])))&&h.push([l(v),l(c[v])]);return x}case kh:return a([d,c.toISOString()],c);case Sh:{const{source:h,flags:x}=c;return a([d,{source:h,flags:x}],c)}case Nh:{const h=[],x=a([d,h],c);for(const[v,b]of c)(e||!(Jl(Zi(v))||Jl(Zi(b))))&&h.push([l(v),l(b)]);return x}case Ch:{const h=[],x=a([d,h],c);for(const v of c)(e||!Jl(Zi(v)))&&h.push(l(v));return x}}const{message:m}=c;return a([d,{name:p,message:m}],c)};return l},Gy=(e,{json:t,lossy:n}={})=>{const s=[];return B4(!(t||n),!!t,new Map,s)(e),s},jc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ky(Gy(e,t)):structuredClone(e):(e,t)=>Ky(Gy(e,t));function U4(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 H4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function W4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||U4,s=e.options.footnoteBackLabel||H4,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];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(),v=ni(x.toLowerCase());let b=0;const C=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++b<=k;){C.length>0&&C.push({type:"text",value:" "});let T=typeof n=="string"?n:n(p,b);typeof T=="string"&&(T={type:"text",value:T}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,b),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const j=h[h.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const T=j.children[j.children.length-1];T&&T.type==="text"?T.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...C)}else h.push(...C);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(h,!0)};e.patch(m,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...jc(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
477
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
478
|
+
`}]}}const M0=(function(e){if(e==null)return G4;if(typeof e=="function")return Gc(e);if(typeof e=="object")return Array.isArray(e)?V4(e):q4(e);if(typeof e=="string")return K4(e);throw new Error("Expected function, string, or object as test")});function V4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=M0(e[n]);return Gc(s);function s(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function q4(e){const t=e;return Gc(n);function n(s){const a=s;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function K4(e){return Gc(t);function t(n){return n&&n.type===e}}function Gc(e){return t;function t(n,s,a){return!!(Y4(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function G4(){return!0}function Y4(e){return e!==null&&typeof e=="object"&&"type"in e}const _0=[],X4=!0,Yy=!1,Q4="skip";function J4(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const l=M0(a),c=s?-1:1;d(e,void 0,[])();function d(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(v,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=_0,C,k,j;if((!t||l(p,m,h[h.length-1]||void 0))&&(b=Z4(n(p,h)),b[0]===Yy))return b;if("children"in p&&p.children){const S=p;if(S.children&&b[0]!==Q4)for(k=(s?S.children.length:-1)+c,j=h.concat(S);k>-1&&k<S.children.length;){const T=S.children[k];if(C=d(T,k,j)(),C[0]===Yy)return C;k=typeof C[1]=="number"?C[1]:k+c}}return b}}}function Z4(e){return Array.isArray(e)?e:typeof e=="number"?[X4,e]:e==null?_0:[e]}function $0(e,t,n,s){let a,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,a=n):(l=t,c=n,a=s),J4(e,l,d,a);function d(p,m){const h=m[m.length-1],x=h?h.children.indexOf(p):void 0;return c(p,x,h)}}const fp={}.hasOwnProperty,eD={};function tD(e,t){const n=t||eD,s=new Map,a=new Map,l=new Map,c={..._4,...n.handlers},d={all:m,applyData:rD,definitionById:s,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:nD,wrap:oD};return $0(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const x=h.type==="definition"?s:a,v=String(h.identifier).toUpperCase();x.has(v)||x.set(v,h)}}),d;function p(h,x){const v=h.type,b=d.handlers[v];if(fp.call(d.handlers,v)&&b)return b(d,h,x);if(d.options.passThrough&&d.options.passThrough.includes(v)){if("children"in h){const{children:k,...j}=h,S=jc(j);return S.children=d.all(h),S}return jc(h)}return(d.options.unknownHandler||sD)(d,h,x)}function m(h){const x=[];if("children"in h){const v=h.children;let b=-1;for(;++b<v.length;){const C=d.one(v[b],h);if(C){if(b&&v[b-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Xy(C.value)),!Array.isArray(C)&&C.type==="element")){const k=C.children[0];k&&k.type==="text"&&(k.value=Xy(k.value))}Array.isArray(C)?x.push(...C):x.push(C)}}}return x}}function nD(e,t){e.position&&(t.position=FR(e))}function rD(e,t){let n=t;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const c="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,jc(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function sD(e,t){const n=t.data||{},s="value"in t&&!(fp.call(n,"hProperties")||fp.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 oD(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
|
|
479
|
+
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
480
|
+
`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
481
|
+
`}),n}function Xy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Qy(e,t){const n=tD(e,t),s=n.one(e,void 0),a=W4(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
|
|
482
|
+
`},a),l}function iD(e,t){return e&&"run"in e?async function(n,s){const a=Qy(n,{file:s,...t});await e.run(a,s)}:function(n,s){return Qy(n,{file:s,...e||t})}}function Jy(e){if(e)throw e}var bf,Zy;function aD(){if(Zy)return bf;Zy=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var 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 v;for(v in m);return typeof v>"u"||e.call(m,v)},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},d=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(s)return s(m,h).value}else return;return m[h]};return bf=function p(){var m,h,x,v,b,C,k=arguments[0],j=1,S=arguments.length,T=!1;for(typeof k=="boolean"&&(T=k,k=arguments[1]||{},j=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});j<S;++j)if(m=arguments[j],m!=null)for(h in m)x=d(k,h),v=d(m,h),k!==v&&(T&&v&&(l(v)||(b=a(v)))?(b?(b=!1,C=x&&a(x)?x:[]):C=x&&l(x)?x:{},c(k,{name:h,newValue:p(T,C,v)})):typeof v<"u"&&c(k,{name:h,newValue:v}));return k},bf}var lD=aD();const wf=Dc(lD);function pp(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 cD(){const e=[],t={run:n,use:s};return t;function n(...a){let l=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...a);function d(p,...m){const h=e[++l];let x=-1;if(p){c(p);return}for(;++x<a.length;)(m[x]===null||m[x]===void 0)&&(m[x]=a[x]);a=m,h?uD(h,d)(...m):c(null,...m)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function uD(e,t){let n;return s;function s(...c){const d=e.length>c.length;let p;d&&c.push(a);try{p=e.apply(this,c)}catch(m){const h=m;if(d&&n)throw h;return a(h)}d||(p&&p.then&&typeof p.then=="function"?p.then(l,a):p instanceof Error?a(p):l(p))}function a(c,...d){n||(n=!0,t(c,...d))}function l(c){a(null,c)}}const Sr={basename:dD,dirname:fD,extname:pD,join:hD,sep:"/"};function dD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Da(e);let n=0,s=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else s<0&&(l=!0,s=a+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else c<0&&(l=!0,c=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(s=a):(d=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function fD(e){if(Da(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 pD(e){Da(e);let t=e.length,n=-1,s=0,a=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function hD(...e){let t=-1,n;for(;++t<e.length;)Da(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mD(n)}function mD(e){Da(e);const t=e.codePointAt(0)===47;let n=gD(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gD(e,t){let n="",s=0,a=-1,l=0,c=-1,d,p;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(a===c-1||l===1))if(a!==c-1&&l===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",s=0):(n=n.slice(0,p),s=n.length-1-n.lastIndexOf("/")),a=c,l=0;continue}}else if(n.length>0){n="",s=0,a=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,c):n=e.slice(a+1,c),s=c-a-1;a=c,l=0}else d===46&&l>-1?l++:l=-1}return n}function Da(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xD={cwd:yD};function yD(){return"/"}function hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function vD(e){if(typeof e=="string")e=new URL(e);else if(!hp(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 bD(e)}function bD(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const jf=["history","path","basename","stem","extname","dirname"];class F0{constructor(t){let n;t?hp(t)?n={path:t}:typeof t=="string"||wD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<jf.length;){const l=jf[s];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)jf.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Sr.basename(this.path):void 0}set basename(t){Sf(t,"basename"),kf(t,"basename"),this.path=Sr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sr.dirname(this.path):void 0}set dirname(t){ev(this.basename,"dirname"),this.path=Sr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sr.extname(this.path):void 0}set extname(t){if(kf(t,"extname"),ev(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=Sr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hp(t)&&(t=vD(t)),Sf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sr.basename(this.path,this.extname):void 0}set stem(t){Sf(t,"stem"),kf(t,"stem"),this.path=Sr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const a=this.message(t,n,s);throw a.fatal=!0,a}info(t,n,s){const a=this.message(t,n,s);return a.fatal=void 0,a}message(t,n,s){const a=new gn(t,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function kf(e,t){if(e&&e.includes(Sr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sr.sep+"`")}function Sf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ev(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function wD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jD=(function(e){const s=this.constructor.prototype,a=s[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),kD={}.hasOwnProperty;class Eh extends jD{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=cD()}copy(){const t=new Eh;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(wf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ef("data",this.frozen),this.namespace[t]=n,this):kD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ef("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(t,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zl(t),s=this.parser||this.Parser;return Nf("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Nf("process",this.parser||this.Parser),Cf("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,c){const d=Zl(t),p=s.parse(d);s.run(p,d,function(h,x,v){if(h||!x||!v)return m(h);const b=x,C=s.stringify(b,v);CD(C)?v.value=C:v.result=C,m(h,v)});function m(h,x){h||!x?c(h):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,s;return this.freeze(),Nf("processSync",this.parser||this.Parser),Cf("processSync",this.compiler||this.Compiler),this.process(t,a),nv("processSync","process",n),s;function a(l,c){n=!0,Jy(l),s=c}}run(t,n,s){tv(t),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?l(void 0,s):new Promise(l);function l(c,d){const p=Zl(n);a.run(t,p,m);function m(h,x,v){const b=x||t;h?d(h):c?c(b):s(void 0,b,v)}}}runSync(t,n){let s=!1,a;return this.run(t,n,l),nv("runSync","run",s),a;function l(c,d){Jy(c),a=d,s=!0}}stringify(t,n){this.freeze();const s=Zl(n),a=this.compiler||this.Compiler;return Cf("stringify",a),tv(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(Ef("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")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");d(m.plugins),m.settings&&(a.settings=wf(!0,a.settings,m.settings))}function d(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,v=-1;for(;++x<s.length;)if(s[x][0]===m){v=x;break}if(v===-1)s.push([m,...h]);else if(h.length>0){let[b,...C]=h;const k=s[v][1];pp(k)&&pp(b)&&(b=wf(!0,k,b)),s[v]=[m,b,...C]}}}}const SD=new Eh().freeze();function Nf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ef(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 tv(e){if(!pp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zl(e){return ND(e)?e:new F0(e)}function ND(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function CD(e){return typeof e=="string"||ED(e)}function ED(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rv=[],sv={allowDangerousHtml:!0},TD=/^(https?|ircs?|mailto|xmpp)$/i,RD=[{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 AD(e){const t=DD(e),n=LD(e);return ID(t.runSync(t.parse(n),n),e)}function DD(e){const t=e.rehypePlugins||rv,n=e.remarkPlugins||rv,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sv}:sv;return SD().use(d4).use(n).use(iD,s).use(t)}function LD(e){const t=e.children||"",n=new F0;return typeof t=="string"&&(n.value=t),n}function ID(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||OD;for(const h of RD)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+PD+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),$0(e,m),WR(e,{Fragment:o.Fragment,components:a,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function m(h,x,v){if(h.type==="raw"&&v&&typeof x=="number")return c?v.children.splice(x,1):v.children[x]={type:"text",value:h.value},x;if(h.type==="element"){let b;for(b in xf)if(Object.hasOwn(xf,b)&&Object.hasOwn(h.properties,b)){const C=h.properties[b],k=xf[b];(k===null||k.includes(h.tagName))&&(h.properties[b]=p(String(C||""),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,v)),b&&v&&typeof x=="number")return d&&h.children?v.children.splice(x,1,...h.children):v.children.splice(x,1),x}}}function OD(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||s!==-1&&t>s||TD.test(e.slice(0,t))?e:""}function Mt({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?o.jsx("div",{className:Be("prose-syntaur max-w-none",t),children:o.jsx(AD,{children:s})}):o.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 MD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>s=>{t.forEach(a=>a(s))},t)}const Yc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ri(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ph(e){return"nodeType"in e}function Ln(e){var t,n;return e?ri(e)?e:Ph(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Th(e){const{Document:t}=Ln(e);return e instanceof t}function La(e){return ri(e)?!1:e instanceof Ln(e).HTMLElement}function z0(e){return e instanceof Ln(e).SVGElement}function si(e){return e?ri(e)?e.document:Ph(e)?Th(e)?e:La(e)||z0(e)?e.ownerDocument:document:document:document}const Lr=Yc?g.useLayoutEffect:g.useEffect;function Rh(e){const t=g.useRef(e);return Lr(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return t.current==null?void 0:t.current(...s)},[])}function _D(){const e=g.useRef(null),t=g.useCallback((s,a)=>{e.current=setInterval(s,a)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ba(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return Lr(()=>{n.current!==e&&(n.current=e)},t),n}function Ia(e,t){const n=g.useRef();return g.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function kc(e){const t=Rh(e),n=g.useRef(null),s=g.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,s]}function mp(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let Pf={};function Oa(e,t){return g.useMemo(()=>{if(t)return t;const n=Pf[e]==null?0:Pf[e]+1;return Pf[e]=n,e+"-"+n},[e,t])}function B0(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return s.reduce((l,c)=>{const d=Object.entries(c);for(const[p,m]of d){const h=l[p];h!=null&&(l[p]=h+e*m)}return l},{...t})}}const Uo=B0(1),Sc=B0(-1);function $D(e){return"clientX"in e&&"clientY"in e}function Ah(e){if(!e)return!1;const{KeyboardEvent:t}=Ln(e.target);return t&&e instanceof t}function FD(e){if(!e)return!1;const{TouchEvent:t}=Ln(e.target);return t&&e instanceof t}function gp(e){if(FD(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 $D(e)?{x:e.clientX,y:e.clientY}:null}const qo=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[qo.Translate.toString(e),qo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),ov="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zD(e){return e.matches(ov)?e:e.querySelector(ov)}const BD={display:"none"};function UD(e){let{id:t,value:n}=e;return Pt.createElement("div",{id:t,style:BD},n)}function HD(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Pt.createElement("div",{id:t,style:a,role:"status","aria-live":s,"aria-atomic":!0},n)}function WD(){const[e,t]=g.useState("");return{announce:g.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const U0=g.createContext(null);function VD(e){const t=g.useContext(U0);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qD(){const[e]=g.useState(()=>new Set),t=g.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[g.useCallback(s=>{let{type:a,event:l}=s;e.forEach(c=>{var d;return(d=c[a])==null?void 0:d.call(c,l)})},[e]),t]}const KD={draggable:`
|
|
483
|
+
To pick up a draggable item, press the space bar.
|
|
484
|
+
While dragging, use the arrow keys to move the item.
|
|
485
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
486
|
+
`},GD={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 YD(e){let{announcements:t=GD,container:n,hiddenTextDescribedById:s,screenReaderInstructions:a=KD}=e;const{announce:l,announcement:c}=WD(),d=Oa("DndLiveRegion"),[p,m]=g.useState(!1);if(g.useEffect(()=>{m(!0)},[]),VD(g.useMemo(()=>({onDragStart(x){let{active:v}=x;l(t.onDragStart({active:v}))},onDragMove(x){let{active:v,over:b}=x;t.onDragMove&&l(t.onDragMove({active:v,over:b}))},onDragOver(x){let{active:v,over:b}=x;l(t.onDragOver({active:v,over:b}))},onDragEnd(x){let{active:v,over:b}=x;l(t.onDragEnd({active:v,over:b}))},onDragCancel(x){let{active:v,over:b}=x;l(t.onDragCancel({active:v,over:b}))}}),[l,t])),!p)return null;const h=Pt.createElement(Pt.Fragment,null,Pt.createElement(UD,{id:s,value:a.draggable}),Pt.createElement(HD,{id:d,announcement:c}));return n?Cs.createPortal(h,n):h}var Bt;(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"})(Bt||(Bt={}));function Nc(){}function Cc(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function H0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const pr=Object.freeze({x:0,y:0});function XD(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function QD(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function JD(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function ZD(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function iv(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 W0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=iv(t,t.left,t.top),l=[];for(const c of s){const{id:d}=c,p=n.get(d);if(p){const m=XD(iv(p),a);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(QD)};function eL(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=a-s,d=l-n;if(s<a&&n<l){const p=t.width*t.height,m=e.width*e.height,h=c*d,x=h/(p+m-h);return Number(x.toFixed(4))}return 0}const tL=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const a=[];for(const l of s){const{id:c}=l,d=n.get(c);if(d){const p=eL(d,t);p>0&&a.push({id:c,data:{droppableContainer:l,value:p}})}}return a.sort(JD)};function nL(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function V0(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pr}function rL(e){return function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return a.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const sL=rL(1);function oL(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 iL(e,t,n){const s=oL(t);if(!s)return e;const{scaleX:a,scaleY:l,x:c,y:d}=s,p=e.left-c-(1-a)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),h=a?e.width/a: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 aL={ignoreTransform:!1};function oi(e,t){t===void 0&&(t=aL);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=Ln(e).getComputedStyle(e);m&&(n=iL(n,m,h))}const{top:s,left:a,width:l,height:c,bottom:d,right:p}=n;return{top:s,left:a,width:l,height:c,bottom:d,right:p}}function av(e){return oi(e,{ignoreTransform:!0})}function lL(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function cL(e,t){return t===void 0&&(t=Ln(e).getComputedStyle(e)),t.position==="fixed"}function uL(e,t){t===void 0&&(t=Ln(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const l=t[a];return typeof l=="string"?n.test(l):!1})}function Dh(e,t){const n=[];function s(a){if(t!=null&&n.length>=t||!a)return n;if(Th(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!La(a)||z0(a)||n.includes(a))return n;const l=Ln(e).getComputedStyle(a);return a!==e&&uL(a,l)&&n.push(a),cL(a,l)?n:s(a.parentNode)}return e?s(e):n}function q0(e){const[t]=Dh(e,1);return t??null}function Tf(e){return!Yc||!e?null:ri(e)?e:Ph(e)?Th(e)||e===si(e).scrollingElement?window:La(e)?e:null:null}function K0(e){return ri(e)?e.scrollX:e.scrollLeft}function G0(e){return ri(e)?e.scrollY:e.scrollTop}function xp(e){return{x:K0(e),y:G0(e)}}var Jt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Jt||(Jt={}));function Y0(e){return!Yc||!e?!1:e===document.scrollingElement}function X0(e){const t={x:0,y:0},n=Y0(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,d=e.scrollLeft>=s.x;return{isTop:a,isLeft:l,isBottom:c,isRight:d,maxScroll:s,minScroll:t}}const dL={x:.2,y:.2};function fL(e,t,n,s,a){let{top:l,left:c,right:d,bottom:p}=n;s===void 0&&(s=10),a===void 0&&(a=dL);const{isTop:m,isBottom:h,isLeft:x,isRight:v}=X0(e),b={x:0,y:0},C={x:0,y:0},k={height:t.height*a.y,width:t.width*a.x};return!m&&l<=t.top+k.height?(b.y=Jt.Backward,C.y=s*Math.abs((t.top+k.height-l)/k.height)):!h&&p>=t.bottom-k.height&&(b.y=Jt.Forward,C.y=s*Math.abs((t.bottom-k.height-p)/k.height)),!v&&d>=t.right-k.width?(b.x=Jt.Forward,C.x=s*Math.abs((t.right-k.width-d)/k.width)):!x&&c<=t.left+k.width&&(b.x=Jt.Backward,C.x=s*Math.abs((t.left+k.width-c)/k.width)),{direction:b,speed:C}}function pL(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:s,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Q0(e){return e.reduce((t,n)=>Uo(t,xp(n)),pr)}function hL(e){return e.reduce((t,n)=>t+K0(n),0)}function mL(e){return e.reduce((t,n)=>t+G0(n),0)}function gL(e,t){if(t===void 0&&(t=oi),!e)return;const{top:n,left:s,bottom:a,right:l}=t(e);q0(e)&&(a<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const xL=[["x",["left","right"],hL],["y",["top","bottom"],mL]];class Lh{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=Dh(n),a=Q0(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of xL)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=d(s),h=a[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class la{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var a;(a=this.target)==null||a.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function yL(e){const{EventTarget:t}=Ln(e);return e instanceof t?e:si(e)}function Rf(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 Jn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Jn||(Jn={}));function lv(e){e.preventDefault()}function vL(e){e.stopPropagation()}var et;(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"})(et||(et={}));const J0={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},bL=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case et.Right:return{...n,x:n.x+25};case et.Left:return{...n,x:n.x-25};case et.Down:return{...n,y:n.y+25};case et.Up:return{...n,y:n.y-25}}};class Xc{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new la(si(n)),this.windowListeners=new la(Ln(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Jn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&gL(s),n(pr)}handleKeyDown(t){if(Ah(t)){const{active:n,context:s,options:a}=this.props,{keyboardCodes:l=J0,coordinateGetter:c=bL,scrollBehavior:d="smooth"}=a,{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}:pr;this.referenceCoordinates||(this.referenceCoordinates=h);const x=c(t,{active:n,context:s.current,currentCoordinates:h});if(x){const v=Sc(x,h),b={x:0,y:0},{scrollableAncestors:C}=s.current;for(const k of C){const j=t.code,{isTop:S,isRight:T,isLeft:N,isBottom:A,maxScroll:I,minScroll:R}=X0(k),D=pL(k),O={x:Math.min(j===et.Right?D.right-D.width/2:D.right,Math.max(j===et.Right?D.left:D.left+D.width/2,x.x)),y:Math.min(j===et.Down?D.bottom-D.height/2:D.bottom,Math.max(j===et.Down?D.top:D.top+D.height/2,x.y))},G=j===et.Right&&!T||j===et.Left&&!N,re=j===et.Down&&!A||j===et.Up&&!S;if(G&&O.x!==x.x){const z=k.scrollLeft+v.x,K=j===et.Right&&z<=I.x||j===et.Left&&z>=R.x;if(K&&!v.y){k.scrollTo({left:z,behavior:d});return}K?b.x=k.scrollLeft-z:b.x=j===et.Right?k.scrollLeft-I.x:k.scrollLeft-R.x,b.x&&k.scrollBy({left:-b.x,behavior:d});break}else if(re&&O.y!==x.y){const z=k.scrollTop+v.y,K=j===et.Down&&z<=I.y||j===et.Up&&z>=R.y;if(K&&!v.x){k.scrollTo({top:z,behavior:d});return}K?b.y=k.scrollTop-z:b.y=j===et.Down?k.scrollTop-I.y:k.scrollTop-R.y,b.y&&k.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,Uo(Sc(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()}}Xc.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=J0,onActivation:a}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function cv(e){return!!(e&&"distance"in e)}function uv(e){return!!(e&&"delay"in e)}class Ih{constructor(t,n,s){var a;s===void 0&&(s=yL(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=si(c),this.documentListeners=new la(this.document),this.listeners=new la(s),this.windowListeners=new la(Ln(c)),this.initialCoordinates=(a=gp(l))!=null?a:pr,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(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.DragStart,lv),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),this.windowListeners.add(Jn.ContextMenu,lv),this.documentListeners.add(Jn.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(uv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(cv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:a}=this.props;a(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Jn.Click,vL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Jn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:a,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!a)return;const p=(n=gp(t))!=null?n:pr,m=Sc(a,p);if(!s&&d){if(cv(d)){if(d.tolerance!=null&&Rf(m,d.tolerance))return this.handleCancel();if(Rf(m,d.distance))return this.handleStart()}if(uv(d)&&Rf(m,d.tolerance))return this.handleCancel();this.handlePending(d,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===et.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const wL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Qc extends Ih{constructor(t){const{event:n}=t,s=si(n.target);super(t,wL,s)}}Qc.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 jL={move:{name:"mousemove"},end:{name:"mouseup"}};var yp;(function(e){e[e.RightClick=2]="RightClick"})(yp||(yp={}));class kL extends Ih{constructor(t){super(t,jL,si(t.event.target))}}kL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===yp.RightClick?!1:(s==null||s({event:n}),!0)}}];const Af={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class SL extends Ih{constructor(t){super(t,Af)}static setup(){return window.addEventListener(Af.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Af.move.name,t)};function t(){}}}SL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:a}=n;return a.length>1?!1:(s==null||s({event:n}),!0)}}];var ca;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ca||(ca={}));var Ec;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ec||(Ec={}));function NL(e){let{acceleration:t,activator:n=ca.Pointer,canScroll:s,draggingRect:a,enabled:l,interval:c=5,order:d=Ec.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:x,threshold:v}=e;const b=EL({delta:x,disabled:!l}),[C,k]=_D(),j=g.useRef({x:0,y:0}),S=g.useRef({x:0,y:0}),T=g.useMemo(()=>{switch(n){case ca.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case ca.DraggableRect:return a}},[n,a,p]),N=g.useRef(null),A=g.useCallback(()=>{const R=N.current;if(!R)return;const D=j.current.x*S.current.x,O=j.current.y*S.current.y;R.scrollBy(D,O)},[]),I=g.useMemo(()=>d===Ec.TreeOrder?[...m].reverse():m,[d,m]);g.useEffect(()=>{if(!l||!m.length||!T){k();return}for(const R of I){if((s==null?void 0:s(R))===!1)continue;const D=m.indexOf(R),O=h[D];if(!O)continue;const{direction:G,speed:re}=fL(R,O,T,t,v);for(const z of["x","y"])b[z][G[z]]||(re[z]=0,G[z]=0);if(re.x>0||re.y>0){k(),N.current=R,C(A,c),j.current=re,S.current=G;return}}j.current={x:0,y:0},S.current={x:0,y:0},k()},[t,A,s,k,l,c,JSON.stringify(T),JSON.stringify(b),C,m,I,h,JSON.stringify(v)])}const CL={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function EL(e){let{delta:t,disabled:n}=e;const s=mp(t);return Ia(a=>{if(n||!s||!a)return CL;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[Jt.Backward]:a.x[Jt.Backward]||l.x===-1,[Jt.Forward]:a.x[Jt.Forward]||l.x===1},y:{[Jt.Backward]:a.y[Jt.Backward]||l.y===-1,[Jt.Forward]:a.y[Jt.Forward]||l.y===1}}},[n,t,s])}function PL(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return Ia(a=>{var l;return t==null?null:(l=s??a)!=null?l:null},[s,t])}function TL(e,t){return g.useMemo(()=>e.reduce((n,s)=>{const{sensor:a}=s,l=a.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...l]},[]),[e,t])}var wa;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(wa||(wa={}));var vp;(function(e){e.Optimized="optimized"})(vp||(vp={}));const dv=new Map;function RL(e,t){let{dragging:n,dependencies:s,config:a}=t;const[l,c]=g.useState(null),{frequency:d,measure:p,strategy:m}=a,h=g.useRef(e),x=j(),v=ba(x),b=g.useCallback(function(S){S===void 0&&(S=[]),!v.current&&c(T=>T===null?S:T.concat(S.filter(N=>!T.includes(N))))},[v]),C=g.useRef(null),k=Ia(S=>{if(x&&!n)return dv;if(!S||S===dv||h.current!==e||l!=null){const T=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){T.set(N.id,N.rect.current);continue}const A=N.node.current,I=A?new Lh(p(A),A):null;N.rect.current=I,I&&T.set(N.id,I)}return T}return S},[e,l,n,x,p]);return g.useEffect(()=>{h.current=e},[e]),g.useEffect(()=>{x||b()},[n,x]),g.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),g.useEffect(()=>{x||typeof d!="number"||C.current!==null||(C.current=setTimeout(()=>{b(),C.current=null},d))},[d,x,b,...s]),{droppableRects:k,measureDroppableContainers:b,measuringScheduled:l!=null};function j(){switch(m){case wa.Always:return!1;case wa.BeforeDragging:return n;default:return!n}}}function Z0(e,t){return Ia(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function AL(e,t){return Z0(e,t)}function DL(e){let{callback:t,disabled:n}=e;const s=Rh(t),a=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return g.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Jc(e){let{callback:t,disabled:n}=e;const s=Rh(t),a=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return g.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function LL(e){return new Lh(oi(e),e)}function fv(e,t,n){t===void 0&&(t=LL);const[s,a]=g.useState(null);function l(){a(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=DL({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}}}}),d=Jc({callback:l});return Lr(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),s}function IL(e){const t=Z0(e);return V0(e,t)}const pv=[];function OL(e){const t=g.useRef(e),n=Ia(s=>e?s&&s!==pv&&e&&t.current&&e.parentNode===t.current.parentNode?s:Dh(e):pv,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function ML(e){const[t,n]=g.useState(null),s=g.useRef(e),a=g.useCallback(l=>{const c=Tf(l.target);c&&n(d=>d?(d.set(c,xp(c)),new Map(d)):null)},[]);return g.useEffect(()=>{const l=s.current;if(e!==l){c(l);const d=e.map(p=>{const m=Tf(p);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,xp(m)]):null}).filter(p=>p!=null);n(d.length?new Map(d):null),s.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(p=>{const m=Tf(p);m==null||m.removeEventListener("scroll",a)})}},[a,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Uo(l,c),pr):Q0(e):pr,[e,t])}function hv(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const s=e!==pr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Sc(e,n.current):pr}function _L(e){g.useEffect(()=>{if(!Yc)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 $L(e,t){return g.useMemo(()=>e.reduce((n,s)=>{let{eventName:a,handler:l}=s;return n[a]=c=>{l(c,t)},n},{}),[e,t])}function ej(e){return g.useMemo(()=>e?lL(e):null,[e])}const mv=[];function FL(e,t){t===void 0&&(t=oi);const[n]=e,s=ej(n?Ln(n):null),[a,l]=g.useState(mv);function c(){l(()=>e.length?e.map(p=>Y0(p)?s:new Lh(t(p),p)):mv)}const d=Jc({callback:c});return Lr(()=>{d==null||d.disconnect(),c(),e.forEach(p=>d==null?void 0:d.observe(p))},[e]),a}function zL(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return La(t)?t:e}function BL(e){let{measure:t}=e;const[n,s]=g.useState(null),a=g.useCallback(m=>{for(const{target:h}of m)if(La(h)){s(x=>{const v=t(h);return x?{...x,width:v.width,height:v.height}:v});break}},[t]),l=Jc({callback:a}),c=g.useCallback(m=>{const h=zL(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),s(h?t(h):null)},[t,l]),[d,p]=kc(c);return g.useMemo(()=>({nodeRef:d,rect:n,setRef:p}),[n,d,p])}const UL=[{sensor:Qc,options:{}},{sensor:Xc,options:{}}],HL={current:{}},pc={draggable:{measure:av},droppable:{measure:av,strategy:wa.WhileDragging,frequency:vp.Optimized},dragOverlay:{measure:oi}};class ua 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 WL={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ua,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Nc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pc,measureDroppableContainers:Nc,windowRect:null,measuringScheduled:!1},VL={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Nc,draggableNodes:new Map,over:null,measureDroppableContainers:Nc},Zc=g.createContext(VL),tj=g.createContext(WL);function qL(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ua}}}function KL(e,t){switch(t.type){case Bt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Bt.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 Bt.DragEnd:case Bt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:n}=t,{id:s}=n,a=new ua(e.droppable.containers);return a.set(s,n),{...e,droppable:{...e.droppable,containers:a}}}case Bt.SetDroppableDisabled:{const{id:n,key:s,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||s!==l.key)return e;const c=new ua(e.droppable.containers);return c.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:c}}}case Bt.UnregisterDroppable:{const{id:n,key:s}=t,a=e.droppable.containers.get(n);if(!a||s!==a.key)return e;const l=new ua(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function GL(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:a}=g.useContext(Zc),l=mp(s),c=mp(n==null?void 0:n.id);return g.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!Ah(l)||document.activeElement===l.target)return;const d=a.get(c);if(!d)return;const{activatorNode:p,node:m}=d;if(!p.current&&!m.current)return;requestAnimationFrame(()=>{for(const h of[p.current,m.current]){if(!h)continue;const x=zD(h);if(x){x.focus();break}}})}},[s,t,a,c,l]),null}function YL(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...s}),n):n}function XL(e){return g.useMemo(()=>({draggable:{...pc.draggable,...e==null?void 0:e.draggable},droppable:{...pc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...pc.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 QL(e){let{activeNode:t,measure:n,initialRect:s,config:a=!0}=e;const l=g.useRef(!1),{x:c,y:d}=typeof a=="boolean"?{x:a,y:a}:a;Lr(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!s)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const h=n(m),x=V0(h,s);if(c||(x.x=0),d||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const v=q0(m);v&&v.scrollBy({top:x.y,left:x.x})}},[t,c,d,s,n])}const nj=g.createContext({...pr,scaleX:1,scaleY:1});var Ns;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ns||(Ns={}));const rj=g.memo(function(t){var n,s,a,l;let{id:c,accessibility:d,autoScroll:p=!0,children:m,sensors:h=UL,collisionDetection:x=tL,measuring:v,modifiers:b,...C}=t;const k=g.useReducer(KL,void 0,qL),[j,S]=k,[T,N]=qD(),[A,I]=g.useState(Ns.Uninitialized),R=A===Ns.Initialized,{draggable:{active:D,nodes:O,translate:G},droppable:{containers:re}}=j,z=D!=null?O.get(D):null,K=g.useRef({initial:null,translated:null}),q=g.useMemo(()=>{var Ve;return D!=null?{id:D,data:(Ve=z==null?void 0:z.data)!=null?Ve:HL,rect:K}:null},[D,z]),J=g.useRef(null),[_,F]=g.useState(null),[B,U]=g.useState(null),Z=ba(C,Object.values(C)),P=Oa("DndDescribedBy",c),M=g.useMemo(()=>re.getEnabled(),[re]),Q=XL(v),{droppableRects:L,measureDroppableContainers:ge,measuringScheduled:Ne}=RL(M,{dragging:R,dependencies:[G.x,G.y],config:Q.droppable}),te=PL(O,D),fe=g.useMemo(()=>B?gp(B):null,[B]),be=vt(),je=AL(te,Q.draggable.measure);QL({activeNode:D!=null?O.get(D):null,config:be.layoutShiftCompensation,initialRect:je,measure:Q.draggable.measure});const we=fv(te,Q.draggable.measure,je),Ye=fv(te?te.parentElement:null),Xe=g.useRef({activatorEvent:null,active:null,activeNode:te,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:re,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=re.getNodeFor((n=Xe.current.over)==null?void 0:n.id),Y=BL({measure:Q.dragOverlay.measure}),ae=(s=Y.nodeRef.current)!=null?s:te,xe=R?(a=Y.rect)!=null?a:we:null,qe=!!(Y.nodeRef.current&&Y.rect),Oe=IL(qe?null:we),Ue=ej(ae?Ln(ae):null),Ge=OL(R?ne??te:null),Nt=FL(Ge),Ct=YL(b,{transform:{x:G.x-Oe.x,y:G.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:B,active:q,activeNodeRect:we,containerNodeRect:Ye,draggingNodeRect:xe,over:Xe.current.over,overlayNodeRect:Y.rect,scrollableAncestors:Ge,scrollableAncestorRects:Nt,windowRect:Ue}),Lt=fe?Uo(fe,G):null,en=ML(Ge),Tt=hv(en),ie=hv(en,[we]),ce=Uo(Ct,Tt),ve=xe?sL(xe,Ct):null,oe=q&&ve?x({active:q,collisionRect:ve,droppableRects:L,droppableContainers:M,pointerCoordinates:Lt}):null,Ce=ZD(oe,"id"),[Ae,qt]=g.useState(null),an=qe?Ct:Uo(Ct,ie),tn=nL(an,(l=Ae==null?void 0:Ae.rect)!=null?l:null,we),V=g.useRef(null),pe=g.useCallback((Ve,it)=>{let{sensor:Rt,options:Kt}=it;if(J.current==null)return;const nn=O.get(J.current);if(!nn)return;const cn=Ve.nativeEvent,bn=new Rt({active:J.current,activeNode:nn,event:cn,options:Kt,context:Xe,onAbort(bt){if(!O.get(bt))return;const{onDragAbort:un}=Z.current,nr={id:bt};un==null||un(nr),T({type:"onDragAbort",event:nr})},onPending(bt,Vn,un,nr){if(!O.get(bt))return;const{onDragPending:yr}=Z.current,In={id:bt,constraint:Vn,initialCoordinates:un,offset:nr};yr==null||yr(In),T({type:"onDragPending",event:In})},onStart(bt){const Vn=J.current;if(Vn==null)return;const un=O.get(Vn);if(!un)return;const{onDragStart:nr}=Z.current,rr={activatorEvent:cn,active:{id:Vn,data:un.data,rect:K}};Cs.unstable_batchedUpdates(()=>{nr==null||nr(rr),I(Ns.Initializing),S({type:Bt.DragStart,initialCoordinates:bt,active:Vn}),T({type:"onDragStart",event:rr}),F(V.current),U(cn)})},onMove(bt){S({type:Bt.DragMove,coordinates:bt})},onEnd:$r(Bt.DragEnd),onCancel:$r(Bt.DragCancel)});V.current=bn;function $r(bt){return async function(){const{active:un,collisions:nr,over:rr,scrollAdjustedTranslate:yr}=Xe.current;let In=null;if(un&&yr){const{cancelDrop:Fr}=Z.current;In={activatorEvent:cn,active:un,collisions:nr,delta:yr,over:rr},bt===Bt.DragEnd&&typeof Fr=="function"&&await Promise.resolve(Fr(In))&&(bt=Bt.DragCancel)}J.current=null,Cs.unstable_batchedUpdates(()=>{S({type:bt}),I(Ns.Uninitialized),qt(null),F(null),U(null),V.current=null;const Fr=bt===Bt.DragEnd?"onDragEnd":"onDragCancel";if(In){const di=Z.current[Fr];di==null||di(In),T({type:Fr,event:In})}})}}},[O]),Ee=g.useCallback((Ve,it)=>(Rt,Kt)=>{const nn=Rt.nativeEvent,cn=O.get(Kt);if(J.current!==null||!cn||nn.dndKit||nn.defaultPrevented)return;const bn={active:cn};Ve(Rt,it.options,bn)===!0&&(nn.dndKit={capturedBy:it.sensor},J.current=Kt,pe(Rt,it))},[O,pe]),ze=TL(h,Ee);_L(h),Lr(()=>{we&&A===Ns.Initializing&&I(Ns.Initialized)},[we,A]),g.useEffect(()=>{const{onDragMove:Ve}=Z.current,{active:it,activatorEvent:Rt,collisions:Kt,over:nn}=Xe.current;if(!it||!Rt)return;const cn={active:it,activatorEvent:Rt,collisions:Kt,delta:{x:ce.x,y:ce.y},over:nn};Cs.unstable_batchedUpdates(()=>{Ve==null||Ve(cn),T({type:"onDragMove",event:cn})})},[ce.x,ce.y]),g.useEffect(()=>{const{active:Ve,activatorEvent:it,collisions:Rt,droppableContainers:Kt,scrollAdjustedTranslate:nn}=Xe.current;if(!Ve||J.current==null||!it||!nn)return;const{onDragOver:cn}=Z.current,bn=Kt.get(Ce),$r=bn&&bn.rect.current?{id:bn.id,rect:bn.rect.current,data:bn.data,disabled:bn.disabled}:null,bt={active:Ve,activatorEvent:it,collisions:Rt,delta:{x:nn.x,y:nn.y},over:$r};Cs.unstable_batchedUpdates(()=>{qt($r),cn==null||cn(bt),T({type:"onDragOver",event:bt})})},[Ce]),Lr(()=>{Xe.current={activatorEvent:B,active:q,activeNode:te,collisionRect:ve,collisions:oe,droppableRects:L,draggableNodes:O,draggingNode:ae,draggingNodeRect:xe,droppableContainers:re,over:Ae,scrollableAncestors:Ge,scrollAdjustedTranslate:ce},K.current={initial:xe,translated:ve}},[q,te,oe,ve,O,ae,xe,L,re,Ae,Ge,ce]),NL({...be,delta:G,draggingRect:ve,pointerCoordinates:Lt,scrollableAncestors:Ge,scrollableAncestorRects:Nt});const Wn=g.useMemo(()=>({active:q,activeNode:te,activeNodeRect:we,activatorEvent:B,collisions:oe,containerNodeRect:Ye,dragOverlay:Y,draggableNodes:O,droppableContainers:re,droppableRects:L,over:Ae,measureDroppableContainers:ge,scrollableAncestors:Ge,scrollableAncestorRects:Nt,measuringConfiguration:Q,measuringScheduled:Ne,windowRect:Ue}),[q,te,we,B,oe,Ye,Y,O,re,L,Ae,ge,Ge,Nt,Q,Ne,Ue]),ln=g.useMemo(()=>({activatorEvent:B,activators:ze,active:q,activeNodeRect:we,ariaDescribedById:{draggable:P},dispatch:S,draggableNodes:O,over:Ae,measureDroppableContainers:ge}),[B,ze,q,we,S,P,O,Ae,ge]);return Pt.createElement(U0.Provider,{value:N},Pt.createElement(Zc.Provider,{value:ln},Pt.createElement(tj.Provider,{value:Wn},Pt.createElement(nj.Provider,{value:tn},m)),Pt.createElement(GL,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Pt.createElement(YD,{...d,hiddenTextDescribedById:P}));function vt(){const Ve=(_==null?void 0:_.autoScrollEnabled)===!1,it=typeof p=="object"?p.enabled===!1:p===!1,Rt=R&&!Ve&&!it;return typeof p=="object"?{...p,enabled:Rt}:{enabled:Rt}}}),JL=g.createContext(null),gv="button",ZL="Draggable";function eI(e){let{id:t,data:n,disabled:s=!1,attributes:a}=e;const l=Oa(ZL),{activators:c,activatorEvent:d,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:x,over:v}=g.useContext(Zc),{role:b=gv,roleDescription:C="draggable",tabIndex:k=0}=a??{},j=(p==null?void 0:p.id)===t,S=g.useContext(j?nj:JL),[T,N]=kc(),[A,I]=kc(),R=$L(c,t),D=ba(n);Lr(()=>(x.set(t,{id:t,key:l,node:T,activatorNode:A,data:D}),()=>{const G=x.get(t);G&&G.key===l&&x.delete(t)}),[x,t]);const O=g.useMemo(()=>({role:b,tabIndex:k,"aria-disabled":s,"aria-pressed":j&&b===gv?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[s,b,k,j,C,h.draggable]);return{active:p,activatorEvent:d,activeNodeRect:m,attributes:O,isDragging:j,listeners:s?void 0:R,node:T,over:v,setNodeRef:N,setActivatorNodeRef:I,transform:S}}function tI(){return g.useContext(tj)}const nI="Droppable",rI={timeout:25};function sI(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:a}=e;const l=Oa(nI),{active:c,dispatch:d,over:p,measureDroppableContainers:m}=g.useContext(Zc),h=g.useRef({disabled:n}),x=g.useRef(!1),v=g.useRef(null),b=g.useRef(null),{disabled:C,updateMeasurementsFor:k,timeout:j}={...rI,...a},S=ba(k??s),T=g.useCallback(()=>{if(!x.current){x.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),b.current=null},j)},[j]),N=Jc({callback:T,disabled:C||!c}),A=g.useCallback((O,G)=>{N&&(G&&(N.unobserve(G),x.current=!1),O&&N.observe(O))},[N]),[I,R]=kc(A),D=ba(t);return g.useEffect(()=>{!N||!I.current||(N.disconnect(),x.current=!1,N.observe(I.current))},[I,N]),g.useEffect(()=>(d({type:Bt.RegisterDroppable,element:{id:s,key:l,disabled:n,node:I,rect:v,data:D}}),()=>d({type:Bt.UnregisterDroppable,key:l,id:s})),[s]),g.useEffect(()=>{n!==h.current.disabled&&(d({type:Bt.SetDroppableDisabled,id:s,key:l,disabled:n}),h.current.disabled=n)},[s,l,n,d]),{active:c,rect:v,isOver:(p==null?void 0:p.id)===s,node:I,over:p,setNodeRef:R}}function eu(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function oI(e,t){return e.reduce((n,s,a)=>{const l=t.get(s);return l&&(n[a]=l),n},Array(e.length))}function ec(e){return e!==null&&e>=0}function iI(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 aI(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sj=e=>{let{rects:t,activeIndex:n,overIndex:s,index:a}=e;const l=eu(t,s,n),c=t[a],d=l[a];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},tc={scaleX:1,scaleY:1},oj=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:a,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:s;if(!d)return null;if(a===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...tc}:null}const p=lI(l,a,n);return a>n&&a<=c?{x:0,y:-d.height-p,...tc}:a<n&&a>=c?{x:0,y:d.height+p,...tc}:{x:0,y:0,...tc}};function lI(e,t,n){const s=e[t],a=e[t-1],l=e[t+1];return s?n<t?a?s.top-(a.top+a.height):l?l.top-(s.top+s.height):0:l?l.top-(s.top+s.height):a?s.top-(a.top+a.height):0:0}const ij="Sortable",aj=Pt.createContext({activeIndex:-1,containerId:ij,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sj,disabled:{draggable:!1,droppable:!1}});function lj(e){let{children:t,id:n,items:s,strategy:a=sj,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:p,over:m,measureDroppableContainers:h}=tI(),x=Oa(ij,n),v=d.rect!==null,b=g.useMemo(()=>s.map(R=>typeof R=="object"&&"id"in R?R.id:R),[s]),C=c!=null,k=c?b.indexOf(c.id):-1,j=m?b.indexOf(m.id):-1,S=g.useRef(b),T=!iI(b,S.current),N=j!==-1&&k===-1||T,A=aI(l);Lr(()=>{T&&C&&h(b)},[T,b,C,h]),g.useEffect(()=>{S.current=b},[b]);const I=g.useMemo(()=>({activeIndex:k,containerId:x,disabled:A,disableTransforms:N,items:b,overIndex:j,useDragOverlay:v,sortedRects:oI(b,p),strategy:a}),[k,x,A.draggable,A.droppable,N,b,j,p,v,a]);return Pt.createElement(aj.Provider,{value:I},t)}const cI=e=>{let{id:t,items:n,activeIndex:s,overIndex:a}=e;return eu(n,s,a).indexOf(t)},uI=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:a,items:l,newIndex:c,previousItems:d,previousContainerId:p,transition:m}=e;return!m||!s||d!==l&&a===c?!1:n?!0:c!==a&&t===p},dI={duration:200,easing:"ease"},cj="transform",fI=qo.Transition.toString({property:cj,duration:0,easing:"linear"}),pI={roleDescription:"sortable"};function hI(e){let{disabled:t,index:n,node:s,rect:a}=e;const[l,c]=g.useState(null),d=g.useRef(n);return Lr(()=>{if(!t&&n!==d.current&&s.current){const p=a.current;if(p){const m=oi(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!==d.current&&(d.current=n)},[t,n,s,a]),g.useEffect(()=>{l&&c(null)},[l]),l}function uj(e){let{animateLayoutChanges:t=uI,attributes:n,disabled:s,data:a,getNewIndex:l=cI,id:c,strategy:d,resizeObserverConfig:p,transition:m=dI}=e;const{items:h,containerId:x,activeIndex:v,disabled:b,disableTransforms:C,sortedRects:k,overIndex:j,useDragOverlay:S,strategy:T}=g.useContext(aj),N=mI(s,b),A=h.indexOf(c),I=g.useMemo(()=>({sortable:{containerId:x,index:A,items:h},...a}),[x,a,A,h]),R=g.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:D,node:O,isOver:G,setNodeRef:re}=sI({id:c,data:I,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...p}}),{active:z,activatorEvent:K,activeNodeRect:q,attributes:J,setNodeRef:_,listeners:F,isDragging:B,over:U,setActivatorNodeRef:Z,transform:P}=eI({id:c,data:I,attributes:{...pI,...n},disabled:N.draggable}),M=MD(re,_),Q=!!z,L=Q&&!C&&ec(v)&&ec(j),ge=!S&&B,Ne=ge&&L?P:null,fe=L?Ne??(d??T)({rects:k,activeNodeRect:q,activeIndex:v,overIndex:j,index:A}):null,be=ec(v)&&ec(j)?l({id:c,items:h,activeIndex:v,overIndex:j}):A,je=z==null?void 0:z.id,we=g.useRef({activeId:je,items:h,newIndex:be,containerId:x}),Ye=h!==we.current.items,Xe=t({active:z,containerId:x,isDragging:B,isSorting:Q,id:c,index:A,items:h,newIndex:we.current.newIndex,previousItems:we.current.items,previousContainerId:we.current.containerId,transition:m,wasDragging:we.current.activeId!=null}),ne=hI({disabled:!Xe,index:A,node:O,rect:D});return g.useEffect(()=>{Q&&we.current.newIndex!==be&&(we.current.newIndex=be),x!==we.current.containerId&&(we.current.containerId=x),h!==we.current.items&&(we.current.items=h)},[Q,be,x,h]),g.useEffect(()=>{if(je===we.current.activeId)return;if(je!=null&&we.current.activeId==null){we.current.activeId=je;return}const ae=setTimeout(()=>{we.current.activeId=je},50);return()=>clearTimeout(ae)},[je]),{active:z,activeIndex:v,attributes:J,data:I,rect:D,index:A,newIndex:be,items:h,isOver:G,isSorting:Q,isDragging:B,listeners:F,node:O,overIndex:j,over:U,setNodeRef:M,setActivatorNodeRef:Z,setDroppableNodeRef:re,setDraggableNodeRef:_,transform:ne??fe,transition:Y()};function Y(){if(ne||Ye&&we.current.newIndex===A)return fI;if(!(ge&&!Ah(K)||!m)&&(Q||Xe))return qo.Transition.toString({...m,property:cj})}}function mI(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}}et.Down,et.Right,et.Up,et.Left;function Mr(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function gI(e){const[t,n]=g.useState(null),[s,a]=g.useState(!0),[l,c]=g.useState(null),d=g.useCallback(async()=>{if(e)try{const p=await fetch(Mr(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{a(!1)}},[e]);return g.useEffect(()=>{d()},[d]),_c(p=>{p.type==="todos-updated"&&p.projectSlug===e&&d()}),{data:t,loading:s,error:l,refetch:d}}async function xI(e,t,n){await fetch(Mr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function yI(e,t,n){await fetch(`${Mr(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function vI(e,t,n){await fetch(`${Mr(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function bI(e,t,n){await fetch(`${Mr(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function wI(e,t){await fetch(`${Mr(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function jI(e,t){await fetch(`${Mr(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function kI(e,t){await fetch(`${Mr(e)}/${t}`,{method:"DELETE"})}async function dj(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let a=null;try{a=s?JSON.parse(s):null}catch{}const l=(a==null?void 0:a.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function SI(e,t){await dj(`${Mr(e)}/promote`,t)}async function NI(e,t,n){await dj(`${Mr(e)}/${t}/move`,{to:n})}const xv=[{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 Oh({status:e,onChange:t}){const[n,s]=g.useState(!1),a=g.useRef(null);g.useEffect(()=>{if(!n)return;function c(d){a.current&&!a.current.contains(d.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=xv.find(c=>c.value===e);return o.jsxs("div",{className:"relative",ref:a,onClick:c=>c.stopPropagation(),children:[o.jsx("button",{onClick:()=>s(!n),className:`text-lg leading-none ${l.color} hover:opacity-70 transition`,title:l.label,children:l.icon}),n&&o.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:xv.filter(c=>c.value!==e).map(c=>o.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:[o.jsx("span",{className:"text-base leading-none",children:c.icon}),o.jsx("span",{children:c.label})]},c.value))})]})}function fj({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a}){const[l,c]=g.useState("new"),[d,p]=g.useState(!1),[m,h]=g.useState(null),[x,v]=g.useState(null),[b,C]=g.useState(null),[k,j]=g.useState(""),[S,T]=g.useState(""),[N,A]=g.useState(""),[I,R]=g.useState(""),[D,O]=g.useState(""),[G,re]=g.useState(""),[z,K]=g.useState(null),[q,J]=g.useState(!1),_=t.length>1;g.useEffect(()=>{if(!e){c("new"),h(null),j(""),T(""),A(""),R(""),O(""),re(""),K(null);return}let P=!1;return(async()=>{try{const M=await fetch("/api/projects");if(!M.ok)throw new Error(`HTTP ${M.status}`);const Q=await M.json();P||v(Q.filter(L=>!L.archived))}catch(M){P||C(M instanceof Error?M.message:String(M))}})(),()=>{P=!0}},[e]),g.useEffect(()=>{if(!D){K(null);return}let P=!1;return J(!0),(async()=>{try{const M=await fetch(`/api/projects/${encodeURIComponent(D)}/assignments`);if(!M.ok)throw new Error(`HTTP ${M.status}`);const Q=await M.json();P||K(Q)}catch{P||K([])}finally{P||J(!1)}})(),()=>{P=!0}},[D]);const F=g.useMemo(()=>x??[],[x]);async function B(P){if(P.preventDefault(),!k){h("Pick a target project.");return}if(_&&!S.trim()){h("Title is required when promoting multiple todos.");return}const M={todoIds:t,mode:"new-assignment",target:{project:k},title:S.trim()||void 0,type:N.trim()||void 0,priority:I||void 0};await Z(M)}async function U(P){if(P.preventDefault(),!D||!G){h("Pick both project and assignment.");return}const M={todoIds:t,mode:"to-assignment",target:{assignment:`${D}/${G}`}};await Z(M)}async function Z(P){p(!0),h(null);try{n.kind==="workspace"?await nE(n.workspace,P):await SI(n.projectId,P),a(),s(!1)}catch(M){h(M instanceof Error?M.message:String(M))}finally{p(!1)}}return o.jsx(ei,{open:e,onOpenChange:P=>d?void 0:s(P),children:o.jsxs(to,{className:"max-w-xl",children:[o.jsxs(rh,{children:[o.jsxs(no,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),o.jsxs(Pa,{children:["Convert the selected todo",t.length===1?"":"s"," to an assignment. The source todo",t.length===1?"":"s"," will be marked completed."]})]}),o.jsxs(r0,{value:l,onValueChange:P=>c(P),children:[o.jsxs(s0,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[o.jsx(rp,{value:"new",className:Be("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"}),o.jsx(rp,{value:"existing",className:Be("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"})]}),o.jsx(sp,{value:"new",children:o.jsxs("form",{onSubmit:B,className:"space-y-4",children:[o.jsx(Oo,{label:"Target project",children:o.jsx(yv,{value:k,onChange:j,projects:F,error:b,disabled:d})}),o.jsx(Oo,{label:_?"Title (required)":"Title (defaults to first todo)",children:o.jsx("input",{type:"text",value:S,onChange:P=>T(P.target.value),disabled:d,className:"editor-textarea w-full bg-background/95 font-sans"})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(Oo,{label:"Type",children:o.jsx("input",{type:"text",value:N,onChange:P=>A(P.target.value),placeholder:"feature",disabled:d,className:"editor-textarea w-full bg-background/95 font-sans"})}),o.jsx(Oo,{label:"Priority",children:o.jsxs("select",{value:I,onChange:P=>R(P.target.value),disabled:d,className:"editor-textarea w-full bg-background/95 font-sans",children:[o.jsx("option",{value:"",children:"—"}),o.jsx("option",{value:"low",children:"low"}),o.jsx("option",{value:"medium",children:"medium"}),o.jsx("option",{value:"high",children:"high"}),o.jsx("option",{value:"critical",children:"critical"})]})})]}),m?o.jsx(vv,{message:m}):null,o.jsx(bv,{onCancel:()=>s(!1),submitting:d,submitLabel:"Promote"})]})}),o.jsx(sp,{value:"existing",children:o.jsxs("form",{onSubmit:U,className:"space-y-4",children:[o.jsx(Oo,{label:"Project",children:o.jsx(yv,{value:D,onChange:P=>{O(P),re("")},projects:F,error:b,disabled:d})}),o.jsx(Oo,{label:q?"Assignment (loading...)":"Assignment",children:o.jsxs("select",{value:G,onChange:P=>re(P.target.value),disabled:d||!D||q,className:"editor-textarea w-full bg-background/95 font-sans",children:[o.jsx("option",{value:"",children:D?"Select assignment...":"Pick a project first"}),(z??[]).map(P=>o.jsxs("option",{value:P.slug,children:[P.title," (",P.status,")"]},P.slug))]})}),m?o.jsx(vv,{message:m}):null,o.jsx(bv,{onCancel:()=>s(!1),submitting:d,submitLabel:"Promote"})]})})]})]})})}function Oo({label:e,children:t}){return o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function yv({value:e,onChange:t,projects:n,error:s,disabled:a}){return s?o.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load projects: ",s]}):o.jsxs("select",{value:e,onChange:l=>t(l.target.value),disabled:a,className:"editor-textarea w-full bg-background/95 font-sans",children:[o.jsx("option",{value:"",children:"Select project..."}),n.map(l=>o.jsxs("option",{value:l.slug,children:[l.title," (",l.slug,")"]},l.slug))]})}function vv({message:e}){return o.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function bv({onCancel:e,submitting:t,submitLabel:n}){return o.jsxs(sh,{children:[o.jsx("button",{type:"button",onClick:e,disabled:t,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),o.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 pj({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:a}){const[l,c]=g.useState("project"),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(!1),[b,C]=g.useState(null),[k,j]=g.useState(null),[S,T]=g.useState(null);g.useEffect(()=>{if(!e){c("project"),p(""),h(""),C(null),j(null);return}let D=!1;return(async()=>{try{const O=await fetch("/api/projects");if(!O.ok)throw new Error(`HTTP ${O.status}`);const G=await O.json();D||T(G.filter(re=>!re.archived))}catch(O){D||j(O instanceof Error?O.message:String(O))}})(),()=>{D=!0}},[e]);const N=g.useMemo(()=>S?n.kind==="project"?S.filter(D=>D.slug!==n.projectId):S:[],[S,n]);function A(){if(l==="global")return{global:!0};if(l==="workspace"){const D=d.trim();return D?{workspace:D}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function I(D,O){try{return n.kind==="workspace"?await rE(n.workspace,D,O):await NI(n.projectId,D,O),{ok:!0}}catch(G){return{ok:!1,error:G instanceof Error?G.message:String(G)}}}async function R(D){D.preventDefault(),j(null);const O=A();if(typeof O=="string"){j(O);return}v(!0),C(null);const G=[],re=[];for(const z of t){const K=await I(z,O);K.ok?G.push(z):re.push({id:z,error:K.error})}v(!1),a(),re.length===0?s(!1):C({succeeded:G,failed:re})}return o.jsx(ei,{open:e,onOpenChange:D=>x?void 0:s(D),children:o.jsx(to,{className:"max-w-xl",children:o.jsxs("form",{onSubmit:R,className:"space-y-4",children:[o.jsxs(rh,{children:[o.jsxs(no,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),o.jsxs(Pa,{children:["Move the selected todo",t.length===1?"":"s"," to a different scope. id, tags, branch, timestamps, and plan dir are preserved."]})]}),o.jsxs("fieldset",{className:"space-y-2",disabled:x,children:[o.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),o.jsx(Df,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),o.jsx(Df,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),o.jsx(Df,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?o.jsx(wv,{label:"Target project",children:o.jsxs("select",{value:m,onChange:D=>h(D.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[o.jsx("option",{value:"",children:"Select project..."}),N.map(D=>o.jsxs("option",{value:D.slug,children:[D.title," (",D.slug,")"]},D.slug))]})}):null,l==="workspace"?o.jsx(wv,{label:"Target workspace name",children:o.jsx("input",{type:"text",value:d,onChange:D=>p(D.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,k?o.jsx(CI,{message:k}):null,b?o.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:[o.jsxs("div",{className:"font-medium",children:["Moved ",b.succeeded.length," of ",t.length,"; ",b.failed.length," failed."]}),o.jsx("ul",{className:"text-xs space-y-0.5",children:b.failed.map(D=>o.jsxs("li",{children:["[t:",D.id,"] ",D.error]},D.id))})]}):null,o.jsxs(sh,{children:[o.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?o.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 wv({label:e,children:t}){return o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Df({kind:e,checked:t,onChange:n,label:s}){return o.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[o.jsx("input",{type:"radio",name:"move-target-kind",value:e,checked:t,onChange:n}),o.jsx("span",{children:s})]})}function CI({message:e}){return o.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}const EI=["top","right","bottom","left"],Ps=Math.min,zn=Math.max,Pc=Math.round,nc=Math.floor,Rr=e=>({x:e,y:e}),PI={left:"right",right:"left",bottom:"top",top:"bottom"};function bp(e,t,n){return zn(e,Ps(t,n))}function Qr(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function ii(e){return e.split("-")[1]}function Mh(e){return e==="x"?"y":"x"}function _h(e){return e==="y"?"height":"width"}function Er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function $h(e){return Mh(Er(e))}function TI(e,t,n){n===void 0&&(n=!1);const s=ii(e),a=$h(e),l=_h(a);let c=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Tc(c)),[c,Tc(c)]}function RI(e){const t=Tc(e);return[wp(e),t,wp(t)]}function wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jv=["left","right"],kv=["right","left"],AI=["top","bottom"],DI=["bottom","top"];function LI(e,t,n){switch(e){case"top":case"bottom":return n?t?kv:jv:t?jv:kv;case"left":case"right":return t?AI:DI;default:return[]}}function II(e,t,n,s){const a=ii(e);let l=LI(Jr(e),n==="start",s);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(wp)))),l}function Tc(e){const t=Jr(e);return PI[t]+e.slice(t.length)}function OI(e){return{top:0,right:0,bottom:0,left:0,...e}}function hj(e){return typeof e!="number"?OI(e):{top:e,right:e,bottom:e,left:e}}function Rc(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}function Sv(e,t,n){let{reference:s,floating:a}=e;const l=Er(t),c=$h(t),d=_h(c),p=Jr(t),m=l==="y",h=s.x+s.width/2-a.width/2,x=s.y+s.height/2-a.height/2,v=s[d]/2-a[d]/2;let b;switch(p){case"top":b={x:h,y:s.y-a.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-a.width,y:x};break;default:b={x:s.x,y:s.y}}switch(ii(t)){case"start":b[c]-=v*(n&&m?-1:1);break;case"end":b[c]+=v*(n&&m?-1:1);break}return b}async function MI(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:l,rects:c,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:x="floating",altBoundary:v=!1,padding:b=0}=Qr(t,e),C=hj(b),j=d[v?x==="floating"?"reference":"floating":x],S=Rc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:h,strategy:p})),T=x==="floating"?{x:s,y:a,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},I=Rc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:N,strategy:p}):T);return{top:(S.top-I.top+C.top)/A.y,bottom:(I.bottom-S.bottom+C.bottom)/A.y,left:(S.left-I.left+C.left)/A.x,right:(I.right-S.right+C.right)/A.x}}const _I=50,$I=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:MI},p=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:x}=Sv(m,s,p),v=s,b=0;const C={};for(let k=0;k<l.length;k++){const j=l[k];if(!j)continue;const{name:S,fn:T}=j,{x:N,y:A,data:I,reset:R}=await T({x:h,y:x,initialPlacement:s,placement:v,strategy:a,middlewareData:C,rects:m,platform:d,elements:{reference:e,floating:t}});h=N??h,x=A??x,C[S]={...C[S],...I},R&&b<_I&&(b++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(m=R.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):R.rects),{x:h,y:x}=Sv(m,v,p)),k=-1)}return{x:h,y:x,placement:v,strategy:a,middlewareData:C}},FI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:l,platform:c,elements:d,middlewareData:p}=t,{element:m,padding:h=0}=Qr(e,t)||{};if(m==null)return{};const x=hj(h),v={x:n,y:s},b=$h(a),C=_h(b),k=await c.getDimensions(m),j=b==="y",S=j?"top":"left",T=j?"bottom":"right",N=j?"clientHeight":"clientWidth",A=l.reference[C]+l.reference[b]-v[b]-l.floating[C],I=v[b]-l.reference[b],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let D=R?R[N]:0;(!D||!await(c.isElement==null?void 0:c.isElement(R)))&&(D=d.floating[N]||l.floating[C]);const O=A/2-I/2,G=D/2-k[C]/2-1,re=Ps(x[S],G),z=Ps(x[T],G),K=re,q=D-k[C]-z,J=D/2-k[C]/2+O,_=bp(K,J,q),F=!p.arrow&&ii(a)!=null&&J!==_&&l.reference[C]/2-(J<K?re:z)-k[C]/2<0,B=F?J<K?J-K:J-q:0;return{[b]:v[b]+B,data:{[b]:_,centerOffset:J-_-B,...F&&{alignmentOffset:B}},reset:F}}}),zI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:l,rects:c,initialPlacement:d,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:x=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:k=!0,...j}=Qr(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Jr(a),T=Er(d),N=Jr(d)===d,A=await(p.isRTL==null?void 0:p.isRTL(m.floating)),I=v||(N||!k?[Tc(d)]:RI(d)),R=C!=="none";!v&&R&&I.push(...II(d,k,C,A));const D=[d,...I],O=await p.detectOverflow(t,j),G=[];let re=((s=l.flip)==null?void 0:s.overflows)||[];if(h&&G.push(O[S]),x){const J=TI(a,c,A);G.push(O[J[0]],O[J[1]])}if(re=[...re,{placement:a,overflows:G}],!G.every(J=>J<=0)){var z,K;const J=(((z=l.flip)==null?void 0:z.index)||0)+1,_=D[J];if(_&&(!(x==="alignment"?T!==Er(_):!1)||re.every(U=>Er(U.placement)===T?U.overflows[0]>0:!0)))return{data:{index:J,overflows:re},reset:{placement:_}};let F=(K=re.filter(B=>B.overflows[0]<=0).sort((B,U)=>B.overflows[1]-U.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(b){case"bestFit":{var q;const B=(q=re.filter(U=>{if(R){const Z=Er(U.placement);return Z===T||Z==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Z=>Z>0).reduce((Z,P)=>Z+P,0)]).sort((U,Z)=>U[1]-Z[1])[0])==null?void 0:q[0];B&&(F=B);break}case"initialPlacement":F=d;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function Nv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cv(e){return EI.some(t=>e[t]>=0)}const BI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:a="referenceHidden",...l}=Qr(e,t);switch(a){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),d=Nv(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Cv(d)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),d=Nv(c,n.floating);return{data:{escapedOffsets:d,escaped:Cv(d)}}}default:return{}}}}},mj=new Set(["left","top"]);async function UI(e,t){const{placement:n,platform:s,elements:a}=e,l=await(s.isRTL==null?void 0:s.isRTL(a.floating)),c=Jr(n),d=ii(n),p=Er(n)==="y",m=mj.has(c)?-1:1,h=l&&p?-1:1,x=Qr(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:C}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return d&&typeof C=="number"&&(b=d==="end"?C*-1:C),p?{x:b*h,y:v*m}:{x:v*m,y:b*h}}const HI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:l,placement:c,middlewareData:d}=t,p=await UI(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+p.x,y:l+p.y,data:{...p,placement:c}}}}},WI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a,platform:l}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:p={fn:S=>{let{x:T,y:N}=S;return{x:T,y:N}}},...m}=Qr(e,t),h={x:n,y:s},x=await l.detectOverflow(t,m),v=Er(Jr(a)),b=Mh(v);let C=h[b],k=h[v];if(c){const S=b==="y"?"top":"left",T=b==="y"?"bottom":"right",N=C+x[S],A=C-x[T];C=bp(N,C,A)}if(d){const S=v==="y"?"top":"left",T=v==="y"?"bottom":"right",N=k+x[S],A=k-x[T];k=bp(N,k,A)}const j=p.fn({...t,[b]:C,[v]:k});return{...j,data:{x:j.x-n,y:j.y-s,enabled:{[b]:c,[v]:d}}}}}},VI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:p=!0,crossAxis:m=!0}=Qr(e,t),h={x:n,y:s},x=Er(a),v=Mh(x);let b=h[v],C=h[x];const k=Qr(d,t),j=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(p){const N=v==="y"?"height":"width",A=l.reference[v]-l.floating[N]+j.mainAxis,I=l.reference[v]+l.reference[N]-j.mainAxis;b<A?b=A:b>I&&(b=I)}if(m){var S,T;const N=v==="y"?"width":"height",A=mj.has(Jr(a)),I=l.reference[x]-l.floating[N]+(A&&((S=c.offset)==null?void 0:S[x])||0)+(A?0:j.crossAxis),R=l.reference[x]+l.reference[N]+(A?0:((T=c.offset)==null?void 0:T[x])||0)-(A?j.crossAxis:0);C<I?C=I:C>R&&(C=R)}return{[v]:b,[x]:C}}}},qI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:a,rects:l,platform:c,elements:d}=t,{apply:p=()=>{},...m}=Qr(e,t),h=await c.detectOverflow(t,m),x=Jr(a),v=ii(a),b=Er(a)==="y",{width:C,height:k}=l.floating;let j,S;x==="top"||x==="bottom"?(j=x,S=v===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=x,j=v==="end"?"top":"bottom");const T=k-h.top-h.bottom,N=C-h.left-h.right,A=Ps(k-h[j],T),I=Ps(C-h[S],N),R=!t.middlewareData.shift;let D=A,O=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(D=T),R&&!v){const re=zn(h.left,0),z=zn(h.right,0),K=zn(h.top,0),q=zn(h.bottom,0);b?O=C-2*(re!==0||z!==0?re+z:zn(h.left,h.right)):D=k-2*(K!==0||q!==0?K+q:zn(h.top,h.bottom))}await p({...t,availableWidth:O,availableHeight:D});const G=await c.getDimensions(d.floating);return C!==G.width||k!==G.height?{reset:{rects:!0}}:{}}}};function tu(){return typeof window<"u"}function ai(e){return gj(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(gj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gj(e){return tu()?e instanceof Node||e instanceof Hn(e).Node:!1}function hr(e){return tu()?e instanceof Element||e instanceof Hn(e).Element:!1}function Zr(e){return tu()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Ev(e){return!tu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}function Ma(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&a!=="inline"&&a!=="contents"}function KI(e){return/^(table|td|th)$/.test(ai(e))}function nu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const GI=/transform|translate|scale|rotate|perspective|filter/,YI=/paint|layout|strict|content/,Ks=e=>!!e&&e!=="none";let Lf;function Fh(e){const t=hr(e)?mr(e):e;return Ks(t.transform)||Ks(t.translate)||Ks(t.scale)||Ks(t.rotate)||Ks(t.perspective)||!zh()&&(Ks(t.backdropFilter)||Ks(t.filter))||GI.test(t.willChange||"")||YI.test(t.contain||"")}function XI(e){let t=Ts(e);for(;Zr(t)&&!Ko(t);){if(Fh(t))return t;if(nu(t))return null;t=Ts(t)}return null}function zh(){return Lf==null&&(Lf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Lf}function Ko(e){return/^(html|body|#document)$/.test(ai(e))}function mr(e){return Hn(e).getComputedStyle(e)}function ru(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ts(e){if(ai(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ev(e)&&e.host||_r(e);return Ev(t)?t.host:t}function xj(e){const t=Ts(e);return Ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zr(t)&&Ma(t)?t:xj(t)}function ja(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=xj(e),l=a===((s=e.ownerDocument)==null?void 0:s.body),c=Hn(a);if(l){const d=jp(c);return t.concat(c,c.visualViewport||[],Ma(a)?a:[],d&&n?ja(d):[])}else return t.concat(a,ja(a,[],n))}function jp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yj(e){const t=mr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=Zr(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:s,d=Pc(n)!==l||Pc(s)!==c;return d&&(n=l,s=c),{width:n,height:s,$:d}}function Bh(e){return hr(e)?e:e.contextElement}function Ho(e){const t=Bh(e);if(!Zr(t))return Rr(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:l}=yj(t);let c=(l?Pc(n.width):n.width)/s,d=(l?Pc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const QI=Rr(0);function vj(e){const t=Hn(e);return!zh()||!t.visualViewport?QI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function Js(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=Bh(e);let c=Rr(1);t&&(s?hr(s)&&(c=Ho(s)):c=Ho(e));const d=JI(l,n,s)?vj(l):Rr(0);let p=(a.left+d.x)/c.x,m=(a.top+d.y)/c.y,h=a.width/c.x,x=a.height/c.y;if(l){const v=Hn(l),b=s&&hr(s)?Hn(s):s;let C=v,k=jp(C);for(;k&&s&&b!==C;){const j=Ho(k),S=k.getBoundingClientRect(),T=mr(k),N=S.left+(k.clientLeft+parseFloat(T.paddingLeft))*j.x,A=S.top+(k.clientTop+parseFloat(T.paddingTop))*j.y;p*=j.x,m*=j.y,h*=j.x,x*=j.y,p+=N,m+=A,C=Hn(k),k=jp(C)}}return Rc({width:h,height:x,x:p,y:m})}function su(e,t){const n=ru(e).scrollLeft;return t?t.left+n:Js(_r(e)).left+n}function bj(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-su(e,n),a=n.top+t.scrollTop;return{x:s,y:a}}function ZI(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const l=a==="fixed",c=_r(s),d=t?nu(t.floating):!1;if(s===c||d&&l)return n;let p={scrollLeft:0,scrollTop:0},m=Rr(1);const h=Rr(0),x=Zr(s);if((x||!x&&!l)&&((ai(s)!=="body"||Ma(c))&&(p=ru(s)),x)){const b=Js(s);m=Ho(s),h.x=b.x+s.clientLeft,h.y=b.y+s.clientTop}const v=c&&!x&&!l?bj(c,p):Rr(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-p.scrollLeft*m.x+h.x+v.x,y:n.y*m.y-p.scrollTop*m.y+h.y+v.y}}function eO(e){return Array.from(e.getClientRects())}function tO(e){const t=_r(e),n=ru(e),s=e.ownerDocument.body,a=zn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=zn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+su(e);const d=-n.scrollTop;return mr(s).direction==="rtl"&&(c+=zn(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:c,y:d}}const Pv=25;function nO(e,t){const n=Hn(e),s=_r(e),a=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,d=0,p=0;if(a){l=a.width,c=a.height;const h=zh();(!h||h&&t==="fixed")&&(d=a.offsetLeft,p=a.offsetTop)}const m=su(s);if(m<=0){const h=s.ownerDocument,x=h.body,v=getComputedStyle(x),b=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,C=Math.abs(s.clientWidth-x.clientWidth-b);C<=Pv&&(l-=C)}else m<=Pv&&(l+=m);return{width:l,height:c,x:d,y:p}}function rO(e,t){const n=Js(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,l=Zr(e)?Ho(e):Rr(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,p=a*l.x,m=s*l.y;return{width:c,height:d,x:p,y:m}}function Tv(e,t,n){let s;if(t==="viewport")s=nO(e,n);else if(t==="document")s=tO(_r(e));else if(hr(t))s=rO(t,n);else{const a=vj(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Rc(s)}function wj(e,t){const n=Ts(e);return n===t||!hr(n)||Ko(n)?!1:mr(n).position==="fixed"||wj(n,t)}function sO(e,t){const n=t.get(e);if(n)return n;let s=ja(e,[],!1).filter(d=>hr(d)&&ai(d)!=="body"),a=null;const l=mr(e).position==="fixed";let c=l?Ts(e):e;for(;hr(c)&&!Ko(c);){const d=mr(c),p=Fh(c);!p&&d.position==="fixed"&&(a=null),(l?!p&&!a:!p&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ma(c)&&!p&&wj(e,c))?s=s.filter(h=>h!==c):a=d,c=Ts(c)}return t.set(e,s),s}function oO(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const c=[...n==="clippingAncestors"?nu(t)?[]:sO(t,this._c):[].concat(n),s],d=Tv(t,c[0],a);let p=d.top,m=d.right,h=d.bottom,x=d.left;for(let v=1;v<c.length;v++){const b=Tv(t,c[v],a);p=zn(b.top,p),m=Ps(b.right,m),h=Ps(b.bottom,h),x=zn(b.left,x)}return{width:m-x,height:h-p,x,y:p}}function iO(e){const{width:t,height:n}=yj(e);return{width:t,height:n}}function aO(e,t,n){const s=Zr(t),a=_r(t),l=n==="fixed",c=Js(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const p=Rr(0);function m(){p.x=su(a)}if(s||!s&&!l)if((ai(t)!=="body"||Ma(a))&&(d=ru(t)),s){const b=Js(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}else a&&m();l&&!s&&a&&m();const h=a&&!s&&!l?bj(a,d):Rr(0),x=c.left+d.scrollLeft-p.x-h.x,v=c.top+d.scrollTop-p.y-h.y;return{x,y:v,width:c.width,height:c.height}}function If(e){return mr(e).position==="static"}function Rv(e,t){if(!Zr(e)||mr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _r(e)===n&&(n=n.ownerDocument.body),n}function jj(e,t){const n=Hn(e);if(nu(e))return n;if(!Zr(e)){let a=Ts(e);for(;a&&!Ko(a);){if(hr(a)&&!If(a))return a;a=Ts(a)}return n}let s=Rv(e,t);for(;s&&KI(s)&&If(s);)s=Rv(s,t);return s&&Ko(s)&&If(s)&&!Fh(s)?n:s||XI(e)||n}const lO=async function(e){const t=this.getOffsetParent||jj,n=this.getDimensions,s=await n(e.floating);return{reference:aO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function cO(e){return mr(e).direction==="rtl"}const uO={convertOffsetParentRelativeRectToViewportRelativeRect:ZI,getDocumentElement:_r,getClippingRect:oO,getOffsetParent:jj,getElementRects:lO,getClientRects:eO,getDimensions:iO,getScale:Ho,isElement:hr,isRTL:cO};function kj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dO(e,t){let n=null,s;const a=_r(e);function l(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function c(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),l();const m=e.getBoundingClientRect(),{left:h,top:x,width:v,height:b}=m;if(d||t(),!v||!b)return;const C=nc(x),k=nc(a.clientWidth-(h+v)),j=nc(a.clientHeight-(x+b)),S=nc(h),N={rootMargin:-C+"px "+-k+"px "+-j+"px "+-S+"px",threshold:zn(0,Ps(1,p))||1};let A=!0;function I(R){const D=R[0].intersectionRatio;if(D!==p){if(!A)return c();D?c(!1,D):s=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!kj(m,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver(I,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}return c(!0),l}function fO(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=Bh(e),h=a||l?[...m?ja(m):[],...t?ja(t):[]]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&d?dO(m,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(S=>{let[T]=S;T&&T.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(t)})),n()}),m&&!p&&b.observe(m),t&&b.observe(t));let C,k=p?Js(e):null;p&&j();function j(){const S=Js(e);k&&!kj(k,S)&&n(),k=S,C=requestAnimationFrame(j)}return n(),()=>{var S;h.forEach(T=>{a&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),x==null||x(),(S=b)==null||S.disconnect(),b=null,p&&cancelAnimationFrame(C)}}const pO=HI,hO=WI,mO=zI,gO=qI,xO=BI,Av=FI,yO=VI,vO=(e,t,n)=>{const s=new Map,a={platform:uO,...n},l={...a.platform,_c:s};return $I(e,t,{...a,platform:l})};var bO=typeof document<"u",wO=function(){},hc=bO?g.useLayoutEffect:wO;function Ac(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Ac(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const l=a[s];if(!(l==="_owner"&&e.$$typeof)&&!Ac(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Sj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dv(e,t){const n=Sj(e);return Math.round(t*n)/n}function Of(e){const t=g.useRef(e);return hc(()=>{t.current=e}),t}function jO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[h,x]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=g.useState(s);Ac(v,s)||b(s);const[C,k]=g.useState(null),[j,S]=g.useState(null),T=g.useCallback(U=>{U!==R.current&&(R.current=U,k(U))},[]),N=g.useCallback(U=>{U!==D.current&&(D.current=U,S(U))},[]),A=l||C,I=c||j,R=g.useRef(null),D=g.useRef(null),O=g.useRef(h),G=p!=null,re=Of(p),z=Of(a),K=Of(m),q=g.useCallback(()=>{if(!R.current||!D.current)return;const U={placement:t,strategy:n,middleware:v};z.current&&(U.platform=z.current),vO(R.current,D.current,U).then(Z=>{const P={...Z,isPositioned:K.current!==!1};J.current&&!Ac(O.current,P)&&(O.current=P,Cs.flushSync(()=>{x(P)}))})},[v,t,n,z,K]);hc(()=>{m===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,x(U=>({...U,isPositioned:!1})))},[m]);const J=g.useRef(!1);hc(()=>(J.current=!0,()=>{J.current=!1}),[]),hc(()=>{if(A&&(R.current=A),I&&(D.current=I),A&&I){if(re.current)return re.current(A,I,q);q()}},[A,I,q,re,G]);const _=g.useMemo(()=>({reference:R,floating:D,setReference:T,setFloating:N}),[T,N]),F=g.useMemo(()=>({reference:A,floating:I}),[A,I]),B=g.useMemo(()=>{const U={position:n,left:0,top:0};if(!F.floating)return U;const Z=Dv(F.floating,h.x),P=Dv(F.floating,h.y);return d?{...U,transform:"translate("+Z+"px, "+P+"px)",...Sj(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:P}},[n,d,F.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:q,refs:_,elements:F,floatingStyles:B}),[h,q,_,F,B])}const kO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:a}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Av({element:s.current,padding:a}).fn(n):{}:s?Av({element:s,padding:a}).fn(n):{}}}},SO=(e,t)=>{const n=pO(e);return{name:n.name,fn:n.fn,options:[e,t]}},NO=(e,t)=>{const n=hO(e);return{name:n.name,fn:n.fn,options:[e,t]}},CO=(e,t)=>({fn:yO(e).fn,options:[e,t]}),EO=(e,t)=>{const n=mO(e);return{name:n.name,fn:n.fn,options:[e,t]}},PO=(e,t)=>{const n=gO(e);return{name:n.name,fn:n.fn,options:[e,t]}},TO=(e,t)=>{const n=xO(e);return{name:n.name,fn:n.fn,options:[e,t]}},RO=(e,t)=>{const n=kO(e);return{name:n.name,fn:n.fn,options:[e,t]}};var AO="Arrow",Nj=g.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...l}=e;return o.jsx($t.svg,{...l,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nj.displayName=AO;var DO=Nj;function LO(e){const[t,n]=g.useState(void 0);return Es(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let c,d;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Uh="Popper",[Cj,Ej]=Zs(Uh),[IO,Pj]=Cj(Uh),Tj=e=>{const{__scopePopper:t,children:n}=e,[s,a]=g.useState(null);return o.jsx(IO,{scope:t,anchor:s,onAnchorChange:a,children:n})};Tj.displayName=Uh;var Rj="PopperAnchor",Aj=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,l=Pj(Rj,n),c=g.useRef(null),d=mn(t,c),p=g.useRef(null);return g.useEffect(()=>{const m=p.current;p.current=(s==null?void 0:s.current)||c.current,m!==p.current&&l.onAnchorChange(p.current)}),s?null:o.jsx($t.div,{...a,ref:d})});Aj.displayName=Rj;var Hh="PopperContent",[OO,MO]=Cj(Hh),Dj=g.forwardRef((e,t)=>{var fe,be,je,we,Ye,Xe;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:C,...k}=e,j=Pj(Hh,n),[S,T]=g.useState(null),N=mn(t,ne=>T(ne)),[A,I]=g.useState(null),R=LO(A),D=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,G=s+(l!=="center"?"-"+l:""),re=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(m)?m:[m],K=z.length>0,q={padding:re,boundary:z.filter($O),altBoundary:K},{refs:J,floatingStyles:_,placement:F,isPositioned:B,middlewareData:U}=jO({strategy:"fixed",placement:G,whileElementsMounted:(...ne)=>fO(...ne,{animationFrame:b==="always"}),elements:{reference:j.anchor},middleware:[SO({mainAxis:a+O,alignmentAxis:c}),p&&NO({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?CO():void 0,...q}),p&&EO({...q}),PO({...q,apply:({elements:ne,rects:Y,availableWidth:ae,availableHeight:xe})=>{const{width:qe,height:Oe}=Y.reference,Ue=ne.floating.style;Ue.setProperty("--radix-popper-available-width",`${ae}px`),Ue.setProperty("--radix-popper-available-height",`${xe}px`),Ue.setProperty("--radix-popper-anchor-width",`${qe}px`),Ue.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),A&&RO({element:A,padding:d}),FO({arrowWidth:D,arrowHeight:O}),v&&TO({strategy:"referenceHidden",...q})]}),[Z,P]=Oj(F),M=Xs(C);Es(()=>{B&&(M==null||M())},[B,M]);const Q=(fe=U.arrow)==null?void 0:fe.x,L=(be=U.arrow)==null?void 0:be.y,ge=((je=U.arrow)==null?void 0:je.centerOffset)!==0,[Ne,te]=g.useState();return Es(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),o.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:B?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[(we=U.transformOrigin)==null?void 0:we.x,(Ye=U.transformOrigin)==null?void 0:Ye.y].join(" "),...((Xe=U.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(OO,{scope:n,placedSide:Z,onArrowChange:I,arrowX:Q,arrowY:L,shouldHideArrow:ge,children:o.jsx($t.div,{"data-side":Z,"data-align":P,...k,ref:N,style:{...k.style,animation:B?void 0:"none"}})})})});Dj.displayName=Hh;var Lj="PopperArrow",_O={top:"bottom",right:"left",bottom:"top",left:"right"},Ij=g.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,l=MO(Lj,s),c=_O[l.placedSide];return o.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:o.jsx(DO,{...a,ref:n,style:{...a.style,display:"block"}})})});Ij.displayName=Lj;function $O(e){return e!==null}var FO=e=>({name:"transformOrigin",options:e,fn(t){var j,S,T;const{placement:n,rects:s,middlewareData:a}=t,c=((j=a.arrow)==null?void 0:j.centerOffset)!==0,d=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=Oj(n),x={start:"0%",center:"50%",end:"100%"}[h],v=(((S=a.arrow)==null?void 0:S.x)??0)+d/2,b=(((T=a.arrow)==null?void 0:T.y)??0)+p/2;let C="",k="";return m==="bottom"?(C=c?x:`${v}px`,k=`${-p}px`):m==="top"?(C=c?x:`${v}px`,k=`${s.floating.height+p}px`):m==="right"?(C=`${-p}px`,k=c?x:`${b}px`):m==="left"&&(C=`${s.floating.width+p}px`,k=c?x:`${b}px`),{data:{x:C,y:k}}}});function Oj(e){const[t,n="center"]=e.split("-");return[t,n]}var zO=Tj,BO=Aj,UO=Dj,HO=Ij,WO=Symbol("radix.slottable");function VO(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=WO,t}var qO=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"}),KO="VisuallyHidden",Mj=g.forwardRef((e,t)=>o.jsx($t.span,{...e,ref:t,style:{...qO,...e.style}}));Mj.displayName=KO;var GO=Mj,[ou]=Zs("Tooltip",[Ej]),iu=Ej(),_j="TooltipProvider",YO=700,kp="tooltip.open",[XO,Wh]=ou(_j),$j=e=>{const{__scopeTooltip:t,delayDuration:n=YO,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:l}=e,c=g.useRef(!0),d=g.useRef(!1),p=g.useRef(0);return g.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),o.jsx(XO,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(p.current),c.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:d,onPointerInTransitChange:g.useCallback(m=>{d.current=m},[]),disableHoverableContent:a,children:l})};$j.displayName=_j;var ka="Tooltip",[QO,_a]=ou(ka),Fj=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,p=Wh(ka,e.__scopeTooltip),m=iu(t),[h,x]=g.useState(null),v=$o(),b=g.useRef(0),C=c??p.disableHoverableContent,k=d??p.delayDuration,j=g.useRef(!1),[S,T]=zc({prop:s,defaultProp:a??!1,onChange:D=>{D?(p.onOpen(),document.dispatchEvent(new CustomEvent(kp))):p.onClose(),l==null||l(D)},caller:ka}),N=g.useMemo(()=>S?j.current?"delayed-open":"instant-open":"closed",[S]),A=g.useCallback(()=>{window.clearTimeout(b.current),b.current=0,j.current=!1,T(!0)},[T]),I=g.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),R=g.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{j.current=!0,T(!0),b.current=0},k)},[k,T]);return g.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(zO,{...m,children:o.jsx(QO,{scope:t,contentId:v,open:S,stateAttribute:N,trigger:h,onTriggerChange:x,onTriggerEnter:g.useCallback(()=>{p.isOpenDelayedRef.current?R():A()},[p.isOpenDelayedRef,R,A]),onTriggerLeave:g.useCallback(()=>{C?I():(window.clearTimeout(b.current),b.current=0)},[I,C]),onOpen:A,onClose:I,disableHoverableContent:C,children:n})})};Fj.displayName=ka;var Sp="TooltipTrigger",zj=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=_a(Sp,n),l=Wh(Sp,n),c=iu(n),d=g.useRef(null),p=mn(t,d,a.onTriggerChange),m=g.useRef(!1),h=g.useRef(!1),x=g.useCallback(()=>m.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),o.jsx(BO,{asChild:!0,...c,children:o.jsx($t.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:p,onPointerMove:yt(e.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:yt(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:yt(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:yt(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:yt(e.onBlur,a.onClose),onClick:yt(e.onClick,a.onClose)})})});zj.displayName=Sp;var Vh="TooltipPortal",[JO,ZO]=ou(Vh,{forceMount:void 0}),Bj=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:a}=e,l=_a(Vh,t);return o.jsx(JO,{scope:t,forceMount:n,children:o.jsx(eo,{present:n||l.open,children:o.jsx(Yp,{asChild:!0,container:a,children:s})})})};Bj.displayName=Vh;var Go="TooltipContent",Uj=g.forwardRef((e,t)=>{const n=ZO(Go,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...l}=e,c=_a(Go,e.__scopeTooltip);return o.jsx(eo,{present:s||c.open,children:c.disableHoverableContent?o.jsx(Hj,{side:a,...l,ref:t}):o.jsx(eM,{side:a,...l,ref:t})})}),eM=g.forwardRef((e,t)=>{const n=_a(Go,e.__scopeTooltip),s=Wh(Go,e.__scopeTooltip),a=g.useRef(null),l=mn(t,a),[c,d]=g.useState(null),{trigger:p,onClose:m}=n,h=a.current,{onPointerInTransitChange:x}=s,v=g.useCallback(()=>{d(null),x(!1)},[x]),b=g.useCallback((C,k)=>{const j=C.currentTarget,S={x:C.clientX,y:C.clientY},T=oM(S,j.getBoundingClientRect()),N=iM(S,T),A=aM(k.getBoundingClientRect()),I=cM([...N,...A]);d(I),x(!0)},[x]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(p&&h){const C=j=>b(j,h),k=j=>b(j,p);return p.addEventListener("pointerleave",C),h.addEventListener("pointerleave",k),()=>{p.removeEventListener("pointerleave",C),h.removeEventListener("pointerleave",k)}}},[p,h,b,v]),g.useEffect(()=>{if(c){const C=k=>{const j=k.target,S={x:k.clientX,y:k.clientY},T=(p==null?void 0:p.contains(j))||(h==null?void 0:h.contains(j)),N=!lM(S,c);T?v():N&&(v(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,h,c,m,v]),o.jsx(Hj,{...e,ref:l})}),[tM,nM]=ou(ka,{isInside:!1}),rM=VO("TooltipContent"),Hj=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,p=_a(Go,n),m=iu(n),{onClose:h}=p;return g.useEffect(()=>(document.addEventListener(kp,h),()=>document.removeEventListener(kp,h)),[h]),g.useEffect(()=>{if(p.trigger){const x=v=>{const b=v.target;b!=null&&b.contains(p.trigger)&&h()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,h]),o.jsx(Gp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:h,children:o.jsxs(UO,{"data-state":p.stateAttribute,...m,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(rM,{children:s}),o.jsx(tM,{scope:n,isInside:!0,children:o.jsx(GO,{id:p.contentId,role:"tooltip",children:a||s})})]})})});Uj.displayName=Go;var Wj="TooltipArrow",sM=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=iu(n);return nM(Wj,n).isInside?null:o.jsx(HO,{...a,...s,ref:t})});sM.displayName=Wj;function oM(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,a,l)){case l:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function iM(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 aM(e){const{top:t,right:n,bottom:s,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:s},{x:a,y:s}]}function lM(e,t){const{x:n,y:s}=e;let a=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],p=t[c],m=d.x,h=d.y,x=p.x,v=p.y;h>s!=v>s&&n<(x-m)*(s-h)/(v-h)+m&&(a=!a)}return a}function cM(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),uM(t)}function uM(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var dM=$j,fM=Fj,pM=zj,hM=Bj,Vj=Uj;const da=dM,fa=fM,pa=pM,Wo=g.forwardRef(({className:e,sideOffset:t=4,...n},s)=>o.jsx(hM,{children:o.jsx(Vj,{ref:s,sideOffset:t,className:Be("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})}));Wo.displayName=Vj.displayName;function mM({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:v,setNodeRef:b,setActivatorNodeRef:C,transform:k,transition:j,isDragging:S}=uj({id:e.id,disabled:m}),T={transform:qo.Transform.toString(k),transition:j,zIndex:S?50:void 0,position:S?"relative":void 0};return o.jsxs("div",{ref:b,style:T,"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 ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[o.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&&o.jsx("button",{ref:C,...x,...v,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:o.jsx(vb,{className:"h-4 w-4"})}),o.jsx(Oh,{status:e.status,onChange:N=>c(e.id,N)}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&o.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&o.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),o.jsx(qj,{item:e})]}),t===e.id?o.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[o.jsx(Ea,{className:"h-3 w-3"})," Copied to clipboard"]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:o.jsx(Mc,{className:"h-3 w-3"})}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:o.jsx(mb,{className:"h-3 w-3"})}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:o.jsx(Or,{className:"h-3 w-3"})})]})]})}function qj({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:o.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 align-middle",children:[e.branch?o.jsx(da,{delayDuration:120,children:o.jsxs(fa,{children:[o.jsx(pa,{asChild:!0,children:o.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:[o.jsx(Mp,{className:"h-2.5 w-2.5"}),o.jsx("span",{className:"max-w-[120px] truncate",children:e.branch})]})}),o.jsx(Wo,{children:e.branch})]})}):null,e.planDir?o.jsx(da,{delayDuration:120,children:o.jsxs(fa,{children:[o.jsx(pa,{asChild:!0,children:o.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:o.jsx(yb,{className:"h-2.5 w-2.5"})})}),o.jsxs(Wo,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?o.jsx(da,{delayDuration:120,children:o.jsxs(fa,{children:[o.jsx(pa,{asChild:!0,children:o.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),o.jsx(Wo,{children:o.jsxs("div",{className:"space-y-0.5 text-xs font-mono",children:[e.worktreePath?o.jsxs("div",{children:["worktree: ",e.worktreePath]}):null,e.createdAt?o.jsxs("div",{children:["created: ",e.createdAt]}):null,e.updatedAt?o.jsxs("div",{children:["updated: ",e.updatedAt]}):null]})})]})}):null]})}function gM(){const{workspace:e}=mt(),t=e||"_global",{data:n,loading:s,error:a,refetch:l}=eE(t),[c,d]=g.useState(""),[p,m]=g.useState(""),[h,x]=g.useState(""),[v,b]=g.useState(""),[C,k]=g.useState(null),[j,S]=g.useState(new Set),[T,N]=g.useState(!1),[A,I]=g.useState(!1),[R,D]=g.useState(null),O=g.useRef(null);ro("list:todos");const G=!!(c.trim()||p||h),re=H0(Cc(Qc,{activationConstraint:{distance:8}}),Cc(Xc));function z(Y,ae){Y.stopPropagation(),navigator.clipboard.writeText(ae),k(ae),setTimeout(()=>k(xe=>xe===ae?null:xe),1500)}const K=g.useMemo(()=>{if(!(n!=null&&n.items))return[];const Y=new Set;for(const ae of n.items)for(const xe of ae.tags)Y.add(xe);return Array.from(Y).sort()},[n]),q=g.useMemo(()=>{if(!(n!=null&&n.items))return[];let Y=n.items;if(c.trim()){const ae=c.toLowerCase();Y=Y.filter(xe=>xe.description.toLowerCase().includes(ae)||xe.tags.some(qe=>qe.toLowerCase().includes(ae))||xe.id.includes(ae))}return p&&(Y=Y.filter(ae=>ae.status===p)),h&&(Y=Y.filter(ae=>ae.tags.includes(h))),Y},[n,c,p,h]);g.useEffect(()=>{S(new Set)},[c,p,h,t]);const J=g.useMemo(()=>q.filter(Y=>j.has(Y.id)).length,[q,j]),_=q.length>0&&J===q.length,F=J>0&&!_;function B(Y){S(ae=>{const xe=new Set(ae);return xe.has(Y)?xe.delete(Y):xe.add(Y),xe})}function U(){S(Y=>{const ae=new Set(Y);if(_)for(const xe of q)ae.delete(xe.id);else for(const xe of q)ae.add(xe.id);return ae})}function Z(){S(new Set)}const P=R?[R]:Array.from(j);function M(){S(new Set),D(null),l()}function Q(){S(new Set),l()}async function L(){v.trim()&&(await Kp(t,v.trim()),b(""),l())}const ge={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function Ne(Y,ae){fe(Y,ge[ae]||"open")}async function te(Y,ae,xe){Y.stopPropagation(),window.confirm(`Delete "${xe}"? This can't be undone.`)&&(await Zb(t,ae),l())}async function fe(Y,ae){switch(ae){case"open":await Jb(t,Y);break;case"in_progress":await Qb(t,Y);break;case"completed":await Yb(t,Y);break;case"blocked":await Xb(t,Y);break}l()}const{hotkeyRowProps:be}=Ta(q,{scope:"list:todos",bindO:!1,onOpen:Y=>Ne(Y.id,Y.status)});xt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var Y;return(Y=O.current)==null?void 0:Y.focus()}}),xt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[je,we]=Ir(),Ye=je.get("focus");g.useEffect(()=>{if(!Ye)return;const Y=document.querySelector(`[data-todo-id="${window.CSS.escape(Ye)}"]`);if(!Y)return;Y.scrollIntoView({block:"nearest"}),Y.classList.add("ring-2","ring-primary/60");const ae=window.setTimeout(()=>{Y.classList.remove("ring-2","ring-primary/60"),we(xe=>{const qe=new URLSearchParams(xe);return qe.delete("focus"),qe})},1500);return()=>window.clearTimeout(ae)},[Ye,q.length,we]);async function Xe(Y){const{active:ae,over:xe}=Y;if(!xe||ae.id===xe.id||!(n!=null&&n.items))return;const qe=n.items.findIndex(Ge=>Ge.id===ae.id),Oe=n.items.findIndex(Ge=>Ge.id===xe.id);if(qe===-1||Oe===-1)return;const Ue=eu(n.items,qe,Oe);await tE(t,Ue.map(Ge=>Ge.id)),l()}if(s)return o.jsx(ot,{label:"Loading todos..."});if(a)return o.jsx(Ze,{error:a});const ne=(n==null?void 0:n.counts)||{open:0,in_progress:0,blocked:0,total:0};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[o.jsx(st,{label:"Open",value:ne.open,icon:Un}),o.jsx(st,{label:"In Progress",value:ne.in_progress,icon:Un,tone:"info"}),o.jsx(st,{label:"Blocked",value:ne.blocked,icon:Qo,tone:"warn"}),o.jsx(st,{label:"Total",value:ne.total,icon:Un})]}),o.jsx("div",{className:"surface-panel p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",placeholder:"Add a todo...",value:v,onChange:Y=>b(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&L(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),o.jsxs("button",{onClick:L,disabled:!v.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:[o.jsx(Wt,{className:"h-4 w-4"}),"Add"]})]})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"relative flex-1 max-w-sm",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{ref:O,type:"text",placeholder:"Search...",value:c,onChange:Y=>d(Y.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"})]}),o.jsxs("select",{value:p,onChange:Y=>m(Y.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:[o.jsx("option",{value:"",children:"All statuses"}),o.jsx("option",{value:"open",children:"Open"}),o.jsx("option",{value:"in_progress",children:"In Progress"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"blocked",children:"Blocked"})]}),K.length>0&&o.jsxs("select",{value:h,onChange:Y=>x(Y.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:[o.jsx("option",{value:"",children:"All tags"}),K.map(Y=>o.jsxs("option",{value:Y,children:["#",Y]},Y))]})]}),j.size>0?o.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[o.jsxs("span",{className:"text-sm font-medium",children:[j.size," selected"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:()=>N(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),o.jsx("button",{type:"button",onClick:()=>{D(null),I(!0)},className:"shell-action",children:"Move to…"}),o.jsx("button",{type:"button",onClick:Z,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,q.length===0?o.jsx(tt,{title:"No todos",description:"Add your first todo above."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[o.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:_,ref:Y=>{Y&&(Y.indeterminate=F)},onChange:U,className:"h-4 w-4 cursor-pointer accent-foreground"}),o.jsxs("span",{children:["Select all in current filter (",q.length,")"]})]}),o.jsx(rj,{sensors:re,collisionDetection:W0,onDragEnd:Xe,children:o.jsx(lj,{items:q.map(Y=>Y.id),strategy:oj,children:o.jsx("div",{className:"space-y-1",children:q.map((Y,ae)=>o.jsx(mM,{item:Y,copiedId:C,selected:j.has(Y.id),onToggleSelected:xe=>B(xe),onMoveOne:(xe,qe)=>{qe.stopPropagation(),D(xe),I(!0)},onCycleStatus:Ne,onStatusChange:fe,onCopyId:z,onDelete:te,disabled:G,hotkeyRowProps:be(ae)},Y.id))})})})]}),o.jsx(fj,{open:T,selectedIds:Array.from(j),scope:{kind:"workspace",workspace:t},onOpenChange:N,onDone:Q}),o.jsx(pj,{open:A,selectedIds:P,scope:{kind:"workspace",workspace:t},onOpenChange:Y=>{I(Y),Y||D(null)},onDone:M})]})}function xM({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:v,setNodeRef:b,setActivatorNodeRef:C,transform:k,transition:j,isDragging:S}=uj({id:e.id,disabled:m}),T={transform:qo.Transform.toString(k),transition:j,zIndex:S?50:void 0,position:S?"relative":void 0};return o.jsxs("div",{ref:b,style:T,"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 ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[o.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&&o.jsx("button",{ref:C,...x,...v,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:o.jsx(vb,{className:"h-4 w-4"})}),o.jsx(Oh,{status:e.status,onChange:N=>c(e.id,N)}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&o.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&o.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),o.jsx(qj,{item:e})]}),t===e.id?o.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[o.jsx(Ea,{className:"h-3 w-3"})," Copied to clipboard"]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:o.jsx(Mc,{className:"h-3 w-3"})}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:o.jsx(mb,{className:"h-3 w-3"})}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:o.jsx(Or,{className:"h-3 w-3"})})]})]})}function yM({projectId:e}){const{data:t,loading:n,error:s,refetch:a}=gI(e),[l,c]=g.useState(""),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(""),[b,C]=g.useState(null),[k,j]=g.useState(new Set),[S,T]=g.useState(!1),[N,A]=g.useState(!1),[I,R]=g.useState(null),D=g.useRef(null);ro("list:todos");const O=!!(l.trim()||d||m),G=H0(Cc(Qc,{activationConstraint:{distance:8}}),Cc(Xc));function re(ne,Y){ne.stopPropagation(),navigator.clipboard.writeText(Y),C(Y),setTimeout(()=>C(ae=>ae===Y?null:ae),1500)}const z=g.useMemo(()=>{if(!(t!=null&&t.items))return[];const ne=new Set;for(const Y of t.items)for(const ae of Y.tags)ne.add(ae);return Array.from(ne).sort()},[t]),K=g.useMemo(()=>{if(!(t!=null&&t.items))return[];let ne=t.items;if(l.trim()){const Y=l.toLowerCase();ne=ne.filter(ae=>ae.description.toLowerCase().includes(Y)||ae.tags.some(xe=>xe.toLowerCase().includes(Y))||ae.id.includes(Y))}return d&&(ne=ne.filter(Y=>Y.status===d)),m&&(ne=ne.filter(Y=>Y.tags.includes(m))),ne},[t,l,d,m]);g.useEffect(()=>{j(new Set)},[l,d,m,e]);const q=g.useMemo(()=>K.filter(ne=>k.has(ne.id)).length,[K,k]),J=K.length>0&&q===K.length,_=q>0&&!J;function F(ne){j(Y=>{const ae=new Set(Y);return ae.has(ne)?ae.delete(ne):ae.add(ne),ae})}function B(){j(ne=>{const Y=new Set(ne);if(J)for(const ae of K)Y.delete(ae.id);else for(const ae of K)Y.add(ae.id);return Y})}function U(){j(new Set)}const Z=I?[I]:Array.from(k);function P(){j(new Set),R(null),a()}function M(){j(new Set),a()}async function Q(){x.trim()&&(await xI(e,x.trim()),v(""),a())}const L={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ge(ne,Y){te(ne,L[Y]||"open")}async function Ne(ne,Y,ae){ne.stopPropagation(),window.confirm(`Delete "${ae}"? This can't be undone.`)&&(await kI(e,Y),a())}async function te(ne,Y){switch(Y){case"open":await wI(e,ne);break;case"in_progress":await bI(e,ne);break;case"completed":await yI(e,ne);break;case"blocked":await vI(e,ne);break}a()}const{hotkeyRowProps:fe}=Ta(K,{scope:"list:todos",bindO:!1,onOpen:ne=>ge(ne.id,ne.status)});xt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ne;return(ne=D.current)==null?void 0:ne.focus()}}),xt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>a()});const[be,je]=Ir(),we=be.get("focus");g.useEffect(()=>{if(!we)return;const ne=document.querySelector(`[data-todo-id="${window.CSS.escape(we)}"]`);if(!ne)return;ne.scrollIntoView({block:"nearest"}),ne.classList.add("ring-2","ring-primary/60");const Y=window.setTimeout(()=>{ne.classList.remove("ring-2","ring-primary/60"),je(ae=>{const xe=new URLSearchParams(ae);return xe.delete("focus"),xe},{replace:!0})},1500);return()=>window.clearTimeout(Y)},[we,K.length,je]);async function Ye(ne){const{active:Y,over:ae}=ne;if(!ae||Y.id===ae.id||!(t!=null&&t.items))return;const xe=t.items.findIndex(Ue=>Ue.id===Y.id),qe=t.items.findIndex(Ue=>Ue.id===ae.id);if(xe===-1||qe===-1)return;const Oe=eu(t.items,xe,qe);await jI(e,Oe.map(Ue=>Ue.id)),a()}if(n)return o.jsx(ot,{label:"Loading todos..."});if(s)return o.jsx(Ze,{error:s});const Xe=(t==null?void 0:t.counts)||{open:0,in_progress:0,blocked:0,total:0};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[o.jsx(st,{label:"Open",value:Xe.open,icon:Un}),o.jsx(st,{label:"In Progress",value:Xe.in_progress,icon:Un,tone:"info"}),o.jsx(st,{label:"Blocked",value:Xe.blocked,icon:Qo,tone:"warn"}),o.jsx(st,{label:"Total",value:Xe.total,icon:Un})]}),o.jsx("div",{className:"surface-panel p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:ne=>v(ne.target.value),onKeyDown:ne=>ne.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"}),o.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:[o.jsx(Wt,{className:"h-4 w-4"}),"Add"]})]})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"relative flex-1 max-w-sm",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{ref:D,type:"text",placeholder:"Search...",value:l,onChange:ne=>c(ne.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),o.jsxs("select",{value:d,onChange:ne=>p(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[o.jsx("option",{value:"",children:"All statuses"}),o.jsx("option",{value:"open",children:"Open"}),o.jsx("option",{value:"in_progress",children:"In Progress"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"blocked",children:"Blocked"})]}),z.length>0&&o.jsxs("select",{value:m,onChange:ne=>h(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[o.jsx("option",{value:"",children:"All tags"}),z.map(ne=>o.jsxs("option",{value:ne,children:["#",ne]},ne))]})]}),k.size>0?o.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[o.jsxs("span",{className:"text-sm font-medium",children:[k.size," selected"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:()=>T(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),o.jsx("button",{type:"button",onClick:()=>{R(null),A(!0)},className:"shell-action",children:"Move to…"}),o.jsx("button",{type:"button",onClick:U,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,K.length===0?o.jsx(tt,{title:"No todos",description:"Add your first todo above."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[o.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:J,ref:ne=>{ne&&(ne.indeterminate=_)},onChange:B,className:"h-4 w-4 cursor-pointer accent-foreground"}),o.jsxs("span",{children:["Select all in current filter (",K.length,")"]})]}),o.jsx(rj,{sensors:G,collisionDetection:W0,onDragEnd:Ye,children:o.jsx(lj,{items:K.map(ne=>ne.id),strategy:oj,children:o.jsx("div",{className:"space-y-1",children:K.map((ne,Y)=>o.jsx(xM,{item:ne,copiedId:b,selected:k.has(ne.id),onToggleSelected:ae=>F(ae),onMoveOne:(ae,xe)=>{xe.stopPropagation(),R(ae),A(!0)},onCycleStatus:ge,onStatusChange:te,onCopyId:re,onDelete:Ne,disabled:O,hotkeyRowProps:fe(Y)},ne.id))})})})]}),o.jsx(fj,{open:S,selectedIds:Array.from(k),scope:{kind:"project",projectId:e},onOpenChange:T,onDone:M}),o.jsx(pj,{open:N,selectedIds:Z,scope:{kind:"project",projectId:e},onOpenChange:ne=>{A(ne),ne||R(null)},onDone:P})]})}const vM=new Set(["overview","assignments","todos","dependencies","knowledge"]);function Lv(){const{slug:e}=mt(),t=_t(),n=St();ro("project"),xt({keys:"a",scope:"project",description:"Create assignment",handler:()=>n(`${t}/projects/${e}/create/assignment`)}),xt({keys:"e",scope:"project",description:"Edit project",handler:()=>n(`${t}/projects/${e}/edit`)});const{data:s,loading:a,error:l,refetch:c}=Vb(e),d=Wc(),{data:p}=Wp(),[m,h]=Ir(),x=m.get("tab"),v=x&&vM.has(x)?x:"overview";function b(z){h(K=>{const q=new URLSearchParams(K);return z==="overview"?q.delete("tab"):q.set("tab",z),q},{replace:!0})}const[C,k]=g.useState("board"),[j,S]=g.useState("all"),[T,N]=g.useState("all"),[A,I]=g.useState("all"),R=g.useMemo(()=>s?Object.fromEntries(s.assignments.flatMap(z=>{const K=`${t}/projects/${s.slug}/assignments/${z.slug}`;return[[z.slug,K],[z.title,K]]})):{},[s]);async function D(z){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:z})}),c()}async function O(z){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:z})}),c()}if(a)return o.jsx(ot,{label:"Loading project workspace…"});if(l||!s)return o.jsx(Ze,{error:l||"Project not found."});const G=Array.from(new Set(s.assignments.map(z=>z.assignee).filter(Boolean))).sort(),re=s.assignments.filter(z=>!(j!=="all"&&z.status!==j||T!=="all"&&z.assignee!==T||A!=="all"&&z.priority!==A));return o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Zt,{status:s.status}),s.statusOverride&&o.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>D(null),title:"Clear manual status override and return to derived status",children:"Clear Override"}),o.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:z=>{z.target.value&&D(z.target.value)},title:"Override project status",children:[o.jsx("option",{value:"",children:"Set Status…"}),d.statuses.map(z=>o.jsx("option",{value:z.id,children:z.label},z.id)),o.jsx("option",{value:"active",children:"Active"})]}),p&&p.workspaces.length>0&&o.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:z=>{z.target.value==="_ungrouped"?O(null):z.target.value&&O(z.target.value)},title:"Move project to a different workspace",children:[o.jsx("option",{value:"",children:"Move to Workspace…"}),p.workspaces.filter(z=>z!==s.workspace).map(z=>o.jsx("option",{value:z,children:z},z)),s.workspace&&o.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),o.jsxs(ye,{className:"shell-action",to:`${t}/projects/${s.slug}/edit`,children:[o.jsx(Bx,{className:"h-4 w-4"}),o.jsx("span",{children:"Edit Project"})]}),o.jsxs(ye,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:[o.jsx(Wt,{className:"h-4 w-4"}),o.jsx("span",{children:"New Assignment"})]}),o.jsx(dh,{externalIds:s.externalIds}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",Ar(s.created),". Last source update ",Rn(s.updated),"."]})]}),o.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[o.jsx(st,{label:"Assignments",value:s.progress.total}),o.jsx(st,{label:"In Progress",value:s.progress.in_progress??0,tone:"info"}),o.jsx(st,{label:"Review",value:s.progress.review??0,tone:"info"}),o.jsx(st,{label:"Blocked",value:s.progress.blocked??0,tone:"warn"}),o.jsx(st,{label:"Completed",value:s.progress.completed??0,tone:"success"})]}),o.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[o.jsx("div",{className:"space-y-4",children:o.jsx(ph,{value:v,onValueChange:b,items:[{value:"overview",label:"Overview",content:o.jsx("div",{className:"space-y-5",children:o.jsx(Ie,{title:"Project Overview",children:o.jsx(Mt,{content:s.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:s.assignments.length,content:o.jsx("div",{className:"space-y-5",children:o.jsx(Ie,{title:"Assignment Queue",description:"Board and table views over the source assignment files.",actions:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("select",{value:j,onChange:z=>S(z.target.value),className:"editor-input max-w-[170px]",children:[o.jsx("option",{value:"all",children:"All statuses"}),d.statuses.map(z=>o.jsx("option",{value:z.id,children:z.label},z.id))]}),o.jsxs("select",{value:T,onChange:z=>N(z.target.value),className:"editor-input max-w-[170px]",children:[o.jsx("option",{value:"all",children:"All assignees"}),G.map(z=>o.jsx("option",{value:z??"",children:z},z))]}),o.jsxs("select",{value:A,onChange:z=>I(z.target.value),className:"editor-input max-w-[170px]",children:[o.jsx("option",{value:"all",children:"All priorities"}),o.jsx("option",{value:"low",children:"Low"}),o.jsx("option",{value:"medium",children:"Medium"}),o.jsx("option",{value:"high",children:"High"}),o.jsx("option",{value:"critical",children:"Critical"})]}),o.jsx(ch,{value:C,onChange:z=>k(z),options:[{value:"board",label:"Board"},{value:"table",label:"Table"}]})]}),children:re.length===0?o.jsx(tt,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:o.jsx(ye,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${s.slug}/create/assignment`,children:"Create Assignment"})}):C==="board"?o.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:re.map(z=>o.jsx(bM,{projectSlug:s.slug,assignment:z},z.slug))}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[o.jsx("th",{className:"pb-3 font-medium",children:"Assignment"}),o.jsx("th",{className:"pb-3 font-medium",children:"Status"}),o.jsx("th",{className:"pb-3 font-medium",children:"Priority"}),o.jsx("th",{className:"pb-3 font-medium",children:"Assignee"}),o.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),o.jsx("tbody",{children:re.map(z=>o.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[o.jsx("td",{className:"py-4",children:o.jsx(ye,{to:`${t}/projects/${s.slug}/assignments/${z.slug}`,className:"font-semibold text-foreground hover:text-primary",children:z.title})}),o.jsx("td",{className:"py-4",children:o.jsx(Zt,{status:z.status})}),o.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:z.priority}),o.jsx("td",{className:"py-4 text-muted-foreground",children:z.assignee??"—"}),o.jsx("td",{className:"py-4 text-muted-foreground",children:Ar(z.updated)})]},z.slug))})]})})})})},{value:"todos",label:"Todos",content:o.jsx(yM,{projectId:s.slug})},{value:"dependencies",label:"Dependencies",content:s.dependencyGraph?o.jsx(Ie,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:o.jsx(pR,{definition:s.dependencyGraph,nodeRoutes:R})}):o.jsx(tt,{title:"No dependency graph yet",description:"Dependencies appear here once assignments declare dependsOn relationships."})},{value:"knowledge",label:"Knowledge",content:o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(Ie,{title:"Resources",description:"Shared project references.",actions:o.jsxs(ye,{className:"shell-action",to:`/resources/new?project=${s.slug}`,children:[o.jsx(Wt,{className:"h-4 w-4"}),o.jsx("span",{children:"New Resource"})]}),children:s.resources.length===0?o.jsx(tt,{title:"No resources yet",description:"Resources live at the project level and stay available to every assignment."}):o.jsx("div",{className:"space-y-3",children:s.resources.map(z=>o.jsxs(ye,{to:`/projects/${s.slug}/resources/${z.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:z.name}),o.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[z.category," · ",z.source]})]},z.slug))})}),o.jsx(Ie,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:o.jsxs(ye,{className:"shell-action",to:`/memories/new?project=${s.slug}`,children:[o.jsx(Wt,{className:"h-4 w-4"}),o.jsx("span",{children:"New Memory"})]}),children:s.memories.length===0?o.jsx(tt,{title:"No memories yet",description:"Memories capture patterns discovered during execution so later assignments can reuse them."}):o.jsx("div",{className:"space-y-3",children:s.memories.map(z=>o.jsxs(ye,{to:`/projects/${s.slug}/memories/${z.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:z.name}),o.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[z.scope," · ",z.source]})]},z.slug))})})]})}]})}),o.jsxs("div",{className:"space-y-5",children:[o.jsx(Ie,{title:"Progress Summary",children:o.jsx(bc,{progress:s.progress,showLegend:!0})}),o.jsx(Ie,{title:"Attention",children:o.jsxs("dl",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("dt",{className:"text-muted-foreground",children:"Blocked"}),o.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.blockedCount})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("dt",{className:"text-muted-foreground",children:"Failed"}),o.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.failedCount})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("dt",{className:"text-muted-foreground",children:"Unanswered questions"}),o.jsx("dd",{className:"font-semibold text-foreground",children:s.needsAttention.openQuestions})]})]})}),o.jsx(Ie,{title:"Quick Links",children:o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs(ye,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/edit`,children:[o.jsx(Bx,{className:"h-4 w-4"}),"Edit project source"]}),o.jsxs(ye,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${s.slug}/create/assignment`,children:[o.jsx(Wt,{className:"h-4 w-4"}),"Create assignment"]}),o.jsxs(ye,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[o.jsx(pC,{className:"h-4 w-4"}),"Review project rules"]}),o.jsxs("button",{type:"button",onClick:()=>b("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[o.jsx(Mp,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),s.archived?o.jsxs(Ie,{title:"Archive Metadata",children:[o.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",s.archivedAt?Rn(s.archivedAt):"with no timestamp recorded","."]}),s.archivedReason?o.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:s.archivedReason}):null]}):null]})]})]})}function bM({projectSlug:e,assignment:t}){const n=_t();return o.jsxs(ye,{to:`${n}/projects/${e}/assignments/${t.slug}`,className:"block rounded-lg border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),o.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),o.jsx("span",{onClick:s=>{s.preventDefault(),s.stopPropagation()},children:o.jsx(Yr,{value:t.id})})]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",Ar(t.updated)]})]}),o.jsx(Zt,{status:t.status})]}),o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[o.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:t.priority}),o.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:t.assignee??"Unassigned"}),o.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 Kj({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:a,onOpenChange:l}){const[c,d]=g.useState("");g.useEffect(()=>{e||d("")},[e,t==null?void 0:t.command]);const p=g.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 o.jsx(ei,{open:e,onOpenChange:v=>s?void 0:l(v),children:o.jsx(to,{className:"max-w-xl",children:o.jsxs("form",{className:"space-y-5",onSubmit:v=>{v.preventDefault(),a(x)},children:[o.jsxs(rh,{children:[o.jsx(no,{children:m}),o.jsx(Pa,{children:t.description})]}),t.warning?o.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,o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:p}),o.jsx("textarea",{value:c,onChange:v=>d(v.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"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave this blank to continue without a written reason."})]}),o.jsxs(sh,{children:[o.jsx("button",{type:"button",onClick:()=>l(!1),disabled:s,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),o.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})]})]})})})}var wM=Symbol("radix.slottable");function jM(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wM,t}var Gj="AlertDialog",[kM]=Zs(Gj,[mw]),es=mw(),Yj=e=>{const{__scopeAlertDialog:t,...n}=e,s=es(t);return o.jsx(Aw,{...s,...n,modal:!0})};Yj.displayName=Gj;var SM="AlertDialogTrigger",NM=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=es(n);return o.jsx(KP,{...a,...s,ref:t})});NM.displayName=SM;var CM="AlertDialogPortal",Xj=e=>{const{__scopeAlertDialog:t,...n}=e,s=es(t);return o.jsx(Dw,{...s,...n})};Xj.displayName=CM;var EM="AlertDialogOverlay",Qj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=es(n);return o.jsx(Zp,{...a,...s,ref:t})});Qj.displayName=EM;var Vo="AlertDialogContent",[PM,TM]=kM(Vo),RM=jM("AlertDialogContent"),Jj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,l=es(n),c=g.useRef(null),d=mn(t,c),p=g.useRef(null);return o.jsx(HP,{contentName:Vo,titleName:Zj,docsSlug:"alert-dialog",children:o.jsx(PM,{scope:n,cancelRef:p,children:o.jsxs(eh,{role:"alertdialog",...l,...a,ref:d,onOpenAutoFocus:yt(a.onOpenAutoFocus,m=>{var h;m.preventDefault(),(h=p.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(RM,{children:s}),o.jsx(DM,{contentRef:c})]})})})});Jj.displayName=Vo;var Zj="AlertDialogTitle",e1=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=es(n);return o.jsx(th,{...a,...s,ref:t})});e1.displayName=Zj;var t1="AlertDialogDescription",n1=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=es(n);return o.jsx(nh,{...a,...s,ref:t})});n1.displayName=t1;var AM="AlertDialogAction",r1=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=es(n);return o.jsx(Lw,{...a,...s,ref:t})});r1.displayName=AM;var s1="AlertDialogCancel",o1=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=TM(s1,n),l=es(n),c=mn(t,a);return o.jsx(Lw,{...l,...s,ref:c})});o1.displayName=s1;var DM=({contentRef:e})=>{const t=`\`${Vo}\` requires a description for the component to be accessible for screen reader users.
|
|
487
|
+
|
|
488
|
+
You can add a description to the \`${Vo}\` by passing a \`${t1}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
489
|
+
|
|
490
|
+
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 \`${Vo}\`. 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.
|
|
491
|
+
|
|
492
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},LM=Yj,IM=Xj,i1=Qj,a1=Jj,l1=r1,c1=o1,u1=e1,d1=n1;const OM=LM,MM=IM,f1=g.forwardRef(({className:e,...t},n)=>o.jsx(i1,{ref:n,className:Be("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));f1.displayName=i1.displayName;const p1=g.forwardRef(({className:e,...t},n)=>o.jsxs(MM,{children:[o.jsx(f1,{}),o.jsx(a1,{ref:n,className:Be("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})]}));p1.displayName=a1.displayName;function _M({className:e,...t}){return o.jsx("div",{className:Be("flex flex-col space-y-2 text-left",e),...t})}function $M({className:e,...t}){return o.jsx("div",{className:Be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const h1=g.forwardRef(({className:e,...t},n)=>o.jsx(u1,{ref:n,className:Be("text-lg font-semibold tracking-tight text-foreground",e),...t}));h1.displayName=u1.displayName;const m1=g.forwardRef(({className:e,...t},n)=>o.jsx(d1,{ref:n,className:Be("text-sm leading-6 text-muted-foreground",e),...t}));m1.displayName=d1.displayName;const g1=g.forwardRef(({className:e,...t},n)=>o.jsx(l1,{ref:n,className:Be(e),...t}));g1.displayName=l1.displayName;const x1=g.forwardRef(({className:e,...t},n)=>o.jsx(c1,{ref:n,className:Be(e),...t}));x1.displayName=c1.displayName;function y1({open:e,title:t,description:n,confirmLabel:s,cancelLabel:a="Cancel",loading:l=!1,destructive:c=!1,onConfirm:d,onOpenChange:p}){return o.jsx(OM,{open:e,onOpenChange:m=>l?void 0:p(m),children:o.jsxs(p1,{children:[o.jsxs(_M,{children:[o.jsx(h1,{children:t}),o.jsx(m1,{children:n})]}),o.jsxs($M,{children:[o.jsx(x1,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:a}),o.jsx(g1,{disabled:l,className:`shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50 ${c?"border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-foreground text-background hover:opacity-90"}`,onClick:m=>{m.preventDefault(),d()},children:l?"Working...":s})]})]})})}function FM({items:e,align:t="end"}){const[n,s]=g.useState(!1),a=g.useRef(null);return g.useEffect(()=>{if(!n)return;function l(d){a.current&&!a.current.contains(d.target)&&s(!1)}function c(d){d.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[n]),e.length===0?null:o.jsxs("div",{className:"relative",ref:a,children:[o.jsx("button",{type:"button",onClick:()=>s(l=>!l),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:o.jsx(kC,{className:"h-4 w-4"})}),n&&o.jsx("div",{className:Be("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:o.jsx(da,{delayDuration:200,children:e.map(l=>{const c=l.icon,d=Be("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=o.jsxs(o.Fragment,{children:[c?o.jsx(c,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{className:"truncate",children:l.label})]});if(l.disabled){const m=o.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:o.jsx("button",{type:"button",disabled:!0,className:d,children:p})});return l.disabledReason?o.jsxs(fa,{children:[o.jsx(pa,{asChild:!0,children:m}),o.jsx(Wo,{side:"left",children:l.disabledReason})]},l.key):o.jsx("div",{children:m},l.key)}return l.href?o.jsx(ye,{to:l.href,className:d,onClick:()=>s(!1),children:p},l.key):o.jsx("button",{type:"button",className:d,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:p},l.key)})})})]})}async function v1(e,t,n,s){const a=await fetch(`/api/projects/${e}/assignments/${t}/transitions/${n.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s?{reason:s}:{})}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${a.status}`);return l.assignment}async function b1(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}),a=await s.json().catch(()=>null);if(!s.ok)throw new Error((a==null?void 0:a.error)||`HTTP ${s.status}`);return a.assignment}async function zM(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 w1(e){return e.requiresReason||e.command==="block"}function BM(e){const t=e.split(`
|
|
493
|
+
`),n=t.findIndex(c=>/^##\s+Acceptance Criteria\s*$/i.test(c.trim()));if(n===-1)return{acceptanceCriteria:[],summaryBody:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).map(c=>c.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.*)$/)).filter(c=>!!c).map(c=>({checked:c[1].toLowerCase()==="x",text:c[2].trim()})),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
494
|
+
`).replace(/\n{3,}/g,`
|
|
495
|
+
|
|
496
|
+
`).trim();return{acceptanceCriteria:a,summaryBody:l}}function UM(e){const t=e.split(`
|
|
497
|
+
`),n=t.findIndex(c=>/^##\s+Todos\s*$/i.test(c.trim()));if(n===-1)return{hasSection:!1,todosMarkdown:"",remaining:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const a=t.slice(n+1,s).join(`
|
|
498
|
+
`).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
|
|
499
|
+
|
|
500
|
+
`).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
501
|
+
`).replace(/\n{3,}/g,`
|
|
502
|
+
|
|
503
|
+
`).trim();return{hasSection:!0,todosMarkdown:a,remaining:l}}function HM({projectSlug:e,dependencies:t,blockedReason:n}){const[s,a]=g.useState(!1);if(t.length===0)return null;const l=t.filter(d=>d.status!=="completed"&&d.status!=="review"),c=l.length===0;return c&&!s?o.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center gap-2 rounded-lg border border-success-foreground/30 bg-success/70 px-4 py-2.5 text-left transition hover:bg-success",children:[o.jsx(Lp,{className:"h-4 w-4 shrink-0 text-success-foreground"}),o.jsxs("span",{className:"text-sm font-medium text-success-foreground",children:["All ",t.length," ",t.length===1?"dependency":"dependencies"," resolved"]}),o.jsx(ya,{className:"ml-auto h-4 w-4 text-success-foreground"})]}):o.jsxs("div",{className:"space-y-3",children:[l.length>0&&o.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3",children:[o.jsx(Vf,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning-foreground"}),o.jsxs("div",{className:"text-sm text-warning-foreground",children:[o.jsxs("strong",{children:[l.length," ",l.length===1?"dependency is":"dependencies are"," not yet completed."]}),n&&o.jsxs("p",{className:"mt-1 text-warning-foreground/80",children:["Blocked reason: ",n]})]})]}),o.jsx(Ie,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?o.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs text-muted-foreground hover:text-foreground",children:"Collapse"}):void 0,children:o.jsx("div",{className:"divide-y divide-border/40",children:t.map(d=>o.jsxs(ye,{to:`/projects/${e}/assignments/${d.slug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[o.jsx(Zt,{status:d.status}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:d.slug})]}),d.assignee&&o.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:d.assignee}),o.jsx(gc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},d.slug))})})]})}function WM({links:e}){const t=_t();if(e.length===0)return null;const n=e.filter(a=>!a.isReverse),s=e.filter(a=>a.isReverse);return o.jsx(Ie,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:o.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(a=>o.jsxs(ye,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[o.jsx(fC,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsx(Zt,{status:a.status}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),o.jsx(gc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${a.slug}`)),s.map(a=>o.jsxs(ye,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[o.jsx(hb,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsx(Zt,{status:a.status}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),o.jsx(gc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${a.slug}`))]})})}function VM(e){const t=new Map;for(const s of e)t.set(s.id,{entry:s,replies:[]});const n=[];for(const s of e){const a=t.get(s.id);s.replyTo&&t.has(s.replyTo)?t.get(s.replyTo).replies.push(a):n.push(a)}return n}function qM(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function j1({projectSlug:e,assignmentSlug:t,entries:n}){const[s,a]=g.useState(n);g.useEffect(()=>{a(n)},[n]);const l=g.useMemo(()=>VM(s),[s]),[c,d]=g.useState(""),[p,m]=g.useState("note"),[h,x]=g.useState(!1),[v,b]=g.useState(null);async function C(j){var N;if(j.preventDefault(),!c.trim())return;x(!0),b(null);const S=`tmp-${Date.now()}`,T={id:S,timestamp:new Date().toISOString(),author:"human",type:p,body:c,resolved:p==="question"?!1:void 0};a(A=>[...A,T]);try{const A=await fetch(qM(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!A.ok){const D=await A.text();throw new Error(D||`HTTP ${A.status}`)}const I=await A.json().catch(()=>null),R=(N=I==null?void 0:I.comment)==null?void 0:N.id;a(D=>D.map(O=>O.id===S?{...O,id:R??O.id}:O)),d(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(A){b(A instanceof Error?A.message:String(A)),a(I=>I.filter(R=>R.id!==S))}finally{x(!1)}}async function k(j,S){a(T=>T.map(N=>N.id===j?{...N,resolved:S}:N));try{const T=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(j)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(j)}/resolved`,N=await fetch(T,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:S})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(T){b(T instanceof Error?T.message:String(T)),a(N=>N.map(A=>A.id===j?{...A,resolved:!S}:A))}}return o.jsx(Ie,{title:"Comments",description:"Threaded questions, notes, and feedback. Questions can be resolved once answered.",children:o.jsxs("div",{className:"space-y-4",children:[l.map(j=>o.jsx(k1,{node:j,onToggleResolved:k,depth:0},j.entry.id)),o.jsxs("form",{onSubmit:C,className:"mt-6 space-y-2 border-t border-border pt-4",children:[o.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Add comment"}),o.jsx("textarea",{value:c,onChange:j=>d(j.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…"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("select",{value:p,onChange:j=>m(j.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs",children:[o.jsx("option",{value:"note",children:"note"}),o.jsx("option",{value:"question",children:"question"}),o.jsx("option",{value:"feedback",children:"feedback"})]}),o.jsx("button",{type:"submit",disabled:h||!c.trim(),className:"shell-action",children:h?"Posting…":"Post comment"}),v?o.jsx("span",{className:"text-xs text-error-foreground",children:v}):null]})]})]})})}function k1({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:a}=e,l=s.type==="question";return o.jsxs("div",{className:Be("space-y-2",t>0&&"ml-4 border-l border-border pl-4"),children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-mono",children:s.id}),o.jsx("span",{children:"·"}),o.jsx("span",{children:s.timestamp}),o.jsx("span",{children:"·"}),o.jsx("span",{className:"font-medium text-foreground",children:s.author}),o.jsx("span",{children:"·"}),o.jsx("span",{className:Be("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?o.jsxs("button",{type:"button",onClick:()=>n(s.id,!s.resolved),className:Be("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?o.jsx(Lp,{className:"h-3 w-3"}):o.jsx(xC,{className:"h-3 w-3"}),s.resolved?"resolved":"open"]}):null,s.replyTo?o.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[o.jsx(_C,{className:"h-3 w-3"}),s.replyTo]}):null]}),o.jsx(Mt,{content:s.body}),a.length>0?o.jsx("div",{className:"space-y-2",children:a.map(c=>o.jsx(k1,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const KM=["review","complete","unblock","start","block","fail","reopen"];function Iv(){var Lt,en,Tt,ie,ce,ve;const{slug:e,aslug:t}=mt(),n=St(),s=_t(),[a,l]=Ir(),[c,d]=g.useState(null),[p,m]=g.useState(null),[h,x]=g.useState(null),[v,b]=g.useState(null),[C,k]=g.useState(null),[j,S]=g.useState(!1),[T,N]=g.useState(!1),[A,I]=g.useState(0),R=a.get("tab")??"summary",D=Wc(),{data:O,loading:G,error:re,refetch:z}=$2(e,t),{data:K}=Vb(e),{data:q}=Vp(),{data:J}=B2(e,t),_=g.useMemo(()=>{if(!O||!K)return[];const oe=new Map(K.assignments.map(Ce=>[Ce.slug,Ce]));return O.dependsOn.map(Ce=>{const Ae=oe.get(Ce);return{slug:Ce,title:(Ae==null?void 0:Ae.title)??Ce,status:(Ae==null?void 0:Ae.status)??"pending",priority:(Ae==null?void 0:Ae.priority)??"medium",assignee:(Ae==null?void 0:Ae.assignee)??null}})},[O,K]),F=_.filter(oe=>oe.status!=="completed"&&oe.status!=="review");ro("assignment");const B=g.useMemo(()=>((K==null?void 0:K.assignments)??[]).map(oe=>oe.slug),[K]),U=t?B.indexOf(t):-1,Z=U>0?B[U-1]:null,P=U>=0&&U<B.length-1?B[U+1]:null,M=`${s}/projects/${e}/assignments/${t}`;xt({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${M}/edit`)}),xt({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${M}/plan/edit`)}),xt({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${M}/handoff/edit`)}),xt({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${M}/decision-record/edit`)}),xt({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${M}/scratchpad/edit`)}),xt({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!Z,handler:()=>Z&&n(`${s}/projects/${e}/assignments/${Z}`)}),xt({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!P,handler:()=>P&&n(`${s}/projects/${e}/assignments/${P}`)});const Q=g.useMemo(()=>O?BM(O.body):{acceptanceCriteria:[],summaryBody:""},[O]),L=g.useMemo(()=>UM(Q.summaryBody),[Q.summaryBody]),ge=Q.acceptanceCriteria,Ne=ge.filter(oe=>oe.checked).length,te=ge.length>0&&Ne===ge.length,fe=g.useRef(te),be=g.useRef(!1);if(g.useEffect(()=>{if(O){if(!be.current){fe.current=te,be.current=!0;return}te&&!fe.current&&I(oe=>oe+1),fe.current=te}},[te,O]),G)return o.jsx(ot,{label:"Loading assignment workspace…"});if(re||!O||!e||!t)return o.jsx(Ze,{error:re||"Assignment not found."});const je=e,we=t,Ye=ge.length>0?{checked:Ne,total:ge.length}:void 0,Xe=O.availableTransitions??[],ne=Xe.filter(oe=>!oe.disabled&&oe.targetStatus!==O.status),Y=KM.map(oe=>ne.find(Ce=>Ce.command===oe)).find(Boolean)??ne[0]??null,ae=[];if(q!=null&&q.sessions)for(const oe of q.sessions)for(const Ce of oe.windows)for(const Ae of Ce.panes)((Lt=Ae.assignment)==null?void 0:Lt.project)===e&&((en=Ae.assignment)==null?void 0:en.slug)===t&&ae.push({sessionName:oe.name,command:Ae.command,urls:Ae.urls});async function xe(oe){d(null);try{await b1(je,we,oe),z()}catch(Ce){d(Ce.message)}}async function qe(){N(!0);try{await zM(je,we),n(`${s}/projects/${je}`)}catch(oe){d(oe.message),N(!1),S(!1)}}async function Oe(oe,Ce){d(null),m(oe.command);try{return await v1(je,we,oe,Ce),z(),!0}catch(Ae){return d(Ae.message),!1}finally{m(null)}}function Ue(oe){if(w1(oe)){x(oe);return}Oe(oe)}async function Ge(oe,Ce){b(null),k(oe);try{const Ae=await fetch(`/api/projects/${je}/assignments/${we}/acceptance-criteria/${oe}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Ce})}),qt=await Ae.json();if(!Ae.ok)throw new Error(qt.error||`HTTP ${Ae.status}`);z()}catch(Ae){b(Ae.message)}finally{k(null)}}const Nt=[...ne.filter(oe=>oe!==Y).map(oe=>({key:`transition-${oe.command}`,label:oe.label,onSelect:()=>Ue(oe),disabled:p===oe.command})),...Xe.filter(oe=>oe.disabled||oe.targetStatus===O.status).map(oe=>({key:`transition-${oe.command}`,label:oe.label,disabled:!0,disabledReason:oe.targetStatus===O.status?`Already ${O.status.replace(/_/g," ")}`:oe.disabledReason??oe.warning??oe.description})),...D.statuses.map(oe=>({key:`override-${oe.id}`,label:`Override → ${oe.label}`,onSelect:()=>xe(oe.id),disabled:oe.id===O.status,disabledReason:oe.id===O.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:NC,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:FC,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:ef,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:gc,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:PC,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:Or,destructive:!0,onSelect:()=>S(!0)}],Ct=(Y==null?void 0:Y.command)==="review";return o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"sticky top-12 z-20 rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm backdrop-blur",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Zt,{status:O.status,progress:Ye}),o.jsx("h1",{className:"text-lg font-semibold text-foreground",children:O.title}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",E2(O.updated)]}),F.length>0&&o.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",F.length," unmet dep",F.length===1?"":"s"]}),o.jsx(dh,{externalIds:O.externalIds}),o.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[Y&&o.jsx("button",{type:"button",title:Y.warning||Y.description,disabled:p===Y.command,onClick:()=>Ue(Y),className:Be("shell-action disabled:cursor-not-allowed disabled:opacity-50",Y.warning&&"border-warning-foreground/40",Ct&&A>0&&"send-to-review-glow"),children:o.jsx("span",{children:p===Y.command?"Working…":Y.label})},Ct?`review-${A}`:Y.command),o.jsx(FM,{items:Nt,align:"end"})]})]}),c?o.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,O.blockedReason?o.jsxs("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:[o.jsx("strong",{children:"Blocked reason:"})," ",O.blockedReason]}):null]}),_.length>0&&o.jsx(HM,{projectSlug:e,dependencies:_,blockedReason:O.blockedReason}),O.enrichedLinks&&O.enrichedLinks.length>0&&o.jsx(WM,{links:O.enrichedLinks}),O.referencedBy&&O.referencedBy.length>0&&o.jsx(Ie,{title:"Referenced by",description:"Other assignments whose Todos, progress, comments, or handoffs link to this one.",children:o.jsx("ul",{className:"space-y-2",children:O.referencedBy.map(oe=>{const Ce=oe.sourceProjectSlug===null?`/assignments/${oe.sourceId}`:`${s}/projects/${oe.sourceProjectSlug}/assignments/${oe.sourceSlug}`;return o.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[o.jsx(ye,{to:Ce,className:"text-foreground hover:text-primary",children:oe.sourceTitle}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",oe.mentions," mention",oe.mentions===1?"":"s",")"]}),oe.sourceProjectSlug===null?o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"}):null]},oe.sourceId)})})}),o.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[o.jsx("div",{className:"space-y-4",children:o.jsx(ph,{value:R,onValueChange:oe=>l({tab:oe}),items:[{value:"summary",label:"Summary",content:o.jsxs("div",{className:"space-y-5",children:[Q.acceptanceCriteria.length>0?o.jsx(Ie,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:o.jsxs("div",{className:"space-y-3",children:[v?o.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:v}):null,Q.acceptanceCriteria.map((oe,Ce)=>{const Ae=C!==null;return o.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border/60 bg-background/80 px-3 py-3",children:[o.jsx("input",{type:"checkbox",checked:oe.checked,disabled:Ae,onChange:qt=>Ge(Ce,qt.target.checked),className:"mt-1 h-4 w-4 rounded border-border text-primary"}),o.jsx("span",{className:"criterion-label text-sm leading-6","data-checked":oe.checked,children:oe.text})]},`${Ce}-${oe.text}`)})]})}):null,L.hasSection?o.jsx(Ie,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:o.jsx(Mt,{content:L.todosMarkdown,emptyState:"No todos yet."})}):null,o.jsx(Ie,{title:"Assignment Summary",children:o.jsx(Mt,{content:L.remaining,emptyState:Q.acceptanceCriteria.length>0||L.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:O.plan?1:0,content:O.plan?o.jsx("div",{className:"space-y-5",children:o.jsxs(Ie,{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:o.jsxs(ye,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[o.jsx(ef,{className:"h-4 w-4"}),o.jsx("span",{children:"Edit Plan"})]}),children:[o.jsx("div",{className:"mb-4",children:o.jsx(Zt,{status:O.plan.status})}),o.jsx(Mt,{content:O.plan.body,emptyState:"No plan content yet."})]})}):o.jsx(tt,{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:O.scratchpad?1:0,content:O.scratchpad?o.jsx(Ie,{title:"Scratchpad",actions:o.jsxs(ye,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[o.jsx(ef,{className:"h-4 w-4"}),o.jsx("span",{children:"Edit Scratchpad"})]}),children:o.jsx(Mt,{content:O.scratchpad.body,emptyState:"Scratchpad is empty."})}):o.jsx(tt,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((Tt=O.handoff)==null?void 0:Tt.handoffCount)??0,content:o.jsx("div",{className:"space-y-5",children:O.handoff?o.jsx(Ie,{children:o.jsx(Mt,{content:O.handoff.body,emptyState:"No handoff history yet."})}):o.jsx(tt,{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:((ie=O.progress)==null?void 0:ie.entryCount)??0,content:o.jsx("div",{className:"space-y-5",children:O.progress&&O.progress.entries.length>0?o.jsx(Ie,{title:"Progress",description:"Reverse-chronological log of work done on this assignment. Agents append entries via progress.md.",children:o.jsx("ol",{className:"space-y-4",children:O.progress.entries.map((oe,Ce)=>o.jsxs("li",{className:"border-l-2 border-border pl-3",children:[o.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:oe.timestamp}),o.jsx(Mt,{content:oe.body})]},`${oe.timestamp}-${Ce}`))})}):o.jsx(tt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((ce=O.comments)==null?void 0:ce.entryCount)??0,content:o.jsx("div",{className:"space-y-5",children:O.comments&&O.comments.entries.length>0?o.jsx(j1,{projectSlug:e,assignmentSlug:t,entries:O.comments.entries}):o.jsx(tt,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((ve=O.decisionRecord)==null?void 0:ve.decisionCount)??0,content:o.jsx("div",{className:"space-y-5",children:O.decisionRecord?o.jsx(Ie,{children:o.jsx(Mt,{content:O.decisionRecord.body,emptyState:"No decision history yet."})}):o.jsx(tt,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),o.jsxs("div",{className:"space-y-5",children:[o.jsx(Ie,{title:"Details",children:o.jsxs("dl",{className:"space-y-3 text-sm",children:[o.jsx(ks,{label:"ID",value:O.id,copyable:!0}),o.jsx(ks,{label:"Priority",value:O.priority}),O.assignee&&o.jsx(ks,{label:"Assignee",value:O.assignee}),o.jsx(ks,{label:"Updated",value:`${C2(O.updated)} · Created ${N2(O.created)}`}),O.workspace.repository&&o.jsx(ks,{label:"Repository",value:O.workspace.repository,copyable:!0}),O.workspace.worktreePath&&o.jsx(ks,{label:"Worktree",value:O.workspace.worktreePath,copyable:!0}),O.workspace.branch&&o.jsx(ks,{label:"Branch",value:O.workspace.branch,copyable:!0}),O.workspace.parentBranch&&o.jsx(ks,{label:"Parent branch",value:O.workspace.parentBranch,copyable:!0})]})}),ae.length>0&&o.jsx(Ie,{title:"Servers",children:o.jsx("div",{className:"space-y-2",children:ae.map((oe,Ce)=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx("span",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:oe.command}),o.jsx("span",{className:"text-xs text-muted-foreground",children:oe.sessionName}),oe.urls.map(Ae=>o.jsxs("a",{href:Ae,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[Ae.replace("http://localhost:",":"),o.jsx(Ip,{className:"h-2.5 w-2.5"})]},Ae))]},Ce))})}),J&&J.sessions.length>0&&o.jsx(Ie,{title:"Agent Sessions",children:o.jsx("div",{className:"space-y-2",children:J.sessions.map(oe=>o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Oc,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),o.jsx("span",{className:"font-medium text-foreground",children:oe.agent}),o.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:oe.sessionId,children:[oe.sessionId.slice(0,8),o.jsx(Yr,{value:oe.sessionId})]})]}),o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Zt,{status:oe.status}),o.jsx("span",{className:"text-xs text-muted-foreground",children:Rn(oe.started)})]})]},oe.sessionId))})})]})]}),o.jsx(Kj,{open:h!==null,action:h,assignmentTitle:O.title,loading:p===(h==null?void 0:h.command),onOpenChange:oe=>{oe||x(null)},onConfirm:async oe=>{if(!h)return;await Oe(h,oe)&&x(null)}}),o.jsx(y1,{open:j,title:"Delete assignment?",description:`This will permanently delete "${O.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:T,onOpenChange:oe=>{oe||S(!1)},onConfirm:qe})]})}function ks({label:e,value:t,copyable:n}){return o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsx("dt",{className:"text-muted-foreground",children:e}),o.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[o.jsx("span",{className:"truncate",title:t,children:t}),n&&t!=="—"&&o.jsx(Yr,{value:t})]})]})}function GM(){var d,p,m,h,x;const{id:e}=mt(),[t,n]=Ir(),s=t.get("tab")??"summary",{data:a,loading:l,error:c}=F2(e);return l?o.jsx(ot,{}):c?o.jsx(Ze,{error:c}):a?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("header",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Zt,{status:a.status}),o.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:a.id}),o.jsx(dh,{externalIds:a.externalIds}),o.jsx(ye,{to:`/assignments/${a.id}/edit`,className:"ml-auto rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit"})]}),o.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:a.title}),a.blockedReason?o.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",a.blockedReason]}):null]}),a.referencedBy&&a.referencedBy.length>0?o.jsx(Ie,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:o.jsx("ul",{className:"space-y-2",children:a.referencedBy.map(v=>o.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[o.jsx(ye,{to:v.sourceProjectSlug===null?`/assignments/${v.sourceId}`:`/projects/${v.sourceProjectSlug}/assignments/${v.sourceSlug}`,className:"text-foreground hover:text-primary",children:v.sourceTitle}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",v.mentions," mention",v.mentions===1?"":"s",")"]})]},v.sourceId))})}):null,o.jsx(ph,{value:s,onValueChange:v=>n({tab:v}),items:[{value:"summary",label:"Summary",content:o.jsx("div",{className:"space-y-5",children:o.jsx(Ie,{title:"Assignment",children:o.jsx(Mt,{content:a.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((d=a.progress)==null?void 0:d.entryCount)??0,content:o.jsx("div",{className:"space-y-5",children:a.progress&&a.progress.entries.length>0?o.jsx(Ie,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:o.jsx("ol",{className:"space-y-4",children:a.progress.entries.map((v,b)=>o.jsxs("li",{className:"border-l-2 border-border pl-3",children:[o.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:v.timestamp}),o.jsx(Mt,{content:v.body})]},`${v.timestamp}-${b}`))})}):o.jsx(tt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((p=a.comments)==null?void 0:p.entryCount)??0,content:o.jsx("div",{className:"space-y-5",children:o.jsx(j1,{projectSlug:null,assignmentSlug:a.id,entries:((m=a.comments)==null?void 0:m.entries)??[]})})},{value:"plan",label:"Plan",content:o.jsx("div",{className:"space-y-5",children:a.plan?o.jsxs(Ie,{children:[o.jsx(Mt,{content:a.plan.body,emptyState:"Plan file exists but is empty."}),o.jsx("div",{className:"mt-3 flex justify-end",children:o.jsx(ye,{to:`/assignments/${a.id}/plan/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit plan"})})]}):o.jsx(tt,{title:"No plan file yet",description:"Create one via the CLI or `/plan-assignment`."})})},{value:"scratchpad",label:"Scratchpad",content:o.jsx("div",{className:"space-y-5",children:a.scratchpad?o.jsxs(Ie,{children:[o.jsx(Mt,{content:a.scratchpad.body,emptyState:"Scratchpad is empty."}),o.jsx("div",{className:"mt-3 flex justify-end",children:o.jsx(ye,{to:`/assignments/${a.id}/scratchpad/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit scratchpad"})})]}):o.jsx(tt,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((h=a.handoff)==null?void 0:h.handoffCount)??0,content:o.jsx("div",{className:"space-y-5",children:a.handoff?o.jsxs(Ie,{children:[o.jsx(Mt,{content:a.handoff.body,emptyState:"No handoff history yet."}),o.jsx("div",{className:"mt-3 flex justify-end",children:o.jsx(ye,{to:`/assignments/${a.id}/handoff/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append handoff"})})]}):o.jsx(tt,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((x=a.decisionRecord)==null?void 0:x.decisionCount)??0,content:o.jsx("div",{className:"space-y-5",children:a.decisionRecord?o.jsxs(Ie,{children:[o.jsx(Mt,{content:a.decisionRecord.body,emptyState:"No decision history yet."}),o.jsx("div",{className:"mt-3 flex justify-end",children:o.jsx(ye,{to:`/assignments/${a.id}/decision-record/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append decision"})})]}):o.jsx(tt,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]})]}):o.jsx(Ze,{error:"Assignment not found"})}const YM=["table","list","kanban"],Ov={critical:0,high:1,medium:2,low:3};function Mv(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function XM(e,t){return e.toString()===t.toString()}function _v(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function QM(e,t,n){return[...e].sort((a,l)=>{let c=0;switch(t){case"title":c=a.title.localeCompare(l.title);break;case"status":c=a.status.localeCompare(l.status);break;case"priority":c=(Ov[a.priority]??99)-(Ov[l.priority]??99);break;case"assignee":c=(a.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=a.dependsOn.length-l.dependsOn.length;break;case"updated":c=a.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function $v(){const{workspace:e}=mt(),t=_t(),n=St(),s=g.useRef(null);ro("list:assignments");const{data:a,loading:l,error:c,refetch:d}=Hb(),p=Wc(),[m,h]=Ir(),x=g.useMemo(()=>MT(p.order),[p]),v=g.useMemo(()=>{const V={};for(const pe of x)V[pe]=DT(p,pe);return V},[x,p]),b=g.useMemo(()=>x.map(V=>({id:V,title:v[V]??V,description:_w(V)})),[x,v]),C=g.useMemo(()=>new Set(["all",...x]),[x]),k=m.get("view"),j=m.get("status"),S=m.get("stale"),T=k&&YM.includes(k)?k:"kanban";function N(V){return!V||!C.has(V)?"all":V}const A=g.useCallback(V=>{h(pe=>{const Ee=new URLSearchParams(pe);return V==="kanban"?Ee.delete("view"):Ee.set("view",V),Ee})},[h]),[I,R]=g.useState(""),[D,O]=g.useState(()=>N(j)),[G,re]=g.useState("all"),[z,K]=g.useState("all"),[q,J]=g.useState("all"),[_,F]=g.useState(()=>Mv(S)),[B,U]=g.useState("updated"),[Z,P]=g.useState("desc"),[M,Q]=g.useState(()=>new Set(x)),[L,ge]=g.useState([]),[Ne,te]=g.useState(null),[fe,be]=g.useState(null),[je,we]=g.useState(null),[Ye,Xe]=g.useState(null),[ne,Y]=g.useState(null);g.useEffect(()=>{ge((a==null?void 0:a.assignments)??[])},[a]),g.useEffect(()=>{const V=N(j);V!==D&&O(V);const pe=Mv(S);pe!==_&&F(pe)},[_,S,D,j]),g.useEffect(()=>{h(V=>{const pe=new URLSearchParams(V);return D==="all"?pe.delete("status"):pe.set("status",D),_==="all"?pe.delete("stale"):_==="stale"?pe.set("stale","1"):pe.set("stale","0"),XM(V,pe)?V:pe})},[_,h,D]);const ae=g.useMemo(()=>Array.from(new Set(L.map(V=>V.status))).sort(),[L]),xe=g.useMemo(()=>Array.from(new Set(L.map(V=>V.priority))).sort(),[L]),qe=g.useMemo(()=>Array.from(new Set(L.map(V=>V.assignee??"__unassigned__"))).sort(),[L]),Oe=g.useMemo(()=>Array.from(new Map(L.filter(V=>V.projectSlug!==null).map(V=>[V.projectSlug,V.projectTitle]))).sort(([,V],[,pe])=>V.localeCompare(pe)),[L]),Ue=g.useMemo(()=>L.filter(V=>{if(e){if(e==="_ungrouped"){if(V.projectWorkspace!==null)return!1}else if(V.projectWorkspace!==e)return!1}if(D!=="all"&&V.status!==D||G!=="all"&&V.priority!==G||_==="stale"&&!_v(V.updated)||_==="fresh"&&_v(V.updated)||z!=="all"&&(V.assignee??"__unassigned__")!==z)return!1;if(q!=="all"){if(q==="__standalone__"){if(V.projectSlug!==null)return!1}else if(V.projectSlug!==q)return!1}const pe=I.trim().toLowerCase();return!(pe&&!`${V.title} ${V.slug} ${V.projectTitle??"standalone"} ${V.projectSlug??""}`.toLowerCase().includes(pe))}),[_,L,I,D,G,z,q,e]),Ge=g.useMemo(()=>QM(Ue,B,Z),[Ue,B,Z]),{visibleItems:Nt,visibleIndexByKey:Ct}=g.useMemo(()=>{const V=T==="table"?Ge:x.flatMap(Ee=>Ue.filter(ze=>ze.status===Ee)),pe=new Map;return V.forEach((Ee,ze)=>pe.set(on(Ee),ze)),{visibleItems:V,visibleIndexByKey:pe}},[T,Ge,Ue,x]),{hotkeyRowProps:Lt}=Ta(Nt,{scope:"list:assignments",onOpen:V=>{if(V.projectSlug===null){n(`/assignments/${V.id}`);return}const pe=V.projectWorkspace?`/w/${V.projectWorkspace}`:t;n(`${pe}/projects/${V.projectSlug}/assignments/${V.slug}`)}});if(xt({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var V;return(V=s.current)==null?void 0:V.focus()}}),xt({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>d()}),l)return o.jsx(ot,{label:"Loading assignments board…"});if(c||!a)return o.jsx(Ze,{error:c||"Assignments board is unavailable."});async function en({item:V,toColumnId:pe,action:Ee,reason:ze}){te(null),be(on(V));const Wn=L;ge(ln=>ln.map(vt=>on(vt)===on(V)?{...vt,status:pe,blockedReason:pe==="blocked"?ze??vt.blockedReason:null}:vt));try{if(V.projectSlug===null){if(!Ee)throw new Error("Standalone assignments require a transition action, not status override.");const vt=await fetch(`/api/assignments/${encodeURIComponent(V.id)}/transitions/${encodeURIComponent(Ee.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ze?{reason:ze}:{})});if(!vt.ok)throw new Error((await vt.json()).error??`HTTP ${vt.status}`);const it=(await vt.json()).assignment;ge(Rt=>Rt.map(Kt=>on(Kt)===on(V)?{...Kt,status:it.status,blockedReason:it.blockedReason,availableTransitions:it.availableTransitions,updated:it.updated}:Kt));return}const ln=Ee?await v1(V.projectSlug,V.slug,Ee,ze):await b1(V.projectSlug,V.slug,pe);return ge(vt=>vt.map(Ve=>on(Ve)===on(V)?{...Ve,status:ln.status,blockedReason:ln.blockedReason,availableTransitions:ln.availableTransitions,updated:ln.updated}:Ve)),d(),!0}catch(ln){return ge(Wn),te(ln.message),!1}finally{be(null)}}async function Tt({item:V,toColumnId:pe}){if(V.status===pe)return;const Ee=ea(V,pe);if(Ee!=null&&Ee.disabled){te(Ee.disabledReason||`Cannot move this assignment to ${pe}.`);return}if(Ee&&w1(Ee)){Y({item:V,toColumnId:pe,action:Ee});return}await en({item:V,toColumnId:pe,action:Ee})}function ie(V){Q(pe=>{const Ee=new Set(pe);return Ee.has(V)?Ee.delete(V):Ee.add(V),Ee})}function ce(V){B===V?P(pe=>pe==="asc"?"desc":"asc"):(U(V),P("asc"))}const ve=je?L.find(V=>on(V)===je)??null:null;function oe(V,pe){V.dataTransfer.effectAllowed="move",V.dataTransfer.setData("text/plain",pe),we(pe)}function Ce(){we(null),Xe(null)}function Ae(V,pe){if(!ve)return;const Ee=ea(ve,pe);ve.status===pe||Ee!=null&&Ee.disabled||(V.preventDefault(),V.dataTransfer.dropEffect="move",Xe(pe))}function qt(V,pe){Ye===pe&&!V.currentTarget.contains(V.relatedTarget)&&Xe(null)}function an(V,pe){if(V.preventDefault(),!ve||ve.status===pe){Ce();return}Ce(),Tt({item:ve,toColumnId:pe})}function tn({field:V,children:pe}){const Ee=B===V;return o.jsx("th",{className:"pb-3 font-medium",children:o.jsxs("button",{type:"button",onClick:()=>ce(V),className:"inline-flex items-center gap-1 hover:text-foreground",children:[pe,Ee?Z==="asc"?o.jsx(xb,{className:"h-3 w-3"}):o.jsx(ya,{className:"h-3 w-3"}):null]})})}return o.jsxs("div",{className:"space-y-5",children:[o.jsx("div",{className:"flex items-center justify-end",children:o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"New Assignment"]})}),o.jsxs(lh,{children:[o.jsx(Hc,{ref:s,value:I,onChange:R,placeholder:"Search assignments or projects"}),o.jsxs("select",{value:D,onChange:V=>O(N(V.target.value)),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All statuses"}),ae.map(V=>o.jsx("option",{value:V,children:v[V]??V},V))]}),o.jsxs("select",{value:G,onChange:V=>re(V.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All priorities"}),xe.map(V=>o.jsx("option",{value:V,className:"capitalize",children:V},V))]}),o.jsxs("select",{value:z,onChange:V=>K(V.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All assignees"}),qe.map(V=>o.jsx("option",{value:V,children:V==="__unassigned__"?"Unassigned":V},V))]}),o.jsxs("select",{value:q,onChange:V=>J(V.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All projects"}),o.jsx("option",{value:"__standalone__",children:"Standalone"}),Oe.map(([V,pe])=>o.jsx("option",{value:V,children:pe},V))]}),o.jsxs("select",{value:_,onChange:V=>F(V.target.value),className:"editor-input max-w-[180px]",children:[o.jsx("option",{value:"all",children:"All activity"}),o.jsx("option",{value:"stale",children:"Stale only"}),o.jsx("option",{value:"fresh",children:"Fresh only"})]}),o.jsx(ch,{value:T,onChange:V=>A(V),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]})]}),Ne?o.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:Ne}):null,a.assignments.length===0?o.jsx(tt,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:o.jsxs(ye,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[o.jsx(Op,{className:"h-4 w-4"}),o.jsx("span",{children:"Browse Projects"})]})}):Ue.length===0?o.jsx(tt,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):T==="table"?o.jsx(Ie,{title:`${Ge.length} assignment${Ge.length===1?"":"s"}`,children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[o.jsx(tn,{field:"title",children:"Assignment"}),o.jsx(tn,{field:"status",children:"Status"}),o.jsx(tn,{field:"priority",children:"Priority"}),o.jsx(tn,{field:"assignee",children:"Assignee"}),o.jsx(tn,{field:"dependencies",children:"Dependencies"}),o.jsx(tn,{field:"updated",children:"Updated"})]})}),o.jsx("tbody",{children:Ge.map((V,pe)=>o.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Lt(pe),children:[o.jsxs("td",{className:"py-4 pr-4",children:[o.jsx(ye,{to:V.projectSlug===null?`/assignments/${V.id}`:`${t}/projects/${V.projectSlug}/assignments/${V.slug}`,className:"font-semibold text-foreground hover:text-primary",children:V.title}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:V.projectTitle??o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),o.jsxs("p",{className:"mt-0.5 inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:V.id,children:[V.id.slice(0,8),o.jsx(Yr,{value:V.id})]})]}),o.jsx("td",{className:"py-4 pr-4",children:o.jsx("select",{value:V.status,disabled:fe===on(V),onChange:Ee=>Tt({item:V,toColumnId:Ee.target.value}),className:Be("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")]`,(vc[V.status]??vc.pending).className,fe===on(V)&&"animate-pulse opacity-60"),children:x.map(Ee=>{const ze=V.status===Ee?void 0:ea(V,Ee),Wn=(ze==null?void 0:ze.disabled)??!1;return o.jsx("option",{value:Ee,disabled:Wn,title:Wn?(ze==null?void 0:ze.disabledReason)??void 0:void 0,children:v[Ee]},Ee)})})}),o.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:V.priority}),o.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:V.assignee??"Unassigned"}),o.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:V.dependsOn.length}),o.jsx("td",{className:"py-4 text-muted-foreground",children:Ar(V.updated)})]},on(V)))})]})})}):T==="list"?o.jsx("div",{className:"space-y-3",children:x.map(V=>{var vt;const pe=Ue.filter(Ve=>Ve.status===V);if(pe.length===0&&!ve)return null;const Ee=M.has(V),ze=ve?ve.status!==V&&!((vt=ea(ve,V))!=null&&vt.disabled):!1,Wn=ve?ve.status!==V&&!ze:!1,ln=Ye===V;return o.jsxs("div",{className:Be("rounded-lg border border-border/60 bg-card/90 transition",ln&&ze&&"ring-2 ring-ring/30",Wn&&"border-dashed opacity-65"),onDragOver:Ve=>Ae(Ve,V),onDragLeave:Ve=>qt(Ve,V),onDrop:Ve=>an(Ve,V),children:[o.jsxs("button",{type:"button",onClick:()=>ie(V),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[o.jsx(ya,{className:`h-4 w-4 text-muted-foreground transition-transform ${Ee?"":"-rotate-90"}`}),o.jsx("span",{className:"font-semibold text-foreground",children:v[V]}),o.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:pe.length})]}),Ee&&pe.length>0&&o.jsx("div",{className:"space-y-3 px-4 pb-4",children:pe.map(Ve=>{const it=on(Ve),Rt=je===it,Kt=Ct.get(it)??-1;return o.jsx("div",{draggable:!0,onDragStart:nn=>oe(nn,it),onDragEnd:Ce,...Kt>=0?Lt(Kt):{},className:Be("cursor-grab transition active:cursor-grabbing",Rt&&"scale-[0.98] opacity-50"),children:o.jsx(Fv,{assignment:Ve,dragging:Rt,transitioning:fe===it})},it)})})]},V)})}):o.jsx($w,{columns:b,items:Ue,getItemId:on,getColumnId:V=>V.status,canDrop:({item:V,fromColumnId:pe,toColumnId:Ee})=>{if(pe===Ee)return{allowed:!0};const ze=ea(V,Ee);return ze!=null&&ze.disabled?{allowed:!1,reason:ze.disabledReason||ze.description}:{allowed:!0,reason:ze?ze.warning||ze.description:`Move to ${Ee} (direct status change).`}},onMove:({item:V,toColumnId:pe})=>Tt({item:V,toColumnId:pe}),emptyMessage:V=>`No ${V.title.toLowerCase()} assignments.`,renderCard:(V,{dragging:pe})=>{const Ee=Ct.get(on(V))??-1;return o.jsx("div",{...Ee>=0?Lt(Ee):{},children:o.jsx(Fv,{assignment:V,dragging:pe,transitioning:fe===on(V)})})}}),o.jsx(Kj,{open:ne!==null,action:(ne==null?void 0:ne.action)??null,assignmentTitle:(ne==null?void 0:ne.item.title)??"Assignment",loading:fe===(ne?on(ne.item):null),onOpenChange:V=>{V||Y(null)},onConfirm:async V=>{if(!ne)return;const pe=ne;await en({item:pe.item,toColumnId:pe.toColumnId,action:pe.action,reason:V})&&Y(null)}})]})}function Fv({assignment:e,dragging:t,transitioning:n}){var a;const s=_t();return o.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(ye,{to:e.projectSlug===null?`/assignments/${e.id}`:`${s}/projects/${e.projectSlug}/assignments/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.projectTitle??o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),o.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:e.id??"",children:[(a=e.id)==null?void 0:a.slice(0,8),e.id&&o.jsx(Yr,{value:e.id})]})]}),o.jsx(Zt,{status:e.status})]}),e.blockedReason?o.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,o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[o.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:e.priority}),o.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:e.assignee??"Unassigned"}),o.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.dependsOn.length," dependencies"]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:[o.jsx("span",{children:n?"Updating":t?"Dragging":"Source-first"}),o.jsx("span",{children:Ar(e.updated)})]})]})}function ea(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function on(e){return e.id||e.slug||"unknown"}function tr(e){const t=e.match(/^---\n([\s\S]*?)\n---\n?/);if(!t)return{order:[],blocks:new Map,body:e};const n=t[1],s=e.slice(t[0].length),a=n.split(`
|
|
504
|
+
`),l=[],c=new Map;let d=null,p=[];const m=()=>{d&&(l.push(d),c.set(d,p))};for(const h of a){const x=h.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!h.startsWith(" ")){m(),d=x[1],p=[h];continue}d&&p.push(h)}return m(),{order:l,blocks:c,body:s}}function li(e){return`---
|
|
505
|
+
${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
|
|
506
|
+
`)}
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
${e.body.replace(/^\n+/,"")}`}function Ut(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const s=n[0].match(/^[^:]+:\s*(.*)$/);if(!s)return"";const a=s[1].trim();return a==="null"?"":a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?a.slice(1,-1):a}function JM(e,t){return Ut(e,t)==="true"}function ha(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 ZM(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 Ht(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${ZM(n)}`])}function ma(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 ga(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function au(e){const t=tr(e);return{title:Ut(t,"title"),slug:Ut(t,"slug"),workspace:Ut(t,"workspace"),archived:JM(t,"archived"),archivedAt:Ut(t,"archivedAt"),archivedReason:Ut(t,"archivedReason"),tags:ha(t,"tags").join(", "),body:t.body}}function e_(e,t){const n=tr(e),s={...au(e),...t};return Ht(n,"title",s.title),Ht(n,"slug",s.slug),Ht(n,"workspace",s.workspace||null),Ht(n,"archived",s.archived),Ht(n,"archivedAt",s.archivedAt||null),Ht(n,"archivedReason",s.archivedReason||null),ma(n,"tags",ga(s.tags)),n.body=s.body,li(n)}function lu(e){const t=tr(e);return{title:Ut(t,"title"),slug:Ut(t,"slug"),status:Ut(t,"status"),priority:Ut(t,"priority")||"medium",assignee:Ut(t,"assignee"),dependsOn:ha(t,"dependsOn").join(", "),links:ha(t,"links").join(", "),blockedReason:Ut(t,"blockedReason"),tags:ha(t,"tags").join(", "),body:t.body}}function t_(e,t){const n=tr(e),s={...lu(e),...t};return Ht(n,"title",s.title),Ht(n,"slug",s.slug),Ht(n,"status",s.status),Ht(n,"priority",s.priority),Ht(n,"assignee",s.assignee||null),ma(n,"dependsOn",ga(s.dependsOn)),ma(n,"links",ga(s.links)),Ht(n,"blockedReason",s.blockedReason||null),ma(n,"tags",ga(s.tags)),n.body=s.body,li(n)}function cu(e){const t=tr(e);return{assignment:Ut(t,"assignment"),status:Ut(t,"status"),body:t.body}}function n_(e,t){const n=tr(e),s={...cu(e),...t};return Ht(n,"assignment",s.assignment),Ht(n,"status",s.status),n.body=s.body,li(n)}function uu(e){const t=tr(e);return{assignment:Ut(t,"assignment"),body:t.body}}function r_(e,t){const n=tr(e),s={...uu(e),...t};return Ht(n,"assignment",s.assignment),n.body=s.body,li(n)}function du(e){const t=tr(e);return{name:Ut(t,"name"),slug:Ut(t,"slug"),description:Ut(t,"description"),whenToUse:Ut(t,"when_to_use"),tags:ha(t,"tags").join(", "),body:t.body}}function s_(e,t){const n=tr(e),s={...du(e),...t};return Ht(n,"name",s.name),Ht(n,"slug",s.slug),Ht(n,"description",s.description||null),Ht(n,"when_to_use",s.whenToUse||null),ma(n,"tags",ga(s.tags)),n.body=s.body,li(n)}function qh(e){return{body:tr(e).body}}function S1(e){return qh(e)}function N1(e,t){const n=tr(e);return t.body!==void 0&&(n.body=t.body),li(n)}function o_(e,t){return N1(e,t)}function ht(e,t,n){switch(e){case"project":return e_(t,n);case"assignment":return t_(t,n);case"plan":return n_(t,n);case"scratchpad":return r_(t,n);case"playbook":return s_(t,n);case"memory":return N1(t,n);case"resource":return o_(t,n);default:return t}}function ci({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:a,error:l,title:c,description:d,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:x=!1}){const[v,b]=g.useState(e),[C,k]=g.useState(!1),[j,S]=g.useState("edit");g.useEffect(()=>{b(e)},[e]);const T=c_(t,v),N=v!==e,A=l_(t,v),I=N?"Unsaved changes":n==="create"?"Draft":"Saved",R=t!=="memory"&&t!=="resource";return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-border/70 bg-card/90 p-3 shadow-sm",children:[o.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"text-lg font-semibold text-foreground",children:c}),o.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:I})]}),d?o.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:d}):null]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:p,className:"shell-action",children:[o.jsx(hb,{className:"h-4 w-4"}),o.jsx("span",{children:"Back"})]}),R?o.jsxs("button",{type:"button",onClick:()=>k(D=>!D),className:"shell-action",children:[o.jsx(SC,{className:"h-4 w-4"}),o.jsx("span",{children:C?"Structured":"Raw Markdown"})]}):null,o.jsxs("button",{type:"button",onClick:()=>s(v),disabled:a||T.length>0,className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-semibold text-background transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:[o.jsx(Fp,{className:"h-4 w-4"}),o.jsx("span",{children:a?"Saving…":"Save"})]})]})]}),l?o.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:l}):null,T.length>0?o.jsx("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:o.jsx("ul",{className:"space-y-1",children:T.map(D=>o.jsx("li",{children:D},D))})}):null]}),o.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[o.jsx("button",{type:"button",onClick:()=>S("edit"),className:`shell-action ${j==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),o.jsxs("button",{type:"button",onClick:()=>S("preview"),className:`shell-action ${j==="preview"?"bg-foreground text-background":""}`,children:[o.jsx(zx,{className:"h-4 w-4"}),"Preview"]})]}),o.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]",children:[o.jsx("div",{className:j==="preview"?"hidden md:block":"",children:o.jsx("div",{className:"surface-panel space-y-3",children:C?o.jsx("textarea",{value:v,onChange:D=>b(D.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}):o.jsx(i_,{documentType:t,content:v,onChange:b,allowSlugEdit:x})})}),o.jsx("div",{className:j==="edit"?"hidden md:block":"",children:o.jsxs("div",{className:"surface-panel sticky top-16 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(zx,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),o.jsx(Mt,{content:A,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function i_({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=au(t);return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(ta,{children:[o.jsx(at,{label:"Project title",children:o.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};s&&(l.slug===dr(l.title)||!l.slug.trim())&&(p.slug=dr(d)),n(ht(e,t,p))},className:"editor-input"})}),o.jsx(at,{label:"Slug",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(ht(e,t,{slug:dr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),o.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."})]})}),o.jsx(at,{label:"Tags",children:o.jsx("input",{value:l.tags,onChange:c=>n(ht(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),o.jsx(a_,{value:l.workspace,onChange:c=>n(ht(e,t,{workspace:c}))})]}),o.jsx(at,{label:"Project body",children:o.jsx("textarea",{value:l.body,onChange:c=>n(ht(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=lu(t);return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(ta,{children:[o.jsx(at,{label:"Assignment title",children:o.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};s&&(l.slug===dr(l.title)||!l.slug.trim())&&(p.slug=dr(d)),n(ht(e,t,p))},className:"editor-input"})}),o.jsx(at,{label:"Slug",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(ht(e,t,{slug:dr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),o.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."})]})}),o.jsx(at,{label:"Status",children:o.jsxs("select",{value:l.status,onChange:c=>n(ht(e,t,{status:c.target.value})),className:"editor-input",children:[o.jsx("option",{value:"pending",children:"Pending"}),o.jsx("option",{value:"in_progress",children:"In Progress"}),o.jsx("option",{value:"blocked",children:"Blocked"}),o.jsx("option",{value:"review",children:"Review"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"failed",children:"Failed"})]})}),o.jsx(at,{label:"Priority",children:o.jsxs("select",{value:l.priority,onChange:c=>n(ht(e,t,{priority:c.target.value})),className:"editor-input",children:[o.jsx("option",{value:"low",children:"Low"}),o.jsx("option",{value:"medium",children:"Medium"}),o.jsx("option",{value:"high",children:"High"}),o.jsx("option",{value:"critical",children:"Critical"})]})}),o.jsx(at,{label:"Assignee",children:o.jsx("input",{value:l.assignee,onChange:c=>n(ht(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),o.jsx(at,{label:"Depends on",className:"md:col-span-2",children:o.jsx("input",{value:l.dependsOn,onChange:c=>n(ht(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),o.jsx(at,{label:"Links",className:"md:col-span-2",children:o.jsx("input",{value:l.links,onChange:c=>n(ht(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),o.jsx(at,{label:"Blocked reason",className:"md:col-span-2",children:o.jsx("input",{value:l.blockedReason,onChange:c=>n(ht(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),o.jsx(at,{label:"Tags",className:"md:col-span-2",children:o.jsx("input",{value:l.tags,onChange:c=>n(ht(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),o.jsx(at,{label:"Assignment body",children:o.jsx("textarea",{value:l.body,onChange:c=>n(ht(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=cu(t);return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(ta,{children:[o.jsx(at,{label:"Assignment",children:o.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),o.jsx(at,{label:"Plan status",children:o.jsxs("select",{value:l.status,onChange:c=>n(ht(e,t,{status:c.target.value})),className:"editor-input",children:[o.jsx("option",{value:"draft",children:"Draft"}),o.jsx("option",{value:"approved",children:"Approved"}),o.jsx("option",{value:"in_progress",children:"In Progress"}),o.jsx("option",{value:"completed",children:"Completed"})]})})]}),o.jsx(at,{label:"Plan body",children:o.jsx("textarea",{value:l.body,onChange:c=>n(ht(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=uu(t);return o.jsxs("div",{className:"space-y-3",children:[o.jsx(ta,{children:o.jsx(at,{label:"Assignment",children:o.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),o.jsx(at,{label:"Scratchpad body",children:o.jsx("textarea",{value:l.body,onChange:c=>n(ht(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?qh(t):S1(t),c=e==="memory"?"Memory body":"Resource body";return o.jsxs("div",{className:"space-y-3",children:[o.jsx(at,{label:c,children:o.jsx("textarea",{value:l.body,onChange:d=>n(ht(e,t,{body:d.target.value})),className:"editor-textarea",spellCheck:!1})}),o.jsx("p",{className:"text-xs text-muted-foreground/80",children:"Frontmatter (name, scope/category, source, related assignments, tags) is preserved server-side on save."})]})}const a=du(t);return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(ta,{children:[o.jsx(at,{label:"Playbook name",children:o.jsx("input",{value:a.name,onChange:l=>{const c=l.target.value,d={name:c};s&&(a.slug===dr(a.name)||!a.slug.trim())&&(d.slug=dr(c)),n(ht(e,t,d))},className:"editor-input"})}),o.jsx(at,{label:"Slug",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("input",{value:a.slug,disabled:!s,onChange:l=>n(ht(e,t,{slug:dr(l.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),o.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."})]})}),o.jsx(at,{label:"Description",className:"md:col-span-2",children:o.jsx("input",{value:a.description,onChange:l=>n(ht(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),o.jsx(at,{label:"Tags",className:"md:col-span-2",children:o.jsx("input",{value:a.tags,onChange:l=>n(ht(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),o.jsx(at,{label:"When to use",className:"md:col-span-2",children:o.jsx("input",{value:a.whenToUse,onChange:l=>n(ht(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),o.jsx(at,{label:"Playbook rules",children:o.jsx("textarea",{value:a.body,onChange:l=>n(ht(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function ta({children:e}){return o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function at({label:e,children:t,className:n}){return o.jsxs("label",{className:`block space-y-2 ${n??""}`,children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:e}),t]})}function a_({value:e,onChange:t}){const{data:n}=Wp(),s=(n==null?void 0:n.workspaces)??[];return o.jsx(at,{label:"Workspace",children:o.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"editor-input",children:[o.jsx("option",{value:"",children:"Ungrouped"}),s.map(a=>o.jsx("option",{value:a,children:a},a))]})})}function l_(e,t){switch(e){case"project":return au(t).body;case"assignment":return lu(t).body;case"plan":return cu(t).body;case"scratchpad":return uu(t).body;case"playbook":return du(t).body;case"memory":return qh(t).body;case"resource":return S1(t).body}}function c_(e,t){switch(e){case"project":{const n=au(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!nf(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=lu(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!nf(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return cu(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return uu(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=du(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!nf(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function zv(){const e=St(),{workspace:t}=mt(),n=_t(),[s,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{fetch("/api/templates/project").then(v=>v.json()).then(v=>{let b=v.content;t&&t!=="_ungrouped"&&(b=b.replace(/^(tags: \[\])$/m,`$1
|
|
510
|
+
workspace: ${t}`)),a(b),c(!1)}).catch(v=>{h(v.message),c(!1)})},[t]);async function x(v){p(!0),h(null);try{const b=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:v})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}e(`${n}/projects/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?o.jsx(ot,{label:"Loading project template…"}):m&&!s?o.jsx(Ze,{error:m}):o.jsx(ci,{initialContent:s||"",documentType:"project",mode:"create",onSave:x,saving:d,error:m,title:"Create Project",description:"Projects hold the high-level objective, shared context, and human-authored overview. Put execution details in assignments instead of overloading project.md.",onCancel:()=>e(`${n}/projects`),helpTitle:"Project editing rules",helpBody:"Use this form for project intent, slug, tags, and overview content. If you ever need less common metadata, raw markdown mode still exposes the full file.",allowSlugEdit:!0})}function Bv(){const{slug:e}=mt(),t=_t(),n=St(),[s,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{fetch("/api/templates/assignment").then(v=>v.json()).then(v=>{a(v.content),c(!1)}).catch(v=>{h(v.message),c(!1)})},[]);async function x(v){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:v})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?o.jsx(ot,{label:"Loading assignment template…"}):m&&!s?o.jsx(Ze,{error:m}):o.jsx(ci,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Assignment",description:"Assignments are the execution unit. Declare dependencies here, keep status pending until work starts, and use blocked later only for runtime obstacles.",onCancel:()=>n(e?`${t}/projects/${e}`:`${t}/projects`),helpTitle:"Assignment editing rules",helpBody:"Use structured fields for priority, assignee, dependencies, and tags. Status can be changed through lifecycle actions, kanban drag, or the status override.",allowSlugEdit:!0})}function Uv(){const{workspace:e}=mt(),t=_t(),n=St(),[s,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{const v=new URLSearchParams({standalone:"1"});e&&v.set("workspace",e),fetch(`/api/templates/assignment?${v.toString()}`).then(b=>b.json()).then(b=>{a(b.content),c(!1)}).catch(b=>{h(b.message),c(!1)})},[e]);async function x(v){var b;p(!0),h(null);try{const C=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:v})}),k=await C.json();if(!C.ok){h(k.error||`HTTP ${C.status}`),p(!1);return}const j=(b=k==null?void 0:k.assignment)==null?void 0:b.id;if(!j){h("Server did not return the new assignment id."),p(!1);return}n(`/assignments/${j}`)}catch(C){h(C.message),p(!1);return}p(!1)}return l?o.jsx(ot,{label:"Loading assignment template…"}):m&&!s?o.jsx(Ze,{error:m}):o.jsx(ci,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Standalone Assignment",description:e?`Standalone assignments live outside any project. This one will be tagged with workspaceGroup: ${e} so it appears in this workspace's views.`:"Standalone assignments live outside any project. Add a workspaceGroup to make them appear in workspace-filtered views.",onCancel:()=>n(`${t}/assignments`),helpTitle:"Standalone assignment editing rules",helpBody:"No project field is needed (it must remain null). Use workspaceGroup to group with other workspace work. Status, priority, and tags work the same as project-nested assignments.",allowSlugEdit:!0})}function ui({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,documentType:l,helpTitle:c,helpBody:d}){const p=St(),{data:m,loading:h,error:x}=qb(e),[v,b]=g.useState(!1),[C,k]=g.useState(null);async function j(S){b(!0),k(null);try{const T=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),N=await T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),b(!1);return}p(n)}catch(T){k(T.message),b(!1);return}b(!1)}return h?o.jsx(ot,{label:`Loading ${s.toLowerCase()}…`}):x||!m?o.jsx(Ze,{error:x||`${s} is unavailable.`}):o.jsx(ci,{initialContent:m.content,documentType:l,onSave:j,saving:v,error:C,title:s,description:a,onCancel:()=>p(n),helpTitle:c,helpBody:d})}function Hv(){const{slug:e}=mt(),t=_t(),n=e??"";return o.jsx(ui,{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 Mf(){const{slug:e,aslug:t,id:n}=mt(),s=_t(),a=!!n,l=a?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=a?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,d=a?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return o.jsx(ui,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Assignment",description:"Edit assignment fields including status, priority, assignee, dependencies, and body.",documentType:"assignment",helpTitle:"Assignment editing",helpBody:"All fields are editable. Status can also be changed through lifecycle actions or kanban drag."})}function _f(){const{slug:e,aslug:t,id:n}=mt(),s=_t(),a=!!n,l=a?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=a?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,d=a?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return o.jsx(ui,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Plan",description:"Plans are separate from assignment status, so keep implementation steps here instead of overloading the assignment body.",documentType:"plan",helpTitle:"Plan status is separate",helpBody:"Plan status tracks the plan document itself. It does not replace the assignment lifecycle state."})}function $f(){const{slug:e,aslug:t,id:n}=mt(),s=_t(),a=!!n,l=a?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=a?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,d=a?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return o.jsx(ui,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Scratchpad",description:"Scratchpad is the assignment’s working memory surface for notes, experiments, and temporary context.",documentType:"scratchpad",helpTitle:"Scratchpad usage",helpBody:"Scratchpad is for transient notes. Keep canonical objective and lifecycle data in assignment.md and any active plan files (plan.md, plan-v2.md, ...)."})}function C1({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:a,helpTitle:l,helpBody:c}){const d=St(),{data:p,loading:m,error:h}=qb(e),[x,v]=g.useState(""),[b,C]=g.useState(""),[k,j]=g.useState(!1),[S,T]=g.useState(null);async function N(){j(!0),T(null);try{const A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:b})}),I=await A.json();if(!A.ok){T(I.error||`HTTP ${A.status}`),j(!1);return}d(n)}catch(A){T(A.message),j(!1);return}j(!1)}return m?o.jsx(ot,{label:`Loading ${s.toLowerCase()}…`}):h||!p?o.jsx(Ze,{error:h||`${s} is unavailable.`}):o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ie,{title:s,description:a,children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"block space-y-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry title"}),o.jsx("input",{value:x,onChange:A=>v(A.target.value),placeholder:"Optional title",className:"editor-input"})]}),o.jsxs("label",{className:"block space-y-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry body"}),o.jsx("textarea",{value:b,onChange:A=>C(A.target.value),className:"editor-textarea",spellCheck:!1})]}),S?o.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:S}):null,o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{type:"button",onClick:()=>d(n),className:"shell-action",children:"Cancel"}),o.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"})]})]})}),o.jsx(Ie,{title:"Current Document",children:o.jsx(Mt,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Ff(){const{slug:e,aslug:t,id:n}=mt(),s=_t(),a=!!n,l=a?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=a?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,d=a?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return o.jsx(C1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Handoff Entry",description:"Add a new handoff without rewriting previous history.",helpTitle:"Append-only handoff history",helpBody:"Handoff log entries preserve the baton-passing trail between sessions and agents. Add a new entry instead of editing older ones."})}function zf(){const{slug:e,aslug:t,id:n}=mt(),s=_t(),a=!!n,l=a?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=a?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,d=a?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return o.jsx(C1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Decision Entry",description:"Record a new decision and rationale without editing prior entries.",helpTitle:"Append-only decision history",helpBody:"Decision records should accumulate over time so the implementation rationale remains auditable and reviewable."})}function Wv(){const{workspace:e}=mt(),{data:t}=Zo(),{data:n,loading:s,error:a,refetch:l}=Vp(),[c,d]=g.useState(!1),[p,m]=g.useState(""),[h,x]=g.useState(!1),v=vn();g.useEffect(()=>{const T=v.hash.match(/^#server-(.+)/);if(!T)return;const N=decodeURIComponent(T[1]),A=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!A)return;A.scrollIntoView({block:"nearest"}),A.classList.add("ring-2","ring-primary/60");const I=window.setTimeout(()=>A.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(I)},[v.hash,n]);const b=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const T=new Set(t.filter(N=>e==="_ungrouped"?N.workspace===null:N.workspace===e).map(N=>N.slug));return n.sessions.filter(N=>N.windows.some(A=>A.panes.some(I=>I.assignment&&I.assignment.project!==null&&T.has(I.assignment.project))))})();async function C(T){if(T.preventDefault(),!!p.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim()})}),m(""),d(!1),l()}catch{}}async function k(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function j(T){await fetch(`/api/servers/${encodeURIComponent(T)}`,{method:"DELETE"}),l()}async function S(T){await fetch(`/api/servers/${encodeURIComponent(T)}/refresh`,{method:"POST"}),l()}return s?o.jsx(ot,{label:"Loading servers…"}):a?o.jsx(Ze,{error:a}):n?n.tmuxAvailable?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c?o.jsxs("form",{onSubmit:C,className:"flex items-center gap-2",children:[o.jsx("input",{type:"text",value:p,onChange:T=>m(T.target.value),placeholder:"tmux session name",className:"editor-input text-sm",autoFocus:!0}),o.jsx("button",{type:"submit",className:"shell-action",children:"Add"}),o.jsx("button",{type:"button",className:"shell-action",onClick:()=>d(!1),children:"Cancel"})]}):o.jsxs("button",{className:"shell-action",onClick:()=>d(!0),children:[o.jsx(Wt,{className:"h-3.5 w-3.5"}),"Track Session"]}),o.jsxs("button",{className:"shell-action",onClick:k,disabled:h,children:[o.jsx(jb,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),b.length===0?o.jsx(tt,{title:"No sessions tracked",description:"Register a tmux session to start tracking your dev servers."}):o.jsx("div",{className:"mt-4 space-y-4",children:b.map(T=>o.jsx(u_,{session:T,onRefresh:()=>S(T.name),onRemove:()=>j(T.name),onRefetch:l},T.name))})]}):o.jsx(o.Fragment,{children:o.jsxs("div",{className:"surface-panel mt-4 flex flex-col items-center gap-3 py-12 text-center",children:[o.jsx(WC,{className:"h-10 w-10 text-muted-foreground/40"}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:"tmux is not installed"}),o.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Server tracking requires tmux. Install it with ",o.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"brew install tmux"})," to get started."]})]})}):null}function u_({session:e,onRefresh:t,onRemove:n,onRefetch:s}){return o.jsxs("div",{className:"surface-panel","data-server-name":e.name,children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(_p,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),o.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"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last refreshed: ",new Date(e.lastRefreshed).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{className:"shell-action",onClick:t,title:"Refresh",children:o.jsx(jb,{className:"h-3.5 w-3.5"})}),o.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:o.jsx(Or,{className:"h-3.5 w-3.5"})})]})]}),e.alive&&e.windows.length>0&&o.jsx("div",{className:"mt-3 space-y-3",children:e.windows.map(a=>o.jsxs("div",{children:[o.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",a.index,": ",a.name]}),o.jsx("div",{className:"space-y-1.5",children:a.panes.map(l=>o.jsx(d_,{pane:l,sessionName:e.name,windowIndex:a.index,onRefetch:s},`${a.index}:${l.index}`))})]},a.index))}),!e.alive&&o.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(zC,{className:"h-4 w-4"}),o.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function d_({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const a=_t(),l=e.cwd.replace(/^\/Users\/[^/]+/,"~");return o.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[o.jsxs("span",{className:"shrink-0 font-mono text-xs text-muted-foreground/60",children:[":",e.index]}),o.jsx("span",{className:"shrink-0 rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:e.command}),o.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx("span",{className:"truncate",title:e.cwd,children:l}),o.jsx(Yr,{value:e.cwd})]}),e.branch&&o.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(Mp,{className:"h-3 w-3"}),e.branch,e.worktree&&o.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&&o.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:e.urls.map(c=>o.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:",":"),o.jsx(Ip,{className:"h-2.5 w-2.5"})]},c))}),o.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?o.jsxs(ye,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${a}/projects/${e.assignment.project}/assignments/${e.assignment.slug}`,className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/20",children:[o.jsx(DC,{className:"h-2.5 w-2.5"}),e.assignment.title,e.assignment.project===null?o.jsx("span",{className:"ml-1 rounded bg-muted px-1 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"Standalone"}):null]}):o.jsx("span",{className:"text-xs text-muted-foreground/40",children:"unlinked"})})]})}function Vv(){const{workspace:e}=mt(),{data:t}=Zo(),{data:n,loading:s,error:a}=z2(),[l,c]=g.useState(""),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState("started_desc"),[b,C]=g.useState(0),[k,j]=g.useState(new Set),[S,T]=g.useState(!1),[N,A]=g.useState(null),[I,R]=g.useState(null),D=(n==null?void 0:n.sessions.some(q=>q.status==="active"))??!1;g.useEffect(()=>{if(!D)return;const q=window.setInterval(()=>C(J=>J+1),3e4);return()=>window.clearInterval(q)},[D]),g.useEffect(()=>{j(q=>{if(q.size===0)return q;const J=new Set((n==null?void 0:n.sessions.map(F=>F.sessionId))??[]),_=new Set([...q].filter(F=>J.has(F)));return _.size===q.size?q:_})},[n]);const O=g.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const q=l.trim().toLowerCase();return[...n.sessions.filter(_=>{var U;if(e&&t){const Z=((U=t.find(P=>P.slug===_.projectSlug))==null?void 0:U.workspace)??null;if(e==="_ungrouped"){if(Z!==null)return!1}else if(Z!==e)return!1}const F=p_(_.started);return d&&(!F||F<d)||m&&(!F||F>m)?!1:q?[_.projectSlug??"",_.assignmentSlug??"",_.agent,_.sessionId,_.path,_.description??"",_.transcriptPath??""].join(" ").toLowerCase().includes(q):!0})].sort((_,F)=>h_(_,F,x))},[n,l,x,d,m,b,e,t]);function G(q){j(J=>{const _=new Set(J);return _.has(q)?_.delete(q):_.add(q),_})}function re(){k.size===O.length&&O.length>0?j(new Set):j(new Set(O.map(q=>q.sessionId)))}async function z(q){A(null),T(!0);try{const J=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:q})}),_=await J.json().catch(()=>null);if(!J.ok)throw new Error((_==null?void 0:_.error)||`HTTP ${J.status}`);j(F=>new Set([...F].filter(B=>!q.includes(B)))),R(null)}catch(J){A(J.message)}finally{T(!1)}}if(s)return o.jsx(ot,{label:"Loading agent sessions..."});if(a)return o.jsx(Ze,{error:a});if(!n)return null;const K=n.sessions.length>0;return o.jsxs(o.Fragment,{children:[o.jsxs(lh,{children:[o.jsx(Hc,{value:l,onChange:c,placeholder:"Search project, assignment, agent, session ID, path, or description"}),o.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",o.jsx("input",{type:"date",value:d,onChange:q=>p(q.target.value),className:"editor-input min-w-[150px]"})]}),o.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",o.jsx("input",{type:"date",value:m,onChange:q=>h(q.target.value),className:"editor-input min-w-[150px]"})]}),o.jsxs("select",{value:x,onChange:q=>v(q.target.value),className:"editor-input max-w-[200px]",children:[o.jsx("option",{value:"started_desc",children:"Newest first"}),o.jsx("option",{value:"started_asc",children:"Oldest first"}),o.jsx("option",{value:"assignment_asc",children:"Assignment A-Z"}),o.jsx("option",{value:"agent_asc",children:"Agent A-Z"})]})]}),N?o.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&&o.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:[o.jsxs("span",{className:"text-muted-foreground",children:[k.size," session",k.size!==1?"s":""," selected"]}),o.jsxs("button",{className:"shell-action text-destructive",onClick:()=>R({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:S,children:[o.jsx(Or,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),o.jsx("button",{className:"shell-action",onClick:()=>j(new Set),children:"Clear Selection"})]}),K?O.length===0?o.jsx(tt,{title:"No agent sessions match these filters",description:"Adjust the status, search term, date range, or sorting controls to show sessions again."}):o.jsx("div",{className:"surface-panel mt-4 overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[1280px] table-fixed text-sm",children:[o.jsxs("colgroup",{children:[o.jsx("col",{style:{width:"32px"}}),o.jsx("col",{style:{width:"140px"}}),o.jsx("col",{style:{width:"160px"}}),o.jsx("col",{style:{width:"200px"}}),o.jsx("col",{style:{width:"110px"}}),o.jsx("col",{style:{width:"130px"}}),o.jsx("col",{style:{width:"140px"}}),o.jsx("col",{style:{width:"200px"}}),o.jsx("col",{style:{width:"200px"}}),o.jsx("col",{style:{width:"40px"}})]}),o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/40 text-left text-xs uppercase tracking-wider text-muted-foreground",children:[o.jsx("th",{className:"pb-2 pr-3",children:o.jsx("button",{onClick:re,className:"text-muted-foreground hover:text-foreground",children:k.size===O.length&&O.length>0?o.jsx(Un,{className:"h-4 w-4"}):o.jsx(kb,{className:"h-4 w-4"})})}),o.jsx("th",{className:"pb-2 pr-3",children:"Project"}),o.jsx("th",{className:"pb-2 pr-3",children:"Assignment"}),o.jsx("th",{className:"pb-2 pr-3",children:"Description"}),o.jsx("th",{className:"pb-2 pr-3",children:"Agent"}),o.jsx("th",{className:"pb-2 pr-3",children:"Session ID"}),o.jsx("th",{className:"pb-2 pr-3",children:"Started"}),o.jsx("th",{className:"pb-2 pr-3",children:"Path"}),o.jsx("th",{className:"pb-2 pr-3",children:"Transcript"}),o.jsx("th",{className:"pb-2"})]})}),o.jsx("tbody",{children:O.map(q=>o.jsx(f_,{session:q,selected:k.has(q.sessionId),onToggle:()=>G(q.sessionId),onDelete:()=>R({sessionIds:[q.sessionId],title:`Delete session ${q.sessionId.slice(0,8)}...?`,description:`Remove this ${q.agent} session record${q.assignmentSlug?` for ${q.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"})},q.sessionId))})]})}):o.jsx(tt,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),o.jsx(y1,{open:I!==null,title:(I==null?void 0:I.title)??"Delete session?",description:(I==null?void 0:I.description)??"",confirmLabel:(I==null?void 0:I.confirmLabel)??"Delete",destructive:!0,loading:S,onOpenChange:q=>{q||R(null)},onConfirm:async()=>{I&&await z(I.sessionIds)}})]})}function f_({session:e,selected:t,onToggle:n,onDelete:s}){const a=_t(),l=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,c=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",d=e.transcriptPath?e.transcriptPath.replace(/^\/Users\/[^/]+/,"~"):"—";return o.jsxs("tr",{className:"border-b border-border/20 last:border-0",children:[o.jsx("td",{className:"py-2 pr-3",children:o.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground",children:t?o.jsx(Un,{className:"h-4 w-4"}):o.jsx(kb,{className:"h-4 w-4"})})}),o.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?o.jsx(ye,{to:`${a}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:Qt(e.projectSlug),children:Qt(e.projectSlug)}):e.assignmentSlug?o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wide text-muted-foreground",children:"Standalone"}):o.jsx("span",{className:"text-muted-foreground",children:"—"})}),o.jsx("td",{className:"py-2 pr-3",children:e.projectSlug&&e.assignmentSlug?o.jsx(ye,{to:`${a}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:Qt(e.assignmentSlug),children:Qt(e.assignmentSlug)}):e.assignmentSlug?o.jsx(ye,{to:`/assignments/${e.assignmentSlug}`,className:"block truncate font-mono text-primary hover:underline",title:e.assignmentSlug,children:e.assignmentSlug}):o.jsx("span",{className:"text-muted-foreground",children:"—"})}),o.jsx("td",{className:"py-2 pr-3",children:e.description?o.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.description,children:e.description}):o.jsx("span",{className:"text-muted-foreground",children:"—"})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx(Oc,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:e.agent})]})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:l}),o.jsx(Yr,{value:e.sessionId})]})}),o.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:o.jsx("span",{className:"truncate block",children:Rn(e.started)})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx("span",{className:"truncate text-xs text-muted-foreground",title:e.path,children:c}),e.path&&o.jsx(Yr,{value:e.path})]})}),o.jsx("td",{className:"py-2 pr-3",children:e.transcriptPath?o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:d}),o.jsx(Yr,{value:e.transcriptPath})]}):o.jsx("span",{className:"text-muted-foreground",children:"—"})}),o.jsx("td",{className:"py-2",children:o.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:o.jsx(Or,{className:"h-3.5 w-3.5"})})})]})}function p_(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${a}`}function rc(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 h_(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 rc(e)-rc(t);case"duration_desc":return rc(t)-rc(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 m_(){const{data:e,loading:t,error:n,refetch:s}=Kb(),[a,l]=g.useState(""),[c,d]=g.useState(null),p=g.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!a.trim())return e.playbooks;const h=a.toLowerCase();return e.playbooks.filter(x=>x.name.toLowerCase().includes(h)||x.description.toLowerCase().includes(h)||x.slug.toLowerCase().includes(h)||x.tags.some(v=>v.toLowerCase().includes(h)))},[e,a]);async function m(h,x,v){if(h.preventDefault(),h.stopPropagation(),!c){d(x);try{const b=v?"disable":"enable",C=await fetch(`/api/playbooks/${encodeURIComponent(x)}/${b}`,{method:"POST"});if(!C.ok){const k=await C.json().catch(()=>({}));throw new Error(k.error||`Failed to ${b} playbook`)}s()}catch(b){console.error(b),alert(b instanceof Error?b.message:"Failed to update playbook")}finally{d(null)}}}return t?o.jsx(ot,{label:"Loading playbooks..."}):n?o.jsx(Ze,{error:n}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"relative flex-1 max-w-sm",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{type:"text",placeholder:"Search playbooks...",value:a,onChange:h=>l(h.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"})]}),o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"Create Playbook"]})]}),o.jsxs(ye,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[o.jsx(yb,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:"Playbook Manifest"}),o.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"})]}),o.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Index of all playbooks with descriptions. Include ",o.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."]})]})]}),p.length===0?o.jsx(tt,{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?o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"Create Playbook"]}):void 0}):o.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:p.map(h=>{const x=c===h.slug;return o.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${h.enabled?"":"opacity-75"}`,children:[o.jsxs(ye,{to:`/playbooks/${h.slug}`,className:"group flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(gb,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:h.name}),h.description?o.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:h.description}):null]})]}),o.jsx("div",{className:"flex items-center gap-2 pt-1 pr-20",children:o.jsxs("div",{className:"flex flex-wrap gap-1",children:[h.tags.slice(0,3).map(v=>o.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:[o.jsx(Sb,{className:"h-2.5 w-2.5"}),v]},v)),h.tags.length>3?o.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",h.tags.length-3]}):null]})})]}),o.jsx("button",{type:"button",role:"switch","aria-checked":h.enabled,"aria-label":h.enabled?"Disable playbook":"Enable playbook",onClick:v=>m(v,h.slug,h.enabled),disabled:x,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 ${h.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:o.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${h.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},h.slug)})})]})}function g_(){const{slug:e}=mt(),t=St(),{data:n,loading:s,error:a,refetch:l}=U2(e),[c,d]=g.useState(!1),[p,m]=g.useState(!1),[h,x]=g.useState(!1),v=e==="manifest";async function b(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function C(){if(!(!e||!n)){x(!0);try{const k=n.enabled?"disable":"enable",j=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${k}`,{method:"POST"});if(!j.ok){const S=await j.json().catch(()=>({}));throw new Error(S.error||`Failed to ${k} playbook`)}l()}catch(k){console.error(k),alert(k instanceof Error?k.message:"Failed to update playbook")}finally{x(!1)}}}return s?o.jsx(ot,{label:"Loading playbook..."}):a?o.jsx(Ze,{error:a}):n?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:v?"Playbook Manifest":n.name}),v?o.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]}),!v&&n.description?o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,v?o.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This file is rebuilt automatically when playbooks are added or removed. Include"," ",o.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,!v&&n.whenToUse?o.jsxs("p",{className:"mt-2 text-sm text-muted-foreground italic",children:["When to use: ",n.whenToUse]}):null,o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Created ",Rn(n.created)]}),o.jsxs("span",{children:["Updated ",Rn(n.updated)]})]}),n.tags.length>0?o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(k=>o.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:[o.jsx(Sb,{className:"h-3 w-3"}),k]},k))}):null]}),v?null:o.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.enabled?"Enabled":"Disabled"}),o.jsx("button",{type:"button",role:"switch","aria-checked":n.enabled,"aria-label":n.enabled?"Disable playbook":"Enable playbook",onClick:C,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:o.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"}`})})]}),o.jsxs(ye,{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:[o.jsx($p,{className:"h-3 w-3"}),"Edit"]}),c?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:b,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"}),o.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):o.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[o.jsx(Or,{className:"h-3 w-3"}),"Delete"]})]})]}),o.jsx("div",{className:"surface-panel p-4",children:o.jsx(Mt,{content:n.body})})]}):null}function x_(){const e=St(),[t,n]=g.useState(null),[s,a]=g.useState(!0),[l,c]=g.useState(!1),[d,p]=g.useState(null);g.useEffect(()=>{fetch("/api/playbooks/template/new").then(h=>h.json()).then(h=>{n(h.content),a(!1)}).catch(h=>{p(h.message),a(!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})}),v=await x.json();if(!x.ok){p(v.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${v.slug}`)}catch(x){p(x.message),c(!1);return}c(!1)}return s?o.jsx(ot,{label:"Loading playbook template..."}):d&&!t?o.jsx(Ze,{error:d}):o.jsx(ci,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:d,title:"Create Playbook",description:"Playbooks define rules and workflows for how agents should operate. Keep them short, imperative, and focused on a single concern.",onCancel:()=>e("/playbooks"),allowSlugEdit:!0})}function y_(){const{slug:e}=mt(),t=St(),[n,s]=g.useState(null),[a,l]=g.useState(!0),[c,d]=g.useState(!1),[p,m]=g.useState(null);g.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){d(!0),m(null);try{const v=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),b=await v.json();if(!v.ok){m(b.error||`HTTP ${v.status}`),d(!1);return}t(`/playbooks/${e}`)}catch(v){m(v.message),d(!1);return}d(!1)}}return a?o.jsx(ot,{label:"Loading playbook..."}):p&&!n?o.jsx(Ze,{error:p}):o.jsx(ci,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function v_(){const{data:e,loading:t,error:n}=H2(),[s,a]=g.useState(""),[l,c]=g.useState("all"),[d,p]=g.useState("all"),[m,h]=g.useState("all"),x=(e==null?void 0:e.memories)??[],v=g.useMemo(()=>Array.from(new Set(x.map(j=>j.projectSlug))).sort(),[x]),b=g.useMemo(()=>Array.from(new Set(x.map(j=>j.scope).filter(Boolean))).sort(),[x]),C=g.useMemo(()=>Array.from(new Set(x.map(j=>j.source).filter(Boolean))).sort(),[x]),k=g.useMemo(()=>x.filter(j=>{if(l!=="all"&&j.projectSlug!==l||d!=="all"&&j.scope!==d||m!=="all"&&j.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!j.name.toLowerCase().includes(S)&&!j.slug.toLowerCase().includes(S)&&!j.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?o.jsx(ot,{label:"Loading memories…"}):n?o.jsx(Ze,{error:n}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{type:"text",placeholder:"Search memories…",value:s,onChange:j=>a(j.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"})]}),o.jsxs("select",{value:l,onChange:j=>c(j.target.value),className:"editor-input max-w-[170px]",children:[o.jsx("option",{value:"all",children:"All projects"}),v.map(j=>o.jsx("option",{value:j,children:j},j))]}),o.jsxs("select",{value:d,onChange:j=>p(j.target.value),className:"editor-input max-w-[140px]",children:[o.jsx("option",{value:"all",children:"All scopes"}),b.map(j=>o.jsx("option",{value:j,children:j},j))]}),o.jsxs("select",{value:m,onChange:j=>h(j.target.value),className:"editor-input max-w-[140px]",children:[o.jsx("option",{value:"all",children:"All sources"}),C.map(j=>o.jsx("option",{value:j,children:j},j))]})]}),o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"New Memory"]})]}),k.length===0?o.jsx(tt,{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?o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"New Memory"]}):void 0}):o.jsx("div",{className:"surface-panel overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Scope"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),o.jsx("tbody",{children:k.map(j=>o.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[o.jsx("td",{className:"px-3 py-3",children:o.jsx(ye,{to:`/projects/${j.projectSlug}/memories/${j.slug}`,className:"font-semibold text-foreground hover:text-primary",children:j.name||j.slug})}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:o.jsx(ye,{to:`/projects/${j.projectSlug}`,className:"hover:text-foreground hover:underline",children:j.projectTitle})}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.scope||"—"}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.source||"—"}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.relatedAssignments.length}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Ar(j.updated)})]},`${j.projectSlug}/${j.slug}`))})]})})]})}function b_(){const{slug:e,itemSlug:t}=mt(),n=St(),{data:s,loading:a,error:l}=W2(e,t),[c,d]=g.useState(!1),[p,m]=g.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 a?o.jsx(ot,{label:"Loading memory…"}):l?o.jsx(Ze,{error:l}):s?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ye,{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?o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Scope: ",s.scope]}):null,s.source?o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,s.sourceAssignment?o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["From: ",s.sourceAssignment]}):null,o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Created ",Rn(s.created)]}),o.jsxs("span",{children:["Updated ",Rn(s.updated)]})]}),s.tags&&s.tags.length>0?o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map(x=>o.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]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[o.jsxs(ye,{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:[o.jsx($p,{className:"h-3 w-3"}),"Edit"]}),c?o.jsxs("div",{className:"flex items-center gap-2",children:[o.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"}),o.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):o.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[o.jsx(Or,{className:"h-3 w-3"}),"Delete"]})]})]}),o.jsx("div",{className:"surface-panel p-4",children:o.jsx(Mt,{content:s.body})})]}):null}function w_(){const e=St(),[t]=Ir(),n=t.get("project"),{data:s,loading:a,error:l}=Zo(),[c,d]=g.useState(n??""),[p,m]=g.useState(""),[h,x]=g.useState(""),[v,b]=g.useState(!1),[C,k]=g.useState(null);g.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function j(S){if(S.preventDefault(),!(!c||!p.trim())){b(!0),k(null);try{const T=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 T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),b(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(T){k(T.message),b(!1)}}}return a?o.jsx(ot,{label:"Loading projects…"}):l?o.jsx(Ze,{error:l}):!s||s.length===0?o.jsx(Ze,{error:"You need at least one project before you can create a memory. Create a project from the sidebar."}):o.jsxs("form",{onSubmit:j,className:"space-y-5",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Memory"}),o.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."})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),o.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>o.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),o.jsx("input",{id:"name",type:"text",value:p,onChange:S=>m(S.target.value),placeholder:"e.g. PostgreSQL connection pooling",className:"editor-input",required:!0,autoFocus:!0}),o.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),o.jsx("textarea",{id:"body",value:h,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the memory body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?o.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"submit",disabled:v||!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:v?"Creating…":"Create Memory"}),o.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 j_(){const{slug:e,itemSlug:t}=mt();return o.jsx(ui,{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 k_(){const{data:e,loading:t,error:n}=V2(),[s,a]=g.useState(""),[l,c]=g.useState("all"),[d,p]=g.useState("all"),[m,h]=g.useState("all"),x=(e==null?void 0:e.resources)??[],v=g.useMemo(()=>Array.from(new Set(x.map(j=>j.projectSlug))).sort(),[x]),b=g.useMemo(()=>Array.from(new Set(x.map(j=>j.category).filter(Boolean))).sort(),[x]),C=g.useMemo(()=>Array.from(new Set(x.map(j=>j.source).filter(Boolean))).sort(),[x]),k=g.useMemo(()=>x.filter(j=>{if(l!=="all"&&j.projectSlug!==l||d!=="all"&&j.category!==d||m!=="all"&&j.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!j.name.toLowerCase().includes(S)&&!j.slug.toLowerCase().includes(S)&&!j.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?o.jsx(ot,{label:"Loading resources…"}):n?o.jsx(Ze,{error:n}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{type:"text",placeholder:"Search resources…",value:s,onChange:j=>a(j.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"})]}),o.jsxs("select",{value:l,onChange:j=>c(j.target.value),className:"editor-input max-w-[170px]",children:[o.jsx("option",{value:"all",children:"All projects"}),v.map(j=>o.jsx("option",{value:j,children:j},j))]}),o.jsxs("select",{value:d,onChange:j=>p(j.target.value),className:"editor-input max-w-[160px]",children:[o.jsx("option",{value:"all",children:"All categories"}),b.map(j=>o.jsx("option",{value:j,children:j},j))]}),o.jsxs("select",{value:m,onChange:j=>h(j.target.value),className:"editor-input max-w-[140px]",children:[o.jsx("option",{value:"all",children:"All sources"}),C.map(j=>o.jsx("option",{value:j,children:j},j))]})]}),o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"New Resource"]})]}),k.length===0?o.jsx(tt,{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?o.jsxs(ye,{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:[o.jsx(Wt,{className:"h-4 w-4"}),"New Resource"]}):void 0}):o.jsx("div",{className:"surface-panel overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Category"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),o.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),o.jsx("tbody",{children:k.map(j=>o.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[o.jsx("td",{className:"px-3 py-3",children:o.jsx(ye,{to:`/projects/${j.projectSlug}/resources/${j.slug}`,className:"font-semibold text-foreground hover:text-primary",children:j.name||j.slug})}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:o.jsx(ye,{to:`/projects/${j.projectSlug}`,className:"hover:text-foreground hover:underline",children:j.projectTitle})}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.category||"—"}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.source||"—"}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:j.relatedAssignments.length}),o.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:Ar(j.updated)})]},`${j.projectSlug}/${j.slug}`))})]})})]})}function S_(){const{slug:e,itemSlug:t}=mt(),n=St(),{data:s,loading:a,error:l}=q2(e,t),[c,d]=g.useState(!1),[p,m]=g.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 a?o.jsx(ot,{label:"Loading resource…"}):l?o.jsx(Ze,{error:l}):s?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ye,{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?o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Category: ",s.category]}):null,s.source?o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,o.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Created ",Rn(s.created)]}),o.jsxs("span",{children:["Updated ",Rn(s.updated)]})]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[o.jsxs(ye,{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:[o.jsx($p,{className:"h-3 w-3"}),"Edit"]}),c?o.jsxs("div",{className:"flex items-center gap-2",children:[o.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"}),o.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):o.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[o.jsx(Or,{className:"h-3 w-3"}),"Delete"]})]})]}),o.jsx("div",{className:"surface-panel p-4",children:o.jsx(Mt,{content:s.body})})]}):null}function N_(){const e=St(),[t]=Ir(),n=t.get("project"),{data:s,loading:a,error:l}=Zo(),[c,d]=g.useState(n??""),[p,m]=g.useState(""),[h,x]=g.useState(""),[v,b]=g.useState(!1),[C,k]=g.useState(null);g.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function j(S){if(S.preventDefault(),!(!c||!p.trim())){b(!0),k(null);try{const T=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 T.json();if(!T.ok){k(N.error||`HTTP ${T.status}`),b(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(T){k(T.message),b(!1)}}}return a?o.jsx(ot,{label:"Loading projects…"}):l?o.jsx(Ze,{error:l}):!s||s.length===0?o.jsx(Ze,{error:"You need at least one project before you can create a resource. Create a project from the sidebar."}):o.jsxs("form",{onSubmit:j,className:"space-y-5",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Resource"}),o.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."})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),o.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>o.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),o.jsx("input",{id:"name",type:"text",value:p,onChange:S=>m(S.target.value),placeholder:"e.g. Auth Requirements",className:"editor-input",required:!0,autoFocus:!0}),o.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),o.jsx("textarea",{id:"body",value:h,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the resource body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?o.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"submit",disabled:v||!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:v?"Creating…":"Create Resource"}),o.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 C_(){const{slug:e,itemSlug:t}=mt();return o.jsx(ui,{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 E_({value:e,onChange:t}){return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:"color",value:e||"#64748b",onChange:n=>t(n.target.value),className:"h-7 w-7 shrink-0 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5",title:"Pick a color"}),o.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs"})]})}const Np=["projects","playbooks","todos","servers","config"];function P_(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))Np.includes(n)&&t.add(n);return t}function qv(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function T_(){const[e,t]=g.useState(!0),[n,s]=g.useState(null),[a,l]=g.useState(""),[c,d]=g.useState(new Set(Np)),[p,m]=g.useState(!1),[h,x]=g.useState(!1),[v,b]=g.useState(null),[C,k]=g.useState(null),j=g.useCallback(async()=>{try{const R=await fetch("/api/backup");if(!R.ok)throw new Error(`HTTP ${R.status}`);const D=await R.json();s(D),l(D.repo??""),d(P_(D.categories)),m(!1)}catch(R){k({type:"error",message:`Failed to load backup config: ${R instanceof Error?R.message:String(R)}`})}finally{t(!1)}},[]);g.useEffect(()=>{j()},[j]);function S(R){d(D=>{const O=new Set(D);return O.has(R)?O.delete(R):O.add(R),O}),m(!0)}async function T(){x(!0),k(null);try{const R=Array.from(c),D=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:a.trim()||null,categories:R})}),O=await D.json();if(!D.ok)throw new Error(O.error||`HTTP ${D.status}`);s(O),m(!1),k({type:"success",message:"Backup configuration saved."})}catch(R){k({type:"error",message:`Save failed: ${R instanceof Error?R.message:String(R)}`})}finally{x(!1)}}async function N(){b("push"),k(null);try{const R=await fetch("/api/backup/push",{method:"POST"}),D=await R.json();if(!R.ok||D.success===!1)throw new Error(D.error||D.message||`HTTP ${R.status}`);k({type:"success",message:D.message||"Backup complete."}),await j()}catch(R){k({type:"error",message:`Backup failed: ${R instanceof Error?R.message:String(R)}`})}finally{b(null)}}async function A(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){b("pull"),k(null);try{const D=await fetch("/api/backup/pull",{method:"POST"}),O=await D.json();if(!D.ok||O.success===!1)throw new Error(O.error||O.message||`HTTP ${D.status}`);k({type:"success",message:O.message||"Restore complete."}),await j()}catch(D){k({type:"error",message:`Restore failed: ${D instanceof Error?D.message:String(D)}`})}finally{b(null)}}}if(e)return o.jsx(Ie,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})});const I=!!a.trim()&&c.size>0&&!v&&!p;return o.jsx(Ie,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository and restore from it",children:o.jsxs("div",{className:"space-y-4",children:[C&&o.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${C.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:C.message}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repository URL"}),o.jsx("input",{type:"text",value:a,onChange:R=>{l(R.target.value),m(!0)},placeholder:"git@github.com:you/syntaur-backup.git",className:"editor-input w-full text-sm"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["SSH or HTTPS URL. Requires ",o.jsx("code",{className:"rounded bg-muted px-1",children:"git"})," installed and credentials configured locally."]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Categories to back up"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Np.map(R=>{const D=c.has(R);return o.jsxs("button",{type:"button",onClick:()=>S(R),className:`shell-action text-xs ${D?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted/30 text-muted-foreground hover:bg-muted/60"}`,children:[o.jsx("span",{className:`mr-1 inline-block h-2 w-2 rounded-full ${D?"bg-primary":"bg-muted-foreground/40"}`}),R]},R)})})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Last backup: "}),qv((n==null?void 0:n.lastBackup)??null)]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),qv((n==null?void 0:n.lastRestore)??null)]}),(n==null?void 0:n.locked)&&o.jsx("div",{className:"sm:col-span-2 text-warning-foreground",children:"⚠ A backup operation is in progress or the lock file is stale."})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[o.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:T,disabled:h||!p,children:[o.jsx(Fp,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Config"]}),o.jsxs("button",{className:"shell-action",onClick:N,disabled:!I,title:I?"Back up now":p?"Save config first":"Set repo and pick categories",children:[o.jsx(VC,{className:"h-3.5 w-3.5"}),v==="push"?"Backing up...":"Back Up Now"]}),o.jsxs("button",{className:"shell-action",onClick:A,disabled:!I,title:I?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[o.jsx(jC,{className:"h-3.5 w-3.5"}),v==="pull"?"Restoring...":"Restore"]}),p&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]}),o.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:[o.jsx(bC,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),o.jsxs("span",{children:["Restore never overwrites ",o.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 R_(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:a,unbindAction:l}=As(),[c,d]=g.useState(null),[p,m]=g.useState(null),[h,x]=g.useState(!1),v=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function b(N,A){m({type:N,message:A}),setTimeout(()=>m(null),2500)}function C(N){d({kind:N,combo:null,conflict:null,saving:!1,error:null})}function k(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),j();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const A=Gb(N.nativeEvent);if(!A)return;const I=s(A,c.kind);d({...c,combo:A,conflict:I,error:null})}async function j(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){d({...c,error:`Reserved: ${c.conflict.description}`});return}d({...c,saving:!0,error:null});try{await a(c.kind,c.combo),d(null),b("success",`Bound ${Yi[c.kind]}`)}catch(A){d({...c,saving:!1,error:A instanceof Error?A.message:"Failed to save"})}}}async function S(N){try{await l(N),b("success",`Cleared ${Yi[N]} binding`)}catch(A){b("error",A instanceof Error?A.message:"Failed to clear binding")}}async function T(){if(!h){x(!0);try{await uT(),b("success","All hotkey bindings cleared")}catch(N){b("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return o.jsxs(Ie,{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:v?o.jsxs("button",{className:"shell-action text-xs",onClick:()=>void T(),disabled:h,children:[o.jsx(Gf,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[p?o.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,o.jsx("ul",{className:"space-y-2",children:$c.map(N=>{var O,G;const A=n.find(re=>re.bindableKind===N),I=e[N],R=typeof t[N]=="string"&&!!t[N],D=(c==null?void 0:c.kind)===N;return o.jsxs("li",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2",children:[o.jsx(Kf,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"text-sm text-foreground",children:(A==null?void 0:A.title)??Yi[N]}),A!=null&&A.subtitle?o.jsx("div",{className:"text-xs text-muted-foreground",children:A.subtitle}):null]}),I?o.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[o.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-foreground",children:Tr(I)}),o.jsx("span",{className:`text-[10px] uppercase tracking-wide ${R?"text-primary":"text-muted-foreground"}`,children:R?"custom":"default"})]}):o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"unbound"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("button",{type:"button",className:"shell-action text-xs",onClick:()=>C(N),children:I?"Rebind":"Bind"}),R?o.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${Yi[N]} binding`,children:[o.jsx(zp,{className:"h-3 w-3"}),"Restore default"]}):null]}),D?o.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&&d(null)},children:c!=null&&c.combo?o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"text-base font-semibold tracking-wide text-foreground",children:Tr(c.combo)}),(O=c.conflict)!=null&&O.description?o.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(G=c.conflict)!=null&&G.kind?o.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',Yi[c.conflict.kind],'". Press Enter to overwrite.']}):o.jsx("div",{className:"text-xs text-muted-foreground",children:"Press Enter to save, Esc to cancel, any other key to retry."}),c.error?o.jsx("div",{className:"text-xs text-destructive",children:c.error}):null]}):o.jsx("div",{className:"text-xs text-muted-foreground",children:"Press the key combination you want to bind…"})}):null]},N)})})]})}function Bf(e){return{statuses:e.statuses.map(t=>({id:t.id,label:t.label,description:t.description??"",color:t.color??"",terminal:t.terminal??!1})),order:[...e.order]}}function A_(){const[e,t]=g.useState(!0),[n,s]=g.useState(null),[a,l]=g.useState(!1),[c,d]=g.useState([]),[p,m]=g.useState([]),[h,x]=g.useState(!1),[v,b]=g.useState(null),[C,k]=g.useState(!1),{preset:j,setPreset:S,resetPreset:T}=Hp(),[N,A]=g.useState(!1),[I,R]=g.useState(null);async function D(B){if(!(B===j||N)){A(!0),R(null);try{await S(B),R({type:"success",message:"Theme updated"}),setTimeout(()=>R(null),2e3)}catch(U){R({type:"error",message:U instanceof Error?U.message:"Failed to save theme"})}finally{A(!1)}}}async function O(){A(!0),R(null);try{await T(),R({type:"success",message:"Theme reset to default"}),setTimeout(()=>R(null),2e3)}catch(B){R({type:"error",message:B instanceof Error?B.message:"Failed to reset theme"})}finally{A(!1)}}const G=g.useCallback(async()=>{try{const B=await fetch("/api/config/statuses");if(!B.ok)throw new Error(`HTTP ${B.status}`);const U=await B.json(),Z=Bf(U);d(Z.statuses),m(Z.order),l(U.custom),k(!1),s(null)}catch(B){s(B instanceof Error?B.message:"Failed to load config")}finally{t(!1)}},[]);g.useEffect(()=>{G()},[G]);function re(){setTimeout(()=>b(null),3e3)}async function z(){x(!0),b(null);try{const B={statuses:c.map(M=>({id:M.id,label:M.label,...M.description?{description:M.description}:{},...M.color?{color:M.color}:{},...M.terminal?{terminal:!0}:{}})),order:p,transitions:[]},U=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)});if(!U.ok){const M=await U.json().catch(()=>({error:"Unknown error"}));throw new Error(M.error??"Save failed")}const Z=await U.json(),P=Bf(Z);d(P.statuses),m(P.order),l(Z.custom),k(!1),py(),b({type:"success",message:"Status config saved"}),re()}catch(B){b({type:"error",message:B instanceof Error?B.message:"Save failed"})}finally{x(!1)}}async function K(){x(!0),b(null);try{const B=await fetch("/api/config/statuses",{method:"DELETE"});if(!B.ok)throw new Error("Reset failed");const U=await B.json(),Z=Bf(U);d(Z.statuses),m(Z.order),l(U.custom),k(!1),py(),b({type:"success",message:"Reset to defaults"}),re()}catch(B){b({type:"error",message:B instanceof Error?B.message:"Reset failed"})}finally{x(!1)}}function q(B,U,Z){d(P=>{const M=[...P];if(M[B]={...M[B],[U]:Z},U==="id"&&typeof Z=="string"){const Q=P[B].id;m(L=>L.map(ge=>ge===Q?Z:ge))}return M}),k(!0)}function J(){const B=`status_${c.length+1}`;d(U=>[...U,{id:B,label:"New Status",description:"",color:"",terminal:!1}]),m(U=>[...U,B]),k(!0)}function _(B){const U=c[B].id;d(Z=>Z.filter((P,M)=>M!==B)),m(Z=>Z.filter(P=>P!==U)),k(!0)}function F(B,U){const Z=B+U;Z<0||Z>=p.length||(m(P=>{const M=[...P];return[M[B],M[Z]]=[M[Z],M[B]],M}),k(!0))}return e?o.jsx(ot,{label:"Loading settings..."}):n?o.jsx(Ze,{error:n}):o.jsx(da,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Ie,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:j!=="default"?o.jsxs("button",{className:"shell-action text-xs",onClick:O,disabled:N,children:[o.jsx(Gf,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[I&&o.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}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Ib.map(B=>{const U=B.slug===j;return o.jsxs("button",{type:"button",onClick:()=>D(B.slug),disabled:N,"aria-pressed":U,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${U?"border-primary ring-2 ring-primary/40":"border-border/60 hover:border-primary/40"}`,children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.primary}}),o.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.secondary}}),o.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.coral}}),o.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.teal}}),o.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.amber}}),U&&o.jsx("span",{className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:o.jsx(Ea,{className:"h-3 w-3"})})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:B.label}),o.jsx("div",{className:"text-xs text-muted-foreground",children:B.description})]})]},B.slug)})})]}),o.jsx(R_,{}),o.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${a?"border-primary/30 bg-primary/5 text-primary":"border-border/60 bg-muted/30 text-muted-foreground"}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(bb,{className:"h-4 w-4"}),a?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),o.jsxs("button",{className:"shell-action text-xs",onClick:K,disabled:h||!a&&!C,children:[o.jsx(Gf,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),v&&o.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${v.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:v.message}),o.jsx(Ie,{title:"Status Definitions",description:"Define the statuses assignments can have",actions:o.jsxs("button",{className:"shell-action text-xs",onClick:J,children:[o.jsx(Wt,{className:"h-3 w-3"}),"Add Status"]}),children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-border/50 text-left text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[o.jsx("th",{className:"pb-2 pr-3",children:"ID"}),o.jsx("th",{className:"pb-2 pr-3",children:"Label"}),o.jsx("th",{className:"pb-2 pr-3",children:"Color"}),o.jsx("th",{className:"pb-2 pr-3",children:o.jsxs(fa,{children:[o.jsx(pa,{asChild:!0,children:o.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-4",children:"Done State"})}),o.jsx(Wo,{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.'})]})}),o.jsx("th",{className:"pb-2 w-10"})]})}),o.jsx("tbody",{className:"divide-y divide-border/30",children:c.map((B,U)=>o.jsxs("tr",{children:[o.jsx("td",{className:"py-2 pr-3",children:o.jsx("input",{type:"text",value:B.id,onChange:Z=>q(U,"id",Z.target.value),className:"editor-input w-full text-sm"})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsx("input",{type:"text",value:B.label,onChange:Z=>q(U,"label",Z.target.value),className:"editor-input w-full text-sm"})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsx(E_,{value:B.color,onChange:Z=>q(U,"color",Z)})}),o.jsx("td",{className:"py-2 pr-3",children:o.jsx("button",{type:"button",role:"switch","aria-checked":B.terminal,onClick:()=>q(U,"terminal",!B.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 ${B.terminal?"bg-primary":"bg-muted"}`,children:o.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${B.terminal?"translate-x-4":"translate-x-0"}`})})}),o.jsx("td",{className:"py-2",children:o.jsx("button",{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>_(U),title:"Remove status",children:o.jsx(Or,{className:"h-3.5 w-3.5"})})})]},U))})]})})}),o.jsx(Ie,{title:"Status Order",description:"Controls display order in the dashboard (Kanban columns, progress bars, dropdowns)",children:o.jsx("div",{className:"space-y-1",children:p.map((B,U)=>{var P;const Z=((P=c.find(M=>M.id===B))==null?void 0:P.label)??B;return o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[o.jsx("span",{className:"mr-1 font-mono text-xs text-muted-foreground/60",children:U+1}),o.jsx("span",{className:"flex-1 font-medium",children:Z}),o.jsx("span",{className:"text-xs text-muted-foreground",children:B}),o.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>F(U,-1),disabled:U===0,title:"Move up",children:o.jsx(xb,{className:"h-3.5 w-3.5"})}),o.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>F(U,1),disabled:U===p.length-1,title:"Move down",children:o.jsx(ya,{className:"h-3.5 w-3.5"})})]},U)})})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:z,disabled:h||!C,children:[o.jsx(Fp,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Configuration"]}),C&&o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),G()},disabled:h,children:"Discard Changes"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),o.jsx(T_,{})]})})}function D_(){const{data:e,loading:t,error:n,refetch:s}=qp(),[a,l]=g.useState(""),c=g.useRef(null);ro("list:todos");const[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(""),[b,C]=g.useState("_global"),[k,j]=g.useState(null);function S(_,F){_.stopPropagation(),navigator.clipboard.writeText(F),j(F),setTimeout(()=>j(B=>B===F?null:B),1500)}const T=g.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const _=[];for(const F of e.workspaces)for(const B of F.items)_.push({...B,workspace:F.workspace});return _},[e]),N=g.useMemo(()=>{const _=new Set;for(const F of T)for(const B of F.tags)_.add(B);return Array.from(_).sort()},[T]),A=g.useMemo(()=>{let _=T;if(a.trim()){const F=a.toLowerCase();_=_.filter(B=>B.description.toLowerCase().includes(F)||B.tags.some(U=>U.toLowerCase().includes(F))||B.id.includes(F))}return d&&(_=_.filter(F=>F.status===d)),m&&(_=_.filter(F=>F.tags.includes(m))),_},[T,a,d,m]),I=g.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const _={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const F of e.workspaces)_.open+=F.counts.open,_.in_progress+=F.counts.in_progress,_.completed+=F.counts.completed,_.blocked+=F.counts.blocked,_.total+=F.counts.total;return _},[e]);async function R(){x.trim()&&(await Kp(b,x.trim()),v(""),s())}const D={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function O(_,F,B){G(_,F,D[B]||"open")}async function G(_,F,B){switch(B){case"open":await Jb(_,F);break;case"in_progress":await Qb(_,F);break;case"completed":await Yb(_,F);break;case"blocked":await Xb(_,F);break}s()}async function re(_,F){await Zb(_,F),s()}const{hotkeyRowProps:z}=Ta(A,{scope:"list:todos",bindO:!1,onOpen:_=>O(_.workspace,_.id,_.status)});xt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var _;return(_=c.current)==null?void 0:_.focus()}}),xt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[K,q]=Ir(),J=K.get("focus");return g.useEffect(()=>{if(!J)return;const _=document.querySelector(`[data-todo-id="${CSS.escape(J)}"]`);if(!_)return;_.scrollIntoView({block:"nearest"}),_.classList.add("ring-2","ring-primary/60");const F=window.setTimeout(()=>{_.classList.remove("ring-2","ring-primary/60"),q(B=>{const U=new URLSearchParams(B);return U.delete("focus"),U})},1500);return()=>window.clearTimeout(F)},[J,A.length,q]),t?o.jsx(ot,{label:"Loading todos..."}):n?o.jsx(Ze,{error:n}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[o.jsx(st,{label:"Open",value:I.open,icon:Un}),o.jsx(st,{label:"In Progress",value:I.in_progress,icon:wb,tone:"info"}),o.jsx(st,{label:"Blocked",value:I.blocked,icon:Qo,tone:"warn"}),o.jsx(st,{label:"Completed",value:I.completed,icon:Un,tone:"default"})]}),o.jsx("div",{className:"surface-panel p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("select",{value:b,onChange:_=>C(_.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:[o.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(_=>_.workspace!=="_global").map(_=>o.jsx("option",{value:_.workspace,children:_.workspace},_.workspace))]}),o.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:_=>v(_.target.value),onKeyDown:_=>_.key==="Enter"&&R(),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"}),o.jsxs("button",{onClick:R,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:[o.jsx(Wt,{className:"h-4 w-4"}),"Add"]})]})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"relative flex-1 max-w-sm",children:[o.jsx(Rs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{ref:c,type:"text",placeholder:"Search todos...",value:a,onChange:_=>l(_.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"})]}),o.jsxs("select",{value:d,onChange:_=>p(_.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:[o.jsx("option",{value:"",children:"All statuses"}),o.jsx("option",{value:"open",children:"Open"}),o.jsx("option",{value:"in_progress",children:"In Progress"}),o.jsx("option",{value:"completed",children:"Completed"}),o.jsx("option",{value:"blocked",children:"Blocked"})]}),N.length>0&&o.jsxs("select",{value:m,onChange:_=>h(_.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:[o.jsx("option",{value:"",children:"All tags"}),N.map(_=>o.jsxs("option",{value:_,children:["#",_]},_))]})]}),A.length===0?o.jsx(tt,{title:"No todos",description:"Add your first todo above or use the CLI: syntaur todo add"}):o.jsx("div",{className:"space-y-1",children:A.map((_,F)=>o.jsxs("div",{"data-todo-id":_.id,...z(F),className:"surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition",onClick:()=>O(_.workspace,_.id,_.status),children:[o.jsx(Oh,{status:_.status,onChange:B=>G(_.workspace,_.id,B)}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:`text-sm ${_.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:_.description}),_.tags.length>0&&o.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:_.tags.map(B=>`#${B}`).join(" ")})]}),o.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:_.workspace!=="_global"&&o.jsx(ye,{to:`/w/${_.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:B=>B.stopPropagation(),children:_.workspace})}),k===_.id?o.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[o.jsx(Ea,{className:"h-3 w-3"})," Copied to clipboard"]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:B=>S(B,_.id),children:["t:",_.id]}),o.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:B=>S(B,_.id),children:o.jsx(Mc,{className:"h-3 w-3"})})]}),o.jsx("button",{onClick:()=>re(_.workspace,_.id),className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${_.workspace}-${_.id}`))})]})}function L_(){return o.jsx(JN,{children:o.jsx(fT,{children:o.jsx(EN,{children:o.jsxs(Le,{element:o.jsx(yT,{}),children:[o.jsx(Le,{path:"/",element:o.jsx(CT,{})}),o.jsx(Le,{path:"/projects",element:o.jsx(my,{})}),o.jsx(Le,{path:"/assignments",element:o.jsx($v,{})}),o.jsx(Le,{path:"/assignments/new",element:o.jsx(Uv,{})}),o.jsx(Le,{path:"/assignments/:id",element:o.jsx(GM,{})}),o.jsx(Le,{path:"/assignments/:id/edit",element:o.jsx(Mf,{})}),o.jsx(Le,{path:"/assignments/:id/plan/edit",element:o.jsx(_f,{})}),o.jsx(Le,{path:"/assignments/:id/scratchpad/edit",element:o.jsx($f,{})}),o.jsx(Le,{path:"/assignments/:id/handoff/edit",element:o.jsx(Ff,{})}),o.jsx(Le,{path:"/assignments/:id/decision-record/edit",element:o.jsx(zf,{})}),o.jsx(Le,{path:"/attention",element:o.jsx(ET,{})}),o.jsx(Le,{path:"/servers",element:o.jsx(Wv,{})}),o.jsx(Le,{path:"/agent-sessions",element:o.jsx(Vv,{})}),o.jsx(Le,{path:"/playbooks",element:o.jsx(m_,{})}),o.jsx(Le,{path:"/playbooks/create",element:o.jsx(x_,{})}),o.jsx(Le,{path:"/playbooks/:slug",element:o.jsx(g_,{})}),o.jsx(Le,{path:"/playbooks/:slug/edit",element:o.jsx(y_,{})}),o.jsx(Le,{path:"/memories",element:o.jsx(v_,{})}),o.jsx(Le,{path:"/memories/new",element:o.jsx(w_,{})}),o.jsx(Le,{path:"/projects/:slug/memories/:itemSlug",element:o.jsx(b_,{})}),o.jsx(Le,{path:"/projects/:slug/memories/:itemSlug/edit",element:o.jsx(j_,{})}),o.jsx(Le,{path:"/resources",element:o.jsx(k_,{})}),o.jsx(Le,{path:"/resources/new",element:o.jsx(N_,{})}),o.jsx(Le,{path:"/projects/:slug/resources/:itemSlug",element:o.jsx(S_,{})}),o.jsx(Le,{path:"/projects/:slug/resources/:itemSlug/edit",element:o.jsx(C_,{})}),o.jsx(Le,{path:"/todos",element:o.jsx(D_,{})}),o.jsx(Le,{path:"/help",element:o.jsx(TT,{})}),o.jsx(Le,{path:"/settings",element:o.jsx(A_,{})}),o.jsx(Le,{path:"/create/project",element:o.jsx(zv,{})}),o.jsx(Le,{path:"/projects/:slug",element:o.jsx(Lv,{})}),o.jsx(Le,{path:"/projects/:slug/edit",element:o.jsx(Hv,{})}),o.jsx(Le,{path:"/projects/:slug/create/assignment",element:o.jsx(Bv,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug",element:o.jsx(Iv,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug/edit",element:o.jsx(Mf,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:o.jsx(_f,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:o.jsx($f,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:o.jsx(Ff,{})}),o.jsx(Le,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:o.jsx(zf,{})}),o.jsx(Le,{path:"/w/:workspace/projects",element:o.jsx(my,{})}),o.jsx(Le,{path:"/w/:workspace/assignments",element:o.jsx($v,{})}),o.jsx(Le,{path:"/w/:workspace/assignments/new",element:o.jsx(Uv,{})}),o.jsx(Le,{path:"/w/:workspace/servers",element:o.jsx(Wv,{})}),o.jsx(Le,{path:"/w/:workspace/agent-sessions",element:o.jsx(Vv,{})}),o.jsx(Le,{path:"/w/:workspace/todos",element:o.jsx(gM,{})}),o.jsx(Le,{path:"/w/:workspace/create/project",element:o.jsx(zv,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug",element:o.jsx(Lv,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/edit",element:o.jsx(Hv,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/create/assignment",element:o.jsx(Bv,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:o.jsx(Iv,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:o.jsx(Mf,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:o.jsx(_f,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:o.jsx($f,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:o.jsx(Ff,{})}),o.jsx(Le,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:o.jsx(zf,{})})]})})})})}L2();ES.createRoot(document.getElementById("root")).render(o.jsx(g.StrictMode,{children:o.jsx(I2,{children:o.jsx(L_,{})})}));export{fR as _,I_ as a,Dc as g};
|