groove-dev 0.22.8 → 0.22.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/node_modules/@groove-dev/daemon/src/api.js +9 -2
  2. package/node_modules/@groove-dev/gui/dist/assets/{index-CTKfkH67.js → index-BKZQfaOu.js} +7 -7
  3. package/node_modules/@groove-dev/gui/dist/assets/index-CDWObHaG.css +1 -0
  4. package/node_modules/@groove-dev/gui/dist/index.html +2 -2
  5. package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +1 -1
  6. package/package.json +1 -1
  7. package/packages/daemon/src/api.js +9 -2
  8. package/packages/gui/dist/assets/{index-CTKfkH67.js → index-BKZQfaOu.js} +7 -7
  9. package/packages/gui/dist/assets/index-CDWObHaG.css +1 -0
  10. package/packages/gui/dist/index.html +2 -2
  11. package/packages/gui/src/components/agents/agent-feed.jsx +1 -1
  12. package/node_modules/@groove-dev/gui/dist/assets/index-DHaSTu1c.css +0 -1
  13. package/packages/gui/dist/assets/index-DHaSTu1c.css +0 -1
  14. package/packages/gui/node_modules/.vite/deps/@codemirror_autocomplete.js +0 -68
  15. package/packages/gui/node_modules/.vite/deps/@codemirror_autocomplete.js.map +0 -7
  16. package/packages/gui/node_modules/.vite/deps/@codemirror_commands.js +0 -1420
  17. package/packages/gui/node_modules/.vite/deps/@codemirror_commands.js.map +0 -7
  18. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-css.js +0 -17
  19. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-css.js.map +0 -7
  20. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-html.js +0 -22
  21. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-html.js.map +0 -7
  22. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-javascript.js +0 -34
  23. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-javascript.js.map +0 -7
  24. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-json.js +0 -101
  25. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-json.js.map +0 -7
  26. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-markdown.js +0 -2534
  27. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-markdown.js.map +0 -7
  28. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-python.js +0 -789
  29. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-python.js.map +0 -7
  30. package/packages/gui/node_modules/.vite/deps/@codemirror_language.js +0 -115
  31. package/packages/gui/node_modules/.vite/deps/@codemirror_language.js.map +0 -7
  32. package/packages/gui/node_modules/.vite/deps/@codemirror_search.js +0 -1136
  33. package/packages/gui/node_modules/.vite/deps/@codemirror_search.js.map +0 -7
  34. package/packages/gui/node_modules/.vite/deps/@codemirror_state.js +0 -63
  35. package/packages/gui/node_modules/.vite/deps/@codemirror_state.js.map +0 -7
  36. package/packages/gui/node_modules/.vite/deps/@codemirror_theme-one-dark.js +0 -179
  37. package/packages/gui/node_modules/.vite/deps/@codemirror_theme-one-dark.js.map +0 -7
  38. package/packages/gui/node_modules/.vite/deps/@codemirror_view.js +0 -104
  39. package/packages/gui/node_modules/.vite/deps/@codemirror_view.js.map +0 -7
  40. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-dialog.js +0 -367
  41. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-dialog.js.map +0 -7
  42. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-scroll-area.js +0 -755
  43. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-scroll-area.js.map +0 -7
  44. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-select.js +0 -1254
  45. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-select.js.map +0 -7
  46. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tabs.js +0 -436
  47. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tabs.js.map +0 -7
  48. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tooltip.js +0 -531
  49. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tooltip.js.map +0 -7
  50. package/packages/gui/node_modules/.vite/deps/@xterm_addon-fit.js +0 -46
  51. package/packages/gui/node_modules/.vite/deps/@xterm_addon-fit.js.map +0 -7
  52. package/packages/gui/node_modules/.vite/deps/@xterm_addon-web-links.js +0 -121
  53. package/packages/gui/node_modules/.vite/deps/@xterm_addon-web-links.js.map +0 -7
  54. package/packages/gui/node_modules/.vite/deps/@xterm_xterm.js +0 -9237
  55. package/packages/gui/node_modules/.vite/deps/@xterm_xterm.js.map +0 -7
  56. package/packages/gui/node_modules/.vite/deps/@xyflow_react.js +0 -9934
  57. package/packages/gui/node_modules/.vite/deps/@xyflow_react.js.map +0 -7
  58. package/packages/gui/node_modules/.vite/deps/_metadata.json +0 -265
  59. package/packages/gui/node_modules/.vite/deps/chunk-3EE34IFC.js +0 -5169
  60. package/packages/gui/node_modules/.vite/deps/chunk-3EE34IFC.js.map +0 -7
  61. package/packages/gui/node_modules/.vite/deps/chunk-3IB5EUP7.js +0 -2000
  62. package/packages/gui/node_modules/.vite/deps/chunk-3IB5EUP7.js.map +0 -7
  63. package/packages/gui/node_modules/.vite/deps/chunk-3LBP22MX.js +0 -1115
  64. package/packages/gui/node_modules/.vite/deps/chunk-3LBP22MX.js.map +0 -7
  65. package/packages/gui/node_modules/.vite/deps/chunk-3Q7HT7ZF.js +0 -701
  66. package/packages/gui/node_modules/.vite/deps/chunk-3Q7HT7ZF.js.map +0 -7
  67. package/packages/gui/node_modules/.vite/deps/chunk-44CLUOQE.js +0 -1776
  68. package/packages/gui/node_modules/.vite/deps/chunk-44CLUOQE.js.map +0 -7
  69. package/packages/gui/node_modules/.vite/deps/chunk-6DLNZUA5.js +0 -142
  70. package/packages/gui/node_modules/.vite/deps/chunk-6DLNZUA5.js.map +0 -7
  71. package/packages/gui/node_modules/.vite/deps/chunk-ACEP5X2F.js +0 -292
  72. package/packages/gui/node_modules/.vite/deps/chunk-ACEP5X2F.js.map +0 -7
  73. package/packages/gui/node_modules/.vite/deps/chunk-AZUN7XMC.js +0 -87
  74. package/packages/gui/node_modules/.vite/deps/chunk-AZUN7XMC.js.map +0 -7
  75. package/packages/gui/node_modules/.vite/deps/chunk-CDLO3JFW.js +0 -1004
  76. package/packages/gui/node_modules/.vite/deps/chunk-CDLO3JFW.js.map +0 -7
  77. package/packages/gui/node_modules/.vite/deps/chunk-HPXOV7QR.js +0 -23
  78. package/packages/gui/node_modules/.vite/deps/chunk-HPXOV7QR.js.map +0 -7
  79. package/packages/gui/node_modules/.vite/deps/chunk-HVFOBSCQ.js +0 -1062
  80. package/packages/gui/node_modules/.vite/deps/chunk-HVFOBSCQ.js.map +0 -7
  81. package/packages/gui/node_modules/.vite/deps/chunk-I2PYXDFH.js +0 -1106
  82. package/packages/gui/node_modules/.vite/deps/chunk-I2PYXDFH.js.map +0 -7
  83. package/packages/gui/node_modules/.vite/deps/chunk-JPXYHBLX.js +0 -306
  84. package/packages/gui/node_modules/.vite/deps/chunk-JPXYHBLX.js.map +0 -7
  85. package/packages/gui/node_modules/.vite/deps/chunk-JYDZ3XIW.js +0 -264
  86. package/packages/gui/node_modules/.vite/deps/chunk-JYDZ3XIW.js.map +0 -7
  87. package/packages/gui/node_modules/.vite/deps/chunk-PR4QN5HX.js +0 -42
  88. package/packages/gui/node_modules/.vite/deps/chunk-PR4QN5HX.js.map +0 -7
  89. package/packages/gui/node_modules/.vite/deps/chunk-QZQGPDRM.js +0 -2328
  90. package/packages/gui/node_modules/.vite/deps/chunk-QZQGPDRM.js.map +0 -7
  91. package/packages/gui/node_modules/.vite/deps/chunk-RE2FU7ZU.js +0 -10985
  92. package/packages/gui/node_modules/.vite/deps/chunk-RE2FU7ZU.js.map +0 -7
  93. package/packages/gui/node_modules/.vite/deps/chunk-UO4Y2XXS.js +0 -105
  94. package/packages/gui/node_modules/.vite/deps/chunk-UO4Y2XXS.js.map +0 -7
  95. package/packages/gui/node_modules/.vite/deps/chunk-VW6LO3QI.js +0 -9
  96. package/packages/gui/node_modules/.vite/deps/chunk-VW6LO3QI.js.map +0 -7
  97. package/packages/gui/node_modules/.vite/deps/chunk-YAD7VOVN.js +0 -280
  98. package/packages/gui/node_modules/.vite/deps/chunk-YAD7VOVN.js.map +0 -7
  99. package/packages/gui/node_modules/.vite/deps/chunk-YYJMNVCJ.js +0 -3459
  100. package/packages/gui/node_modules/.vite/deps/chunk-YYJMNVCJ.js.map +0 -7
  101. package/packages/gui/node_modules/.vite/deps/clsx.js +0 -22
  102. package/packages/gui/node_modules/.vite/deps/clsx.js.map +0 -7
  103. package/packages/gui/node_modules/.vite/deps/framer-motion.js +0 -12732
  104. package/packages/gui/node_modules/.vite/deps/framer-motion.js.map +0 -7
  105. package/packages/gui/node_modules/.vite/deps/lucide-react.js +0 -29653
  106. package/packages/gui/node_modules/.vite/deps/lucide-react.js.map +0 -7
  107. package/packages/gui/node_modules/.vite/deps/package.json +0 -3
  108. package/packages/gui/node_modules/.vite/deps/react-dom.js +0 -6
  109. package/packages/gui/node_modules/.vite/deps/react-dom.js.map +0 -7
  110. package/packages/gui/node_modules/.vite/deps/react-dom_client.js +0 -20217
  111. package/packages/gui/node_modules/.vite/deps/react-dom_client.js.map +0 -7
  112. package/packages/gui/node_modules/.vite/deps/react.js +0 -5
  113. package/packages/gui/node_modules/.vite/deps/react.js.map +0 -7
  114. package/packages/gui/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -278
  115. package/packages/gui/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
  116. package/packages/gui/node_modules/.vite/deps/react_jsx-runtime.js +0 -6
  117. package/packages/gui/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
  118. package/packages/gui/node_modules/.vite/deps/tailwind-merge.js +0 -3263
  119. package/packages/gui/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
  120. package/packages/gui/node_modules/.vite/deps/zustand.js +0 -56
  121. package/packages/gui/node_modules/.vite/deps/zustand.js.map +0 -7
@@ -515,14 +515,14 @@ Error generating stack: `+c.message+`
515
515
  constructor(\${params}) {
516
516
  \${}
517
517
  }
518
- }`,{label:"class",detail:"definition",type:"keyword"}),He('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),He('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],e3=cv.concat([He("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),He("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),He("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),r1=new Sf,uv=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function _r(t){return(n,s)=>{let l=n.node.getChild("VariableDefinition");return l&&s(l,t),!0}}const t3=["FunctionDeclaration"],a3={FunctionDeclaration:_r("function"),ClassDeclaration:_r("class"),ClassExpression:()=>!0,EnumDeclaration:_r("constant"),TypeAliasDeclaration:_r("type"),NamespaceDeclaration:_r("namespace"),VariableDefinition(t,n){t.matchContext(t3)||n(t,"variable")},TypeDefinition(t,n){n(t,"type")},__proto__:null};function dv(t,n){let s=r1.get(n);if(s)return s;let l=[],i=!0;function u(d,f){let m=t.sliceString(d.from,d.to);l.push({label:m,type:f})}return n.cursor(yc.IncludeAnonymous).iterate(d=>{if(i)i=!1;else if(d.name){let f=a3[d.name];if(f&&f(d,u)||uv.has(d.name))return!1}else if(d.to-d.from>8192){for(let f of dv(t,d.node))l.push(f);return!1}}),r1.set(n,l),l}const i1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Ov=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function n3(t){let n=pa(t.state).resolveInner(t.pos,-1);if(Ov.indexOf(n.name)>-1)return null;let s=n.name=="VariableName"||n.to-n.from<20&&i1.test(t.state.sliceDoc(n.from,n.to));if(!s&&!t.explicit)return null;let l=[];for(let i=n;i;i=i.parent)uv.has(i.name)&&(l=l.concat(dv(t.state.doc,i)));return{options:l,from:s?n.from:t.pos,validFor:i1}}const $a=ti.define({name:"javascript",parser:JN.configure({props:[zl.add({IfStatement:bl({except:/^\s*({|else\b)/}),TryStatement:bl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:gj,SwitchBody:t=>{let n=t.textAfter,s=/^\s*\}/.test(n),l=/^\s*(case|default)\b/.test(n);return t.baseIndent+(s?0:l?1:2)*t.unit},Block:Uo({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":bl({except:/^\s*{/}),JSXElement(t){let n=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)},JSXEscape(t){let n=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),ks.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Sc,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let n=t.firstChild;if(!n||n.name=="JSXSelfClosingTag")return null;let s=t.lastChild;return{from:n.to,to:s.type.isError?t.to:s.from}},"JSXSelfClosingTag JSXOpenTag"(t){var n;let s=(n=t.firstChild)===null||n===void 0?void 0:n.nextSibling,l=t.lastChild;return!s||s.type.isError?null:{from:s.to,to:l.type.isError?t.to:l.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),fv={test:t=>/^JSX/.test(t.name),facet:y0({commentTokens:{block:{open:"{/*",close:"*/}"}}})},hv=$a.configure({dialect:"ts"},"typescript"),mv=$a.configure({dialect:"jsx",props:[v0.add(t=>t.isTop?[fv]:void 0)]}),pv=$a.configure({dialect:"jsx ts",props:[v0.add(t=>t.isTop?[fv]:void 0)]},"typescript");let xv=t=>({label:t,type:"keyword"});const gv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(xv),s3=gv.concat(["declare","implements","private","protected","public"].map(xv));function of(t={}){let n=t.jsx?t.typescript?pv:mv:t.typescript?hv:$a,s=t.typescript?e3.concat(s3):cv.concat(gv);return new vs(n,[$a.data.of({autocomplete:g0(Ov,b0(s))}),$a.data.of({autocomplete:n3}),t.jsx?i3:[]])}function l3(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function o1(t,n,s=t.length){for(let l=n==null?void 0:n.firstChild;l;l=l.nextSibling)if(l.name=="JSXIdentifier"||l.name=="JSXBuiltin"||l.name=="JSXNamespacedName"||l.name=="JSXMemberExpression")return t.sliceString(l.from,Math.min(l.to,s));return""}const r3=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),i3=jl.inputHandler.of((t,n,s,l,i)=>{if((r3?t.composing:t.compositionStarted)||t.state.readOnly||n!=s||l!=">"&&l!="/"||!$a.isActiveAt(t.state,n,-1))return!1;let u=i(),{state:d}=u,f=d.changeByRange(m=>{var p;let{head:x}=m,g=pa(d).resolveInner(x-1,-1),b;if(g.name=="JSXStartTag"&&(g=g.parent),!(d.doc.sliceString(x-1,x)!=l||g.name=="JSXAttributeValue"&&g.to>x)){if(l==">"&&g.name=="JSXFragmentTag")return{range:m,changes:{from:x,insert:"</>"}};if(l=="/"&&g.name=="JSXStartCloseTag"){let S=g.parent,w=S.parent;if(w&&S.from==x-2&&((b=o1(d.doc,w.firstChild,x))||((p=w.firstChild)===null||p===void 0?void 0:p.name)=="JSXFragmentTag")){let j=`${b}>`;return{range:Un.cursor(x+j.length,-1),changes:{from:x,insert:j}}}}else if(l==">"){let S=l3(g);if(S&&S.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(d.doc.sliceString(x,x+2))&&(b=o1(d.doc,S,x)))return{range:m,changes:{from:x,insert:`</${b}>`}}}}return{range:m}});return f.changes.empty?!1:(t.dispatch([u,d.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),o3=135,c1=1,c3=136,u3=137,bv=2,d3=138,O3=3,f3=4,vv=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],h3=58,m3=40,yv=95,p3=91,Do=45,x3=46,g3=35,b3=37,v3=38,y3=92,S3=10,Q3=42;function Hr(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Ff(t){return t>=48&&t<=57}function u1(t){return Ff(t)||t>=97&&t<=102||t>=65&&t<=70}const Sv=(t,n,s)=>(l,i)=>{for(let u=!1,d=0,f=0;;f++){let{next:m}=l;if(Hr(m)||m==Do||m==yv||u&&Ff(m))!u&&(m!=Do||f>0)&&(u=!0),d===f&&m==Do&&d++,l.advance();else if(m==y3&&l.peek(1)!=S3){if(l.advance(),u1(l.next)){do l.advance();while(u1(l.next));l.next==32&&l.advance()}else l.next>-1&&l.advance();u=!0}else{u&&l.acceptToken(d==2&&i.canShift(bv)?n:m==m3?s:t);break}}},j3=new xt(Sv(c3,bv,u3),{contextual:!0}),w3=new xt(Sv(d3,O3,f3),{contextual:!0}),$3=new xt(t=>{if(vv.includes(t.peek(-1))){let{next:n}=t;(Hr(n)||n==yv||n==g3||n==x3||n==Q3||n==p3||n==h3&&Hr(t.peek(1))||n==Do||n==v3)&&t.acceptToken(o3)}}),k3=new xt(t=>{if(!vv.includes(t.peek(-1))){let{next:n}=t;if(n==b3&&(t.advance(),t.acceptToken(c1)),Hr(n)){do t.advance();while(Hr(t.next)||Ff(t.next));t.acceptToken(c1)}}}),T3=$s({"AtKeyword import charset namespace keyframes media supports font-feature-values":C.definitionKeyword,"from to selector scope MatchFlag":C.keyword,NamespaceName:C.namespace,KeyframeName:C.labelName,KeyframeRangeName:C.operatorKeyword,TagName:C.tagName,ClassName:C.className,PseudoClassName:C.constant(C.className),IdName:C.labelName,"FeatureName PropertyName":C.propertyName,AttributeName:C.attributeName,NumberLiteral:C.number,KeywordQuery:C.keyword,UnaryQueryOp:C.operatorKeyword,"CallTag ValueName FontName":C.atom,VariableName:C.variableName,Callee:C.operatorKeyword,Unit:C.unit,"UniversalSelector NestingSelector":C.definitionOperator,"MatchOp CompareOp":C.compareOperator,"ChildOp SiblingOp, LogicOp":C.logicOperator,BinOp:C.arithmeticOperator,Important:C.modifier,Comment:C.blockComment,ColorLiteral:C.color,"ParenthesizedContent StringLiteral":C.string,":":C.punctuation,"PseudoOp #":C.derefOperator,"; , |":C.separator,"( )":C.paren,"[ ]":C.squareBracket,"{ }":C.brace}),P3={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},N3={__proto__:null,or:104,and:104,not:112,only:112,layer:186},z3={__proto__:null,selector:118,layer:182},R3={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},X3={__proto__:null,to:223},_3=Bn.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQ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${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[T3],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g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3,4,new hc("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>P3[t]||-1},{term:138,get:t=>N3[t]||-1},{term:4,get:t=>z3[t]||-1},{term:28,get:t=>R3[t]||-1},{term:136,get:t=>X3[t]||-1}],tokenPrec:2256});let vO=null;function yO(){if(!vO&&typeof document=="object"&&document.body){let{style:t}=document.body,n=[],s=new Set;for(let l in t)l!="cssText"&&l!="cssFloat"&&typeof t[l]=="string"&&(/[A-Z]/.test(l)&&(l=l.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),s.has(l)||(n.push(l),s.add(l)));vO=n.sort().map(l=>({type:"property",label:l,apply:l+": "}))}return vO||[]}const d1=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),O1=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),C3=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Z3=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Fa=/^(\w[\w-]*|-\w[\w-]*|)$/,A3=/^-(-[\w-]*)?$/;function E3(t,n){var s;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let l=(s=t.parent)===null||s===void 0?void 0:s.firstChild;return(l==null?void 0:l.name)!="Callee"?!1:n.sliceString(l.from,l.to)=="var"}const f1=new Sf,q3=["Declaration"];function M3(t){for(let n=t;;){if(n.type.isTop)return n;if(!(n=n.parent))return t}}function Qv(t,n,s){if(n.to-n.from>4096){let l=f1.get(n);if(l)return l;let i=[],u=new Set,d=n.cursor(yc.IncludeAnonymous);if(d.firstChild())do for(let f of Qv(t,d.node,s))u.has(f.label)||(u.add(f.label),i.push(f));while(d.nextSibling());return f1.set(n,i),i}else{let l=[],i=new Set;return n.cursor().iterate(u=>{var d;if(s(u)&&u.matchContext(q3)&&((d=u.node.nextSibling)===null||d===void 0?void 0:d.name)==":"){let f=t.sliceString(u.from,u.to);i.has(f)||(i.add(f),l.push({label:f,type:"variable"}))}}),l}}const Y3=t=>n=>{let{state:s,pos:l}=n,i=pa(s).resolveInner(l,-1),u=i.type.isError&&i.from==i.to-1&&s.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(u||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:yO(),validFor:Fa};if(i.name=="ValueName")return{from:i.from,options:O1,validFor:Fa};if(i.name=="PseudoClassName")return{from:i.from,options:d1,validFor:Fa};if(t(i)||(n.explicit||u)&&E3(i,s.doc))return{from:t(i)||u?i.from:l,options:Qv(s.doc,M3(i),t),validFor:A3};if(i.name=="TagName"){for(let{parent:m}=i;m;m=m.parent)if(m.name=="Block")return{from:i.from,options:yO(),validFor:Fa};return{from:i.from,options:C3,validFor:Fa}}if(i.name=="AtKeyword")return{from:i.from,options:Z3,validFor:Fa};if(!n.explicit)return null;let d=i.resolve(l),f=d.childBefore(l);return f&&f.name==":"&&d.name=="PseudoClassSelector"?{from:l,options:d1,validFor:Fa}:f&&f.name==":"&&d.name=="Declaration"||d.name=="ArgList"?{from:l,options:O1,validFor:Fa}:d.name=="Block"||d.name=="Styles"?{from:l,options:yO(),validFor:Fa}:null},V3=Y3(t=>t.name=="VariableName"),mc=ti.define({name:"css",parser:_3.configure({props:[zl.add({Declaration:bl()}),ks.add({"Block KeyframeList":Sc})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function jv(){return new vs(mc,mc.data.of({autocomplete:V3}))}const U3=55,G3=1,L3=56,D3=2,W3=57,B3=3,h1=4,H3=5,Kf=6,wv=7,$v=8,kv=9,Tv=10,I3=11,F3=12,K3=13,SO=58,J3=14,e4=15,m1=59,Pv=21,t4=23,Nv=24,a4=25,cf=27,zv=28,n4=29,s4=32,l4=35,r4=37,i4=38,o4=0,c4=1,u4={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},d4={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},p1={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function O4(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let x1=null,g1=null,b1=0;function uf(t,n){let s=t.pos+n;if(b1==s&&g1==t)return x1;let l=t.peek(n),i="";for(;O4(l);)i+=String.fromCharCode(l),l=t.peek(++n);return g1=t,b1=s,x1=i?i.toLowerCase():l==f4||l==h4?void 0:null}const Rv=60,pc=62,Jf=47,f4=63,h4=33,m4=45;function v1(t,n){this.name=t,this.parent=n}const p4=[Kf,Tv,wv,$v,kv],x4=new If({start:null,shift(t,n,s,l){return p4.indexOf(n)>-1?new v1(uf(l,1)||"",t):t},reduce(t,n){return n==Pv&&t?t.parent:t},reuse(t,n,s,l){let i=n.type.id;return i==Kf||i==r4?new v1(uf(l,1)||"",t):t},strict:!1}),g4=new xt((t,n)=>{if(t.next!=Rv){t.next<0&&n.context&&t.acceptToken(SO);return}t.advance();let s=t.next==Jf;s&&t.advance();let l=uf(t,0);if(l===void 0)return;if(!l)return t.acceptToken(s?e4:J3);let i=n.context?n.context.name:null;if(s){if(l==i)return t.acceptToken(I3);if(i&&d4[i])return t.acceptToken(SO,-2);if(n.dialectEnabled(o4))return t.acceptToken(F3);for(let u=n.context;u;u=u.parent)if(u.name==l)return;t.acceptToken(K3)}else{if(l=="script")return t.acceptToken(wv);if(l=="style")return t.acceptToken($v);if(l=="textarea")return t.acceptToken(kv);if(u4.hasOwnProperty(l))return t.acceptToken(Tv);i&&p1[i]&&p1[i][l]?t.acceptToken(SO,-1):t.acceptToken(Kf)}},{contextual:!0}),b4=new xt(t=>{for(let n=0,s=0;;s++){if(t.next<0){s&&t.acceptToken(m1);break}if(t.next==m4)n++;else if(t.next==pc&&n>=2){s>=3&&t.acceptToken(m1,-2);break}else n=0;t.advance()}});function v4(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const y4=new xt((t,n)=>{if(t.next==Jf&&t.peek(1)==pc){let s=n.dialectEnabled(c4)||v4(n.context);t.acceptToken(s?H3:h1,2)}else t.next==pc&&t.acceptToken(h1,1)});function eh(t,n,s){let l=2+t.length;return new xt(i=>{for(let u=0,d=0,f=0;;f++){if(i.next<0){f&&i.acceptToken(n);break}if(u==0&&i.next==Rv||u==1&&i.next==Jf||u>=2&&u<l&&i.next==t.charCodeAt(u-2))u++,d++;else if(u==l&&i.next==pc){f>d?i.acceptToken(n,-d):i.acceptToken(s,-(d-2));break}else if((i.next==10||i.next==13)&&f){i.acceptToken(n,1);break}else u=d=0;i.advance()}})}const S4=eh("script",U3,G3),Q4=eh("style",L3,D3),j4=eh("textarea",W3,B3),w4=$s({"Text RawText IncompleteTag IncompleteCloseTag":C.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":C.angleBracket,TagName:C.tagName,"MismatchedCloseTag/TagName":[C.tagName,C.invalid],AttributeName:C.attributeName,"AttributeValue UnquotedAttributeValue":C.attributeValue,Is:C.definitionOperator,"EntityReference CharacterReference":C.character,Comment:C.blockComment,ProcessingInst:C.processingInstruction,DoctypeDecl:C.documentMeta}),$4=Bn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+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QgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:x4,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[w4],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q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for(let l of t.getChildren(Nv)){let i=l.getChild(a4),u=l.getChild(cf)||l.getChild(zv);i&&(s[n.read(i.from,i.to)]=u?u.type.id==cf?n.read(u.from+1,u.to-1):n.read(u.from,u.to):"")}return s}function y1(t,n){let s=t.getChild(t4);return s?n.read(s.from,s.to):" "}function QO(t,n,s){let l;for(let i of s)if(!i.attrs||i.attrs(l||(l=Xv(t.node.parent.firstChild,n))))return{parser:i.parser,bracketed:!0};return null}function _v(t=[],n=[]){let s=[],l=[],i=[],u=[];for(let f of t)(f.tag=="script"?s:f.tag=="style"?l:f.tag=="textarea"?i:u).push(f);let d=n.length?Object.create(null):null;for(let f of n)(d[f.name]||(d[f.name]=[])).push(f);return S0((f,m)=>{let p=f.type.id;if(p==n4)return QO(f,m,s);if(p==s4)return QO(f,m,l);if(p==l4)return QO(f,m,i);if(p==Pv&&u.length){let x=f.node,g=x.firstChild,b=g&&y1(g,m),S;if(b){for(let w of u)if(w.tag==b&&(!w.attrs||w.attrs(S||(S=Xv(g,m))))){let j=x.lastChild,$=j.type.id==i4?j.from:x.to;if($>g.to)return{parser:w.parser,overlay:[{from:g.to,to:$}]}}}}if(d&&p==Nv){let x=f.node,g;if(g=x.firstChild){let b=d[m.read(g.from,g.to)];if(b)for(let S of b){if(S.tagName&&S.tagName!=y1(x.parent,m))continue;let w=x.lastChild;if(w.type.id==cf){let j=w.from+1,$=w.lastChild,k=w.to-($&&$.isError?0:1);if(k>j)return{parser:S.parser,overlay:[{from:j,to:k}],bracketed:!0}}else if(w.type.id==zv)return{parser:S.parser,overlay:[{from:w.from,to:w.to}]}}}}return null})}const Cr=["_blank","_self","_top","_parent"],jO=["ascii","utf-8","utf-16","latin1","latin1"],wO=["get","post","put","delete"],$O=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Vt=["true","false"],de={},k4={a:{attrs:{href:null,ping:null,type:null,media:null,target:Cr,hreflang:null}},abbr:de,address:de,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:de,aside:de,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:de,base:{attrs:{href:null,target:Cr}},bdi:de,bdo:de,blockquote:{attrs:{cite:null}},body:de,br:de,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:$O,formmethod:wO,formnovalidate:["novalidate"],formtarget:Cr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:de,center:de,cite:de,code:de,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:de,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:de,div:de,dl:de,dt:de,em:de,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:de,figure:de,footer:de,form:{attrs:{action:null,name:null,"accept-charset":jO,autocomplete:["on","off"],enctype:$O,method:wO,novalidate:["novalidate"],target:Cr}},h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:de,hgroup:de,hr:de,html:{attrs:{manifest:null}},i:de,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:$O,formmethod:wO,formnovalidate:["novalidate"],formtarget:Cr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:de,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:de,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:de,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:jO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:de,noscript:de,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:de,param:{attrs:{name:null,value:null}},pre:de,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:de,rt:de,ruby:de,samp:de,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:jO}},section:de,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:de,source:{attrs:{src:null,type:null,media:null}},span:de,strong:de,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:de,summary:de,sup:de,table:de,tbody:de,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:de,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:de,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:de,time:{attrs:{datetime:null}},title:de,tr:de,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:de,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:de},Cv={accesskey:null,class:null,contenteditable:Vt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Vt,autocorrect:Vt,autocapitalize:Vt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Vt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Vt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Vt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Vt,"aria-hidden":Vt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Vt,"aria-multiselectable":Vt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Vt,"aria-relevant":null,"aria-required":Vt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Zv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of Zv)Cv[t]=null;class Ir{constructor(n,s){this.tags={...k4,...n},this.globalAttrs={...Cv,...s},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Ir.default=new Ir;function Tl(t,n,s=t.length){if(!n)return"";let l=n.firstChild,i=l&&l.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,s)):""}function Pl(t,n=!1){for(;t;t=t.parent)if(t.name=="Element")if(n)n=!1;else return t;return null}function Av(t,n,s){let l=s.tags[Tl(t,Pl(n))];return(l==null?void 0:l.children)||s.allTags}function th(t,n){let s=[];for(let l=Pl(n);l&&!l.type.isTop;l=Pl(l.parent)){let i=Tl(t,l);if(i&&l.lastChild.name=="CloseTag")break;i&&s.indexOf(i)<0&&(n.name=="EndTag"||n.from>=l.firstChild.to)&&s.push(i)}return s}const Ev=/^[:\-\.\w\u00b7-\uffff]*$/;function S1(t,n,s,l,i){let u=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",d=Pl(s,s.name=="StartTag"||s.name=="TagName");return{from:l,to:i,options:Av(t.doc,d,n).map(f=>({label:f,type:"type"})).concat(th(t.doc,s).map((f,m)=>({label:"/"+f,apply:"/"+f+u,type:"type",boost:99-m}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Q1(t,n,s,l){let i=/\s*>/.test(t.sliceDoc(l,l+5))?"":">";return{from:s,to:l,options:th(t.doc,n).map((u,d)=>({label:u,apply:u+i,type:"type",boost:99-d})),validFor:Ev}}function T4(t,n,s,l){let i=[],u=0;for(let d of Av(t.doc,s,n))i.push({label:"<"+d,type:"type"});for(let d of th(t.doc,s))i.push({label:"</"+d+">",type:"type",boost:99-u++});return{from:l,to:l,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function P4(t,n,s,l,i){let u=Pl(s),d=u?n.tags[Tl(t.doc,u)]:null,f=d&&d.attrs?Object.keys(d.attrs):[],m=d&&d.globalAttrs===!1?f:f.length?f.concat(n.globalAttrNames):n.globalAttrNames;return{from:l,to:i,options:m.map(p=>({label:p,type:"property"})),validFor:Ev}}function N4(t,n,s,l,i){var u;let d=(u=s.parent)===null||u===void 0?void 0:u.getChild("AttributeName"),f=[],m;if(d){let p=t.sliceDoc(d.from,d.to),x=n.globalAttrs[p];if(!x){let g=Pl(s),b=g?n.tags[Tl(t.doc,g)]:null;x=(b==null?void 0:b.attrs)&&b.attrs[p]}if(x){let g=t.sliceDoc(l,i).toLowerCase(),b='"',S='"';/^['"]/.test(g)?(m=g[0]=='"'?/^[^"]*$/:/^[^']*$/,b="",S=t.sliceDoc(i,i+1)==g[0]?"":g[0],g=g.slice(1),l++):m=/^[^\s<>='"]*$/;for(let w of x)f.push({label:w,apply:b+w+S,type:"constant"})}}return{from:l,to:i,options:f,validFor:m}}function qv(t,n){let{state:s,pos:l}=n,i=pa(s).resolveInner(l,-1),u=i.resolve(l);for(let d=l,f;u==i&&(f=i.childBefore(d));){let m=f.lastChild;if(!m||!m.type.isError||m.from<m.to)break;u=i=f,d=m.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?Q1(s,i,i.from,l):S1(s,t,i,i.from,l):i.name=="StartTag"||i.name=="IncompleteTag"?S1(s,t,i,l,l):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?Q1(s,i,l,l):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?P4(s,t,i,i.name=="AttributeName"?i.from:l,l):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?N4(s,t,i,i.name=="Is"?l:i.from,l):n.explicit&&(u.name=="Element"||u.name=="Text"||u.name=="Document")?T4(s,t,i,l):null}function z4(t){return qv(Ir.default,t)}function R4(t){let{extraTags:n,extraGlobalAttributes:s}=t,l=s||n?new Ir(n,s):Ir.default;return i=>qv(l,i)}const X4=$a.parser.configure({top:"SingleExpression"}),Mv=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:hv.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:mv.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:pv.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:X4},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:$a.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:mc.parser}],Yv=[{name:"style",parser:mc.parser.configure({top:"Styles"})}].concat(Zv.map(t=>({name:t,parser:$a.parser}))),Vv=ti.define({name:"html",parser:$4.configure({props:[zl.add({Element(t){let n=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+n[0].length?t.continue():t.lineIndent(t.node.from)+(n[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let n=null,s;for(let l=t.node;;){let i=l.lastChild;if(!i||i.name!="Element"||i.to!=l.to)break;n=l=i}return n&&!((s=n.lastChild)&&(s.name=="CloseTag"||s.name=="SelfClosingTag"))?t.lineIndent(n.from)+t.unit:null}}),ks.add({Element(t){let n=t.firstChild,s=t.lastChild;return!n||n.name!="OpenTag"?null:{from:n.to,to:s.name=="CloseTag"?s.from:t.to}}}),bj.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Wo=Vv.configure({wrap:_v(Mv,Yv)});function Uv(t={}){let n="",s;t.matchClosingTags===!1&&(n="noMatch"),t.selfClosingTags===!0&&(n=(n?n+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(s=_v((t.nestedLanguages||[]).concat(Mv),(t.nestedAttributes||[]).concat(Yv)));let l=s?Vv.configure({wrap:s,dialect:n}):n?Wo.configure({dialect:n}):Wo;return new vs(l,[Wo.data.of({autocomplete:R4(t)}),t.autoCloseTags!==!1?_4:[],of().support,jv().support])}const j1=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),_4=jl.inputHandler.of((t,n,s,l,i)=>{if(t.composing||t.state.readOnly||n!=s||l!=">"&&l!="/"||!Wo.isActiveAt(t.state,n,-1))return!1;let u=i(),{state:d}=u,f=d.changeByRange(m=>{var p,x,g;let b=d.doc.sliceString(m.from-1,m.to)==l,{head:S}=m,w=pa(d).resolveInner(S,-1),j;if(b&&l==">"&&w.name=="EndTag"){let $=w.parent;if(((x=(p=$.parent)===null||p===void 0?void 0:p.lastChild)===null||x===void 0?void 0:x.name)!="CloseTag"&&(j=Tl(d.doc,$.parent,S))&&!j1.has(j)){let k=S+(d.doc.sliceString(S,S+1)===">"?1:0),N=`</${j}>`;return{range:m,changes:{from:S,to:k,insert:N}}}}else if(b&&l=="/"&&w.name=="IncompleteCloseTag"){let $=w.parent;if(w.from==S-2&&((g=$.lastChild)===null||g===void 0?void 0:g.name)!="CloseTag"&&(j=Tl(d.doc,$,S))&&!j1.has(j)){let k=S+(d.doc.sliceString(S,S+1)===">"?1:0),N=`${j}>`;return{range:Un.cursor(S+N.length,-1),changes:{from:S,to:k,insert:N}}}}return{range:m}});return f.changes.empty?!1:(t.dispatch([u,d.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),C4=$s({String:C.string,Number:C.number,"True False":C.bool,PropertyName:C.propertyName,Null:C.null,", :":C.separator,"[ ]":C.squareBracket,"{ }":C.brace}),Z4=Bn.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[C4],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),A4=ti.define({name:"json",parser:Z4.configure({props:[zl.add({Object:bl({except:/^\s*\}/}),Array:bl({except:/^\s*\]/})}),ks.add({"Object Array":Sc})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function E4(){return new vs(A4)}class xc{static create(n,s,l,i,u){let d=i+(i<<8)+n+(s<<4)|0;return new xc(n,s,l,d,u,[],[])}constructor(n,s,l,i,u,d,f){this.type=n,this.value=s,this.from=l,this.hash=i,this.end=u,this.children=d,this.positions=f,this.hashProp=[[nn.contextHash,i]]}addChild(n,s){n.prop(nn.contextHash)!=this.hash&&(n=new fa(n.type,n.children,n.positions,n.length,this.hashProp)),this.children.push(n),this.positions.push(s)}toTree(n,s=this.end){let l=this.children.length-1;return l>=0&&(s=Math.max(s,this.positions[l]+this.children[l].length+this.from)),new fa(n.types[this.type],this.children,this.positions,s-this.from).balance({makeTree:(i,u,d)=>new fa(ei.none,i,u,d,this.hashProp)})}}var ae;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(ae||(ae={}));class q4{constructor(n,s){this.start=n,this.content=s,this.marks=[],this.parsers=[]}}class M4{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let n=this.skipSpace(this.basePos);this.indent=this.countIndent(n,this.pos,this.indent),this.pos=n,this.next=n==this.text.length?-1:this.text.charCodeAt(n)}skipSpace(n){return Mr(this.text,n)}reset(n){for(this.text=n,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(n){this.basePos=n,this.baseIndent=this.countIndent(n,this.pos,this.indent)}moveBaseColumn(n){this.baseIndent=n,this.basePos=this.findColumn(n)}addMarker(n){this.markers.push(n)}countIndent(n,s=0,l=0){for(let i=s;i<n;i++)l+=this.text.charCodeAt(i)==9?4-l%4:1;return l}findColumn(n){let s=0;for(let l=0;s<this.text.length&&l<n;s++)l+=this.text.charCodeAt(s)==9?4-l%4:1;return s}scrub(){if(!this.baseIndent)return this.text;let n="";for(let s=0;s<this.basePos;s++)n+=" ";return n+this.text.slice(this.basePos)}}function w1(t,n,s){if(s.pos==s.text.length||t!=n.block&&s.indent>=n.stack[s.depth+1].value+s.baseIndent)return!0;if(s.indent>=s.baseIndent+4)return!1;let l=(t.type==ae.OrderedList?sh:nh)(s,n,!1);return l>0&&(t.type!=ae.BulletList||ah(s,n,!1)<0)&&s.text.charCodeAt(s.pos+l-1)==t.value}const Gv={[ae.Blockquote](t,n,s){return s.next!=62?!1:(s.markers.push(Te(ae.QuoteMark,n.lineStart+s.pos,n.lineStart+s.pos+1)),s.moveBase(s.pos+(oa(s.text.charCodeAt(s.pos+1))?2:1)),t.end=n.lineStart+s.text.length,!0)},[ae.ListItem](t,n,s){return s.indent<s.baseIndent+t.value&&s.next>-1?!1:(s.moveBaseColumn(s.baseIndent+t.value),!0)},[ae.OrderedList]:w1,[ae.BulletList]:w1,[ae.Document](){return!0}};function oa(t){return t==32||t==9||t==10||t==13}function Mr(t,n=0){for(;n<t.length&&oa(t.charCodeAt(n));)n++;return n}function $1(t,n,s){for(;n>s&&oa(t.charCodeAt(n-1));)n--;return n}function Lv(t){if(t.next!=96&&t.next!=126)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==t.next;)n++;if(n<t.pos+3)return-1;if(t.next==96){for(let s=n;s<t.text.length;s++)if(t.text.charCodeAt(s)==96)return-1}return n}function Dv(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function ah(t,n,s){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let l=1;for(let i=t.pos+1;i<t.text.length;i++){let u=t.text.charCodeAt(i);if(u==t.next)l++;else if(!oa(u))return-1}return s&&t.next==45&&Hv(t)>-1&&t.depth==n.stack.length&&n.parser.leafBlockParsers.indexOf(Jv.SetextHeading)>-1||l<3?-1:1}function Wv(t,n){for(let s=t.stack.length-1;s>=0;s--)if(t.stack[s].type==n)return!0;return!1}function nh(t,n,s){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||oa(t.text.charCodeAt(t.pos+1)))&&(!s||Wv(n,ae.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function sh(t,n,s){let l=t.pos,i=t.next;for(;i>=48&&i<=57;){l++;if(l==t.text.length)return-1;i=t.text.charCodeAt(l)}return l==t.pos||l>t.pos+9||i!=46&&i!=41||l<t.text.length-1&&!oa(t.text.charCodeAt(l+1))||s&&!Wv(n,ae.OrderedList)&&(t.skipSpace(l+1)==t.text.length||l>t.pos+1||t.next!=49)?-1:l+1-t.pos}function Bv(t){if(t.next!=35)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==35;)n++;if(n<t.text.length&&t.text.charCodeAt(n)!=32)return-1;let s=n-t.pos;return s>6?-1:s}function Hv(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==t.next;)n++;let s=n;for(;n<t.text.length&&oa(t.text.charCodeAt(n));)n++;return n==t.text.length?s:-1}const df=/^[ \t]*$/,Iv=/-->/,Fv=/\?>/,Of=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Iv],[/^\s*<\?/,Fv],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,df],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,df]];function Kv(t,n,s){if(t.next!=60)return-1;let l=t.text.slice(t.pos);for(let i=0,u=Of.length-(s?1:0);i<u;i++)if(Of[i][0].test(l))return i;return-1}function k1(t,n){let s=t.countIndent(n,t.pos,t.indent),l=t.countIndent(t.skipSpace(n),n,s);return l>=s+5?s+1:l}function En(t,n,s){let l=t.length-1;l>=0&&t[l].to==n&&t[l].type==ae.CodeText?t[l].to=s:t.push(Te(ae.CodeText,n,s))}const _o={LinkReference:void 0,IndentedCode(t,n){let s=n.baseIndent+4;if(n.indent<s)return!1;let l=n.findColumn(s),i=t.lineStart+l,u=t.lineStart+n.text.length,d=[],f=[];for(En(d,i,u);t.nextLine()&&n.depth>=t.stack.length;)if(n.pos==n.text.length){En(f,t.lineStart-1,t.lineStart);for(let m of n.markers)f.push(m)}else{if(n.indent<s)break;{if(f.length){for(let p of f)p.type==ae.CodeText?En(d,p.from,p.to):d.push(p);f=[]}En(d,t.lineStart-1,t.lineStart);for(let p of n.markers)d.push(p);u=t.lineStart+n.text.length;let m=t.lineStart+n.findColumn(n.baseIndent+4);m<u&&En(d,m,u)}}return f.length&&(f=f.filter(m=>m.type!=ae.CodeText),f.length&&(n.markers=f.concat(n.markers))),t.addNode(t.buffer.writeElements(d,-i).finish(ae.CodeBlock,u-i),i),!0},FencedCode(t,n){let s=Lv(n);if(s<0)return!1;let l=t.lineStart+n.pos,i=n.next,u=s-n.pos,d=n.skipSpace(s),f=$1(n.text,n.text.length,d),m=[Te(ae.CodeMark,l,l+u)];d<f&&m.push(Te(ae.CodeInfo,t.lineStart+d,t.lineStart+f));for(let p=!0,x=!0,g=!1;t.nextLine()&&n.depth>=t.stack.length;p=!1){let b=n.pos;if(n.indent-n.baseIndent<4)for(;b<n.text.length&&n.text.charCodeAt(b)==i;)b++;if(b-n.pos>=u&&n.skipSpace(b)==n.text.length){for(let S of n.markers)m.push(S);x&&g&&En(m,t.lineStart-1,t.lineStart),m.push(Te(ae.CodeMark,t.lineStart+n.pos,t.lineStart+b)),t.nextLine();break}else{g=!0,p||(En(m,t.lineStart-1,t.lineStart),x=!1);for(let j of n.markers)m.push(j);let S=t.lineStart+n.basePos,w=t.lineStart+n.text.length;S<w&&(En(m,S,w),x=!1)}}return t.addNode(t.buffer.writeElements(m,-l).finish(ae.FencedCode,t.prevLineEnd()-l),l),!0},Blockquote(t,n){let s=Dv(n);return s<0?!1:(t.startContext(ae.Blockquote,n.pos),t.addNode(ae.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1),n.moveBase(n.pos+s),null)},HorizontalRule(t,n){if(ah(n,t,!1)<0)return!1;let s=t.lineStart+n.pos;return t.nextLine(),t.addNode(ae.HorizontalRule,s),!0},BulletList(t,n){let s=nh(n,t,!1);if(s<0)return!1;t.block.type!=ae.BulletList&&t.startContext(ae.BulletList,n.basePos,n.next);let l=k1(n,n.pos+1);return t.startContext(ae.ListItem,n.basePos,l-n.baseIndent),t.addNode(ae.ListMark,t.lineStart+n.pos,t.lineStart+n.pos+s),n.moveBaseColumn(l),null},OrderedList(t,n){let s=sh(n,t,!1);if(s<0)return!1;t.block.type!=ae.OrderedList&&t.startContext(ae.OrderedList,n.basePos,n.text.charCodeAt(n.pos+s-1));let l=k1(n,n.pos+s);return t.startContext(ae.ListItem,n.basePos,l-n.baseIndent),t.addNode(ae.ListMark,t.lineStart+n.pos,t.lineStart+n.pos+s),n.moveBaseColumn(l),null},ATXHeading(t,n){let s=Bv(n);if(s<0)return!1;let l=n.pos,i=t.lineStart+l,u=$1(n.text,n.text.length,l),d=u;for(;d>l&&n.text.charCodeAt(d-1)==n.next;)d--;(d==u||d==l||!oa(n.text.charCodeAt(d-1)))&&(d=n.text.length);let f=t.buffer.write(ae.HeaderMark,0,s).writeElements(t.parser.parseInline(n.text.slice(l+s+1,d),i+s+1),-i);d<n.text.length&&f.write(ae.HeaderMark,d-l,u-l);let m=f.finish(ae.ATXHeading1-1+s,n.text.length-l);return t.nextLine(),t.addNode(m,i),!0},HTMLBlock(t,n){let s=Kv(n,t,!1);if(s<0)return!1;let l=t.lineStart+n.pos,i=Of[s][1],u=[],d=i!=df;for(;!i.test(n.text)&&t.nextLine();){if(n.depth<t.stack.length){d=!1;break}for(let p of n.markers)u.push(p)}d&&t.nextLine();let f=i==Iv?ae.CommentBlock:i==Fv?ae.ProcessingInstructionBlock:ae.HTMLBlock,m=t.prevLineEnd();return t.addNode(t.buffer.writeElements(u,-l).finish(f,m-l),l),!0},SetextHeading:void 0};class Y4{constructor(n){this.stage=0,this.elts=[],this.pos=0,this.start=n.start,this.advance(n.content)}nextLine(n,s,l){if(this.stage==-1)return!1;let i=l.content+`
519
- `+s.scrub(),u=this.advance(i);return u>-1&&u<i.length?this.complete(n,l,u):!1}finish(n,s){return(this.stage==2||this.stage==3)&&Mr(s.content,this.pos)==s.content.length?this.complete(n,s,s.content.length):!1}complete(n,s,l){return n.addLeafElement(s,Te(ae.LinkReference,this.start,this.start+l,this.elts)),!0}nextStage(n){return n?(this.pos=n.to-this.start,this.elts.push(n),this.stage++,!0):(n===!1&&(this.stage=-1),!1)}advance(n){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(oy(n,this.pos,this.start,!0)))return-1;if(n.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Te(ae.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ry(n,Mr(n,this.pos),this.start)))return-1}else if(this.stage==2){let s=Mr(n,this.pos),l=0;if(s>this.pos){let i=iy(n,s,this.start);if(i){let u=kO(n,i.to-this.start);u>0&&(this.nextStage(i),l=u)}}return l||(l=kO(n,this.pos)),l>0&&l<n.length?l:-1}else return kO(n,this.pos)}}}function kO(t,n){for(;n<t.length;n++){let s=t.charCodeAt(n);if(s==10)break;if(!oa(s))return-1}return n}class V4{nextLine(n,s,l){let i=s.depth<n.stack.length?-1:Hv(s),u=s.next;if(i<0)return!1;let d=Te(ae.HeaderMark,n.lineStart+s.pos,n.lineStart+i);return n.nextLine(),n.addLeafElement(l,Te(u==61?ae.SetextHeading1:ae.SetextHeading2,l.start,n.prevLineEnd(),[...n.parser.parseInline(l.content,l.start),d])),!0}finish(){return!1}}const Jv={LinkReference(t,n){return n.content.charCodeAt(0)==91?new Y4(n):null},SetextHeading(){return new V4}},U4=[(t,n)=>Bv(n)>=0,(t,n)=>Lv(n)>=0,(t,n)=>Dv(n)>=0,(t,n)=>nh(n,t,!0)>=0,(t,n)=>sh(n,t,!0)>=0,(t,n)=>ah(n,t,!0)>=0,(t,n)=>Kv(n,t,!0)>=0],G4={text:"",end:0};class L4{constructor(n,s,l,i){this.parser=n,this.input=s,this.ranges=i,this.line=new M4,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=xc.create(ae.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=l.length?new B4(l,s):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:n}=this;for(;;){for(let l=0;;){let i=n.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;l<n.markers.length&&(!i||n.markers[l].from<i.end);){let u=n.markers[l++];this.addNode(u.type,u.from,u.to)}if(!i)break;this.finishContext()}if(n.pos<n.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(n.basePos))return null;e:for(;;){for(let l of this.parser.blockParsers)if(l){let i=l(this,n);if(i!=!1){if(i==!0)return null;n.forward();continue e}}break}let s=new q4(this.lineStart+n.pos,n.text.slice(n.pos));for(let l of this.parser.leafBlockParsers)if(l){let i=l(this,s);i&&s.parsers.push(i)}e:for(;this.nextLine()&&n.pos!=n.text.length;){if(n.indent<n.baseIndent+4){for(let l of this.parser.endLeafBlock)if(l(this,n,s))break e}for(let l of s.parsers)if(l.nextLine(this,n,s))return null;s.content+=`
520
- `+n.scrub();for(let l of n.markers)s.marks.push(l)}return this.finishLeaf(s),null}stopAt(n){if(this.stoppedAt!=null&&this.stoppedAt<n)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=n}reuseFragment(n){if(!this.fragments.moveTo(this.absoluteLineStart+n,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let s=this.fragments.takeNodes(this);return s?(this.absoluteLineStart+=s,this.lineStart=cy(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(n=this.depth-1){return this.parser.nodeSet.types[this.stack[n].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(n){let s=G4;if(s.end=n,n>=this.to)s.text="";else if(s.text=this.lineChunkAt(n),s.end+=s.text.length,this.ranges.length>1){let l=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<s.end;){i++;let u=this.ranges[i].from,d=this.lineChunkAt(u);s.end=u+d.length,s.text=s.text.slice(0,this.ranges[i-1].to-l)+d,l=s.end-s.text.length}}return s}readLine(){let{line:n}=this,{text:s,end:l}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=l,n.reset(s);n.depth<this.stack.length;n.depth++){let i=this.stack[n.depth],u=this.parser.skipContextMarkup[i.type];if(!u)throw new Error("Unhandled block context "+ae[i.type]);let d=this.line.markers.length;if(!u(i,this,n)){this.line.markers.length>d&&(i.end=this.line.markers[this.line.markers.length-1].to),n.forward();break}n.forward()}}lineChunkAt(n){let s=this.input.chunk(n),l;if(this.input.lineChunks)l=s==`
518
+ }`,{label:"class",detail:"definition",type:"keyword"}),He('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),He('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],e3=cv.concat([He("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),He("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),He("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),r1=new Sf,uv=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function _r(t){return(n,s)=>{let l=n.node.getChild("VariableDefinition");return l&&s(l,t),!0}}const t3=["FunctionDeclaration"],a3={FunctionDeclaration:_r("function"),ClassDeclaration:_r("class"),ClassExpression:()=>!0,EnumDeclaration:_r("constant"),TypeAliasDeclaration:_r("type"),NamespaceDeclaration:_r("namespace"),VariableDefinition(t,n){t.matchContext(t3)||n(t,"variable")},TypeDefinition(t,n){n(t,"type")},__proto__:null};function dv(t,n){let s=r1.get(n);if(s)return s;let l=[],i=!0;function u(d,f){let m=t.sliceString(d.from,d.to);l.push({label:m,type:f})}return n.cursor(yc.IncludeAnonymous).iterate(d=>{if(i)i=!1;else if(d.name){let f=a3[d.name];if(f&&f(d,u)||uv.has(d.name))return!1}else if(d.to-d.from>8192){for(let f of dv(t,d.node))l.push(f);return!1}}),r1.set(n,l),l}const i1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Ov=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function n3(t){let n=pa(t.state).resolveInner(t.pos,-1);if(Ov.indexOf(n.name)>-1)return null;let s=n.name=="VariableName"||n.to-n.from<20&&i1.test(t.state.sliceDoc(n.from,n.to));if(!s&&!t.explicit)return null;let l=[];for(let i=n;i;i=i.parent)uv.has(i.name)&&(l=l.concat(dv(t.state.doc,i)));return{options:l,from:s?n.from:t.pos,validFor:i1}}const $a=ti.define({name:"javascript",parser:JN.configure({props:[zl.add({IfStatement:bl({except:/^\s*({|else\b)/}),TryStatement:bl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:gj,SwitchBody:t=>{let n=t.textAfter,s=/^\s*\}/.test(n),l=/^\s*(case|default)\b/.test(n);return t.baseIndent+(s?0:l?1:2)*t.unit},Block:Uo({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":bl({except:/^\s*{/}),JSXElement(t){let n=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)},JSXEscape(t){let n=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),ks.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Sc,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let n=t.firstChild;if(!n||n.name=="JSXSelfClosingTag")return null;let s=t.lastChild;return{from:n.to,to:s.type.isError?t.to:s.from}},"JSXSelfClosingTag JSXOpenTag"(t){var n;let s=(n=t.firstChild)===null||n===void 0?void 0:n.nextSibling,l=t.lastChild;return!s||s.type.isError?null:{from:s.to,to:l.type.isError?t.to:l.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),fv={test:t=>/^JSX/.test(t.name),facet:y0({commentTokens:{block:{open:"{/*",close:"*/}"}}})},hv=$a.configure({dialect:"ts"},"typescript"),mv=$a.configure({dialect:"jsx",props:[v0.add(t=>t.isTop?[fv]:void 0)]}),pv=$a.configure({dialect:"jsx ts",props:[v0.add(t=>t.isTop?[fv]:void 0)]},"typescript");let xv=t=>({label:t,type:"keyword"});const gv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(xv),s3=gv.concat(["declare","implements","private","protected","public"].map(xv));function of(t={}){let n=t.jsx?t.typescript?pv:mv:t.typescript?hv:$a,s=t.typescript?e3.concat(s3):cv.concat(gv);return new vs(n,[$a.data.of({autocomplete:g0(Ov,b0(s))}),$a.data.of({autocomplete:n3}),t.jsx?i3:[]])}function l3(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function o1(t,n,s=t.length){for(let l=n==null?void 0:n.firstChild;l;l=l.nextSibling)if(l.name=="JSXIdentifier"||l.name=="JSXBuiltin"||l.name=="JSXNamespacedName"||l.name=="JSXMemberExpression")return t.sliceString(l.from,Math.min(l.to,s));return""}const r3=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),i3=jl.inputHandler.of((t,n,s,l,i)=>{if((r3?t.composing:t.compositionStarted)||t.state.readOnly||n!=s||l!=">"&&l!="/"||!$a.isActiveAt(t.state,n,-1))return!1;let u=i(),{state:d}=u,f=d.changeByRange(m=>{var p;let{head:x}=m,g=pa(d).resolveInner(x-1,-1),b;if(g.name=="JSXStartTag"&&(g=g.parent),!(d.doc.sliceString(x-1,x)!=l||g.name=="JSXAttributeValue"&&g.to>x)){if(l==">"&&g.name=="JSXFragmentTag")return{range:m,changes:{from:x,insert:"</>"}};if(l=="/"&&g.name=="JSXStartCloseTag"){let S=g.parent,w=S.parent;if(w&&S.from==x-2&&((b=o1(d.doc,w.firstChild,x))||((p=w.firstChild)===null||p===void 0?void 0:p.name)=="JSXFragmentTag")){let j=`${b}>`;return{range:Un.cursor(x+j.length,-1),changes:{from:x,insert:j}}}}else if(l==">"){let S=l3(g);if(S&&S.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(d.doc.sliceString(x,x+2))&&(b=o1(d.doc,S,x)))return{range:m,changes:{from:x,insert:`</${b}>`}}}}return{range:m}});return f.changes.empty?!1:(t.dispatch([u,d.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),o3=135,c1=1,c3=136,u3=137,bv=2,d3=138,O3=3,f3=4,vv=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],h3=58,m3=40,yv=95,p3=91,Do=45,x3=46,g3=35,b3=37,v3=38,y3=92,S3=10,Q3=42;function Hr(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Ff(t){return t>=48&&t<=57}function u1(t){return Ff(t)||t>=97&&t<=102||t>=65&&t<=70}const Sv=(t,n,s)=>(l,i)=>{for(let u=!1,d=0,f=0;;f++){let{next:m}=l;if(Hr(m)||m==Do||m==yv||u&&Ff(m))!u&&(m!=Do||f>0)&&(u=!0),d===f&&m==Do&&d++,l.advance();else if(m==y3&&l.peek(1)!=S3){if(l.advance(),u1(l.next)){do l.advance();while(u1(l.next));l.next==32&&l.advance()}else l.next>-1&&l.advance();u=!0}else{u&&l.acceptToken(d==2&&i.canShift(bv)?n:m==m3?s:t);break}}},j3=new xt(Sv(c3,bv,u3),{contextual:!0}),w3=new xt(Sv(d3,O3,f3),{contextual:!0}),$3=new xt(t=>{if(vv.includes(t.peek(-1))){let{next:n}=t;(Hr(n)||n==yv||n==g3||n==x3||n==Q3||n==p3||n==h3&&Hr(t.peek(1))||n==Do||n==v3)&&t.acceptToken(o3)}}),k3=new xt(t=>{if(!vv.includes(t.peek(-1))){let{next:n}=t;if(n==b3&&(t.advance(),t.acceptToken(c1)),Hr(n)){do t.advance();while(Hr(t.next)||Ff(t.next));t.acceptToken(c1)}}}),T3=$s({"AtKeyword import charset namespace keyframes media supports font-feature-values":C.definitionKeyword,"from to selector scope MatchFlag":C.keyword,NamespaceName:C.namespace,KeyframeName:C.labelName,KeyframeRangeName:C.operatorKeyword,TagName:C.tagName,ClassName:C.className,PseudoClassName:C.constant(C.className),IdName:C.labelName,"FeatureName PropertyName":C.propertyName,AttributeName:C.attributeName,NumberLiteral:C.number,KeywordQuery:C.keyword,UnaryQueryOp:C.operatorKeyword,"CallTag ValueName FontName":C.atom,VariableName:C.variableName,Callee:C.operatorKeyword,Unit:C.unit,"UniversalSelector NestingSelector":C.definitionOperator,"MatchOp CompareOp":C.compareOperator,"ChildOp SiblingOp, LogicOp":C.logicOperator,BinOp:C.arithmeticOperator,Important:C.modifier,Comment:C.blockComment,ColorLiteral:C.color,"ParenthesizedContent StringLiteral":C.string,":":C.punctuation,"PseudoOp #":C.derefOperator,"; , |":C.separator,"( )":C.paren,"[ ]":C.squareBracket,"{ }":C.brace}),P3={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},N3={__proto__:null,or:104,and:104,not:112,only:112,layer:186},z3={__proto__:null,selector:118,layer:182},R3={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},X3={__proto__:null,to:223},_3=Bn.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[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. ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[T3],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%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jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[$3,k3,j3,w3,1,2,3,4,new hc("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>P3[t]||-1},{term:138,get:t=>N3[t]||-1},{term:4,get:t=>z3[t]||-1},{term:28,get:t=>R3[t]||-1},{term:136,get:t=>X3[t]||-1}],tokenPrec:2256});let vO=null;function yO(){if(!vO&&typeof document=="object"&&document.body){let{style:t}=document.body,n=[],s=new Set;for(let l in t)l!="cssText"&&l!="cssFloat"&&typeof t[l]=="string"&&(/[A-Z]/.test(l)&&(l=l.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),s.has(l)||(n.push(l),s.add(l)));vO=n.sort().map(l=>({type:"property",label:l,apply:l+": "}))}return vO||[]}const d1=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),O1=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),C3=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Z3=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Fa=/^(\w[\w-]*|-\w[\w-]*|)$/,A3=/^-(-[\w-]*)?$/;function E3(t,n){var s;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let l=(s=t.parent)===null||s===void 0?void 0:s.firstChild;return(l==null?void 0:l.name)!="Callee"?!1:n.sliceString(l.from,l.to)=="var"}const f1=new Sf,q3=["Declaration"];function M3(t){for(let n=t;;){if(n.type.isTop)return n;if(!(n=n.parent))return t}}function Qv(t,n,s){if(n.to-n.from>4096){let l=f1.get(n);if(l)return l;let i=[],u=new Set,d=n.cursor(yc.IncludeAnonymous);if(d.firstChild())do for(let f of Qv(t,d.node,s))u.has(f.label)||(u.add(f.label),i.push(f));while(d.nextSibling());return f1.set(n,i),i}else{let l=[],i=new Set;return n.cursor().iterate(u=>{var d;if(s(u)&&u.matchContext(q3)&&((d=u.node.nextSibling)===null||d===void 0?void 0:d.name)==":"){let f=t.sliceString(u.from,u.to);i.has(f)||(i.add(f),l.push({label:f,type:"variable"}))}}),l}}const Y3=t=>n=>{let{state:s,pos:l}=n,i=pa(s).resolveInner(l,-1),u=i.type.isError&&i.from==i.to-1&&s.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(u||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:yO(),validFor:Fa};if(i.name=="ValueName")return{from:i.from,options:O1,validFor:Fa};if(i.name=="PseudoClassName")return{from:i.from,options:d1,validFor:Fa};if(t(i)||(n.explicit||u)&&E3(i,s.doc))return{from:t(i)||u?i.from:l,options:Qv(s.doc,M3(i),t),validFor:A3};if(i.name=="TagName"){for(let{parent:m}=i;m;m=m.parent)if(m.name=="Block")return{from:i.from,options:yO(),validFor:Fa};return{from:i.from,options:C3,validFor:Fa}}if(i.name=="AtKeyword")return{from:i.from,options:Z3,validFor:Fa};if(!n.explicit)return null;let d=i.resolve(l),f=d.childBefore(l);return f&&f.name==":"&&d.name=="PseudoClassSelector"?{from:l,options:d1,validFor:Fa}:f&&f.name==":"&&d.name=="Declaration"||d.name=="ArgList"?{from:l,options:O1,validFor:Fa}:d.name=="Block"||d.name=="Styles"?{from:l,options:yO(),validFor:Fa}:null},V3=Y3(t=>t.name=="VariableName"),mc=ti.define({name:"css",parser:_3.configure({props:[zl.add({Declaration:bl()}),ks.add({"Block KeyframeList":Sc})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function jv(){return new vs(mc,mc.data.of({autocomplete:V3}))}const U3=55,G3=1,L3=56,D3=2,W3=57,B3=3,h1=4,H3=5,Kf=6,wv=7,$v=8,kv=9,Tv=10,I3=11,F3=12,K3=13,SO=58,J3=14,ez=15,m1=59,Pv=21,tz=23,Nv=24,az=25,cf=27,zv=28,nz=29,sz=32,lz=35,rz=37,iz=38,oz=0,cz=1,uz={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},dz={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},p1={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Oz(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let x1=null,g1=null,b1=0;function uf(t,n){let s=t.pos+n;if(b1==s&&g1==t)return x1;let l=t.peek(n),i="";for(;Oz(l);)i+=String.fromCharCode(l),l=t.peek(++n);return g1=t,b1=s,x1=i?i.toLowerCase():l==fz||l==hz?void 0:null}const Rv=60,pc=62,Jf=47,fz=63,hz=33,mz=45;function v1(t,n){this.name=t,this.parent=n}const pz=[Kf,Tv,wv,$v,kv],xz=new If({start:null,shift(t,n,s,l){return pz.indexOf(n)>-1?new v1(uf(l,1)||"",t):t},reduce(t,n){return n==Pv&&t?t.parent:t},reuse(t,n,s,l){let i=n.type.id;return i==Kf||i==rz?new v1(uf(l,1)||"",t):t},strict:!1}),gz=new xt((t,n)=>{if(t.next!=Rv){t.next<0&&n.context&&t.acceptToken(SO);return}t.advance();let s=t.next==Jf;s&&t.advance();let l=uf(t,0);if(l===void 0)return;if(!l)return t.acceptToken(s?ez:J3);let i=n.context?n.context.name:null;if(s){if(l==i)return t.acceptToken(I3);if(i&&dz[i])return t.acceptToken(SO,-2);if(n.dialectEnabled(oz))return t.acceptToken(F3);for(let u=n.context;u;u=u.parent)if(u.name==l)return;t.acceptToken(K3)}else{if(l=="script")return t.acceptToken(wv);if(l=="style")return t.acceptToken($v);if(l=="textarea")return t.acceptToken(kv);if(uz.hasOwnProperty(l))return t.acceptToken(Tv);i&&p1[i]&&p1[i][l]?t.acceptToken(SO,-1):t.acceptToken(Kf)}},{contextual:!0}),bz=new xt(t=>{for(let n=0,s=0;;s++){if(t.next<0){s&&t.acceptToken(m1);break}if(t.next==mz)n++;else if(t.next==pc&&n>=2){s>=3&&t.acceptToken(m1,-2);break}else n=0;t.advance()}});function vz(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const yz=new xt((t,n)=>{if(t.next==Jf&&t.peek(1)==pc){let s=n.dialectEnabled(cz)||vz(n.context);t.acceptToken(s?H3:h1,2)}else t.next==pc&&t.acceptToken(h1,1)});function eh(t,n,s){let l=2+t.length;return new xt(i=>{for(let u=0,d=0,f=0;;f++){if(i.next<0){f&&i.acceptToken(n);break}if(u==0&&i.next==Rv||u==1&&i.next==Jf||u>=2&&u<l&&i.next==t.charCodeAt(u-2))u++,d++;else if(u==l&&i.next==pc){f>d?i.acceptToken(n,-d):i.acceptToken(s,-(d-2));break}else if((i.next==10||i.next==13)&&f){i.acceptToken(n,1);break}else u=d=0;i.advance()}})}const Sz=eh("script",U3,G3),Qz=eh("style",L3,D3),jz=eh("textarea",W3,B3),wz=$s({"Text RawText IncompleteTag IncompleteCloseTag":C.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":C.angleBracket,TagName:C.tagName,"MismatchedCloseTag/TagName":[C.tagName,C.invalid],AttributeName:C.attributeName,"AttributeValue UnquotedAttributeValue":C.attributeValue,Is:C.definitionOperator,"EntityReference CharacterReference":C.character,Comment:C.blockComment,ProcessingInst:C.processingInstruction,DoctypeDecl:C.documentMeta}),$z=Bn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/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{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:xz,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[wz],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R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pOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Sz,Qz,jz,yz,gz,bz,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function Xv(t,n){let s=Object.create(null);for(let l of t.getChildren(Nv)){let i=l.getChild(az),u=l.getChild(cf)||l.getChild(zv);i&&(s[n.read(i.from,i.to)]=u?u.type.id==cf?n.read(u.from+1,u.to-1):n.read(u.from,u.to):"")}return s}function y1(t,n){let s=t.getChild(tz);return s?n.read(s.from,s.to):" "}function QO(t,n,s){let l;for(let i of s)if(!i.attrs||i.attrs(l||(l=Xv(t.node.parent.firstChild,n))))return{parser:i.parser,bracketed:!0};return null}function _v(t=[],n=[]){let s=[],l=[],i=[],u=[];for(let f of t)(f.tag=="script"?s:f.tag=="style"?l:f.tag=="textarea"?i:u).push(f);let d=n.length?Object.create(null):null;for(let f of n)(d[f.name]||(d[f.name]=[])).push(f);return S0((f,m)=>{let p=f.type.id;if(p==nz)return QO(f,m,s);if(p==sz)return QO(f,m,l);if(p==lz)return QO(f,m,i);if(p==Pv&&u.length){let x=f.node,g=x.firstChild,b=g&&y1(g,m),S;if(b){for(let w of u)if(w.tag==b&&(!w.attrs||w.attrs(S||(S=Xv(g,m))))){let j=x.lastChild,$=j.type.id==iz?j.from:x.to;if($>g.to)return{parser:w.parser,overlay:[{from:g.to,to:$}]}}}}if(d&&p==Nv){let x=f.node,g;if(g=x.firstChild){let b=d[m.read(g.from,g.to)];if(b)for(let S of b){if(S.tagName&&S.tagName!=y1(x.parent,m))continue;let w=x.lastChild;if(w.type.id==cf){let j=w.from+1,$=w.lastChild,k=w.to-($&&$.isError?0:1);if(k>j)return{parser:S.parser,overlay:[{from:j,to:k}],bracketed:!0}}else if(w.type.id==zv)return{parser:S.parser,overlay:[{from:w.from,to:w.to}]}}}}return null})}const Cr=["_blank","_self","_top","_parent"],jO=["ascii","utf-8","utf-16","latin1","latin1"],wO=["get","post","put","delete"],$O=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Vt=["true","false"],de={},kz={a:{attrs:{href:null,ping:null,type:null,media:null,target:Cr,hreflang:null}},abbr:de,address:de,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:de,aside:de,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:de,base:{attrs:{href:null,target:Cr}},bdi:de,bdo:de,blockquote:{attrs:{cite:null}},body:de,br:de,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:$O,formmethod:wO,formnovalidate:["novalidate"],formtarget:Cr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:de,center:de,cite:de,code:de,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:de,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:de,div:de,dl:de,dt:de,em:de,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:de,figure:de,footer:de,form:{attrs:{action:null,name:null,"accept-charset":jO,autocomplete:["on","off"],enctype:$O,method:wO,novalidate:["novalidate"],target:Cr}},h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:de,hgroup:de,hr:de,html:{attrs:{manifest:null}},i:de,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:$O,formmethod:wO,formnovalidate:["novalidate"],formtarget:Cr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:de,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:de,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:de,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:jO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:de,noscript:de,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:de,param:{attrs:{name:null,value:null}},pre:de,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:de,rt:de,ruby:de,samp:de,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:jO}},section:de,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:de,source:{attrs:{src:null,type:null,media:null}},span:de,strong:de,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:de,summary:de,sup:de,table:de,tbody:de,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:de,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:de,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:de,time:{attrs:{datetime:null}},title:de,tr:de,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:de,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:de},Cv={accesskey:null,class:null,contenteditable:Vt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Vt,autocorrect:Vt,autocapitalize:Vt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Vt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Vt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Vt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Vt,"aria-hidden":Vt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Vt,"aria-multiselectable":Vt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Vt,"aria-relevant":null,"aria-required":Vt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Zv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of Zv)Cv[t]=null;class Ir{constructor(n,s){this.tags={...kz,...n},this.globalAttrs={...Cv,...s},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Ir.default=new Ir;function Tl(t,n,s=t.length){if(!n)return"";let l=n.firstChild,i=l&&l.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,s)):""}function Pl(t,n=!1){for(;t;t=t.parent)if(t.name=="Element")if(n)n=!1;else return t;return null}function Av(t,n,s){let l=s.tags[Tl(t,Pl(n))];return(l==null?void 0:l.children)||s.allTags}function th(t,n){let s=[];for(let l=Pl(n);l&&!l.type.isTop;l=Pl(l.parent)){let i=Tl(t,l);if(i&&l.lastChild.name=="CloseTag")break;i&&s.indexOf(i)<0&&(n.name=="EndTag"||n.from>=l.firstChild.to)&&s.push(i)}return s}const Ev=/^[:\-\.\w\u00b7-\uffff]*$/;function S1(t,n,s,l,i){let u=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",d=Pl(s,s.name=="StartTag"||s.name=="TagName");return{from:l,to:i,options:Av(t.doc,d,n).map(f=>({label:f,type:"type"})).concat(th(t.doc,s).map((f,m)=>({label:"/"+f,apply:"/"+f+u,type:"type",boost:99-m}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Q1(t,n,s,l){let i=/\s*>/.test(t.sliceDoc(l,l+5))?"":">";return{from:s,to:l,options:th(t.doc,n).map((u,d)=>({label:u,apply:u+i,type:"type",boost:99-d})),validFor:Ev}}function Tz(t,n,s,l){let i=[],u=0;for(let d of Av(t.doc,s,n))i.push({label:"<"+d,type:"type"});for(let d of th(t.doc,s))i.push({label:"</"+d+">",type:"type",boost:99-u++});return{from:l,to:l,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Pz(t,n,s,l,i){let u=Pl(s),d=u?n.tags[Tl(t.doc,u)]:null,f=d&&d.attrs?Object.keys(d.attrs):[],m=d&&d.globalAttrs===!1?f:f.length?f.concat(n.globalAttrNames):n.globalAttrNames;return{from:l,to:i,options:m.map(p=>({label:p,type:"property"})),validFor:Ev}}function Nz(t,n,s,l,i){var u;let d=(u=s.parent)===null||u===void 0?void 0:u.getChild("AttributeName"),f=[],m;if(d){let p=t.sliceDoc(d.from,d.to),x=n.globalAttrs[p];if(!x){let g=Pl(s),b=g?n.tags[Tl(t.doc,g)]:null;x=(b==null?void 0:b.attrs)&&b.attrs[p]}if(x){let g=t.sliceDoc(l,i).toLowerCase(),b='"',S='"';/^['"]/.test(g)?(m=g[0]=='"'?/^[^"]*$/:/^[^']*$/,b="",S=t.sliceDoc(i,i+1)==g[0]?"":g[0],g=g.slice(1),l++):m=/^[^\s<>='"]*$/;for(let w of x)f.push({label:w,apply:b+w+S,type:"constant"})}}return{from:l,to:i,options:f,validFor:m}}function qv(t,n){let{state:s,pos:l}=n,i=pa(s).resolveInner(l,-1),u=i.resolve(l);for(let d=l,f;u==i&&(f=i.childBefore(d));){let m=f.lastChild;if(!m||!m.type.isError||m.from<m.to)break;u=i=f,d=m.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?Q1(s,i,i.from,l):S1(s,t,i,i.from,l):i.name=="StartTag"||i.name=="IncompleteTag"?S1(s,t,i,l,l):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?Q1(s,i,l,l):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?Pz(s,t,i,i.name=="AttributeName"?i.from:l,l):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?Nz(s,t,i,i.name=="Is"?l:i.from,l):n.explicit&&(u.name=="Element"||u.name=="Text"||u.name=="Document")?Tz(s,t,i,l):null}function zz(t){return qv(Ir.default,t)}function Rz(t){let{extraTags:n,extraGlobalAttributes:s}=t,l=s||n?new Ir(n,s):Ir.default;return i=>qv(l,i)}const Xz=$a.parser.configure({top:"SingleExpression"}),Mv=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:hv.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:mv.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:pv.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:Xz},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:$a.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:mc.parser}],Yv=[{name:"style",parser:mc.parser.configure({top:"Styles"})}].concat(Zv.map(t=>({name:t,parser:$a.parser}))),Vv=ti.define({name:"html",parser:$z.configure({props:[zl.add({Element(t){let n=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+n[0].length?t.continue():t.lineIndent(t.node.from)+(n[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let n=null,s;for(let l=t.node;;){let i=l.lastChild;if(!i||i.name!="Element"||i.to!=l.to)break;n=l=i}return n&&!((s=n.lastChild)&&(s.name=="CloseTag"||s.name=="SelfClosingTag"))?t.lineIndent(n.from)+t.unit:null}}),ks.add({Element(t){let n=t.firstChild,s=t.lastChild;return!n||n.name!="OpenTag"?null:{from:n.to,to:s.name=="CloseTag"?s.from:t.to}}}),bj.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Wo=Vv.configure({wrap:_v(Mv,Yv)});function Uv(t={}){let n="",s;t.matchClosingTags===!1&&(n="noMatch"),t.selfClosingTags===!0&&(n=(n?n+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(s=_v((t.nestedLanguages||[]).concat(Mv),(t.nestedAttributes||[]).concat(Yv)));let l=s?Vv.configure({wrap:s,dialect:n}):n?Wo.configure({dialect:n}):Wo;return new vs(l,[Wo.data.of({autocomplete:Rz(t)}),t.autoCloseTags!==!1?_z:[],of().support,jv().support])}const j1=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),_z=jl.inputHandler.of((t,n,s,l,i)=>{if(t.composing||t.state.readOnly||n!=s||l!=">"&&l!="/"||!Wo.isActiveAt(t.state,n,-1))return!1;let u=i(),{state:d}=u,f=d.changeByRange(m=>{var p,x,g;let b=d.doc.sliceString(m.from-1,m.to)==l,{head:S}=m,w=pa(d).resolveInner(S,-1),j;if(b&&l==">"&&w.name=="EndTag"){let $=w.parent;if(((x=(p=$.parent)===null||p===void 0?void 0:p.lastChild)===null||x===void 0?void 0:x.name)!="CloseTag"&&(j=Tl(d.doc,$.parent,S))&&!j1.has(j)){let k=S+(d.doc.sliceString(S,S+1)===">"?1:0),N=`</${j}>`;return{range:m,changes:{from:S,to:k,insert:N}}}}else if(b&&l=="/"&&w.name=="IncompleteCloseTag"){let $=w.parent;if(w.from==S-2&&((g=$.lastChild)===null||g===void 0?void 0:g.name)!="CloseTag"&&(j=Tl(d.doc,$,S))&&!j1.has(j)){let k=S+(d.doc.sliceString(S,S+1)===">"?1:0),N=`${j}>`;return{range:Un.cursor(S+N.length,-1),changes:{from:S,to:k,insert:N}}}}return{range:m}});return f.changes.empty?!1:(t.dispatch([u,d.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Cz=$s({String:C.string,Number:C.number,"True False":C.bool,PropertyName:C.propertyName,Null:C.null,", :":C.separator,"[ ]":C.squareBracket,"{ }":C.brace}),Zz=Bn.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Cz],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Az=ti.define({name:"json",parser:Zz.configure({props:[zl.add({Object:bl({except:/^\s*\}/}),Array:bl({except:/^\s*\]/})}),ks.add({"Object Array":Sc})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Ez(){return new vs(Az)}class xc{static create(n,s,l,i,u){let d=i+(i<<8)+n+(s<<4)|0;return new xc(n,s,l,d,u,[],[])}constructor(n,s,l,i,u,d,f){this.type=n,this.value=s,this.from=l,this.hash=i,this.end=u,this.children=d,this.positions=f,this.hashProp=[[nn.contextHash,i]]}addChild(n,s){n.prop(nn.contextHash)!=this.hash&&(n=new fa(n.type,n.children,n.positions,n.length,this.hashProp)),this.children.push(n),this.positions.push(s)}toTree(n,s=this.end){let l=this.children.length-1;return l>=0&&(s=Math.max(s,this.positions[l]+this.children[l].length+this.from)),new fa(n.types[this.type],this.children,this.positions,s-this.from).balance({makeTree:(i,u,d)=>new fa(ei.none,i,u,d,this.hashProp)})}}var ae;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(ae||(ae={}));class qz{constructor(n,s){this.start=n,this.content=s,this.marks=[],this.parsers=[]}}class Mz{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let n=this.skipSpace(this.basePos);this.indent=this.countIndent(n,this.pos,this.indent),this.pos=n,this.next=n==this.text.length?-1:this.text.charCodeAt(n)}skipSpace(n){return Mr(this.text,n)}reset(n){for(this.text=n,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(n){this.basePos=n,this.baseIndent=this.countIndent(n,this.pos,this.indent)}moveBaseColumn(n){this.baseIndent=n,this.basePos=this.findColumn(n)}addMarker(n){this.markers.push(n)}countIndent(n,s=0,l=0){for(let i=s;i<n;i++)l+=this.text.charCodeAt(i)==9?4-l%4:1;return l}findColumn(n){let s=0;for(let l=0;s<this.text.length&&l<n;s++)l+=this.text.charCodeAt(s)==9?4-l%4:1;return s}scrub(){if(!this.baseIndent)return this.text;let n="";for(let s=0;s<this.basePos;s++)n+=" ";return n+this.text.slice(this.basePos)}}function w1(t,n,s){if(s.pos==s.text.length||t!=n.block&&s.indent>=n.stack[s.depth+1].value+s.baseIndent)return!0;if(s.indent>=s.baseIndent+4)return!1;let l=(t.type==ae.OrderedList?sh:nh)(s,n,!1);return l>0&&(t.type!=ae.BulletList||ah(s,n,!1)<0)&&s.text.charCodeAt(s.pos+l-1)==t.value}const Gv={[ae.Blockquote](t,n,s){return s.next!=62?!1:(s.markers.push(Te(ae.QuoteMark,n.lineStart+s.pos,n.lineStart+s.pos+1)),s.moveBase(s.pos+(oa(s.text.charCodeAt(s.pos+1))?2:1)),t.end=n.lineStart+s.text.length,!0)},[ae.ListItem](t,n,s){return s.indent<s.baseIndent+t.value&&s.next>-1?!1:(s.moveBaseColumn(s.baseIndent+t.value),!0)},[ae.OrderedList]:w1,[ae.BulletList]:w1,[ae.Document](){return!0}};function oa(t){return t==32||t==9||t==10||t==13}function Mr(t,n=0){for(;n<t.length&&oa(t.charCodeAt(n));)n++;return n}function $1(t,n,s){for(;n>s&&oa(t.charCodeAt(n-1));)n--;return n}function Lv(t){if(t.next!=96&&t.next!=126)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==t.next;)n++;if(n<t.pos+3)return-1;if(t.next==96){for(let s=n;s<t.text.length;s++)if(t.text.charCodeAt(s)==96)return-1}return n}function Dv(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function ah(t,n,s){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let l=1;for(let i=t.pos+1;i<t.text.length;i++){let u=t.text.charCodeAt(i);if(u==t.next)l++;else if(!oa(u))return-1}return s&&t.next==45&&Hv(t)>-1&&t.depth==n.stack.length&&n.parser.leafBlockParsers.indexOf(Jv.SetextHeading)>-1||l<3?-1:1}function Wv(t,n){for(let s=t.stack.length-1;s>=0;s--)if(t.stack[s].type==n)return!0;return!1}function nh(t,n,s){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||oa(t.text.charCodeAt(t.pos+1)))&&(!s||Wv(n,ae.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function sh(t,n,s){let l=t.pos,i=t.next;for(;i>=48&&i<=57;){l++;if(l==t.text.length)return-1;i=t.text.charCodeAt(l)}return l==t.pos||l>t.pos+9||i!=46&&i!=41||l<t.text.length-1&&!oa(t.text.charCodeAt(l+1))||s&&!Wv(n,ae.OrderedList)&&(t.skipSpace(l+1)==t.text.length||l>t.pos+1||t.next!=49)?-1:l+1-t.pos}function Bv(t){if(t.next!=35)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==35;)n++;if(n<t.text.length&&t.text.charCodeAt(n)!=32)return-1;let s=n-t.pos;return s>6?-1:s}function Hv(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let n=t.pos+1;for(;n<t.text.length&&t.text.charCodeAt(n)==t.next;)n++;let s=n;for(;n<t.text.length&&oa(t.text.charCodeAt(n));)n++;return n==t.text.length?s:-1}const df=/^[ \t]*$/,Iv=/-->/,Fv=/\?>/,Of=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Iv],[/^\s*<\?/,Fv],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,df],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,df]];function Kv(t,n,s){if(t.next!=60)return-1;let l=t.text.slice(t.pos);for(let i=0,u=Of.length-(s?1:0);i<u;i++)if(Of[i][0].test(l))return i;return-1}function k1(t,n){let s=t.countIndent(n,t.pos,t.indent),l=t.countIndent(t.skipSpace(n),n,s);return l>=s+5?s+1:l}function En(t,n,s){let l=t.length-1;l>=0&&t[l].to==n&&t[l].type==ae.CodeText?t[l].to=s:t.push(Te(ae.CodeText,n,s))}const _o={LinkReference:void 0,IndentedCode(t,n){let s=n.baseIndent+4;if(n.indent<s)return!1;let l=n.findColumn(s),i=t.lineStart+l,u=t.lineStart+n.text.length,d=[],f=[];for(En(d,i,u);t.nextLine()&&n.depth>=t.stack.length;)if(n.pos==n.text.length){En(f,t.lineStart-1,t.lineStart);for(let m of n.markers)f.push(m)}else{if(n.indent<s)break;{if(f.length){for(let p of f)p.type==ae.CodeText?En(d,p.from,p.to):d.push(p);f=[]}En(d,t.lineStart-1,t.lineStart);for(let p of n.markers)d.push(p);u=t.lineStart+n.text.length;let m=t.lineStart+n.findColumn(n.baseIndent+4);m<u&&En(d,m,u)}}return f.length&&(f=f.filter(m=>m.type!=ae.CodeText),f.length&&(n.markers=f.concat(n.markers))),t.addNode(t.buffer.writeElements(d,-i).finish(ae.CodeBlock,u-i),i),!0},FencedCode(t,n){let s=Lv(n);if(s<0)return!1;let l=t.lineStart+n.pos,i=n.next,u=s-n.pos,d=n.skipSpace(s),f=$1(n.text,n.text.length,d),m=[Te(ae.CodeMark,l,l+u)];d<f&&m.push(Te(ae.CodeInfo,t.lineStart+d,t.lineStart+f));for(let p=!0,x=!0,g=!1;t.nextLine()&&n.depth>=t.stack.length;p=!1){let b=n.pos;if(n.indent-n.baseIndent<4)for(;b<n.text.length&&n.text.charCodeAt(b)==i;)b++;if(b-n.pos>=u&&n.skipSpace(b)==n.text.length){for(let S of n.markers)m.push(S);x&&g&&En(m,t.lineStart-1,t.lineStart),m.push(Te(ae.CodeMark,t.lineStart+n.pos,t.lineStart+b)),t.nextLine();break}else{g=!0,p||(En(m,t.lineStart-1,t.lineStart),x=!1);for(let j of n.markers)m.push(j);let S=t.lineStart+n.basePos,w=t.lineStart+n.text.length;S<w&&(En(m,S,w),x=!1)}}return t.addNode(t.buffer.writeElements(m,-l).finish(ae.FencedCode,t.prevLineEnd()-l),l),!0},Blockquote(t,n){let s=Dv(n);return s<0?!1:(t.startContext(ae.Blockquote,n.pos),t.addNode(ae.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1),n.moveBase(n.pos+s),null)},HorizontalRule(t,n){if(ah(n,t,!1)<0)return!1;let s=t.lineStart+n.pos;return t.nextLine(),t.addNode(ae.HorizontalRule,s),!0},BulletList(t,n){let s=nh(n,t,!1);if(s<0)return!1;t.block.type!=ae.BulletList&&t.startContext(ae.BulletList,n.basePos,n.next);let l=k1(n,n.pos+1);return t.startContext(ae.ListItem,n.basePos,l-n.baseIndent),t.addNode(ae.ListMark,t.lineStart+n.pos,t.lineStart+n.pos+s),n.moveBaseColumn(l),null},OrderedList(t,n){let s=sh(n,t,!1);if(s<0)return!1;t.block.type!=ae.OrderedList&&t.startContext(ae.OrderedList,n.basePos,n.text.charCodeAt(n.pos+s-1));let l=k1(n,n.pos+s);return t.startContext(ae.ListItem,n.basePos,l-n.baseIndent),t.addNode(ae.ListMark,t.lineStart+n.pos,t.lineStart+n.pos+s),n.moveBaseColumn(l),null},ATXHeading(t,n){let s=Bv(n);if(s<0)return!1;let l=n.pos,i=t.lineStart+l,u=$1(n.text,n.text.length,l),d=u;for(;d>l&&n.text.charCodeAt(d-1)==n.next;)d--;(d==u||d==l||!oa(n.text.charCodeAt(d-1)))&&(d=n.text.length);let f=t.buffer.write(ae.HeaderMark,0,s).writeElements(t.parser.parseInline(n.text.slice(l+s+1,d),i+s+1),-i);d<n.text.length&&f.write(ae.HeaderMark,d-l,u-l);let m=f.finish(ae.ATXHeading1-1+s,n.text.length-l);return t.nextLine(),t.addNode(m,i),!0},HTMLBlock(t,n){let s=Kv(n,t,!1);if(s<0)return!1;let l=t.lineStart+n.pos,i=Of[s][1],u=[],d=i!=df;for(;!i.test(n.text)&&t.nextLine();){if(n.depth<t.stack.length){d=!1;break}for(let p of n.markers)u.push(p)}d&&t.nextLine();let f=i==Iv?ae.CommentBlock:i==Fv?ae.ProcessingInstructionBlock:ae.HTMLBlock,m=t.prevLineEnd();return t.addNode(t.buffer.writeElements(u,-l).finish(f,m-l),l),!0},SetextHeading:void 0};class Yz{constructor(n){this.stage=0,this.elts=[],this.pos=0,this.start=n.start,this.advance(n.content)}nextLine(n,s,l){if(this.stage==-1)return!1;let i=l.content+`
519
+ `+s.scrub(),u=this.advance(i);return u>-1&&u<i.length?this.complete(n,l,u):!1}finish(n,s){return(this.stage==2||this.stage==3)&&Mr(s.content,this.pos)==s.content.length?this.complete(n,s,s.content.length):!1}complete(n,s,l){return n.addLeafElement(s,Te(ae.LinkReference,this.start,this.start+l,this.elts)),!0}nextStage(n){return n?(this.pos=n.to-this.start,this.elts.push(n),this.stage++,!0):(n===!1&&(this.stage=-1),!1)}advance(n){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(oy(n,this.pos,this.start,!0)))return-1;if(n.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Te(ae.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ry(n,Mr(n,this.pos),this.start)))return-1}else if(this.stage==2){let s=Mr(n,this.pos),l=0;if(s>this.pos){let i=iy(n,s,this.start);if(i){let u=kO(n,i.to-this.start);u>0&&(this.nextStage(i),l=u)}}return l||(l=kO(n,this.pos)),l>0&&l<n.length?l:-1}else return kO(n,this.pos)}}}function kO(t,n){for(;n<t.length;n++){let s=t.charCodeAt(n);if(s==10)break;if(!oa(s))return-1}return n}class Vz{nextLine(n,s,l){let i=s.depth<n.stack.length?-1:Hv(s),u=s.next;if(i<0)return!1;let d=Te(ae.HeaderMark,n.lineStart+s.pos,n.lineStart+i);return n.nextLine(),n.addLeafElement(l,Te(u==61?ae.SetextHeading1:ae.SetextHeading2,l.start,n.prevLineEnd(),[...n.parser.parseInline(l.content,l.start),d])),!0}finish(){return!1}}const Jv={LinkReference(t,n){return n.content.charCodeAt(0)==91?new Yz(n):null},SetextHeading(){return new Vz}},Uz=[(t,n)=>Bv(n)>=0,(t,n)=>Lv(n)>=0,(t,n)=>Dv(n)>=0,(t,n)=>nh(n,t,!0)>=0,(t,n)=>sh(n,t,!0)>=0,(t,n)=>ah(n,t,!0)>=0,(t,n)=>Kv(n,t,!0)>=0],Gz={text:"",end:0};class Lz{constructor(n,s,l,i){this.parser=n,this.input=s,this.ranges=i,this.line=new Mz,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=xc.create(ae.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=l.length?new Bz(l,s):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:n}=this;for(;;){for(let l=0;;){let i=n.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;l<n.markers.length&&(!i||n.markers[l].from<i.end);){let u=n.markers[l++];this.addNode(u.type,u.from,u.to)}if(!i)break;this.finishContext()}if(n.pos<n.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(n.basePos))return null;e:for(;;){for(let l of this.parser.blockParsers)if(l){let i=l(this,n);if(i!=!1){if(i==!0)return null;n.forward();continue e}}break}let s=new qz(this.lineStart+n.pos,n.text.slice(n.pos));for(let l of this.parser.leafBlockParsers)if(l){let i=l(this,s);i&&s.parsers.push(i)}e:for(;this.nextLine()&&n.pos!=n.text.length;){if(n.indent<n.baseIndent+4){for(let l of this.parser.endLeafBlock)if(l(this,n,s))break e}for(let l of s.parsers)if(l.nextLine(this,n,s))return null;s.content+=`
520
+ `+n.scrub();for(let l of n.markers)s.marks.push(l)}return this.finishLeaf(s),null}stopAt(n){if(this.stoppedAt!=null&&this.stoppedAt<n)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=n}reuseFragment(n){if(!this.fragments.moveTo(this.absoluteLineStart+n,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let s=this.fragments.takeNodes(this);return s?(this.absoluteLineStart+=s,this.lineStart=cy(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(n=this.depth-1){return this.parser.nodeSet.types[this.stack[n].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(n){let s=Gz;if(s.end=n,n>=this.to)s.text="";else if(s.text=this.lineChunkAt(n),s.end+=s.text.length,this.ranges.length>1){let l=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<s.end;){i++;let u=this.ranges[i].from,d=this.lineChunkAt(u);s.end=u+d.length,s.text=s.text.slice(0,this.ranges[i-1].to-l)+d,l=s.end-s.text.length}}return s}readLine(){let{line:n}=this,{text:s,end:l}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=l,n.reset(s);n.depth<this.stack.length;n.depth++){let i=this.stack[n.depth],u=this.parser.skipContextMarkup[i.type];if(!u)throw new Error("Unhandled block context "+ae[i.type]);let d=this.line.markers.length;if(!u(i,this,n)){this.line.markers.length>d&&(i.end=this.line.markers[this.line.markers.length-1].to),n.forward();break}n.forward()}}lineChunkAt(n){let s=this.input.chunk(n),l;if(this.input.lineChunks)l=s==`
521
521
  `?"":s;else{let i=s.indexOf(`
522
- `);l=i<0?s:s.slice(0,i)}return n+l.length>this.to?l.slice(0,this.to-n):l}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(n,s,l=0){this.block=xc.create(n,l,this.lineStart+s,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(n,s,l=0){this.startContext(this.parser.getNodeType(n),s,l)}addNode(n,s,l){typeof n=="number"&&(n=new fa(this.parser.nodeSet.types[n],Nl,Nl,(l??this.prevLineEnd())-s)),this.block.addChild(n,s-this.block.from)}addElement(n){this.block.addChild(n.toTree(this.parser.nodeSet),n.from-this.block.from)}addLeafElement(n,s){this.addNode(this.buffer.writeElements(hf(s.children,n.marks),-s.from).finish(s.type,s.to-s.from),s.from)}finishContext(){let n=this.stack.pop(),s=this.stack[this.stack.length-1];s.addChild(n.toTree(this.parser.nodeSet),n.from-s.from),this.block=s}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(n){return this.ranges.length>1?ey(this.ranges,0,n.topNode,this.ranges[0].from,this.reusePlaceholders):n}finishLeaf(n){for(let l of n.parsers)if(l.finish(this,n))return;let s=hf(this.parser.parseInline(n.content,n.start),n.marks);this.addNode(this.buffer.writeElements(s,-n.start).finish(ae.Paragraph,n.content.length),n.start)}elt(n,s,l,i){return typeof n=="string"?Te(this.parser.getNodeType(n),s,l,i):new ny(n,s)}get buffer(){return new ay(this.parser.nodeSet)}}function ey(t,n,s,l,i){let u=t[n].to,d=[],f=[],m=s.from+l;function p(x,g){for(;g?x>=u:x>u;){let b=t[n+1].from-u;l+=b,x+=b,n++,u=t[n].to}}for(let x=s.firstChild;x;x=x.nextSibling){p(x.from+l,!0);let g=x.from+l,b,S=i.get(x.tree);S?b=S:x.to+l>u?(b=ey(t,n,x,l,i),p(x.to+l,!1)):b=x.toTree(),d.push(b),f.push(g-m)}return p(s.to+l,!1),new fa(s.type,d,f,s.to+l-m,s.tree?s.tree.propValues:void 0)}class Ec extends x0{constructor(n,s,l,i,u,d,f,m,p){super(),this.nodeSet=n,this.blockParsers=s,this.leafBlockParsers=l,this.blockNames=i,this.endLeafBlock=u,this.skipContextMarkup=d,this.inlineParsers=f,this.inlineNames=m,this.wrappers=p,this.nodeTypes=Object.create(null);for(let x of n.types)this.nodeTypes[x.name]=x.id}createParse(n,s,l){let i=new L4(this,n,s,l);for(let u of this.wrappers)i=u(i,n,s,l);return i}configure(n){let s=ff(n);if(!s)return this;let{nodeSet:l,skipContextMarkup:i}=this,u=this.blockParsers.slice(),d=this.leafBlockParsers.slice(),f=this.blockNames.slice(),m=this.inlineParsers.slice(),p=this.inlineNames.slice(),x=this.endLeafBlock.slice(),g=this.wrappers;if(Zr(s.defineNodes)){i=Object.assign({},i);let b=l.types.slice(),S;for(let w of s.defineNodes){let{name:j,block:$,composite:k,style:N}=typeof w=="string"?{name:w}:w;if(b.some(U=>U.name==j))continue;k&&(i[b.length]=(U,X,z)=>k(X,z,U.value));let R=b.length,A=k?["Block","BlockContext"]:$?R>=ae.ATXHeading1&&R<=ae.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;b.push(ei.define({id:R,name:j,props:A&&[[nn.group,A]]})),N&&(S||(S={}),Array.isArray(N)||N instanceof vj?S[j]=N:Object.assign(S,N))}l=new yf(b),S&&(l=l.extend($s(S)))}if(Zr(s.props)&&(l=l.extend(...s.props)),Zr(s.remove))for(let b of s.remove){let S=this.blockNames.indexOf(b),w=this.inlineNames.indexOf(b);S>-1&&(u[S]=d[S]=void 0),w>-1&&(m[w]=void 0)}if(Zr(s.parseBlock))for(let b of s.parseBlock){let S=f.indexOf(b.name);if(S>-1)u[S]=b.parse,d[S]=b.leaf;else{let w=b.before?Co(f,b.before):b.after?Co(f,b.after)+1:f.length-1;u.splice(w,0,b.parse),d.splice(w,0,b.leaf),f.splice(w,0,b.name)}b.endLeaf&&x.push(b.endLeaf)}if(Zr(s.parseInline))for(let b of s.parseInline){let S=p.indexOf(b.name);if(S>-1)m[S]=b.parse;else{let w=b.before?Co(p,b.before):b.after?Co(p,b.after)+1:p.length-1;m.splice(w,0,b.parse),p.splice(w,0,b.name)}}return s.wrap&&(g=g.concat(s.wrap)),new Ec(l,u,d,f,x,i,m,p,g)}getNodeType(n){let s=this.nodeTypes[n];if(s==null)throw new RangeError(`Unknown node type '${n}'`);return s}parseInline(n,s){let l=new lh(this,n,s);e:for(let i=s;i<l.end;){let u=l.char(i);for(let d of this.inlineParsers)if(d){let f=d(l,u,i);if(f>=0){i=f;continue e}}i++}return l.resolveMarkers(0)}}function Zr(t){return t!=null&&t.length>0}function ff(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let n=ff(t[0]);if(t.length==1)return n;let s=ff(t.slice(1));if(!s||!n)return n||s;let l=(d,f)=>(d||Nl).concat(f||Nl),i=n.wrap,u=s.wrap;return{props:l(n.props,s.props),defineNodes:l(n.defineNodes,s.defineNodes),parseBlock:l(n.parseBlock,s.parseBlock),parseInline:l(n.parseInline,s.parseInline),remove:l(n.remove,s.remove),wrap:i?u?(d,f,m,p)=>i(u(d,f,m,p),f,m,p):i:u}}function Co(t,n){let s=t.indexOf(n);if(s<0)throw new RangeError(`Position specified relative to unknown parser ${n}`);return s}let ty=[ei.none];for(let t=1,n;n=ae[t];t++)ty[t]=ei.define({id:t,name:n,props:t>=ae.Escape?[]:[[nn.group,t in Gv?["Block","BlockContext"]:["Block","LeafBlock"]]],top:n=="Document"});const Nl=[];class ay{constructor(n){this.nodeSet=n,this.content=[],this.nodes=[]}write(n,s,l,i=0){return this.content.push(n,s,l,4+i*4),this}writeElements(n,s=0){for(let l of n)l.writeTo(this,s);return this}finish(n,s){return fa.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:n,length:s})}}let Fr=class{constructor(n,s,l,i=Nl){this.type=n,this.from=s,this.to=l,this.children=i}writeTo(n,s){let l=n.content.length;n.writeElements(this.children,s),n.content.push(this.type,this.from+s,this.to+s,n.content.length+4-l)}toTree(n){return new ay(n).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class ny{constructor(n,s){this.tree=n,this.from=s}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Nl}writeTo(n,s){n.nodes.push(this.tree),n.content.push(n.nodes.length-1,this.from+s,this.to+s,-1)}toTree(){return this.tree}}function Te(t,n,s,l){return new Fr(t,n,s,l)}const sy={resolve:"Emphasis",mark:"EmphasisMark"},ly={resolve:"Emphasis",mark:"EmphasisMark"},gs={},gc={};class Ut{constructor(n,s,l,i){this.type=n,this.from=s,this.to=l,this.side=i}}const T1="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Kr=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Kr=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const TO={Escape(t,n,s){if(n!=92||s==t.end-1)return-1;let l=t.char(s+1);for(let i=0;i<T1.length;i++)if(T1.charCodeAt(i)==l)return t.append(Te(ae.Escape,s,s+2));return-1},Entity(t,n,s){if(n!=38)return-1;let l=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(s+1,s+31));return l?t.append(Te(ae.Entity,s,s+1+l[0].length)):-1},InlineCode(t,n,s){if(n!=96||s&&t.char(s-1)==96)return-1;let l=s+1;for(;l<t.end&&t.char(l)==96;)l++;let i=l-s,u=0;for(;l<t.end;l++)if(t.char(l)==96){if(u++,u==i&&t.char(l+1)!=96)return t.append(Te(ae.InlineCode,s,l+1,[Te(ae.CodeMark,s,s+i),Te(ae.CodeMark,l+1-i,l+1)]))}else u=0;return-1},HTMLTag(t,n,s){if(n!=60||s==t.end-1)return-1;let l=t.slice(s+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(l);if(i)return t.append(Te(ae.Autolink,s,s+1+i[0].length,[Te(ae.LinkMark,s,s+1),Te(ae.URL,s+1,s+i[0].length),Te(ae.LinkMark,s+i[0].length,s+1+i[0].length)]));let u=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(l);if(u)return t.append(Te(ae.Comment,s,s+1+u[0].length));let d=/^\?[^]*?\?>/.exec(l);if(d)return t.append(Te(ae.ProcessingInstruction,s,s+1+d[0].length));let f=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(l);return f?t.append(Te(ae.HTMLTag,s,s+1+f[0].length)):-1},Emphasis(t,n,s){if(n!=95&&n!=42)return-1;let l=s+1;for(;t.char(l)==n;)l++;let i=t.slice(s-1,s),u=t.slice(l,l+1),d=Kr.test(i),f=Kr.test(u),m=/\s|^$/.test(i),p=/\s|^$/.test(u),x=!p&&(!f||m||d),g=!m&&(!d||p||f),b=x&&(n==42||!g||d),S=g&&(n==42||!x||f);return t.append(new Ut(n==95?sy:ly,s,l,(b?1:0)|(S?2:0)))},HardBreak(t,n,s){if(n==92&&t.char(s+1)==10)return t.append(Te(ae.HardBreak,s,s+2));if(n==32){let l=s+1;for(;t.char(l)==32;)l++;if(t.char(l)==10&&l>=s+2)return t.append(Te(ae.HardBreak,s,l+1))}return-1},Link(t,n,s){return n==91?t.append(new Ut(gs,s,s+1,1)):-1},Image(t,n,s){return n==33&&t.char(s+1)==91?t.append(new Ut(gc,s,s+2,1)):-1},LinkEnd(t,n,s){if(n!=93)return-1;for(let l=t.parts.length-1;l>=0;l--){let i=t.parts[l];if(i instanceof Ut&&(i.type==gs||i.type==gc)){if(!i.side||t.skipSpace(i.to)==s&&!/[(\[]/.test(t.slice(s+1,s+2)))return t.parts[l]=null,-1;let u=t.takeContent(l),d=t.parts[l]=D4(t,u,i.type==gs?ae.Link:ae.Image,i.from,s+1);if(i.type==gs)for(let f=0;f<l;f++){let m=t.parts[f];m instanceof Ut&&m.type==gs&&(m.side=0)}return d.to}}return-1}};function D4(t,n,s,l,i){let{text:u}=t,d=t.char(i),f=i;if(n.unshift(Te(ae.LinkMark,l,l+(s==ae.Image?2:1))),n.push(Te(ae.LinkMark,i-1,i)),d==40){let m=t.skipSpace(i+1),p=ry(u,m-t.offset,t.offset),x;p&&(m=t.skipSpace(p.to),m!=p.to&&(x=iy(u,m-t.offset,t.offset),x&&(m=t.skipSpace(x.to)))),t.char(m)==41&&(n.push(Te(ae.LinkMark,i,i+1)),f=m+1,p&&n.push(p),x&&n.push(x),n.push(Te(ae.LinkMark,m,f)))}else if(d==91){let m=oy(u,i-t.offset,t.offset,!1);m&&(n.push(m),f=m.to)}return Te(s,l,f,n)}function ry(t,n,s){if(t.charCodeAt(n)==60){for(let i=n+1;i<t.length;i++){let u=t.charCodeAt(i);if(u==62)return Te(ae.URL,n+s,i+1+s);if(u==60||u==10)return!1}return null}else{let i=0,u=n;for(let d=!1;u<t.length;u++){let f=t.charCodeAt(u);if(oa(f))break;if(d)d=!1;else if(f==40)i++;else if(f==41){if(!i)break;i--}else f==92&&(d=!0)}return u>n?Te(ae.URL,n+s,u+s):u==t.length?null:!1}}function iy(t,n,s){let l=t.charCodeAt(n);if(l!=39&&l!=34&&l!=40)return!1;let i=l==40?41:l;for(let u=n+1,d=!1;u<t.length;u++){let f=t.charCodeAt(u);if(d)d=!1;else{if(f==i)return Te(ae.LinkTitle,n+s,u+1+s);f==92&&(d=!0)}}return null}function oy(t,n,s,l){for(let i=!1,u=n+1,d=Math.min(t.length,u+999);u<d;u++){let f=t.charCodeAt(u);if(i)i=!1;else{if(f==93)return l?!1:Te(ae.LinkLabel,n+s,u+1+s);if(l&&!oa(f)&&(l=!1),f==91)return!1;f==92&&(i=!0)}}return null}class lh{constructor(n,s,l){this.parser=n,this.text=s,this.offset=l,this.parts=[]}char(n){return n>=this.end?-1:this.text.charCodeAt(n-this.offset)}get end(){return this.offset+this.text.length}slice(n,s){return this.text.slice(n-this.offset,s-this.offset)}append(n){return this.parts.push(n),n.to}addDelimiter(n,s,l,i,u){return this.append(new Ut(n,s,l,(i?1:0)|(u?2:0)))}get hasOpenLink(){for(let n=this.parts.length-1;n>=0;n--){let s=this.parts[n];if(s instanceof Ut&&(s.type==gs||s.type==gc))return!0}return!1}addElement(n){return this.append(n)}resolveMarkers(n){for(let l=n;l<this.parts.length;l++){let i=this.parts[l];if(!(i instanceof Ut&&i.type.resolve&&i.side&2))continue;let u=i.type==sy||i.type==ly,d=i.to-i.from,f,m=l-1;for(;m>=n;m--){let j=this.parts[m];if(j instanceof Ut&&j.side&1&&j.type==i.type&&!(u&&(i.side&1||j.side&2)&&(j.to-j.from+d)%3==0&&((j.to-j.from)%3||d%3))){f=j;break}}if(!f)continue;let p=i.type.resolve,x=[],g=f.from,b=i.to;if(u){let j=Math.min(2,f.to-f.from,d);g=f.to-j,b=i.from+j,p=j==1?"Emphasis":"StrongEmphasis"}f.type.mark&&x.push(this.elt(f.type.mark,g,f.to));for(let j=m+1;j<l;j++)this.parts[j]instanceof Fr&&x.push(this.parts[j]),this.parts[j]=null;i.type.mark&&x.push(this.elt(i.type.mark,i.from,b));let S=this.elt(p,g,b,x);this.parts[m]=u&&f.from!=g?new Ut(f.type,f.from,g,f.side):null,(this.parts[l]=u&&i.to!=b?new Ut(i.type,b,i.to,i.side):null)?this.parts.splice(l,0,S):this.parts[l]=S}let s=[];for(let l=n;l<this.parts.length;l++){let i=this.parts[l];i instanceof Fr&&s.push(i)}return s}findOpeningDelimiter(n){for(let s=this.parts.length-1;s>=0;s--){let l=this.parts[s];if(l instanceof Ut&&l.type==n&&l.side&1)return s}return null}takeContent(n){let s=this.resolveMarkers(n);return this.parts.length=n,s}getDelimiterAt(n){let s=this.parts[n];return s instanceof Ut?s:null}skipSpace(n){return Mr(this.text,n-this.offset)+this.offset}elt(n,s,l,i){return typeof n=="string"?Te(this.parser.getNodeType(n),s,l,i):new ny(n,s)}}lh.linkStart=gs;lh.imageStart=gc;function hf(t,n){if(!n.length)return t;if(!t.length)return n;let s=t.slice(),l=0;for(let i of n){for(;l<s.length&&s[l].to<i.to;)l++;if(l<s.length&&s[l].from<i.from){let u=s[l];u instanceof Fr&&(s[l]=new Fr(u.type,u.from,u.to,hf(u.children,[i])))}else s.splice(l++,0,i)}return s}const W4=[ae.CodeBlock,ae.ListItem,ae.OrderedList,ae.BulletList];class B4{constructor(n,s){this.fragments=n,this.input=s,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,n.length&&(this.fragment=n[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(n,s){for(;this.fragment&&this.fragment.to<=n;)this.nextFragment();if(!this.fragment||this.fragment.from>(n?n-1:0))return!1;if(this.fragmentEnd<0){let u=this.fragment.to;for(;u>0&&this.input.read(u-1,u)!=`
523
- `;)u--;this.fragmentEnd=u?u-1:0}let l=this.cursor;l||(l=this.cursor=this.fragment.tree.cursor(),l.firstChild());let i=n+this.fragment.offset;for(;l.to<=i;)if(!l.parent())return!1;for(;;){if(l.from>=i)return this.fragment.from<=s;if(!l.childAfter(i))return!1}}matches(n){let s=this.cursor.tree;return s&&s.prop(nn.contextHash)==n}takeNodes(n){let s=this.cursor,l=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),u=n.absoluteLineStart,d=u,f=n.block.children.length,m=d,p=f;for(;;){if(s.to-l>i){if(s.type.isAnonymous&&s.firstChild())continue;break}let x=cy(s.from-l,n.ranges);if(s.to-l<=n.ranges[n.rangeI].to)n.addNode(s.tree,x);else{let g=new fa(n.parser.nodeSet.types[ae.Paragraph],[],[],0,n.block.hashProp);n.reusePlaceholders.set(g,s.tree),n.addNode(g,x)}if(s.type.is("Block")&&(W4.indexOf(s.type.id)<0?(d=s.to-l,f=n.block.children.length):(d=m,f=p),m=s.to-l,p=n.block.children.length),!s.nextSibling())break}for(;n.block.children.length>f;)n.block.children.pop(),n.block.positions.pop();return d-u}}function cy(t,n){let s=t;for(let l=1;l<n.length;l++){let i=n[l-1].to,u=n[l].from;i<t&&(s-=u-i)}return s}const H4=$s({"Blockquote/...":C.quote,HorizontalRule:C.contentSeparator,"ATXHeading1/... SetextHeading1/...":C.heading1,"ATXHeading2/... SetextHeading2/...":C.heading2,"ATXHeading3/...":C.heading3,"ATXHeading4/...":C.heading4,"ATXHeading5/...":C.heading5,"ATXHeading6/...":C.heading6,"Comment CommentBlock":C.comment,Escape:C.escape,Entity:C.character,"Emphasis/...":C.emphasis,"StrongEmphasis/...":C.strong,"Link/... Image/...":C.link,"OrderedList/... BulletList/...":C.list,"BlockQuote/...":C.quote,"InlineCode CodeText":C.monospace,"URL Autolink":C.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":C.processingInstruction,"CodeInfo LinkLabel":C.labelName,LinkTitle:C.string,Paragraph:C.content}),I4=new Ec(new yf(ty).extend(H4),Object.keys(_o).map(t=>_o[t]),Object.keys(_o).map(t=>Jv[t]),Object.keys(_o),U4,Gv,Object.keys(TO).map(t=>TO[t]),Object.keys(TO),[]);function F4(t,n,s){let l=[];for(let i=t.firstChild,u=n;;i=i.nextSibling){let d=i?i.from:s;if(d>u&&l.push({from:u,to:d}),!i)break;u=i.to}return l}function K4(t){let{codeParser:n,htmlParser:s}=t;return{wrap:S0((i,u)=>{let d=i.type.id;if(n&&(d==ae.CodeBlock||d==ae.FencedCode)){let f="";if(d==ae.FencedCode){let p=i.node.getChild(ae.CodeInfo);p&&(f=u.read(p.from,p.to))}let m=n(f);if(m)return{parser:m,overlay:p=>p.type.id==ae.CodeText,bracketed:d==ae.FencedCode}}else if(s&&(d==ae.HTMLBlock||d==ae.HTMLTag||d==ae.CommentBlock))return{parser:s,overlay:F4(i.node,i.from,i.to)};return null})}}const J4={resolve:"Strikethrough",mark:"StrikethroughMark"},ez={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":C.strikethrough}},{name:"StrikethroughMark",style:C.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,n,s){if(n!=126||t.char(s+1)!=126||t.char(s+2)==126)return-1;let l=t.slice(s-1,s),i=t.slice(s+2,s+3),u=/\s|^$/.test(l),d=/\s|^$/.test(i),f=Kr.test(l),m=Kr.test(i);return t.addDelimiter(J4,s,s+2,!d&&(!m||u||f),!u&&(!f||d||m))},after:"Emphasis"}]};function Yr(t,n,s=0,l,i=0){let u=0,d=!0,f=-1,m=-1,p=!1,x=()=>{l.push(t.elt("TableCell",i+f,i+m,t.parser.parseInline(n.slice(f,m),i+f)))};for(let g=s;g<n.length;g++){let b=n.charCodeAt(g);b==124&&!p?((!d||f>-1)&&u++,d=!1,l&&(f>-1&&x(),l.push(t.elt("TableDelimiter",g+i,g+i+1))),f=m=-1):(p||b!=32&&b!=9)&&(f<0&&(f=g),m=g+1),p=!p&&b==92}return f>-1&&(u++,l&&x()),u}function P1(t,n){for(let s=n;s<t.length;s++){let l=t.charCodeAt(s);if(l==124)return!0;l==92&&s++}return!1}const uy=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class N1{constructor(){this.rows=null}nextLine(n,s,l){if(this.rows==null){this.rows=!1;let i;if((s.next==45||s.next==58||s.next==124)&&uy.test(i=s.text.slice(s.pos))){let u=[];Yr(n,l.content,0,u,l.start)==Yr(n,i,s.pos)&&(this.rows=[n.elt("TableHeader",l.start,l.start+l.content.length,u),n.elt("TableDelimiter",n.lineStart+s.pos,n.lineStart+s.text.length)])}}else if(this.rows){let i=[];Yr(n,s.text,s.pos,i,n.lineStart),this.rows.push(n.elt("TableRow",n.lineStart+s.pos,n.lineStart+s.text.length,i))}return!1}finish(n,s){return this.rows?(n.addLeafElement(s,n.elt("Table",s.start,s.start+s.content.length,this.rows)),!0):!1}}const tz={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":C.heading}},"TableRow",{name:"TableCell",style:C.content},{name:"TableDelimiter",style:C.processingInstruction}],parseBlock:[{name:"Table",leaf(t,n){return P1(n.content,0)?new N1:null},endLeaf(t,n,s){if(s.parsers.some(i=>i instanceof N1)||!P1(n.text,n.basePos))return!1;let l=t.peekLine();return uy.test(l)&&Yr(t,n.text,n.basePos)==Yr(t,l,n.basePos)},before:"SetextHeading"}]};class az{nextLine(){return!1}finish(n,s){return n.addLeafElement(s,n.elt("Task",s.start,s.start+s.content.length,[n.elt("TaskMarker",s.start,s.start+3),...n.parser.parseInline(s.content.slice(3),s.start+3)])),!0}}const nz={defineNodes:[{name:"Task",block:!0,style:C.list},{name:"TaskMarker",style:C.atom}],parseBlock:[{name:"TaskList",leaf(t,n){return/^\[[ xX]\][ \t]/.test(n.content)&&t.parentType().name=="ListItem"?new az:null},after:"SetextHeading"}]},z1=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,R1=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,sz=/[\w-]+\.[\w-]+($|\/)/,X1=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,_1=/\/[a-zA-Z\d@.]+/gy;function C1(t,n,s,l){let i=0;for(let u=n;u<s;u++)t[u]==l&&i++;return i}function lz(t,n){R1.lastIndex=n;let s=R1.exec(t);if(!s||sz.exec(s[0])[0].indexOf("_")>-1)return-1;let l=n+s[0].length;for(;;){let i=t[l-1],u;if(/[?!.,:*_~]/.test(i)||i==")"&&C1(t,n,l,")")>C1(t,n,l,"("))l--;else if(i==";"&&(u=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(n,l))))l=n+u.index;else break}return l}function Z1(t,n){X1.lastIndex=n;let s=X1.exec(t);if(!s)return-1;let l=s[0][s[0].length-1];return l=="_"||l=="-"?-1:n+s[0].length-(l=="."?1:0)}const rz={parseInline:[{name:"Autolink",parse(t,n,s){let l=s-t.offset;if(l&&/\w/.test(t.text[l-1]))return-1;z1.lastIndex=l;let i=z1.exec(t.text),u=-1;if(!i)return-1;if(i[1]||i[2]){if(u=lz(t.text,l+i[0].length),u>-1&&t.hasOpenLink){let d=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(l,u));u=l+d[0].length}}else i[3]?u=Z1(t.text,l):(u=Z1(t.text,l+i[0].length),u>-1&&i[0]=="xmpp:"&&(_1.lastIndex=u,i=_1.exec(t.text),i&&(u=i.index+i[0].length)));return u<0?-1:(t.addElement(t.elt("URL",s,u+t.offset)),u+t.offset)}}]},iz=[tz,nz,ez,rz];function dy(t,n,s){return(l,i,u)=>{if(i!=t||l.char(u+1)==t)return-1;let d=[l.elt(s,u,u+1)];for(let f=u+1;f<l.end;f++){let m=l.char(f);if(m==t)return l.addElement(l.elt(n,u,f+1,d.concat(l.elt(s,f,f+1))));if(m==92&&d.push(l.elt("Escape",f,f+++2)),oa(m))break}return-1}}const oz={defineNodes:[{name:"Superscript",style:C.special(C.content)},{name:"SuperscriptMark",style:C.processingInstruction}],parseInline:[{name:"Superscript",parse:dy(94,"Superscript","SuperscriptMark")}]},cz={defineNodes:[{name:"Subscript",style:C.special(C.content)},{name:"SubscriptMark",style:C.processingInstruction}],parseInline:[{name:"Subscript",parse:dy(126,"Subscript","SubscriptMark")}]},uz={defineNodes:[{name:"Emoji",style:C.character}],parseInline:[{name:"Emoji",parse(t,n,s){let l;return n!=58||!(l=/^[a-zA-Z_0-9]+:/.exec(t.slice(s+1,t.end)))?-1:t.addElement(t.elt("Emoji",s,s+1+l[0].length))}}]},Oy=y0({commentTokens:{block:{open:"<!--",close:"-->"}}}),fy=new nn,hy=I4.configure({props:[ks.add(t=>!t.is("Block")||t.is("Document")||mf(t)!=null||dz(t)?void 0:(n,s)=>({from:s.doc.lineAt(n.from).to,to:n.to})),fy.add(mf),zl.add({Document:()=>null}),$j.add({Document:Oy})]});function mf(t){let n=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return n?+n[1]:void 0}function dz(t){return t.name=="OrderedList"||t.name=="BulletList"}function Oz(t,n){let s=t;for(;;){let l=s.nextSibling,i;if(!l||(i=mf(l.type))!=null&&i<=n)break;s=l}return s.to}const fz=Sj.of((t,n,s)=>{for(let l=pa(t).resolveInner(s,-1);l&&!(l.from<n);l=l.parent){let i=l.type.prop(fy);if(i==null)continue;let u=Oz(l,i);if(u>s)return{from:s,to:u}}return null});function rh(t){return new Qj(Oy,t,[],"markdown")}const hz=rh(hy),mz=hy.configure([iz,cz,oz,uz,{props:[ks.add({Table:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})})]}]),bc=rh(mz);function pz(t,n){return s=>{if(s&&t){let l=null;if(s=/\S*/.exec(s)[0],typeof t=="function"?l=t(s):l=hg.matchLanguageName(t,s,!0),l instanceof hg)return l.support?l.support.language.parser:kj.getSkippingParser(l.load());if(l)return l.parser}return n?n.parser:null}}let PO=class{constructor(n,s,l,i,u,d,f){this.node=n,this.from=s,this.to=l,this.spaceBefore=i,this.spaceAfter=u,this.type=d,this.item=f}blank(n,s=!0){let l=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(n!=null){for(;l.length<n;)l+=" ";return l}else{for(let i=this.to-this.from-l.length-this.spaceAfter.length;i>0;i--)l+=" ";return l+(s?this.spaceAfter:"")}}marker(n,s){let l=this.node.name=="OrderedList"?String(+py(this.item,n)[2]+s):"";return this.spaceBefore+l+this.type+this.spaceAfter}};function my(t,n){let s=[],l=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return l;(i.name=="ListItem"||i.name=="Blockquote")&&s.push(i)}for(let i=s.length-1;i>=0;i--){let u=s[i],d,f=n.lineAt(u.from),m=u.from-f.from;if(u.name=="Blockquote"&&(d=/^ *>( ?)/.exec(f.text.slice(m))))l.push(new PO(u,m,m+d[0].length,"",d[1],">",null));else if(u.name=="ListItem"&&u.parent.name=="OrderedList"&&(d=/^( *)\d+([.)])( *)/.exec(f.text.slice(m)))){let p=d[3],x=d[0].length;p.length>=4&&(p=p.slice(0,p.length-4),x-=4),l.push(new PO(u.parent,m,m+x,d[1],p,d[2],u))}else if(u.name=="ListItem"&&u.parent.name=="BulletList"&&(d=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(f.text.slice(m)))){let p=d[4],x=d[0].length;p.length>4&&(p=p.slice(0,p.length-4),x-=4);let g=d[2];d[3]&&(g+=d[3].replace(/[xX]/," ")),l.push(new PO(u.parent,m,m+x,d[1],p,g,u))}}return l}function py(t,n){return/^(\s*)(\d+)(?=[.)])/.exec(n.sliceString(t.from,t.from+10))}function NO(t,n,s,l=0){for(let i=-1,u=t;;){if(u.name=="ListItem"){let f=py(u,n),m=+f[2];if(i>=0){if(m!=i+1)return;s.push({from:u.from+f[1].length,to:u.from+f[0].length,insert:String(i+2+l)})}i=m}let d=u.nextSibling;if(!d)break;u=d}}function ih(t,n){let s=/^[ \t]*/.exec(t)[0].length;if(!s||n.facet(jj)!=" ")return t;let l=Vr(t,4,s),i="";for(let u=l;u>0;)u>=4?(i+=" ",u-=4):(i+=" ",u--);return i+t.slice(s)}const xz=(t={})=>({state:n,dispatch:s})=>{let l=pa(n),{doc:i}=n,u=null,d=n.changeByRange(f=>{if(!f.empty||!bc.isActiveAt(n,f.from,-1)&&!bc.isActiveAt(n,f.from,1))return u={range:f};let m=f.from,p=i.lineAt(m),x=my(l.resolveInner(m,-1),i);for(;x.length&&x[x.length-1].from>m-p.from;)x.pop();if(!x.length)return u={range:f};let g=x[x.length-1];if(g.to-g.spaceAfter.length>m-p.from)return u={range:f};let b=m>=g.to-g.spaceAfter.length&&!/\S/.test(p.text.slice(g.to));if(g.item&&b){let k=g.node.firstChild,N=g.node.getChild("ListItem","ListItem");if(k.to>=m||N&&N.to<m||p.from>0&&!/[^\s>]/.test(i.lineAt(p.from-1).text)||t.nonTightLists===!1){let R=x.length>1?x[x.length-2]:null,A,U="";R&&R.item?(A=p.from+R.from,U=R.marker(i,1)):A=p.from+(R?R.to:0);let X=[{from:A,to:m,insert:U}];return g.node.name=="OrderedList"&&NO(g.item,i,X,-2),R&&R.node.name=="OrderedList"&&NO(R.item,i,X),{range:Un.cursor(A+U.length),changes:X}}else{let R=E1(x,n,p);return{range:Un.cursor(m+R.length+1),changes:{from:p.from,insert:R+n.lineBreak}}}}if(g.node.name=="Blockquote"&&b&&p.from){let k=i.lineAt(p.from-1),N=/>\s*$/.exec(k.text);if(N&&N.index==g.from){let R=n.changes([{from:k.from+N.index,to:k.to},{from:p.from+g.from,to:p.to}]);return{range:f.map(R),changes:R}}}let S=[];g.node.name=="OrderedList"&&NO(g.item,i,S);let w=g.item&&g.item.from<p.from,j="";if(!w||/^[\s\d.)\-+*>]*/.exec(p.text)[0].length>=g.to)for(let k=0,N=x.length-1;k<=N;k++)j+=k==N&&!w?x[k].marker(i,1):x[k].blank(k<N?Vr(p.text,4,x[k+1].from)-j.length:null);let $=m;for(;$>p.from&&/\s/.test(p.text.charAt($-p.from-1));)$--;return j=ih(j,n),bz(g.node,n.doc)&&(j=E1(x,n,p)+n.lineBreak+j),S.push({from:$,to:m,insert:n.lineBreak+j}),{range:Un.cursor($+j.length+1),changes:S}});return u?!1:(s(n.update(d,{scrollIntoView:!0,userEvent:"input"})),!0)},gz=xz();function A1(t){return t.name=="QuoteMark"||t.name=="ListMark"}function bz(t,n){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let s=t.firstChild,l=t.getChild("ListItem","ListItem");if(!l)return!1;let i=n.lineAt(s.to),u=n.lineAt(l.from),d=/^[\s>]*$/.test(i.text);return i.number+(d?0:1)<u.number}function E1(t,n,s){let l="";for(let i=0,u=t.length-2;i<=u;i++)l+=t[i].blank(i<u?Vr(s.text,4,t[i+1].from)-l.length:null,i<u);return ih(l,n)}function vz(t,n){let s=t.resolveInner(n,-1),l=n;A1(s)&&(l=s.from,s=s.parent);for(let i;i=s.childBefore(l);)if(A1(i))l=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")s=i.lastChild,l=s.to;else break;return s}const yz=({state:t,dispatch:n})=>{let s=pa(t),l=null,i=t.changeByRange(u=>{let d=u.from,{doc:f}=t;if(u.empty&&bc.isActiveAt(t,u.from)){let m=f.lineAt(d),p=my(vz(s,d),f);if(p.length){let x=p[p.length-1],g=x.to-x.spaceAfter.length+(x.spaceAfter?1:0);if(d-m.from>g&&!/\S/.test(m.text.slice(g,d-m.from)))return{range:Un.cursor(m.from+g),changes:{from:m.from+g,to:d}};if(d-m.from==g&&(!x.item||m.from<=x.item.from||!/\S/.test(m.text.slice(0,x.to)))){let b=m.from+x.from;if(x.item&&x.node.from<x.item.from&&/\S/.test(m.text.slice(x.from,x.to))){let S=x.blank(Vr(m.text,4,x.to)-Vr(m.text,4,x.from));return b==m.from&&(S=ih(S,t)),{range:Un.cursor(b+S.length),changes:{from:b,to:m.from+x.to,insert:S}}}if(b<d)return{range:Un.cursor(b),changes:{from:b,to:d}}}}}return l={range:u}});return l?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},Sz=[{key:"Enter",run:gz},{key:"Backspace",run:yz}],xy=Uv({matchClosingTags:!1});function Qz(t={}){let{codeLanguages:n,defaultCodeLanguage:s,addKeymap:l=!0,base:{parser:i}=hz,completeHTMLTags:u=!0,pasteURLAsLink:d=!0,htmlTagLanguage:f=xy}=t;if(!(i instanceof Ec))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let m=t.extensions?[t.extensions]:[],p=[f.support,fz],x;d&&p.push(kz),s instanceof vs?(p.push(s.support),x=s.language):s&&(x=s);let g=n||x?pz(n,x):void 0;m.push(K4({codeParser:g,htmlParser:f.language.parser})),l&&p.push(yj.high(BO.of(Sz)));let b=rh(i.configure(m));return u&&p.push(b.data.of({autocomplete:jz})),new vs(b,p)}function jz(t){let{state:n,pos:s}=t,l=/<[:\-\.\w\u00b7-\uffff]*$/.exec(n.sliceDoc(s-25,s));if(!l)return null;let i=pa(n).resolveInner(s,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:s-l[0].length,to:s,options:wz(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let zO=null;function wz(){if(zO)return zO;let t=z4(new wj(Q0.create({extensions:xy}),0,!0));return zO=t?t.options:[]}const $z=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,kz=jl.domEventHandlers({paste:(t,n)=>{var s;let{main:l}=n.state.selection;if(l.empty)return!1;let i=(s=t.clipboardData)===null||s===void 0?void 0:s.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!bc.isActiveAt(n.state,l.from,1)))return!1;let u=pa(n.state),d=!1;return u.iterate({from:l.from,to:l.to,enter:f=>{(f.from>l.from||$z.test(f.name))&&(d=!0)},leave:f=>{f.to<l.to&&(d=!0)}}),d?!1:(n.dispatch({changes:[{from:l.from,insert:"["},{from:l.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Tz=1,gy=194,by=195,Pz=196,q1=197,Nz=198,zz=199,Rz=200,Xz=2,vy=3,M1=201,_z=24,Cz=25,Zz=49,Az=50,Ez=55,qz=56,Mz=57,Yz=59,Vz=60,Uz=61,Gz=62,Lz=63,Dz=65,Wz=238,Bz=71,Hz=241,Iz=242,Fz=243,Kz=244,Jz=245,eR=246,tR=247,aR=248,yy=72,nR=249,sR=250,lR=251,rR=252,iR=253,oR=254,cR=255,uR=256,dR=73,OR=77,fR=263,hR=112,mR=130,pR=151,xR=152,gR=155,js=10,Jr=13,oh=32,qc=9,ch=35,bR=40,vR=46,pf=123,Y1=125,Sy=39,Qy=34,V1=92,yR=111,SR=120,QR=78,jR=117,wR=85,$R=new Set([Cz,Zz,Az,fR,Dz,mR,qz,Mz,Wz,Gz,Lz,yy,dR,OR,Vz,Uz,pR,xR,gR,hR]);function RO(t){return t==js||t==Jr}function XO(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const kR=new xt((t,n)=>{let s;if(t.next<0)t.acceptToken(zz);else if(n.context.flags&Bo)RO(t.next)&&t.acceptToken(Nz,1);else if(((s=t.peek(-1))<0||RO(s))&&n.canShift(q1)){let l=0;for(;t.next==oh||t.next==qc;)t.advance(),l++;(t.next==js||t.next==Jr||t.next==ch)&&t.acceptToken(q1,-l)}else RO(t.next)&&t.acceptToken(Pz,1)},{contextual:!0}),TR=new xt((t,n)=>{let s=n.context;if(s.flags)return;let l=t.peek(-1);if(l==js||l==Jr){let i=0,u=0;for(;;){if(t.next==oh)i++;else if(t.next==qc)i+=8-i%8;else break;t.advance(),u++}i!=s.indent&&t.next!=js&&t.next!=Jr&&t.next!=ch&&(i<s.indent?t.acceptToken(by,-u):t.acceptToken(gy))}}),Bo=1,jy=2,Ka=4,Ja=8,en=16,tn=32;function Ho(t,n,s){this.parent=t,this.indent=n,this.flags=s,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+s+(s<<6)}const PR=new Ho(null,0,0);function NR(t){let n=0;for(let s=0;s<t.length;s++)n+=t.charCodeAt(s)==qc?8-n%8:1;return n}const U1=new Map([[Hz,0],[Iz,Ka],[Fz,Ja],[Kz,Ja|Ka],[Jz,en],[eR,en|Ka],[tR,en|Ja],[aR,en|Ja|Ka],[nR,tn],[sR,tn|Ka],[lR,tn|Ja],[rR,tn|Ja|Ka],[iR,tn|en],[oR,tn|en|Ka],[cR,tn|en|Ja],[uR,tn|en|Ja|Ka]].map(([t,n])=>[t,n|jy])),zR=new If({start:PR,reduce(t,n,s,l){return t.flags&Bo&&$R.has(n)||(n==Bz||n==yy)&&t.flags&jy?t.parent:t},shift(t,n,s,l){return n==gy?new Ho(t,NR(l.read(l.pos,s.pos)),0):n==by?t.parent:n==_z||n==Ez||n==Yz||n==vy?new Ho(t,0,Bo):U1.has(n)?new Ho(t,0,U1.get(n)|t.flags&Bo):t},hash(t){return t.hash}}),RR=new xt(t=>{for(let n=0;n<5;n++){if(t.next!="print".charCodeAt(n))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let n=0;;n++){let s=t.peek(n);if(!(s==oh||s==qc)){s!=bR&&s!=vR&&s!=js&&s!=Jr&&s!=ch&&t.acceptToken(Tz);return}}}),XR=new xt((t,n)=>{let{flags:s}=n.context,l=s&Ka?Qy:Sy,i=(s&Ja)>0,u=!(s&en),d=(s&tn)>0,f=t.pos;for(;!(t.next<0);)if(d&&t.next==pf)if(t.peek(1)==pf)t.advance(2);else{if(t.pos==f){t.acceptToken(vy,1);return}break}else if(u&&t.next==V1){if(t.pos==f){t.advance();let m=t.next;m>=0&&(t.advance(),_R(t,m)),t.acceptToken(Xz);return}break}else if(t.next==V1&&!u&&t.peek(1)>-1)t.advance(2);else if(t.next==l&&(!i||t.peek(1)==l&&t.peek(2)==l)){if(t.pos==f){t.acceptToken(M1,i?3:1);return}break}else if(t.next==js){if(i)t.advance();else if(t.pos==f){t.acceptToken(M1);return}break}else t.advance();t.pos>f&&t.acceptToken(Rz)});function _R(t,n){if(n==yR)for(let s=0;s<2&&t.next>=48&&t.next<=55;s++)t.advance();else if(n==SR)for(let s=0;s<2&&XO(t.next);s++)t.advance();else if(n==jR)for(let s=0;s<4&&XO(t.next);s++)t.advance();else if(n==wR)for(let s=0;s<8&&XO(t.next);s++)t.advance();else if(n==QR&&t.next==pf){for(t.advance();t.next>=0&&t.next!=Y1&&t.next!=Sy&&t.next!=Qy&&t.next!=js;)t.advance();t.next==Y1&&t.advance()}}const CR=$s({'async "*" "**" FormatConversion FormatSpec':C.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":C.controlKeyword,"in not and or is del":C.operatorKeyword,"from def class global nonlocal lambda":C.definitionKeyword,import:C.moduleKeyword,"with as print":C.keyword,Boolean:C.bool,None:C.null,VariableName:C.variableName,"CallExpression/VariableName":C.function(C.variableName),"FunctionDefinition/VariableName":C.function(C.definition(C.variableName)),"ClassDefinition/VariableName":C.definition(C.className),PropertyName:C.propertyName,"CallExpression/MemberExpression/PropertyName":C.function(C.propertyName),Comment:C.lineComment,Number:C.number,String:C.string,FormatString:C.special(C.string),Escape:C.escape,UpdateOp:C.updateOperator,"ArithOp!":C.arithmeticOperator,BitOp:C.bitwiseOperator,CompareOp:C.compareOperator,AssignOp:C.definitionOperator,Ellipsis:C.punctuation,At:C.meta,"( )":C.paren,"[ ]":C.squareBracket,"{ }":C.brace,".":C.derefOperator,", ;":C.separator}),ZR={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},AR=Bn.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOO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m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:zR,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,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`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[RR,TR,kR,XR,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>ZR[t]||-1}],tokenPrec:7668}),G1=new Sf,wy=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Zo(t){return(n,s,l)=>{if(l)return!1;let i=n.node.getChild("VariableName");return i&&s(i,t),!0}}const ER={FunctionDefinition:Zo("function"),ClassDefinition:Zo("class"),ForStatement(t,n,s){if(s){for(let l=t.node.firstChild;l;l=l.nextSibling)if(l.name=="VariableName")n(l,"variable");else if(l.name=="in")break}},ImportStatement(t,n){var s,l;let{node:i}=t,u=((s=i.firstChild)===null||s===void 0?void 0:s.name)=="from";for(let d=i.getChild("import");d;d=d.nextSibling)d.name=="VariableName"&&((l=d.nextSibling)===null||l===void 0?void 0:l.name)!="as"&&n(d,u?"variable":"namespace")},AssignStatement(t,n){for(let s=t.node.firstChild;s;s=s.nextSibling)if(s.name=="VariableName")n(s,"variable");else if(s.name==":"||s.name=="AssignOp")break},ParamList(t,n){for(let s=null,l=t.node.firstChild;l;l=l.nextSibling)l.name=="VariableName"&&(!s||!/\*|AssignOp/.test(s.name))&&n(l,"variable"),s=l},CapturePattern:Zo("variable"),AsPattern:Zo("variable"),__proto__:null};function $y(t,n){let s=G1.get(n);if(s)return s;let l=[],i=!0;function u(d,f){let m=t.sliceString(d.from,d.to);l.push({label:m,type:f})}return n.cursor(yc.IncludeAnonymous).iterate(d=>{if(d.name){let f=ER[d.name];if(f&&f(d,u,i)||!i&&wy.has(d.name))return!1;i=!1}else if(d.to-d.from>8192){for(let f of $y(t,d.node))l.push(f);return!1}}),G1.set(n,l),l}const L1=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,ky=["String","FormatString","Comment","PropertyName"];function qR(t){let n=pa(t.state).resolveInner(t.pos,-1);if(ky.indexOf(n.name)>-1)return null;let s=n.name=="VariableName"||n.to-n.from<20&&L1.test(t.state.sliceDoc(n.from,n.to));if(!s&&!t.explicit)return null;let l=[];for(let i=n;i;i=i.parent)wy.has(i.name)&&(l=l.concat($y(t.state.doc,i)));return{options:l,from:s?n.from:t.pos,validFor:L1}}const MR=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),YR=[He("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),He("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),He("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),He("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),He(`if \${}:
522
+ `);l=i<0?s:s.slice(0,i)}return n+l.length>this.to?l.slice(0,this.to-n):l}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(n,s,l=0){this.block=xc.create(n,l,this.lineStart+s,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(n,s,l=0){this.startContext(this.parser.getNodeType(n),s,l)}addNode(n,s,l){typeof n=="number"&&(n=new fa(this.parser.nodeSet.types[n],Nl,Nl,(l??this.prevLineEnd())-s)),this.block.addChild(n,s-this.block.from)}addElement(n){this.block.addChild(n.toTree(this.parser.nodeSet),n.from-this.block.from)}addLeafElement(n,s){this.addNode(this.buffer.writeElements(hf(s.children,n.marks),-s.from).finish(s.type,s.to-s.from),s.from)}finishContext(){let n=this.stack.pop(),s=this.stack[this.stack.length-1];s.addChild(n.toTree(this.parser.nodeSet),n.from-s.from),this.block=s}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(n){return this.ranges.length>1?ey(this.ranges,0,n.topNode,this.ranges[0].from,this.reusePlaceholders):n}finishLeaf(n){for(let l of n.parsers)if(l.finish(this,n))return;let s=hf(this.parser.parseInline(n.content,n.start),n.marks);this.addNode(this.buffer.writeElements(s,-n.start).finish(ae.Paragraph,n.content.length),n.start)}elt(n,s,l,i){return typeof n=="string"?Te(this.parser.getNodeType(n),s,l,i):new ny(n,s)}get buffer(){return new ay(this.parser.nodeSet)}}function ey(t,n,s,l,i){let u=t[n].to,d=[],f=[],m=s.from+l;function p(x,g){for(;g?x>=u:x>u;){let b=t[n+1].from-u;l+=b,x+=b,n++,u=t[n].to}}for(let x=s.firstChild;x;x=x.nextSibling){p(x.from+l,!0);let g=x.from+l,b,S=i.get(x.tree);S?b=S:x.to+l>u?(b=ey(t,n,x,l,i),p(x.to+l,!1)):b=x.toTree(),d.push(b),f.push(g-m)}return p(s.to+l,!1),new fa(s.type,d,f,s.to+l-m,s.tree?s.tree.propValues:void 0)}class Ec extends x0{constructor(n,s,l,i,u,d,f,m,p){super(),this.nodeSet=n,this.blockParsers=s,this.leafBlockParsers=l,this.blockNames=i,this.endLeafBlock=u,this.skipContextMarkup=d,this.inlineParsers=f,this.inlineNames=m,this.wrappers=p,this.nodeTypes=Object.create(null);for(let x of n.types)this.nodeTypes[x.name]=x.id}createParse(n,s,l){let i=new Lz(this,n,s,l);for(let u of this.wrappers)i=u(i,n,s,l);return i}configure(n){let s=ff(n);if(!s)return this;let{nodeSet:l,skipContextMarkup:i}=this,u=this.blockParsers.slice(),d=this.leafBlockParsers.slice(),f=this.blockNames.slice(),m=this.inlineParsers.slice(),p=this.inlineNames.slice(),x=this.endLeafBlock.slice(),g=this.wrappers;if(Zr(s.defineNodes)){i=Object.assign({},i);let b=l.types.slice(),S;for(let w of s.defineNodes){let{name:j,block:$,composite:k,style:N}=typeof w=="string"?{name:w}:w;if(b.some(U=>U.name==j))continue;k&&(i[b.length]=(U,X,z)=>k(X,z,U.value));let R=b.length,A=k?["Block","BlockContext"]:$?R>=ae.ATXHeading1&&R<=ae.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;b.push(ei.define({id:R,name:j,props:A&&[[nn.group,A]]})),N&&(S||(S={}),Array.isArray(N)||N instanceof vj?S[j]=N:Object.assign(S,N))}l=new yf(b),S&&(l=l.extend($s(S)))}if(Zr(s.props)&&(l=l.extend(...s.props)),Zr(s.remove))for(let b of s.remove){let S=this.blockNames.indexOf(b),w=this.inlineNames.indexOf(b);S>-1&&(u[S]=d[S]=void 0),w>-1&&(m[w]=void 0)}if(Zr(s.parseBlock))for(let b of s.parseBlock){let S=f.indexOf(b.name);if(S>-1)u[S]=b.parse,d[S]=b.leaf;else{let w=b.before?Co(f,b.before):b.after?Co(f,b.after)+1:f.length-1;u.splice(w,0,b.parse),d.splice(w,0,b.leaf),f.splice(w,0,b.name)}b.endLeaf&&x.push(b.endLeaf)}if(Zr(s.parseInline))for(let b of s.parseInline){let S=p.indexOf(b.name);if(S>-1)m[S]=b.parse;else{let w=b.before?Co(p,b.before):b.after?Co(p,b.after)+1:p.length-1;m.splice(w,0,b.parse),p.splice(w,0,b.name)}}return s.wrap&&(g=g.concat(s.wrap)),new Ec(l,u,d,f,x,i,m,p,g)}getNodeType(n){let s=this.nodeTypes[n];if(s==null)throw new RangeError(`Unknown node type '${n}'`);return s}parseInline(n,s){let l=new lh(this,n,s);e:for(let i=s;i<l.end;){let u=l.char(i);for(let d of this.inlineParsers)if(d){let f=d(l,u,i);if(f>=0){i=f;continue e}}i++}return l.resolveMarkers(0)}}function Zr(t){return t!=null&&t.length>0}function ff(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let n=ff(t[0]);if(t.length==1)return n;let s=ff(t.slice(1));if(!s||!n)return n||s;let l=(d,f)=>(d||Nl).concat(f||Nl),i=n.wrap,u=s.wrap;return{props:l(n.props,s.props),defineNodes:l(n.defineNodes,s.defineNodes),parseBlock:l(n.parseBlock,s.parseBlock),parseInline:l(n.parseInline,s.parseInline),remove:l(n.remove,s.remove),wrap:i?u?(d,f,m,p)=>i(u(d,f,m,p),f,m,p):i:u}}function Co(t,n){let s=t.indexOf(n);if(s<0)throw new RangeError(`Position specified relative to unknown parser ${n}`);return s}let ty=[ei.none];for(let t=1,n;n=ae[t];t++)ty[t]=ei.define({id:t,name:n,props:t>=ae.Escape?[]:[[nn.group,t in Gv?["Block","BlockContext"]:["Block","LeafBlock"]]],top:n=="Document"});const Nl=[];class ay{constructor(n){this.nodeSet=n,this.content=[],this.nodes=[]}write(n,s,l,i=0){return this.content.push(n,s,l,4+i*4),this}writeElements(n,s=0){for(let l of n)l.writeTo(this,s);return this}finish(n,s){return fa.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:n,length:s})}}let Fr=class{constructor(n,s,l,i=Nl){this.type=n,this.from=s,this.to=l,this.children=i}writeTo(n,s){let l=n.content.length;n.writeElements(this.children,s),n.content.push(this.type,this.from+s,this.to+s,n.content.length+4-l)}toTree(n){return new ay(n).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class ny{constructor(n,s){this.tree=n,this.from=s}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Nl}writeTo(n,s){n.nodes.push(this.tree),n.content.push(n.nodes.length-1,this.from+s,this.to+s,-1)}toTree(){return this.tree}}function Te(t,n,s,l){return new Fr(t,n,s,l)}const sy={resolve:"Emphasis",mark:"EmphasisMark"},ly={resolve:"Emphasis",mark:"EmphasisMark"},gs={},gc={};class Ut{constructor(n,s,l,i){this.type=n,this.from=s,this.to=l,this.side=i}}const T1="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Kr=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Kr=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const TO={Escape(t,n,s){if(n!=92||s==t.end-1)return-1;let l=t.char(s+1);for(let i=0;i<T1.length;i++)if(T1.charCodeAt(i)==l)return t.append(Te(ae.Escape,s,s+2));return-1},Entity(t,n,s){if(n!=38)return-1;let l=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(s+1,s+31));return l?t.append(Te(ae.Entity,s,s+1+l[0].length)):-1},InlineCode(t,n,s){if(n!=96||s&&t.char(s-1)==96)return-1;let l=s+1;for(;l<t.end&&t.char(l)==96;)l++;let i=l-s,u=0;for(;l<t.end;l++)if(t.char(l)==96){if(u++,u==i&&t.char(l+1)!=96)return t.append(Te(ae.InlineCode,s,l+1,[Te(ae.CodeMark,s,s+i),Te(ae.CodeMark,l+1-i,l+1)]))}else u=0;return-1},HTMLTag(t,n,s){if(n!=60||s==t.end-1)return-1;let l=t.slice(s+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(l);if(i)return t.append(Te(ae.Autolink,s,s+1+i[0].length,[Te(ae.LinkMark,s,s+1),Te(ae.URL,s+1,s+i[0].length),Te(ae.LinkMark,s+i[0].length,s+1+i[0].length)]));let u=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(l);if(u)return t.append(Te(ae.Comment,s,s+1+u[0].length));let d=/^\?[^]*?\?>/.exec(l);if(d)return t.append(Te(ae.ProcessingInstruction,s,s+1+d[0].length));let f=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(l);return f?t.append(Te(ae.HTMLTag,s,s+1+f[0].length)):-1},Emphasis(t,n,s){if(n!=95&&n!=42)return-1;let l=s+1;for(;t.char(l)==n;)l++;let i=t.slice(s-1,s),u=t.slice(l,l+1),d=Kr.test(i),f=Kr.test(u),m=/\s|^$/.test(i),p=/\s|^$/.test(u),x=!p&&(!f||m||d),g=!m&&(!d||p||f),b=x&&(n==42||!g||d),S=g&&(n==42||!x||f);return t.append(new Ut(n==95?sy:ly,s,l,(b?1:0)|(S?2:0)))},HardBreak(t,n,s){if(n==92&&t.char(s+1)==10)return t.append(Te(ae.HardBreak,s,s+2));if(n==32){let l=s+1;for(;t.char(l)==32;)l++;if(t.char(l)==10&&l>=s+2)return t.append(Te(ae.HardBreak,s,l+1))}return-1},Link(t,n,s){return n==91?t.append(new Ut(gs,s,s+1,1)):-1},Image(t,n,s){return n==33&&t.char(s+1)==91?t.append(new Ut(gc,s,s+2,1)):-1},LinkEnd(t,n,s){if(n!=93)return-1;for(let l=t.parts.length-1;l>=0;l--){let i=t.parts[l];if(i instanceof Ut&&(i.type==gs||i.type==gc)){if(!i.side||t.skipSpace(i.to)==s&&!/[(\[]/.test(t.slice(s+1,s+2)))return t.parts[l]=null,-1;let u=t.takeContent(l),d=t.parts[l]=Dz(t,u,i.type==gs?ae.Link:ae.Image,i.from,s+1);if(i.type==gs)for(let f=0;f<l;f++){let m=t.parts[f];m instanceof Ut&&m.type==gs&&(m.side=0)}return d.to}}return-1}};function Dz(t,n,s,l,i){let{text:u}=t,d=t.char(i),f=i;if(n.unshift(Te(ae.LinkMark,l,l+(s==ae.Image?2:1))),n.push(Te(ae.LinkMark,i-1,i)),d==40){let m=t.skipSpace(i+1),p=ry(u,m-t.offset,t.offset),x;p&&(m=t.skipSpace(p.to),m!=p.to&&(x=iy(u,m-t.offset,t.offset),x&&(m=t.skipSpace(x.to)))),t.char(m)==41&&(n.push(Te(ae.LinkMark,i,i+1)),f=m+1,p&&n.push(p),x&&n.push(x),n.push(Te(ae.LinkMark,m,f)))}else if(d==91){let m=oy(u,i-t.offset,t.offset,!1);m&&(n.push(m),f=m.to)}return Te(s,l,f,n)}function ry(t,n,s){if(t.charCodeAt(n)==60){for(let i=n+1;i<t.length;i++){let u=t.charCodeAt(i);if(u==62)return Te(ae.URL,n+s,i+1+s);if(u==60||u==10)return!1}return null}else{let i=0,u=n;for(let d=!1;u<t.length;u++){let f=t.charCodeAt(u);if(oa(f))break;if(d)d=!1;else if(f==40)i++;else if(f==41){if(!i)break;i--}else f==92&&(d=!0)}return u>n?Te(ae.URL,n+s,u+s):u==t.length?null:!1}}function iy(t,n,s){let l=t.charCodeAt(n);if(l!=39&&l!=34&&l!=40)return!1;let i=l==40?41:l;for(let u=n+1,d=!1;u<t.length;u++){let f=t.charCodeAt(u);if(d)d=!1;else{if(f==i)return Te(ae.LinkTitle,n+s,u+1+s);f==92&&(d=!0)}}return null}function oy(t,n,s,l){for(let i=!1,u=n+1,d=Math.min(t.length,u+999);u<d;u++){let f=t.charCodeAt(u);if(i)i=!1;else{if(f==93)return l?!1:Te(ae.LinkLabel,n+s,u+1+s);if(l&&!oa(f)&&(l=!1),f==91)return!1;f==92&&(i=!0)}}return null}class lh{constructor(n,s,l){this.parser=n,this.text=s,this.offset=l,this.parts=[]}char(n){return n>=this.end?-1:this.text.charCodeAt(n-this.offset)}get end(){return this.offset+this.text.length}slice(n,s){return this.text.slice(n-this.offset,s-this.offset)}append(n){return this.parts.push(n),n.to}addDelimiter(n,s,l,i,u){return this.append(new Ut(n,s,l,(i?1:0)|(u?2:0)))}get hasOpenLink(){for(let n=this.parts.length-1;n>=0;n--){let s=this.parts[n];if(s instanceof Ut&&(s.type==gs||s.type==gc))return!0}return!1}addElement(n){return this.append(n)}resolveMarkers(n){for(let l=n;l<this.parts.length;l++){let i=this.parts[l];if(!(i instanceof Ut&&i.type.resolve&&i.side&2))continue;let u=i.type==sy||i.type==ly,d=i.to-i.from,f,m=l-1;for(;m>=n;m--){let j=this.parts[m];if(j instanceof Ut&&j.side&1&&j.type==i.type&&!(u&&(i.side&1||j.side&2)&&(j.to-j.from+d)%3==0&&((j.to-j.from)%3||d%3))){f=j;break}}if(!f)continue;let p=i.type.resolve,x=[],g=f.from,b=i.to;if(u){let j=Math.min(2,f.to-f.from,d);g=f.to-j,b=i.from+j,p=j==1?"Emphasis":"StrongEmphasis"}f.type.mark&&x.push(this.elt(f.type.mark,g,f.to));for(let j=m+1;j<l;j++)this.parts[j]instanceof Fr&&x.push(this.parts[j]),this.parts[j]=null;i.type.mark&&x.push(this.elt(i.type.mark,i.from,b));let S=this.elt(p,g,b,x);this.parts[m]=u&&f.from!=g?new Ut(f.type,f.from,g,f.side):null,(this.parts[l]=u&&i.to!=b?new Ut(i.type,b,i.to,i.side):null)?this.parts.splice(l,0,S):this.parts[l]=S}let s=[];for(let l=n;l<this.parts.length;l++){let i=this.parts[l];i instanceof Fr&&s.push(i)}return s}findOpeningDelimiter(n){for(let s=this.parts.length-1;s>=0;s--){let l=this.parts[s];if(l instanceof Ut&&l.type==n&&l.side&1)return s}return null}takeContent(n){let s=this.resolveMarkers(n);return this.parts.length=n,s}getDelimiterAt(n){let s=this.parts[n];return s instanceof Ut?s:null}skipSpace(n){return Mr(this.text,n-this.offset)+this.offset}elt(n,s,l,i){return typeof n=="string"?Te(this.parser.getNodeType(n),s,l,i):new ny(n,s)}}lh.linkStart=gs;lh.imageStart=gc;function hf(t,n){if(!n.length)return t;if(!t.length)return n;let s=t.slice(),l=0;for(let i of n){for(;l<s.length&&s[l].to<i.to;)l++;if(l<s.length&&s[l].from<i.from){let u=s[l];u instanceof Fr&&(s[l]=new Fr(u.type,u.from,u.to,hf(u.children,[i])))}else s.splice(l++,0,i)}return s}const Wz=[ae.CodeBlock,ae.ListItem,ae.OrderedList,ae.BulletList];class Bz{constructor(n,s){this.fragments=n,this.input=s,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,n.length&&(this.fragment=n[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(n,s){for(;this.fragment&&this.fragment.to<=n;)this.nextFragment();if(!this.fragment||this.fragment.from>(n?n-1:0))return!1;if(this.fragmentEnd<0){let u=this.fragment.to;for(;u>0&&this.input.read(u-1,u)!=`
523
+ `;)u--;this.fragmentEnd=u?u-1:0}let l=this.cursor;l||(l=this.cursor=this.fragment.tree.cursor(),l.firstChild());let i=n+this.fragment.offset;for(;l.to<=i;)if(!l.parent())return!1;for(;;){if(l.from>=i)return this.fragment.from<=s;if(!l.childAfter(i))return!1}}matches(n){let s=this.cursor.tree;return s&&s.prop(nn.contextHash)==n}takeNodes(n){let s=this.cursor,l=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),u=n.absoluteLineStart,d=u,f=n.block.children.length,m=d,p=f;for(;;){if(s.to-l>i){if(s.type.isAnonymous&&s.firstChild())continue;break}let x=cy(s.from-l,n.ranges);if(s.to-l<=n.ranges[n.rangeI].to)n.addNode(s.tree,x);else{let g=new fa(n.parser.nodeSet.types[ae.Paragraph],[],[],0,n.block.hashProp);n.reusePlaceholders.set(g,s.tree),n.addNode(g,x)}if(s.type.is("Block")&&(Wz.indexOf(s.type.id)<0?(d=s.to-l,f=n.block.children.length):(d=m,f=p),m=s.to-l,p=n.block.children.length),!s.nextSibling())break}for(;n.block.children.length>f;)n.block.children.pop(),n.block.positions.pop();return d-u}}function cy(t,n){let s=t;for(let l=1;l<n.length;l++){let i=n[l-1].to,u=n[l].from;i<t&&(s-=u-i)}return s}const Hz=$s({"Blockquote/...":C.quote,HorizontalRule:C.contentSeparator,"ATXHeading1/... SetextHeading1/...":C.heading1,"ATXHeading2/... SetextHeading2/...":C.heading2,"ATXHeading3/...":C.heading3,"ATXHeading4/...":C.heading4,"ATXHeading5/...":C.heading5,"ATXHeading6/...":C.heading6,"Comment CommentBlock":C.comment,Escape:C.escape,Entity:C.character,"Emphasis/...":C.emphasis,"StrongEmphasis/...":C.strong,"Link/... Image/...":C.link,"OrderedList/... BulletList/...":C.list,"BlockQuote/...":C.quote,"InlineCode CodeText":C.monospace,"URL Autolink":C.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":C.processingInstruction,"CodeInfo LinkLabel":C.labelName,LinkTitle:C.string,Paragraph:C.content}),Iz=new Ec(new yf(ty).extend(Hz),Object.keys(_o).map(t=>_o[t]),Object.keys(_o).map(t=>Jv[t]),Object.keys(_o),Uz,Gv,Object.keys(TO).map(t=>TO[t]),Object.keys(TO),[]);function Fz(t,n,s){let l=[];for(let i=t.firstChild,u=n;;i=i.nextSibling){let d=i?i.from:s;if(d>u&&l.push({from:u,to:d}),!i)break;u=i.to}return l}function Kz(t){let{codeParser:n,htmlParser:s}=t;return{wrap:S0((i,u)=>{let d=i.type.id;if(n&&(d==ae.CodeBlock||d==ae.FencedCode)){let f="";if(d==ae.FencedCode){let p=i.node.getChild(ae.CodeInfo);p&&(f=u.read(p.from,p.to))}let m=n(f);if(m)return{parser:m,overlay:p=>p.type.id==ae.CodeText,bracketed:d==ae.FencedCode}}else if(s&&(d==ae.HTMLBlock||d==ae.HTMLTag||d==ae.CommentBlock))return{parser:s,overlay:Fz(i.node,i.from,i.to)};return null})}}const Jz={resolve:"Strikethrough",mark:"StrikethroughMark"},e4={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":C.strikethrough}},{name:"StrikethroughMark",style:C.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,n,s){if(n!=126||t.char(s+1)!=126||t.char(s+2)==126)return-1;let l=t.slice(s-1,s),i=t.slice(s+2,s+3),u=/\s|^$/.test(l),d=/\s|^$/.test(i),f=Kr.test(l),m=Kr.test(i);return t.addDelimiter(Jz,s,s+2,!d&&(!m||u||f),!u&&(!f||d||m))},after:"Emphasis"}]};function Yr(t,n,s=0,l,i=0){let u=0,d=!0,f=-1,m=-1,p=!1,x=()=>{l.push(t.elt("TableCell",i+f,i+m,t.parser.parseInline(n.slice(f,m),i+f)))};for(let g=s;g<n.length;g++){let b=n.charCodeAt(g);b==124&&!p?((!d||f>-1)&&u++,d=!1,l&&(f>-1&&x(),l.push(t.elt("TableDelimiter",g+i,g+i+1))),f=m=-1):(p||b!=32&&b!=9)&&(f<0&&(f=g),m=g+1),p=!p&&b==92}return f>-1&&(u++,l&&x()),u}function P1(t,n){for(let s=n;s<t.length;s++){let l=t.charCodeAt(s);if(l==124)return!0;l==92&&s++}return!1}const uy=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class N1{constructor(){this.rows=null}nextLine(n,s,l){if(this.rows==null){this.rows=!1;let i;if((s.next==45||s.next==58||s.next==124)&&uy.test(i=s.text.slice(s.pos))){let u=[];Yr(n,l.content,0,u,l.start)==Yr(n,i,s.pos)&&(this.rows=[n.elt("TableHeader",l.start,l.start+l.content.length,u),n.elt("TableDelimiter",n.lineStart+s.pos,n.lineStart+s.text.length)])}}else if(this.rows){let i=[];Yr(n,s.text,s.pos,i,n.lineStart),this.rows.push(n.elt("TableRow",n.lineStart+s.pos,n.lineStart+s.text.length,i))}return!1}finish(n,s){return this.rows?(n.addLeafElement(s,n.elt("Table",s.start,s.start+s.content.length,this.rows)),!0):!1}}const t4={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":C.heading}},"TableRow",{name:"TableCell",style:C.content},{name:"TableDelimiter",style:C.processingInstruction}],parseBlock:[{name:"Table",leaf(t,n){return P1(n.content,0)?new N1:null},endLeaf(t,n,s){if(s.parsers.some(i=>i instanceof N1)||!P1(n.text,n.basePos))return!1;let l=t.peekLine();return uy.test(l)&&Yr(t,n.text,n.basePos)==Yr(t,l,n.basePos)},before:"SetextHeading"}]};class a4{nextLine(){return!1}finish(n,s){return n.addLeafElement(s,n.elt("Task",s.start,s.start+s.content.length,[n.elt("TaskMarker",s.start,s.start+3),...n.parser.parseInline(s.content.slice(3),s.start+3)])),!0}}const n4={defineNodes:[{name:"Task",block:!0,style:C.list},{name:"TaskMarker",style:C.atom}],parseBlock:[{name:"TaskList",leaf(t,n){return/^\[[ xX]\][ \t]/.test(n.content)&&t.parentType().name=="ListItem"?new a4:null},after:"SetextHeading"}]},z1=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,R1=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,s4=/[\w-]+\.[\w-]+($|\/)/,X1=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,_1=/\/[a-zA-Z\d@.]+/gy;function C1(t,n,s,l){let i=0;for(let u=n;u<s;u++)t[u]==l&&i++;return i}function l4(t,n){R1.lastIndex=n;let s=R1.exec(t);if(!s||s4.exec(s[0])[0].indexOf("_")>-1)return-1;let l=n+s[0].length;for(;;){let i=t[l-1],u;if(/[?!.,:*_~]/.test(i)||i==")"&&C1(t,n,l,")")>C1(t,n,l,"("))l--;else if(i==";"&&(u=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(n,l))))l=n+u.index;else break}return l}function Z1(t,n){X1.lastIndex=n;let s=X1.exec(t);if(!s)return-1;let l=s[0][s[0].length-1];return l=="_"||l=="-"?-1:n+s[0].length-(l=="."?1:0)}const r4={parseInline:[{name:"Autolink",parse(t,n,s){let l=s-t.offset;if(l&&/\w/.test(t.text[l-1]))return-1;z1.lastIndex=l;let i=z1.exec(t.text),u=-1;if(!i)return-1;if(i[1]||i[2]){if(u=l4(t.text,l+i[0].length),u>-1&&t.hasOpenLink){let d=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(l,u));u=l+d[0].length}}else i[3]?u=Z1(t.text,l):(u=Z1(t.text,l+i[0].length),u>-1&&i[0]=="xmpp:"&&(_1.lastIndex=u,i=_1.exec(t.text),i&&(u=i.index+i[0].length)));return u<0?-1:(t.addElement(t.elt("URL",s,u+t.offset)),u+t.offset)}}]},i4=[t4,n4,e4,r4];function dy(t,n,s){return(l,i,u)=>{if(i!=t||l.char(u+1)==t)return-1;let d=[l.elt(s,u,u+1)];for(let f=u+1;f<l.end;f++){let m=l.char(f);if(m==t)return l.addElement(l.elt(n,u,f+1,d.concat(l.elt(s,f,f+1))));if(m==92&&d.push(l.elt("Escape",f,f+++2)),oa(m))break}return-1}}const o4={defineNodes:[{name:"Superscript",style:C.special(C.content)},{name:"SuperscriptMark",style:C.processingInstruction}],parseInline:[{name:"Superscript",parse:dy(94,"Superscript","SuperscriptMark")}]},c4={defineNodes:[{name:"Subscript",style:C.special(C.content)},{name:"SubscriptMark",style:C.processingInstruction}],parseInline:[{name:"Subscript",parse:dy(126,"Subscript","SubscriptMark")}]},u4={defineNodes:[{name:"Emoji",style:C.character}],parseInline:[{name:"Emoji",parse(t,n,s){let l;return n!=58||!(l=/^[a-zA-Z_0-9]+:/.exec(t.slice(s+1,t.end)))?-1:t.addElement(t.elt("Emoji",s,s+1+l[0].length))}}]},Oy=y0({commentTokens:{block:{open:"<!--",close:"-->"}}}),fy=new nn,hy=Iz.configure({props:[ks.add(t=>!t.is("Block")||t.is("Document")||mf(t)!=null||d4(t)?void 0:(n,s)=>({from:s.doc.lineAt(n.from).to,to:n.to})),fy.add(mf),zl.add({Document:()=>null}),$j.add({Document:Oy})]});function mf(t){let n=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return n?+n[1]:void 0}function d4(t){return t.name=="OrderedList"||t.name=="BulletList"}function O4(t,n){let s=t;for(;;){let l=s.nextSibling,i;if(!l||(i=mf(l.type))!=null&&i<=n)break;s=l}return s.to}const f4=Sj.of((t,n,s)=>{for(let l=pa(t).resolveInner(s,-1);l&&!(l.from<n);l=l.parent){let i=l.type.prop(fy);if(i==null)continue;let u=O4(l,i);if(u>s)return{from:s,to:u}}return null});function rh(t){return new Qj(Oy,t,[],"markdown")}const h4=rh(hy),m4=hy.configure([i4,c4,o4,u4,{props:[ks.add({Table:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})})]}]),bc=rh(m4);function p4(t,n){return s=>{if(s&&t){let l=null;if(s=/\S*/.exec(s)[0],typeof t=="function"?l=t(s):l=hg.matchLanguageName(t,s,!0),l instanceof hg)return l.support?l.support.language.parser:kj.getSkippingParser(l.load());if(l)return l.parser}return n?n.parser:null}}let PO=class{constructor(n,s,l,i,u,d,f){this.node=n,this.from=s,this.to=l,this.spaceBefore=i,this.spaceAfter=u,this.type=d,this.item=f}blank(n,s=!0){let l=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(n!=null){for(;l.length<n;)l+=" ";return l}else{for(let i=this.to-this.from-l.length-this.spaceAfter.length;i>0;i--)l+=" ";return l+(s?this.spaceAfter:"")}}marker(n,s){let l=this.node.name=="OrderedList"?String(+py(this.item,n)[2]+s):"";return this.spaceBefore+l+this.type+this.spaceAfter}};function my(t,n){let s=[],l=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return l;(i.name=="ListItem"||i.name=="Blockquote")&&s.push(i)}for(let i=s.length-1;i>=0;i--){let u=s[i],d,f=n.lineAt(u.from),m=u.from-f.from;if(u.name=="Blockquote"&&(d=/^ *>( ?)/.exec(f.text.slice(m))))l.push(new PO(u,m,m+d[0].length,"",d[1],">",null));else if(u.name=="ListItem"&&u.parent.name=="OrderedList"&&(d=/^( *)\d+([.)])( *)/.exec(f.text.slice(m)))){let p=d[3],x=d[0].length;p.length>=4&&(p=p.slice(0,p.length-4),x-=4),l.push(new PO(u.parent,m,m+x,d[1],p,d[2],u))}else if(u.name=="ListItem"&&u.parent.name=="BulletList"&&(d=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(f.text.slice(m)))){let p=d[4],x=d[0].length;p.length>4&&(p=p.slice(0,p.length-4),x-=4);let g=d[2];d[3]&&(g+=d[3].replace(/[xX]/," ")),l.push(new PO(u.parent,m,m+x,d[1],p,g,u))}}return l}function py(t,n){return/^(\s*)(\d+)(?=[.)])/.exec(n.sliceString(t.from,t.from+10))}function NO(t,n,s,l=0){for(let i=-1,u=t;;){if(u.name=="ListItem"){let f=py(u,n),m=+f[2];if(i>=0){if(m!=i+1)return;s.push({from:u.from+f[1].length,to:u.from+f[0].length,insert:String(i+2+l)})}i=m}let d=u.nextSibling;if(!d)break;u=d}}function ih(t,n){let s=/^[ \t]*/.exec(t)[0].length;if(!s||n.facet(jj)!=" ")return t;let l=Vr(t,4,s),i="";for(let u=l;u>0;)u>=4?(i+=" ",u-=4):(i+=" ",u--);return i+t.slice(s)}const x4=(t={})=>({state:n,dispatch:s})=>{let l=pa(n),{doc:i}=n,u=null,d=n.changeByRange(f=>{if(!f.empty||!bc.isActiveAt(n,f.from,-1)&&!bc.isActiveAt(n,f.from,1))return u={range:f};let m=f.from,p=i.lineAt(m),x=my(l.resolveInner(m,-1),i);for(;x.length&&x[x.length-1].from>m-p.from;)x.pop();if(!x.length)return u={range:f};let g=x[x.length-1];if(g.to-g.spaceAfter.length>m-p.from)return u={range:f};let b=m>=g.to-g.spaceAfter.length&&!/\S/.test(p.text.slice(g.to));if(g.item&&b){let k=g.node.firstChild,N=g.node.getChild("ListItem","ListItem");if(k.to>=m||N&&N.to<m||p.from>0&&!/[^\s>]/.test(i.lineAt(p.from-1).text)||t.nonTightLists===!1){let R=x.length>1?x[x.length-2]:null,A,U="";R&&R.item?(A=p.from+R.from,U=R.marker(i,1)):A=p.from+(R?R.to:0);let X=[{from:A,to:m,insert:U}];return g.node.name=="OrderedList"&&NO(g.item,i,X,-2),R&&R.node.name=="OrderedList"&&NO(R.item,i,X),{range:Un.cursor(A+U.length),changes:X}}else{let R=E1(x,n,p);return{range:Un.cursor(m+R.length+1),changes:{from:p.from,insert:R+n.lineBreak}}}}if(g.node.name=="Blockquote"&&b&&p.from){let k=i.lineAt(p.from-1),N=/>\s*$/.exec(k.text);if(N&&N.index==g.from){let R=n.changes([{from:k.from+N.index,to:k.to},{from:p.from+g.from,to:p.to}]);return{range:f.map(R),changes:R}}}let S=[];g.node.name=="OrderedList"&&NO(g.item,i,S);let w=g.item&&g.item.from<p.from,j="";if(!w||/^[\s\d.)\-+*>]*/.exec(p.text)[0].length>=g.to)for(let k=0,N=x.length-1;k<=N;k++)j+=k==N&&!w?x[k].marker(i,1):x[k].blank(k<N?Vr(p.text,4,x[k+1].from)-j.length:null);let $=m;for(;$>p.from&&/\s/.test(p.text.charAt($-p.from-1));)$--;return j=ih(j,n),b4(g.node,n.doc)&&(j=E1(x,n,p)+n.lineBreak+j),S.push({from:$,to:m,insert:n.lineBreak+j}),{range:Un.cursor($+j.length+1),changes:S}});return u?!1:(s(n.update(d,{scrollIntoView:!0,userEvent:"input"})),!0)},g4=x4();function A1(t){return t.name=="QuoteMark"||t.name=="ListMark"}function b4(t,n){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let s=t.firstChild,l=t.getChild("ListItem","ListItem");if(!l)return!1;let i=n.lineAt(s.to),u=n.lineAt(l.from),d=/^[\s>]*$/.test(i.text);return i.number+(d?0:1)<u.number}function E1(t,n,s){let l="";for(let i=0,u=t.length-2;i<=u;i++)l+=t[i].blank(i<u?Vr(s.text,4,t[i+1].from)-l.length:null,i<u);return ih(l,n)}function v4(t,n){let s=t.resolveInner(n,-1),l=n;A1(s)&&(l=s.from,s=s.parent);for(let i;i=s.childBefore(l);)if(A1(i))l=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")s=i.lastChild,l=s.to;else break;return s}const y4=({state:t,dispatch:n})=>{let s=pa(t),l=null,i=t.changeByRange(u=>{let d=u.from,{doc:f}=t;if(u.empty&&bc.isActiveAt(t,u.from)){let m=f.lineAt(d),p=my(v4(s,d),f);if(p.length){let x=p[p.length-1],g=x.to-x.spaceAfter.length+(x.spaceAfter?1:0);if(d-m.from>g&&!/\S/.test(m.text.slice(g,d-m.from)))return{range:Un.cursor(m.from+g),changes:{from:m.from+g,to:d}};if(d-m.from==g&&(!x.item||m.from<=x.item.from||!/\S/.test(m.text.slice(0,x.to)))){let b=m.from+x.from;if(x.item&&x.node.from<x.item.from&&/\S/.test(m.text.slice(x.from,x.to))){let S=x.blank(Vr(m.text,4,x.to)-Vr(m.text,4,x.from));return b==m.from&&(S=ih(S,t)),{range:Un.cursor(b+S.length),changes:{from:b,to:m.from+x.to,insert:S}}}if(b<d)return{range:Un.cursor(b),changes:{from:b,to:d}}}}}return l={range:u}});return l?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},S4=[{key:"Enter",run:g4},{key:"Backspace",run:y4}],xy=Uv({matchClosingTags:!1});function Q4(t={}){let{codeLanguages:n,defaultCodeLanguage:s,addKeymap:l=!0,base:{parser:i}=h4,completeHTMLTags:u=!0,pasteURLAsLink:d=!0,htmlTagLanguage:f=xy}=t;if(!(i instanceof Ec))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let m=t.extensions?[t.extensions]:[],p=[f.support,f4],x;d&&p.push(k4),s instanceof vs?(p.push(s.support),x=s.language):s&&(x=s);let g=n||x?p4(n,x):void 0;m.push(Kz({codeParser:g,htmlParser:f.language.parser})),l&&p.push(yj.high(BO.of(S4)));let b=rh(i.configure(m));return u&&p.push(b.data.of({autocomplete:j4})),new vs(b,p)}function j4(t){let{state:n,pos:s}=t,l=/<[:\-\.\w\u00b7-\uffff]*$/.exec(n.sliceDoc(s-25,s));if(!l)return null;let i=pa(n).resolveInner(s,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:s-l[0].length,to:s,options:w4(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let zO=null;function w4(){if(zO)return zO;let t=zz(new wj(Q0.create({extensions:xy}),0,!0));return zO=t?t.options:[]}const $4=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,k4=jl.domEventHandlers({paste:(t,n)=>{var s;let{main:l}=n.state.selection;if(l.empty)return!1;let i=(s=t.clipboardData)===null||s===void 0?void 0:s.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!bc.isActiveAt(n.state,l.from,1)))return!1;let u=pa(n.state),d=!1;return u.iterate({from:l.from,to:l.to,enter:f=>{(f.from>l.from||$4.test(f.name))&&(d=!0)},leave:f=>{f.to<l.to&&(d=!0)}}),d?!1:(n.dispatch({changes:[{from:l.from,insert:"["},{from:l.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),T4=1,gy=194,by=195,P4=196,q1=197,N4=198,z4=199,R4=200,X4=2,vy=3,M1=201,_4=24,C4=25,Z4=49,A4=50,E4=55,q4=56,M4=57,Y4=59,V4=60,U4=61,G4=62,L4=63,D4=65,W4=238,B4=71,H4=241,I4=242,F4=243,K4=244,J4=245,eR=246,tR=247,aR=248,yy=72,nR=249,sR=250,lR=251,rR=252,iR=253,oR=254,cR=255,uR=256,dR=73,OR=77,fR=263,hR=112,mR=130,pR=151,xR=152,gR=155,js=10,Jr=13,oh=32,qc=9,ch=35,bR=40,vR=46,pf=123,Y1=125,Sy=39,Qy=34,V1=92,yR=111,SR=120,QR=78,jR=117,wR=85,$R=new Set([C4,Z4,A4,fR,D4,mR,q4,M4,W4,G4,L4,yy,dR,OR,V4,U4,pR,xR,gR,hR]);function RO(t){return t==js||t==Jr}function XO(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const kR=new xt((t,n)=>{let s;if(t.next<0)t.acceptToken(z4);else if(n.context.flags&Bo)RO(t.next)&&t.acceptToken(N4,1);else if(((s=t.peek(-1))<0||RO(s))&&n.canShift(q1)){let l=0;for(;t.next==oh||t.next==qc;)t.advance(),l++;(t.next==js||t.next==Jr||t.next==ch)&&t.acceptToken(q1,-l)}else RO(t.next)&&t.acceptToken(P4,1)},{contextual:!0}),TR=new xt((t,n)=>{let s=n.context;if(s.flags)return;let l=t.peek(-1);if(l==js||l==Jr){let i=0,u=0;for(;;){if(t.next==oh)i++;else if(t.next==qc)i+=8-i%8;else break;t.advance(),u++}i!=s.indent&&t.next!=js&&t.next!=Jr&&t.next!=ch&&(i<s.indent?t.acceptToken(by,-u):t.acceptToken(gy))}}),Bo=1,jy=2,Ka=4,Ja=8,en=16,tn=32;function Ho(t,n,s){this.parent=t,this.indent=n,this.flags=s,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+s+(s<<6)}const PR=new Ho(null,0,0);function NR(t){let n=0;for(let s=0;s<t.length;s++)n+=t.charCodeAt(s)==qc?8-n%8:1;return n}const U1=new Map([[H4,0],[I4,Ka],[F4,Ja],[K4,Ja|Ka],[J4,en],[eR,en|Ka],[tR,en|Ja],[aR,en|Ja|Ka],[nR,tn],[sR,tn|Ka],[lR,tn|Ja],[rR,tn|Ja|Ka],[iR,tn|en],[oR,tn|en|Ka],[cR,tn|en|Ja],[uR,tn|en|Ja|Ka]].map(([t,n])=>[t,n|jy])),zR=new If({start:PR,reduce(t,n,s,l){return t.flags&Bo&&$R.has(n)||(n==B4||n==yy)&&t.flags&jy?t.parent:t},shift(t,n,s,l){return n==gy?new Ho(t,NR(l.read(l.pos,s.pos)),0):n==by?t.parent:n==_4||n==E4||n==Y4||n==vy?new Ho(t,0,Bo):U1.has(n)?new Ho(t,0,U1.get(n)|t.flags&Bo):t},hash(t){return t.hash}}),RR=new xt(t=>{for(let n=0;n<5;n++){if(t.next!="print".charCodeAt(n))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let n=0;;n++){let s=t.peek(n);if(!(s==oh||s==qc)){s!=bR&&s!=vR&&s!=js&&s!=Jr&&s!=ch&&t.acceptToken(T4);return}}}),XR=new xt((t,n)=>{let{flags:s}=n.context,l=s&Ka?Qy:Sy,i=(s&Ja)>0,u=!(s&en),d=(s&tn)>0,f=t.pos;for(;!(t.next<0);)if(d&&t.next==pf)if(t.peek(1)==pf)t.advance(2);else{if(t.pos==f){t.acceptToken(vy,1);return}break}else if(u&&t.next==V1){if(t.pos==f){t.advance();let m=t.next;m>=0&&(t.advance(),_R(t,m)),t.acceptToken(X4);return}break}else if(t.next==V1&&!u&&t.peek(1)>-1)t.advance(2);else if(t.next==l&&(!i||t.peek(1)==l&&t.peek(2)==l)){if(t.pos==f){t.acceptToken(M1,i?3:1);return}break}else if(t.next==js){if(i)t.advance();else if(t.pos==f){t.acceptToken(M1);return}break}else t.advance();t.pos>f&&t.acceptToken(R4)});function _R(t,n){if(n==yR)for(let s=0;s<2&&t.next>=48&&t.next<=55;s++)t.advance();else if(n==SR)for(let s=0;s<2&&XO(t.next);s++)t.advance();else if(n==jR)for(let s=0;s<4&&XO(t.next);s++)t.advance();else if(n==wR)for(let s=0;s<8&&XO(t.next);s++)t.advance();else if(n==QR&&t.next==pf){for(t.advance();t.next>=0&&t.next!=Y1&&t.next!=Sy&&t.next!=Qy&&t.next!=js;)t.advance();t.next==Y1&&t.advance()}}const CR=$s({'async "*" "**" FormatConversion FormatSpec':C.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":C.controlKeyword,"in not and or is del":C.operatorKeyword,"from def class global nonlocal lambda":C.definitionKeyword,import:C.moduleKeyword,"with as print":C.keyword,Boolean:C.bool,None:C.null,VariableName:C.variableName,"CallExpression/VariableName":C.function(C.variableName),"FunctionDefinition/VariableName":C.function(C.definition(C.variableName)),"ClassDefinition/VariableName":C.definition(C.className),PropertyName:C.propertyName,"CallExpression/MemberExpression/PropertyName":C.function(C.propertyName),Comment:C.lineComment,Number:C.number,String:C.string,FormatString:C.special(C.string),Escape:C.escape,UpdateOp:C.updateOperator,"ArithOp!":C.arithmeticOperator,BitOp:C.bitwiseOperator,CompareOp:C.compareOperator,AssignOp:C.definitionOperator,Ellipsis:C.punctuation,At:C.meta,"( )":C.paren,"[ ]":C.squareBracket,"{ }":C.brace,".":C.derefOperator,", ;":C.separator}),ZR={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},AR=Bn.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5z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)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:zR,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[CR],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=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o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[RR,TR,kR,XR,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>ZR[t]||-1}],tokenPrec:7668}),G1=new Sf,wy=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Zo(t){return(n,s,l)=>{if(l)return!1;let i=n.node.getChild("VariableName");return i&&s(i,t),!0}}const ER={FunctionDefinition:Zo("function"),ClassDefinition:Zo("class"),ForStatement(t,n,s){if(s){for(let l=t.node.firstChild;l;l=l.nextSibling)if(l.name=="VariableName")n(l,"variable");else if(l.name=="in")break}},ImportStatement(t,n){var s,l;let{node:i}=t,u=((s=i.firstChild)===null||s===void 0?void 0:s.name)=="from";for(let d=i.getChild("import");d;d=d.nextSibling)d.name=="VariableName"&&((l=d.nextSibling)===null||l===void 0?void 0:l.name)!="as"&&n(d,u?"variable":"namespace")},AssignStatement(t,n){for(let s=t.node.firstChild;s;s=s.nextSibling)if(s.name=="VariableName")n(s,"variable");else if(s.name==":"||s.name=="AssignOp")break},ParamList(t,n){for(let s=null,l=t.node.firstChild;l;l=l.nextSibling)l.name=="VariableName"&&(!s||!/\*|AssignOp/.test(s.name))&&n(l,"variable"),s=l},CapturePattern:Zo("variable"),AsPattern:Zo("variable"),__proto__:null};function $y(t,n){let s=G1.get(n);if(s)return s;let l=[],i=!0;function u(d,f){let m=t.sliceString(d.from,d.to);l.push({label:m,type:f})}return n.cursor(yc.IncludeAnonymous).iterate(d=>{if(d.name){let f=ER[d.name];if(f&&f(d,u,i)||!i&&wy.has(d.name))return!1;i=!1}else if(d.to-d.from>8192){for(let f of $y(t,d.node))l.push(f);return!1}}),G1.set(n,l),l}const L1=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,ky=["String","FormatString","Comment","PropertyName"];function qR(t){let n=pa(t.state).resolveInner(t.pos,-1);if(ky.indexOf(n.name)>-1)return null;let s=n.name=="VariableName"||n.to-n.from<20&&L1.test(t.state.sliceDoc(n.from,n.to));if(!s&&!t.explicit)return null;let l=[];for(let i=n;i;i=i.parent)wy.has(i.name)&&(l=l.concat($y(t.state.doc,i)));return{options:l,from:s?n.from:t.pos,validFor:L1}}const MR=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),YR=[He("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),He("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),He("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),He("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),He(`if \${}:
524
524
 
525
- `,{label:"if",detail:"block",type:"keyword"}),He("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),He("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),He("import ${module}",{label:"import",detail:"statement",type:"keyword"}),He("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],VR=g0(ky,b0(MR.concat(YR)));function _O(t){let{node:n,pos:s}=t,l=t.lineIndent(s,-1),i=null;for(;;){let u=n.childBefore(s);if(u)if(u.name=="Comment")s=u.from;else if(u.name=="Body"||u.name=="MatchBody")t.baseIndentFor(u)+t.unit<=l&&(i=u),n=u;else if(u.name=="MatchClause")n=u;else if(u.type.is("Statement"))n=u;else break;else break}return i}function CO(t,n){let s=t.baseIndentFor(n),l=t.lineAt(t.pos,-1),i=l.from+l.text.length;return/^\s*($|#)/.test(l.text)&&t.node.to<i+100&&!/\S/.test(t.state.sliceDoc(i,t.node.to))&&t.lineIndent(t.pos,-1)<=s||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>s?null:s+t.unit}const ZO=ti.define({name:"python",parser:AR.configure({props:[zl.add({Body:t=>{var n;let s=/^\s*(#|$)/.test(t.textAfter)&&_O(t)||t.node;return(n=CO(t,s))!==null&&n!==void 0?n:t.continue()},MatchBody:t=>{var n;let s=_O(t);return(n=CO(t,s||t.node))!==null&&n!==void 0?n:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Uo({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Uo({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Uo({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var n;let s=_O(t);return(n=s&&CO(t,s))!==null&&n!==void 0?n:t.continue()}}),ks.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Sc,Body:(t,n)=>({from:t.from+1,to:t.to-(t.to==n.doc.length?0:1)}),"String FormatString":(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function UR(){return new vs(ZO,[ZO.data.of({autocomplete:qR}),ZO.data.of({autocomplete:VR})])}const Ao={javascript:()=>of({jsx:!0,typescript:!1}),typescript:()=>of({jsx:!0,typescript:!0}),css:()=>jv(),html:()=>Uv(),json:()=>E4(),markdown:()=>Qz(),python:()=>UR()},GR=jl.theme({"&":{backgroundColor:"#24282f",color:"#bcc2cd",fontFamily:"var(--font-mono)",fontSize:"13px",height:"100%"},".cm-scroller":{overflow:"auto"},".cm-content":{caretColor:"#33afbc"},".cm-cursor":{borderLeftColor:"#33afbc"},".cm-gutters":{backgroundColor:"#24282f",borderRight:"1px solid #2c313a",color:"#505862"},".cm-activeLineGutter":{backgroundColor:"#2c313a"},".cm-activeLine":{backgroundColor:"rgba(44, 49, 58, 0.5)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}},{dark:!0});function LR({content:t,language:n,onChange:s,onSave:l}){const i=y.useRef(null),u=y.useRef(null),d=y.useRef(new Tj),f=y.useRef(s),m=y.useRef(l);return f.current=s,m.current=l,y.useEffect(()=>{if(!i.current)return;const p=Ao[n]||Ao.javascript,x=BO.of([{key:"Mod-s",run:()=>{var S;return(S=m.current)==null||S.call(m),!0}}]),g=Q0.create({doc:t||"",extensions:[Nj(),zj(),Rj(),Xj(),_j(),Cj(),Zj(),BO.of([...Aj,...Ej,...qj]),x,Pj,GR,d.current.of(p()),jl.updateListener.of(S=>{var w;S.docChanged&&((w=f.current)==null||w.call(f,S.state.doc.toString()))})]}),b=new jl({state:g,parent:i.current});return u.current=b,()=>{b.destroy(),u.current=null}},[]),y.useEffect(()=>{const p=u.current;if(!p)return;const x=p.state.doc.toString();t!==x&&p.dispatch({changes:{from:0,to:x.length,insert:t||""}})},[t]),y.useEffect(()=>{const p=u.current;if(!p)return;const x=Ao[n]||Ao.javascript;p.dispatch({effects:d.current.reconfigure(x())})},[n]),o.jsx("div",{ref:i,className:"w-full h-full overflow-hidden"})}const DR=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],Ty=["mp4","webm","mov","avi","mkv","ogv"];function WR(t){var s;const n=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return DR.includes(n)||Ty.includes(n)}function BR({path:t}){var u;const n=(u=t.split(".").pop())==null?void 0:u.toLowerCase(),s=`/api/files/raw?path=${encodeURIComponent(t)}`,l=t.split("/").pop(),i=Ty.includes(n);return o.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[o.jsx(De,{children:n==null?void 0:n.toUpperCase()}),o.jsx("span",{className:"font-mono",children:l}),o.jsx("a",{href:s,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:o.jsx(ic,{size:12})})]}),i?o.jsx("video",{src:s,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):o.jsx("img",{src:s,alt:l,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}function HR(){const t=D(b=>b.editorActiveFile),n=D(b=>b.editorFiles),s=D(b=>b.editorChangedFiles),l=D(b=>b.updateFileContent),i=D(b=>b.saveFile),u=D(b=>b.reloadFile),d=D(b=>b.dismissFileChange),[f,m]=y.useState("");y.useEffect(()=>{J.get("/files/root").then(b=>m(b.root||"")).catch(()=>{})},[]);const p=t?n[t]:null,x=t&&WR(t),g=t&&s[t];return o.jsxs("div",{className:"flex h-full",children:[o.jsx("div",{className:"w-60 flex-shrink-0 border-r border-border",children:o.jsx(fN,{rootDir:f})}),o.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[o.jsx(hN,{}),o.jsxs("div",{className:"flex-1 relative min-h-0",children:[g&&o.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center gap-2 px-4 py-2 bg-warning/10 border-b border-warning/20",children:[o.jsx(Xc,{size:14,className:"text-warning"}),o.jsx("span",{className:"text-xs text-warning font-sans flex-1",children:"File modified externally"}),o.jsxs(Se,{variant:"ghost",size:"sm",onClick:()=>u(t),children:[o.jsx(_l,{size:12})," Reload"]}),o.jsxs(Se,{variant:"ghost",size:"sm",onClick:()=>d(t),children:[o.jsx(Nt,{size:12})," Dismiss"]})]}),!t&&o.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx(Ta,{size:32,className:"mx-auto"}),o.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&x&&o.jsx(BR,{path:t}),t&&!x&&p&&o.jsx(LR,{content:p.content,language:p.language,onChange:b=>l(t,b),onSave:()=>i(t)})]})]})]})}function IR(){const t=D(p=>p.connected),n=D(p=>p.agents),[s,l]=y.useState(null),[i,u]=y.useState(!0),[d,f]=y.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[]}),m=y.useRef(0);return y.useEffect(()=>{if(!t)return;let p=!0;async function x(){try{const b=await J.get("/dashboard");if(!p)return;l(b),u(!1),m.current=Date.now(),f(S=>{var $,k,N,R;const w=Date.now(),j=(A,U)=>[...A.slice(-59),{t:w,v:U||0}];return{tokens:j(S.tokens,($=b.tokens)==null?void 0:$.totalUsed),cost:j(S.cost,(k=b.tokens)==null?void 0:k.totalCostUsd),saved:j(S.saved,(N=b.tokens)==null?void 0:N.totalSaved),efficiency:j(S.efficiency,(()=>{var U,X,z;const A=(((U=b.tokens)==null?void 0:U.totalUsed)||0)+(((X=b.tokens)==null?void 0:X.totalSaved)||0);return A>0?(((z=b.tokens)==null?void 0:z.totalSaved)||0)/A*100:0})()),cache:j(S.cache,(R=b.tokens)==null?void 0:R.cacheHitRate)}})}catch{p&&u(!1)}}x();const g=setInterval(x,4e3);return()=>{p=!1,clearInterval(g)}},[t]),{data:s,loading:i,agents:n,connected:t,kpiHistory:d,lastFetch:m.current}}function D1({connected:t,runningCount:n,totalCount:s,uptime:l,lastFetch:i}){return o.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border",children:[o.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Command Center"}),o.jsx("div",{className:"flex-1"}),t&&o.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[o.jsxs("span",{children:[n,"/",s," agents"]}),l>0&&o.jsxs("span",{children:["Up ",Cc(l)]}),i>0&&o.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[o.jsx(_l,{size:10})," ",Wt(i)]})]}),o.jsx(Qs,{status:t?"running":"crashed",size:"sm"})]})}const Ie={surface4:"#2c313a",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd"};function FR({data:t,color:n=Ie.accent,width:s=80,height:l=24}){if(!t||t.length<2)return o.jsx("div",{style:{width:s,height:l}});const i=t.map(p=>p.v),u=Math.min(...i),f=Math.max(...i)-u||1,m=t.map((p,x)=>{const g=x/(t.length-1)*s,b=l-(p.v-u)/f*(l-2)-1;return`${g},${b}`}).join(" ");return o.jsxs("svg",{width:s,height:l,className:"flex-shrink-0",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:`kpi-${n}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:n,stopOpacity:"0.3"}),o.jsx("stop",{offset:"100%",stopColor:n,stopOpacity:"0"})]})}),o.jsx("polygon",{points:`0,${l} ${m} ${s},${l}`,fill:`url(#kpi-${n})`}),o.jsx("polyline",{points:m,fill:"none",stroke:n,strokeWidth:"1.5",strokeLinejoin:"round"})]})}function Ar({label:t,value:n,sparkData:s,color:l=Ie.accent,className:i}){return o.jsxs("div",{className:se("flex items-center gap-3 px-4 py-3 bg-surface-1 border-b border-border-subtle min-w-0",i),children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-2xs text-text-3 font-sans uppercase tracking-wider mb-0.5 truncate",children:t}),o.jsx("div",{className:"text-lg font-semibold font-mono text-text-0 tabular-nums",children:n})]}),o.jsx(FR,{data:s,color:l})]})}function KR(t){return t?t.split(/[\s\-_]+/).map(n=>n[0]).join("").toUpperCase().slice(0,2):"?"}function JR({name:t,role:n,size:s="md",spinning:l,className:i}){const u=Gf(n),d={sm:"w-6 h-6 text-2xs",md:"w-7 h-7 text-xs",lg:"w-10 h-10 text-sm"};return o.jsxs("div",{className:se("relative inline-flex",i),children:[l&&o.jsx("div",{className:"absolute inset-[-2px] rounded-full animate-[spin-slow_3s_linear_infinite]",style:{background:`conic-gradient(${u.border}, transparent, ${u.border})`,mask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",WebkitMask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))"}}),o.jsx("div",{className:se("rounded-full flex items-center justify-center font-semibold font-sans select-none",d[s]),style:{background:u.bg,color:u.text},children:KR(t)})]})}function eX({agents:t}){if(!(t!=null&&t.length))return o.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-4 font-sans p-4",children:"No agents running"});const n={};for(const s of t){const l=s.teamId||"Ungrouped";n[l]||(n[l]=[]),n[l].push(s)}return o.jsx(Na,{className:"flex-1",children:o.jsx("div",{className:"p-3 space-y-4",children:Object.entries(n).map(([s,l])=>o.jsxs("div",{children:[o.jsx("div",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2",children:s}),o.jsx("div",{className:"space-y-1",children:l.map(i=>o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-5 transition-colors",children:[o.jsx(Qs,{status:i.status,size:"sm"}),o.jsx(JR,{name:i.name,role:i.role,size:"sm"}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx("div",{className:"text-xs text-text-0 font-sans truncate",children:i.name})}),o.jsx("span",{className:"text-2xs font-mono text-text-3",children:Dt(i.tokensUsed||0)}),o.jsx("div",{className:"w-10 h-1 bg-surface-0 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(i.contextUsage||0,100)}%`,background:(i.contextUsage||0)>=80?"var(--color-danger)":(i.contextUsage||0)>=60?"var(--color-warning)":"var(--color-success)"}})})]},i.id))})]},s))})})}function AO({label:t,value:n,total:s,color:l}){const i=s>0?n/s*100:0;return o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs font-sans",children:[o.jsx("span",{className:"text-text-2",children:t}),o.jsx("span",{className:"text-text-0 font-mono",children:Dt(n)})]}),o.jsx("div",{className:"h-1.5 bg-surface-0 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(i,100)}%`,background:l}})})]})}function xs({label:t,value:n}){return o.jsxs("div",{className:"flex items-center justify-between text-xs font-sans",children:[o.jsx("span",{className:"text-text-3",children:t}),o.jsx("span",{className:"text-text-0 font-mono",children:n})]})}function tX({data:t,rotation:n,routing:s,adaptive:l}){var x,g;if(!t)return null;const{totalSaved:i=0,rotationSaved:u=0,conflictSaved:d=0,coldStartSaved:f=0,totalUsed:m=0}=t,p=m+i;return o.jsxs("div",{className:"p-4 space-y-5 overflow-y-auto h-full",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-xl font-semibold font-mono text-success",children:Dt(i)}),o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"tokens saved"}),p>0&&o.jsxs("span",{className:"text-xs text-text-4 font-sans",children:["(",qr(i/p*100),")"]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(AO,{label:"Rotation savings",value:u,total:p,color:Ie.accent}),o.jsx(AO,{label:"Conflict prevention",value:d,total:p,color:Ie.purple}),o.jsx(AO,{label:"Cold-start prevention",value:f,total:p,color:Ie.info})]}),n&&(n.totalRotations>0||((x=n.history)==null?void 0:x.length)>0)&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Rotations"}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(xs,{label:"Total rotations",value:n.totalRotations||0}),o.jsx(xs,{label:"Tokens saved",value:Dt(n.totalTokensSaved||0)})]}),((g=n.history)==null?void 0:g.length)>0&&o.jsx("div",{className:"space-y-1 mt-2",children:n.history.slice(-5).reverse().map((b,S)=>o.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-3 font-sans px-2 py-1 bg-surface-0 rounded",children:[o.jsx("span",{className:"text-text-1 font-medium capitalize",children:b.agentName||b.role}),o.jsx("span",{className:"font-mono",children:qr((b.contextUsage||0)*100)}),o.jsx("span",{className:"ml-auto text-text-4",children:Wt(b.timestamp)})]},S))})]}),s&&s.totalDecisions>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Model Routing"}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(xs,{label:"Auto-routed agents",value:s.autoRoutedCount||0}),o.jsx(xs,{label:"Total decisions",value:s.totalDecisions||0}),s.byTier&&o.jsxs(o.Fragment,{children:[o.jsx(xs,{label:"Heavy (Opus)",value:s.byTier.heavy||0}),o.jsx(xs,{label:"Medium (Sonnet)",value:s.byTier.medium||0}),o.jsx(xs,{label:"Light (Haiku)",value:s.byTier.light||0})]})]})]}),(l==null?void 0:l.length)>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Adaptive Thresholds"}),o.jsx("div",{className:"space-y-1",children:l.map(b=>o.jsxs("div",{className:"flex items-center gap-2 text-2xs font-sans px-2 py-1 bg-surface-0 rounded",children:[o.jsx("span",{className:"text-text-1 font-mono flex-1 truncate",children:b.key}),o.jsx("span",{className:"font-mono text-text-0",children:qr(b.threshold*100)}),o.jsx("span",{className:se("text-2xs",b.converged?"text-success":"text-text-4"),children:b.converged?"converged":`${b.adjustments} adj`})]},b.key))})]})]})}function aX({data:t,width:n,height:s}){const l=y.useRef(null);return y.useEffect(()=>{const i=l.current;if(!i||!(t!=null&&t.length))return;const u=i.getContext("2d"),d=window.devicePixelRatio||1;i.width=n*d,i.height=s*d,u.scale(d,d),u.clearRect(0,0,n,s);const f={top:12,right:60,bottom:28,left:60},m=n-f.left-f.right,p=s-f.top-f.bottom,x=t.map(j=>j.tokens||0),g=t.map(j=>j.costUsd||0),b=Math.max(...x,1),S=Math.max(...g,.01);u.strokeStyle=Ie.surface4,u.lineWidth=.5;for(let j=0;j<=4;j++){const $=f.top+p/4*j;u.beginPath(),u.moveTo(f.left,$),u.lineTo(f.left+m,$),u.stroke()}u.beginPath(),u.moveTo(f.left,f.top+p),t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.tokens||0)/b*p;u.lineTo(k,N)}),u.lineTo(f.left+m,f.top+p),u.closePath();const w=u.createLinearGradient(0,f.top,0,f.top+p);w.addColorStop(0,"rgba(51, 175, 188, 0.2)"),w.addColorStop(1,"rgba(51, 175, 188, 0.01)"),u.fillStyle=w,u.fill(),u.beginPath(),u.strokeStyle=Ie.accent,u.lineWidth=1.5,t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.tokens||0)/b*p;$===0?u.moveTo(k,N):u.lineTo(k,N)}),u.stroke(),u.beginPath(),u.strokeStyle=Ie.warning,u.lineWidth=1,u.setLineDash([4,3]),t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.costUsd||0)/S*p;$===0?u.moveTo(k,N):u.lineTo(k,N)}),u.stroke(),u.setLineDash([]),u.fillStyle=Ie.text3,u.font="10px var(--font-mono)",u.textAlign="right";for(let j=0;j<=4;j++){const $=b/4*(4-j);u.fillText(Dt($),f.left-6,f.top+p/4*j+4)}u.textAlign="left",u.fillStyle=Ie.text4;for(let j=0;j<=4;j++){const $=S/4*(4-j);u.fillText(Lf($),f.left+m+6,f.top+p/4*j+4)}u.font="10px sans-serif",u.fillStyle=Ie.accent,u.fillText("● Tokens",f.left,s-6),u.fillStyle=Ie.warning,u.fillText("● Cost",f.left+70,s-6)},[t,n,s]),o.jsx("canvas",{ref:l,style:{width:n,height:s},className:"block"})}const W1={spawn:iP,rotation:ii,completion:Lr,error:Xc,default:In},B1={spawn:"text-accent",rotation:"text-purple",completion:"text-success",error:"text-danger",default:"text-text-3"};function nX({events:t=[]}){return t.length?o.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:t.slice(-10).reverse().map((n,s)=>{const l=W1[n.type]||W1.default,i=B1[n.type]||B1.default;return o.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0 text-2xs font-sans",children:[o.jsx(l,{size:12,className:i}),o.jsx("span",{className:"text-text-2 whitespace-nowrap",children:n.text}),o.jsx("span",{className:"text-text-4",children:Wt(n.timestamp)})]},s)})}):o.jsx("div",{className:"text-xs text-text-4 font-sans py-3 text-center",children:"No recent activity"})}function ra({className:t,...n}){return o.jsx("div",{className:se("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...n})}function sX(){return o.jsxs("div",{className:"flex-1 flex flex-col p-4 gap-3",children:[o.jsx("div",{className:"flex gap-3",children:[...Array(5)].map((t,n)=>o.jsx(ra,{className:"h-16 flex-1 rounded-md"},n))}),o.jsxs("div",{className:"flex gap-3 flex-1",children:[o.jsx(ra,{className:"flex-[5] rounded-md"}),o.jsx(ra,{className:"flex-[3] rounded-md"}),o.jsx(ra,{className:"flex-[3] rounded-md"})]})]})}function lX(){const{data:t,loading:n,agents:s,connected:l,kpiHistory:i,lastFetch:u}=IR(),d=y.useRef(null),[f,m]=y.useState({width:400,height:200}),p=s.filter(w=>w.status==="running").length;if(y.useEffect(()=>{if(!d.current)return;const w=new ResizeObserver(j=>{const{width:$,height:k}=j[0].contentRect;m({width:Math.floor($),height:Math.floor(k)})});return w.observe(d.current),()=>w.disconnect()},[]),!l)return o.jsx("div",{className:"w-full h-full flex items-center justify-center",children:o.jsxs("div",{className:"text-center space-y-2 text-text-4 font-sans",children:[o.jsx(Nc,{size:32,className:"mx-auto"}),o.jsx("p",{className:"text-sm",children:"Connecting to daemon..."})]})});if(n||!t)return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx(D1,{connected:l,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),o.jsx(sX,{})]});const x=t.tokens||{},g=t.timeline||[],b=(x.totalUsed||0)+(x.totalSaved||0),S=b>0?(x.totalSaved||0)/b*100:0;return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx(D1,{connected:l,runningCount:p,totalCount:s.length,uptime:t.uptime||0,lastFetch:u}),o.jsxs("div",{className:"flex flex-shrink-0 border-b border-border",children:[o.jsx(Ar,{label:"Tokens Used",value:Dt(x.totalUsed),sparkData:i.tokens,color:Ie.accent,className:"flex-1"}),o.jsx(Ar,{label:"Total Cost",value:Lf(x.totalCostUsd),sparkData:i.cost,color:Ie.warning,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Tokens Saved",value:Dt(x.totalSaved),sparkData:i.saved,color:Ie.success,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Efficiency",value:qr(S),sparkData:i.efficiency,color:Ie.purple,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Cache Rate",value:qr(x.cacheHitRate),sparkData:i.cache,color:Ie.info,className:"flex-1 border-l border-border-subtle"})]}),o.jsxs("div",{className:"flex-1 flex min-h-0",children:[o.jsx("div",{ref:d,className:"flex-[5] min-w-0 bg-surface-1 border-r border-border-subtle",children:f.width>0&&o.jsx(aX,{data:g,width:f.width,height:f.height})}),o.jsxs("div",{className:"flex-[3] flex flex-col min-w-0 bg-surface-1 border-r border-border-subtle",children:[o.jsx("div",{className:"px-3 py-2 border-b border-border-subtle",children:o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Agent Fleet"})}),o.jsx(eX,{agents:s})]}),o.jsxs("div",{className:"flex-[3] flex flex-col min-w-0 bg-surface-1",children:[o.jsx("div",{className:"px-3 py-2 border-b border-border-subtle",children:o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Savings"})}),o.jsx(tX,{data:x,rotation:t.rotation,routing:t.routing,adaptive:t.adaptive})]})]}),o.jsx("div",{className:"flex-shrink-0 border-t border-border bg-surface-1",children:o.jsx(nX,{events:t.events||[]})})]})}const H1={sm:12,md:16,lg:20};function rX({fill:t="full",size:n,color:s="#fbbf24",emptyColor:l="rgba(255,255,255,0.4)"}){const i=`star-${Math.random().toString(36).slice(2,8)}`;return o.jsxs("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&o.jsx("defs",{children:o.jsxs("linearGradient",{id:i,children:[o.jsx("stop",{offset:"50%",stopColor:s}),o.jsx("stop",{offset:"50%",stopColor:l})]})}),o.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?s:t==="half"?`url(#${i})`:l})]})}function Py({rating:t=0,count:n,size:s="sm"}){const l=H1[s]||H1.sm,i=[];for(let u=1;u<=5;u++)t>=u?i.push("full"):t>=u-.5?i.push("half"):i.push("empty");return o.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[i.map((u,d)=>o.jsx(rX,{fill:u,size:l},d)),n!=null&&o.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",n,")"]})]})}const I1={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function Ny({label:t,variant:n,className:s}){const l=I1[n]||I1.draft;return o.jsx("span",{className:se("inline-flex items-center whitespace-nowrap font-sans select-none",s),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:l.color,background:l.bg},children:t})}function zy({price:t=0,size:n="sm"}){const s=!t||t===0,l={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return o.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${l[n]||l.sm} ${s?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:s?"Free":`$${t.toFixed(2)}`})}function Ry({type:t="verified",size:n=12}){const s=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return o.jsxs("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[o.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:s}),o.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Xy="groove_favorites";function uh(){try{return JSON.parse(localStorage.getItem(Xy)||"[]")}catch{return[]}}function iX(t){return uh().includes(t)}function oX(t){const n=uh(),s=n.indexOf(t);return s>=0?n.splice(s,1):n.push(t),localStorage.setItem(Xy,JSON.stringify(n)),s<0}function cX(t){const n=new Set(uh());return t.map(s=>({...s,favorited:n.has(s.id)}))}function uX({filled:t,size:n=16}){return o.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:o.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function dX(){return o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"7 10 12 15 17 10"}),o.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function OX({skill:t,onClick:n}){var u,d;const[s,l]=y.useState(()=>iX(t.id));function i(f){f.stopPropagation(),l(oX(t.id))}return o.jsxs("div",{onClick:()=>n==null?void 0:n(t),className:se("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((d=(u=t.name)==null?void 0:u[0])==null?void 0:d.toUpperCase())||"?"}),o.jsx("button",{onClick:i,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:o.jsx(uX,{filled:s})})]}),o.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[o.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&o.jsx(Ry,{type:t.source,size:12})]}),o.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),o.jsx("div",{className:"mt-3",children:o.jsx(Ny,{label:t.category||"general",variant:t.category||"draft"})}),o.jsx("div",{className:"h-px bg-border-subtle my-3"}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx(Py,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),o.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[o.jsx(dX,{}),Dt(t.downloads||0)]}),o.jsx(zy,{price:t.price||0,size:"sm"})]})]})}function _y(){return o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[o.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),o.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),o.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),o.jsx("div",{className:"h-px bg-surface-4 my-3"}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),o.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),o.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const fX={slack:"https://cdn.simpleicons.org/slack/E01E5A",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",discord:"https://cdn.simpleicons.org/discord/5865F2",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2"};function hX({item:t,size:n=40}){const s=fX[t.id];if(s)return o.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:n,height:n},children:[o.jsx("img",{src:s,alt:t.name,className:"w-5 h-5",onError:u=>{u.target.style.display="none",u.target.nextSibling.style.display="flex"}}),o.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const l=(t.name||"?")[0].toUpperCase(),i=t.name?t.name.charCodeAt(0)*37%360:200;return o.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:n,height:n,background:`hsl(${i}, 40%, 18%)`,color:`hsl(${i}, 60%, 65%)`},children:l})}function mX({item:t,onClick:n,className:s}){var i;const l=t.installed;return o.jsxs("button",{onClick:()=>n(t),className:se("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",s),style:{minHeight:200},children:[o.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[o.jsx(hX,{item:t,size:36}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&o.jsx(Lr,{size:11,className:"text-accent flex-shrink-0"})]}),o.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),o.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),o.jsx("div",{className:"h-px bg-border-subtle my-2"}),o.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Ef,{size:10}),Dt(t.downloads||0)]}),(t.rating||0)>0&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Yb,{size:10,className:"text-warning",fill:"currentColor"}),(i=t.rating)==null?void 0:i.toFixed(1)]}),o.jsx("span",{className:"flex-1"}),l&&o.jsx(De,{variant:"accent",className:"text-2xs",children:"Installed"})]})]})}function Cy({value:t,onChange:n,placeholder:s="Search skills, tags, authors...",large:l}){const[i,u]=y.useState(t||""),d=y.useRef(null);y.useEffect(()=>{u(t||"")},[t]);function f(m){const p=m.target.value;u(p),clearTimeout(d.current),d.current=setTimeout(()=>n(p),300)}return o.jsxs("div",{className:"relative w-full",children:[o.jsx(Cl,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),o.jsx("input",{value:i,onChange:f,placeholder:s,className:se("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",l?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),l&&o.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const pX=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function xX({selected:t="",categories:n=pX,onSelect:s}){return o.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:n.map(l=>{const i=t===l.id;return o.jsx("button",{onClick:()=>s(l.id),className:se("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",i?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:l.label},l.id)})})}function Mc(){const t=D(n=>n.addToast);return{success:(n,s)=>t("success",n,s),error:(n,s)=>t("error",n,s),info:(n,s)=>t("info",n,s),warning:(n,s)=>t("warning",n,s)}}function gX({skill:t,onBack:n}){var j,$,k;const s=Mc(),[l,i]=y.useState(""),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,x]=y.useState(t.installed),[g,b]=y.useState(!0);y.useEffect(()=>{b(!0),J.get(`/skills/${t.id}/content`).then(N=>{i(N.content||""),d(N.requiresPurchase||!1)}).catch(()=>{}).finally(()=>b(!1))},[t.id]);async function S(){m(!0);try{await J.post(`/skills/${t.id}/install`),x(!0),s.success(`${t.name} installed`)}catch(N){s.error("Install failed",N.message)}m(!1)}async function w(){const{marketplaceAuthenticated:N,marketplaceLogin:R,marketplaceCheckout:A}=D.getState();if(!N){R();return}try{await A(t.id)}catch{}}return o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-6 py-5",children:[o.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[o.jsx(yT,{size:14})," Back"]}),o.jsxs("div",{className:"flex gap-8",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||(($=(j=t.name)==null?void 0:j[0])==null?void 0:$.toUpperCase())}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[o.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&o.jsx(Ry,{type:t.source,size:13})]})]})]}),o.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((k=t.tags)==null?void 0:k.length)>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(N=>o.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:N},N))}),o.jsx("div",{className:"h-px bg-border-subtle my-5"}),g?o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),o.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),o.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):l?o.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[o.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),o.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:l})]}):u?o.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[o.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):o.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),o.jsx("div",{className:"w-[240px] flex-shrink-0",children:o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[o.jsx(zy,{price:t.price||0,size:"md"}),u&&!p?o.jsxs("button",{onClick:w,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):o.jsx("button",{onClick:S,disabled:f||p,className:`w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border ${p?"bg-success/15 text-success border-success/20":"bg-accent/15 text-accent border-accent/20 hover:bg-accent/25"}`,children:f?"Installing...":p?"✓ Installed":"Install"}),o.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",o.jsx("span",{className:"font-mono text-text-0",children:Dt(t.downloads||0)},"d")],["Rating",o.jsx(Py,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",o.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",o.jsx(Ny,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",o.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([N,R])=>o.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[o.jsx("span",{className:"text-text-3",children:N}),R]},N))})]})})]})]})})}function bX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),[i,u]=y.useState(""),[d,f]=y.useState(""),[m,p]=y.useState("popular"),[x,g]=y.useState(null);return y.useEffect(()=>{l(!0);const b=new URLSearchParams;i&&b.set("search",i),d&&b.set("category",d),m&&b.set("sort",m),J.get(`/skills/registry?${b}`).then(S=>n(cX(S.skills||S.items||(Array.isArray(S)?S:[])))).catch(()=>n([])).finally(()=>l(!1))},[i,d,m]),x?o.jsx(gX,{skill:x,onBack:()=>g(null)}):o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-72",children:o.jsx(Cy,{value:i,onChange:u})}),o.jsx(xX,{selected:d,onSelect:f}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"relative flex-shrink-0",children:[o.jsxs("select",{value:m,onChange:b=>p(b.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[o.jsx("option",{value:"popular",children:"Popular"}),o.jsx("option",{value:"rating",children:"Top Rated"}),o.jsx("option",{value:"newest",children:"Newest"}),o.jsx("option",{value:"name",children:"A-Z"})]}),o.jsx(Dn,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),o.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),o.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:8}).map((b,S)=>o.jsx(_y,{},S)):t.map(b=>o.jsx(OX,{skill:b,onClick:g},b.id))}),!s&&t.length===0&&o.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}function vX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),[i,u]=y.useState(""),d=Mc();return y.useEffect(()=>{l(!0),J.get(`/integrations/registry?search=${encodeURIComponent(i)}`).then(f=>n(f.integrations||f.items||(Array.isArray(f)?f:[]))).catch(()=>n([])).finally(()=>l(!1))},[i]),o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-72",children:o.jsx(Cy,{value:i,onChange:u,placeholder:"Search integrations..."})}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),o.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:6}).map((f,m)=>o.jsx(_y,{},m)):t.map(f=>o.jsx(mX,{item:f,onClick:()=>d.info(`${f.name} — install via CLI: groove integrations install ${f.id}`)},f.id))}),!s&&t.length===0&&o.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]})})}function yX(){const t=D(g=>g.marketplaceAuthenticated),n=D(g=>g.marketplaceLogin),[s,l]=y.useState([]),[i,u]=y.useState([]),[d,f]=y.useState(!0),m=Mc(),p=y.useRef(null);y.useEffect(()=>{f(!0),Promise.all([t?J.get("/auth/purchases").then(g=>g.purchases||[]).catch(()=>[]):Promise.resolve([]),J.get("/skills/installed").then(g=>Array.isArray(g)?g:g.skills||[]).catch(()=>[])]).then(([g,b])=>{l(g),u(b)}).finally(()=>f(!1))},[t]);async function x(g){var S;const b=(S=g.target.files)==null?void 0:S[0];if(b){try{const w=await b.text(),j=b.name.replace(/\.md$/i,"");await J.post("/skills/import",{name:j,content:w}),m.success(`Imported "${j}"`);const $=await J.get("/skills/installed");u(Array.isArray($)?$:$.skills||[])}catch(w){m.error("Import failed",w.message)}g.target.value=""}}return d?o.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map((g,b)=>o.jsx(ra,{className:"h-14 rounded-md"},b))}):o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4 space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{ref:p,type:"file",accept:".md",onChange:x,className:"hidden"}),o.jsxs(Se,{variant:"secondary",size:"md",onClick:()=>{var g;return(g=p.current)==null?void 0:g.click()},className:"gap-1.5",children:[o.jsx(nP,{size:13}),"Import .md Skill"]}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Drop a markdown skill file to install locally"})]}),t&&s.length>0&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[o.jsx(mO,{size:12}),"Purchases (",s.length,")"]}),o.jsx("div",{className:"space-y-1.5",children:s.map(g=>{var b,S;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:g.skill_icon||((S=(b=g.skill_name)==null?void 0:b[0])==null?void 0:S.toUpperCase())||"?"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:g.skill_name||g.skill_id}),o.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",(g.amount||0).toFixed(2)," · ",Wt(g.created_at)]})]}),o.jsx(De,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},g.id||g.skill_id)})})]}),t&&s.length===0&&o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(mO,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(mO,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),o.jsxs(Se,{variant:"primary",size:"sm",onClick:n,className:"gap-1.5 mx-auto",children:[o.jsx(Mf,{size:12})," Sign in"]})]}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[o.jsx(zb,{size:12}),"Installed (",i.length,")"]}),i.length===0?o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(Ef,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No skills installed — browse the Skills tab or import a .md file"})]}):o.jsx("div",{className:"space-y-1.5",children:i.map(g=>{var b,S;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle group",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:g.icon||((S=(b=g.name)==null?void 0:b[0])==null?void 0:S.toUpperCase())||"?"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:g.name||g.id}),o.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:g.description||g.category||"local skill"})]}),o.jsx(De,{variant:"accent",className:"text-2xs flex-shrink-0",children:"Installed"})]},g.id)})})]})]})})}function SX(){const t=D(i=>i.marketplaceAuthenticated),n=D(i=>i.marketplaceUser),s=D(i=>i.marketplaceLogin),l=D(i=>i.marketplaceLogout);return t?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-surface-3 border border-border-subtle",children:[o.jsx("div",{className:"w-4 h-4 rounded-full bg-accent/20 flex items-center justify-center",children:o.jsx(Vb,{size:9,className:"text-accent"})}),o.jsx("span",{className:"text-xs text-text-0 font-sans font-medium max-w-[120px] truncate",children:(n==null?void 0:n.displayName)||(n==null?void 0:n.id)||"Account"})]}),o.jsx("button",{onClick:l,className:"flex items-center gap-1 px-2 py-1.5 rounded text-xs text-text-3 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:o.jsx(Tb,{size:11})})]}):o.jsxs("button",{onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans text-text-0 bg-accent/15 border border-accent/25 rounded hover:bg-accent/25 cursor-pointer transition-colors",children:[o.jsx(Mf,{size:12}),"Sign in"]})}function QX(){const[t,n]=y.useState("skills"),s=[{id:"skills",label:"Skills",icon:Mb},{id:"integrations",label:"Integrations",icon:Rb},{id:"library",label:"My Library",icon:zb}];return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:o.jsxs("div",{className:"flex items-center px-5 h-11",children:[o.jsx("div",{className:"flex items-center",children:s.map(l=>{const i=l.icon;return o.jsxs("button",{onClick:()=>n(l.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===l.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[o.jsx(i,{size:12}),l.label]},l.id)})}),o.jsx("div",{className:"flex-1"}),o.jsx(SX,{})]})}),o.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&o.jsx(bX,{}),t==="integrations"&&o.jsx(vX,{}),t==="library"&&o.jsx(yX,{})]})]})}function jX(t){const n=t+"CollectionProvider",[s,l]=Ts(n),[i,u]=s(n,{collectionRef:{current:null},itemMap:new Map}),d=j=>{const{scope:$,children:k}=j,N=qn.useRef(null),R=qn.useRef(new Map).current;return o.jsx(i,{scope:$,itemMap:R,collectionRef:N,children:k})};d.displayName=n;const f=t+"CollectionSlot",m=Ko(f),p=qn.forwardRef((j,$)=>{const{scope:k,children:N}=j,R=u(f,k),A=rt($,R.collectionRef);return o.jsx(m,{ref:A,children:N})});p.displayName=f;const x=t+"CollectionItemSlot",g="data-radix-collection-item",b=Ko(x),S=qn.forwardRef((j,$)=>{const{scope:k,children:N,...R}=j,A=qn.useRef(null),U=rt($,A),X=u(x,k);return qn.useEffect(()=>(X.itemMap.set(A,{ref:A,...R}),()=>void X.itemMap.delete(A))),o.jsx(b,{[g]:"",ref:U,children:N})});S.displayName=x;function w(j){const $=u(t+"CollectionConsumer",j);return qn.useCallback(()=>{const N=$.collectionRef.current;if(!N)return[];const R=Array.from(N.querySelectorAll(`[${g}]`));return Array.from($.itemMap.values()).sort((X,z)=>R.indexOf(X.ref.current)-R.indexOf(z.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:d,Slot:p,ItemSlot:S},w,l]}var EO="rovingFocusGroup.onEntryFocus",wX={bubbles:!1,cancelable:!0},ci="RovingFocusGroup",[xf,Zy,$X]=jX(ci),[kX,Ay]=Ts(ci,[$X]),[TX,PX]=kX(ci),Ey=y.forwardRef((t,n)=>o.jsx(xf.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(xf.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(NX,{...t,ref:n})})}));Ey.displayName=ci;var NX=y.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:s,orientation:l,loop:i=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...g}=t,b=y.useRef(null),S=rt(n,b),w=Df(u),[j,$]=kc({prop:d,defaultProp:f??null,onChange:m,caller:ci}),[k,N]=y.useState(!1),R=Pt(p),A=Zy(s),U=y.useRef(!1),[X,z]=y.useState(0);return y.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(EO,R),()=>T.removeEventListener(EO,R)},[R]),o.jsx(TX,{scope:s,orientation:l,dir:w,loop:i,currentTabStopId:j,onItemFocus:y.useCallback(T=>$(T),[$]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>z(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>z(T=>T-1),[]),children:o.jsx(We.div,{tabIndex:k||X===0?-1:0,"data-orientation":l,...g,ref:S,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{U.current=!0}),onFocus:Ce(t.onFocus,T=>{const B=!U.current;if(T.target===T.currentTarget&&B&&!k){const V=new CustomEvent(EO,wX);if(T.currentTarget.dispatchEvent(V),!V.defaultPrevented){const le=A().filter(Z=>Z.focusable),Oe=le.find(Z=>Z.active),be=le.find(Z=>Z.id===j),K=[Oe,be,...le].filter(Boolean).map(Z=>Z.ref.current);Yy(K,x)}}U.current=!1}),onBlur:Ce(t.onBlur,()=>N(!1))})})}),qy="RovingFocusGroupItem",My=y.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:s,focusable:l=!0,active:i=!1,tabStopId:u,children:d,...f}=t,m=vl(),p=u||m,x=PX(qy,s),g=x.currentTabStopId===p,b=Zy(s),{onFocusableItemAdd:S,onFocusableItemRemove:w,currentTabStopId:j}=x;return y.useEffect(()=>{if(l)return S(),()=>w()},[l,S,w]),o.jsx(xf.ItemSlot,{scope:s,id:p,focusable:l,active:i,children:o.jsx(We.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...f,ref:n,onMouseDown:Ce(t.onMouseDown,$=>{l?x.onItemFocus(p):$.preventDefault()}),onFocus:Ce(t.onFocus,()=>x.onItemFocus(p)),onKeyDown:Ce(t.onKeyDown,$=>{if($.key==="Tab"&&$.shiftKey){x.onItemShiftTab();return}if($.target!==$.currentTarget)return;const k=XX($,x.orientation,x.dir);if(k!==void 0){if($.metaKey||$.ctrlKey||$.altKey||$.shiftKey)return;$.preventDefault();let R=b().filter(A=>A.focusable).map(A=>A.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const A=R.indexOf($.currentTarget);R=x.loop?_X(R,A+1):R.slice(A+1)}setTimeout(()=>Yy(R))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:j!=null}):d})})});My.displayName=qy;var zX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RX(t,n){return n!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function XX(t,n,s){const l=RX(t.key,s);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return zX[l]}function Yy(t,n=!1){const s=document.activeElement;for(const l of t)if(l===s||(l.focus({preventScroll:n}),document.activeElement!==s))return}function _X(t,n){return t.map((s,l)=>t[(n+l)%t.length])}var CX=Ey,ZX=My,Yc="Tabs",[AX]=Ts(Yc,[Ay]),Vy=Ay(),[EX,dh]=AX(Yc),Uy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,onValueChange:i,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:m="automatic",...p}=t,x=Df(f),[g,b]=kc({prop:l,onChange:i,defaultProp:u??"",caller:Yc});return o.jsx(EX,{scope:s,baseId:vl(),value:g,onValueChange:b,orientation:d,dir:x,activationMode:m,children:o.jsx(We.div,{dir:x,"data-orientation":d,...p,ref:n})})});Uy.displayName=Yc;var Gy="TabsList",Ly=y.forwardRef((t,n)=>{const{__scopeTabs:s,loop:l=!0,...i}=t,u=dh(Gy,s),d=Vy(s);return o.jsx(CX,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:o.jsx(We.div,{role:"tablist","aria-orientation":u.orientation,...i,ref:n})})});Ly.displayName=Gy;var Dy="TabsTrigger",Wy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,disabled:i=!1,...u}=t,d=dh(Dy,s),f=Vy(s),m=Iy(d.baseId,l),p=Fy(d.baseId,l),x=l===d.value;return o.jsx(ZX,{asChild:!0,...f,focusable:!i,active:x,children:o.jsx(We.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:m,...u,ref:n,onMouseDown:Ce(t.onMouseDown,g=>{!i&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:Ce(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:Ce(t.onFocus,()=>{const g=d.activationMode!=="manual";!x&&!i&&g&&d.onValueChange(l)})})})});Wy.displayName=Dy;var By="TabsContent",Hy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,forceMount:i,children:u,...d}=t,f=dh(By,s),m=Iy(f.baseId,l),p=Fy(f.baseId,l),x=l===f.value,g=y.useRef(x);return y.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),o.jsx(xa,{present:i||x,children:({present:b})=>o.jsx(We.div,{"data-state":x?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:p,tabIndex:0,...d,ref:n,style:{...t.style,animationDuration:g.current?"0s":void 0},children:b&&u})})});Hy.displayName=By;function Iy(t,n){return`${t}-trigger-${n}`}function Fy(t,n){return`${t}-content-${n}`}var qX=Uy,MX=Ly,YX=Wy,VX=Hy;function UX({children:t,...n}){return o.jsx(qX,{...n,children:t})}function GX({children:t,className:n,...s}){return o.jsx(MX,{className:se("flex items-center gap-0 border-b border-border-subtle",n),...s,children:t})}function F1({children:t,className:n,...s}){return o.jsx(YX,{className:se("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",n),...s,children:t})}function K1({children:t,className:n,...s}){return o.jsx(VX,{className:se("flex-1 min-h-0",n),...s,children:t})}function LX({children:t,className:n,hover:s,...l}){return o.jsx("div",{className:se("rounded-md border border-border bg-surface-1",s&&"hover:border-accent/50 hover:bg-surface-2 transition-all duration-150 cursor-pointer",n),...l,children:t})}function DX(){const t=D(l=>l.pendingApprovals),n=D(l=>l.approveRequest),s=D(l=>l.rejectRequest);return t.length===0?null:o.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Xc,{size:13,className:"text-warning"}),o.jsxs("span",{className:"text-xs font-semibold text-warning font-sans",children:["Pending Approval (",t.length,")"]})]}),t.map(l=>{var i,u,d;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-warning/5 border border-warning/20",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[l.agentName,": ",((i=l.action)==null?void 0:i.description)||((u=l.action)==null?void 0:u.type)||"action"]}),((d=l.action)==null?void 0:d.filePath)&&o.jsx("div",{className:"text-2xs text-text-3 font-mono truncate mt-0.5",children:l.action.filePath}),o.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:Wt(l.requestedAt)})]}),o.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[o.jsxs(Se,{variant:"primary",size:"sm",onClick:()=>n(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[o.jsx(Eb,{size:11})," Approve"]}),o.jsxs(Se,{variant:"danger",size:"sm",onClick:()=>s(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[o.jsx(D5,{size:11})," Reject"]})]})]},l.id)})]})}function WX(){const t=D(m=>m.resolvedApprovals),[n,s]=y.useState([]),[l,i]=y.useState(!0);y.useEffect(()=>{const m=setInterval(u,4e3);return u(),()=>clearInterval(m)},[]);async function u(){try{const m=await J.get("/pm/history");s(m.history||m||[])}catch{}i(!1)}const d=new Set,f=[...t,...n].filter(m=>{const p=m.id||`${m.agentName}-${m.timestamp}`;return d.has(p)?!1:(d.add(p),!0)});return l&&f.length===0?o.jsx("div",{className:"p-4 space-y-2",children:[...Array(4)].map((m,p)=>o.jsx(ra,{className:"h-12 rounded-md"},p))}):o.jsxs(Na,{className:"flex-1",children:[o.jsx(DX,{}),o.jsxs("div",{className:"p-4 space-y-2",children:[f.length===0&&o.jsxs("div",{className:"text-center py-12 text-text-4 font-sans",children:[o.jsx(Lr,{size:32,className:"mx-auto mb-2"}),o.jsx("p",{className:"text-sm",children:"No approval history"}),o.jsx("p",{className:"text-2xs text-text-4 mt-1",children:'Approvals appear when agents use "Agent Approve" permission mode'})]}),f.map((m,p)=>{var x;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-surface-1 border border-border-subtle",children:[m.status==="approved"||m.verdict==="approved"?o.jsx(Lr,{size:14,className:"text-success flex-shrink-0"}):o.jsx(TT,{size:14,className:"text-danger flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"text-xs text-text-0 font-sans truncate",children:[m.agentName,": ",((x=m.action)==null?void 0:x.description)||m.action||"action"]}),m.reason&&o.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:m.reason})]}),o.jsx("span",{className:"text-2xs text-text-4 font-sans flex-shrink-0",children:Wt(m.resolvedAt||m.timestamp)})]},m.id||p)})]})]})}function BX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),i=Mc();y.useEffect(()=>{const f=setInterval(u,1e4);return u(),()=>clearInterval(f)},[]);async function u(){try{const f=await J.get("/schedules");n(f.schedules||f||[])}catch{}l(!1)}async function d(f,m){try{await J.post(`/schedules/${f}/${m?"disable":"enable"}`),u()}catch(p){i.error("Failed to toggle schedule",p.message)}}return s?o.jsx("div",{className:"p-4 space-y-2",children:[...Array(3)].map((f,m)=>o.jsx(ra,{className:"h-16 rounded-md"},m))}):o.jsx(Na,{className:"flex-1",children:o.jsxs("div",{className:"p-4 space-y-2",children:[t.length===0&&o.jsxs("div",{className:"text-center py-12 text-text-4 font-sans",children:[o.jsx(rc,{size:32,className:"mx-auto mb-2"}),o.jsx("p",{className:"text-sm",children:"No schedules configured"})]}),t.map(f=>o.jsx(LX,{className:"p-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:f.name}),o.jsx(De,{variant:f.enabled?"success":"default",children:f.enabled?"Active":"Paused"})]}),o.jsxs("div",{className:"text-2xs text-text-3 font-mono mt-0.5",children:[f.cron," · ",f.role]})]}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>d(f.id,f.enabled),children:f.enabled?"Pause":"Enable"})]})},f.id))]})})}function HX(){return o.jsxs(UX,{defaultValue:"approvals",className:"flex flex-col h-full",children:[o.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[o.jsx("div",{className:"flex items-center gap-4 mb-0",children:o.jsx("h2",{className:"text-base font-semibold text-text-0 font-sans",children:"Management"})}),o.jsxs(GX,{className:"border-b-0",children:[o.jsx(F1,{value:"approvals",children:"Approvals"}),o.jsx(F1,{value:"schedules",children:"Schedules"})]})]}),o.jsx(K1,{value:"approvals",className:"flex-1 min-h-0",children:o.jsx(WX,{})}),o.jsx(K1,{value:"schedules",className:"flex-1 min-h-0",children:o.jsx(BX,{})})]})}const IX={code:"Code",general:"General"},FX={light:"text-success",medium:"text-accent",heavy:"text-warning"};function KX(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function Ky({hardware:t}){if(!t)return null;const{totalRamGb:n,gpu:s,isAppleSilicon:l}=t;return o.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[o.jsx(Yf,{size:14,className:"text-text-3 flex-shrink-0"}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[o.jsxs("span",{className:"text-text-0 font-semibold",children:[n," GB RAM"]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-text-4",children:"·"}),o.jsx("span",{className:"text-text-2",children:s.name})]}),l&&o.jsx(De,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function JX({onRecheck:t}){const[n,s]=y.useState(null),[l,i]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),p=D(A=>A.addToast);y.useEffect(()=>{J.post("/providers/ollama/check").then(s).catch(()=>{})},[]);async function x(){i(!0);try{const A=await J.post("/providers/ollama/check");s(A),A.installed&&A.serverRunning?(p("success","Ollama is ready!"),t()):A.installed?p("info","Ollama installed — server needs to start"):p("info","Ollama not found — install and try again")}catch{}i(!1)}async function g(){d(!0);try{if((await J.post("/providers/ollama/serve")).ok){p("success","Ollama server started!");const U=await J.post("/providers/ollama/check");s(U),U.serverRunning&&t()}}catch(A){p("error","Could not start server",A.message)}d(!1)}function b(A){navigator.clipboard.writeText(A),m(!0),setTimeout(()=>m(!1),2e3)}if(!n)return o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:S,install:w,requirements:j,installed:$,serverRunning:k}=n,N=S.totalRamGb>=j.minRAM,R=S.recommended;return o.jsxs("div",{className:"space-y-3 p-3",children:[o.jsx(Ky,{hardware:S}),N?o.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[o.jsx(la,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans",children:[o.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),o.jsx("span",{className:"text-text-2 ml-1",children:R.code?`Recommended: ${R.code}`:`${S.totalRamGb} GB RAM available`})]})]}):o.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[o.jsx(Ss,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans text-text-2",children:[o.jsxs("span",{className:"text-warning font-semibold",children:[S.totalRamGb," GB RAM detected."]})," ","Minimum ",j.minRAM," GB needed. Smallest models may still work."]})]}),$&&!k&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[o.jsx(Ss,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans text-text-2",children:[o.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),o.jsxs(Se,{variant:"primary",size:"md",onClick:g,disabled:u,className:"w-full gap-1.5",children:[o.jsx(In,{size:12}),u?"Starting...":"Start Ollama Server"]})]}),!$&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:w.command}),o.jsxs(Se,{variant:"secondary",size:"sm",onClick:()=>b(w.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[f?o.jsx(la,{size:12}):o.jsx(nf,{size:12}),f?"Copied":"Copy"]})]}),w.alt&&o.jsx("p",{className:"text-2xs text-text-4 font-sans",children:w.alt})]}),o.jsxs(Se,{variant:"secondary",size:"md",onClick:x,disabled:l,className:"w-full gap-1.5",children:[o.jsx(_l,{size:12,className:l?"animate-spin":""}),l?"Checking...":$?"Check again":"I installed it — check again"]})]})}function e_({model:t,isInstalled:n,isRecommended:s,canRun:l,onPull:i,onDelete:u,pulling:d}){const f=d===t.id;return o.jsxs("div",{className:se("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!l&&"opacity-40"),children:[n?o.jsx(la,{size:12,className:"text-success flex-shrink-0"}):o.jsx("div",{className:"w-3"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),s&&o.jsx(Yb,{size:10,className:"text-warning flex-shrink-0"})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[o.jsx("span",{className:se("text-2xs font-semibold font-sans",FX[t.tier]),children:t.tier}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:KX(t.sizeGb)}),o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),n?o.jsx("button",{onClick:()=>u(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:o.jsx(Rc,{size:12})}):l?o.jsx(Se,{variant:"secondary",size:"sm",onClick:()=>i(t.id),disabled:!!d,className:"h-7 px-2 text-2xs gap-1",children:f?o.jsxs(o.Fragment,{children:[o.jsx(_l,{size:10,className:"animate-spin"})," Pulling..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Ef,{size:10})," Pull"]})}):o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function t_({onModelChange:t}){var U,X;const[n,s]=y.useState(null),[l,i]=y.useState(null),[u,d]=y.useState("code"),[f,m]=y.useState(!1),p=D(z=>z.addToast);function x(){J.get("/providers/ollama/models").then(s).catch(()=>{})}y.useEffect(()=>{x()},[]);async function g(z){i(z);try{await J.post("/providers/ollama/pull",{model:z}),p("success",`Pulled ${z}`),x(),t&&t()}catch(T){p("error",`Pull failed: ${T.message}`)}i(null)}async function b(z){try{await J.delete(`/providers/ollama/models/${encodeURIComponent(z)}`),p("info",`Removed ${z}`),x(),t&&t()}catch(T){p("error",`Delete failed: ${T.message}`)}}if(!n)return o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:S,catalog:w,hardware:j}=n,$=new Set(S.map(z=>z.id)),k=j.totalRamGb,N=[(U=j.recommended)==null?void 0:U.code,(X=j.recommended)==null?void 0:X.general].filter(Boolean),R=w.filter(z=>z.category===u),A=f?R:R.filter(z=>z.ramGb<=k);return o.jsxs("div",{className:"space-y-2 p-3",children:[o.jsx(Ky,{hardware:j}),S.length>0&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[o.jsx(wb,{size:12,className:"text-text-3"}),o.jsx("span",{className:"font-semibold",children:S.length})," model",S.length!==1?"s":""," installed"]}),o.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(IX).map(([z,T])=>o.jsx("button",{onClick:()=>d(z),className:se("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",u===z?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:T},z))}),o.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[A.map(z=>o.jsx(e_,{model:z,isInstalled:$.has(z.id),isRecommended:N.includes(z.id),canRun:z.ramGb<=k,onPull:g,onDelete:b,pulling:l},z.id)),A.length===0&&o.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",u," models available for your hardware"]})]}),!f&&R.length>A.length&&o.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[o.jsx(Dn,{size:10}),"Show ",R.length-A.length," more (exceed your RAM)"]})]})}function Jy({isInstalled:t,onModelChange:n}){const[s,l]=y.useState(!1),[i,u]=y.useState(!1);return y.useEffect(()=>{t?J.post("/providers/ollama/check").then(d=>{l(d.installed&&d.serverRunning),u(!0)}).catch(()=>u(!0)):u(!0)},[t]),i?s?o.jsx(t_,{onModelChange:n}):o.jsx(JX,{onRecheck:()=>{l(!0),n&&n()}}):o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}var qO="focusScope.autoFocusOnMount",MO="focusScope.autoFocusOnUnmount",J1={bubbles:!1,cancelable:!0},a_="FocusScope",eS=y.forwardRef((t,n)=>{const{loop:s=!1,trapped:l=!1,onMountAutoFocus:i,onUnmountAutoFocus:u,...d}=t,[f,m]=y.useState(null),p=Pt(i),x=Pt(u),g=y.useRef(null),b=rt(n,j=>m(j)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(l){let j=function(R){if(S.paused||!f)return;const A=R.target;f.contains(A)?g.current=A:Mn(g.current,{select:!0})},$=function(R){if(S.paused||!f)return;const A=R.relatedTarget;A!==null&&(f.contains(A)||Mn(g.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const U of R)U.removedNodes.length>0&&Mn(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",$);const N=new MutationObserver(k);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",$),N.disconnect()}}},[l,f,S.paused]),y.useEffect(()=>{if(f){t0.add(S);const j=document.activeElement;if(!f.contains(j)){const k=new CustomEvent(qO,J1);f.addEventListener(qO,p),f.dispatchEvent(k),k.defaultPrevented||(n_(o_(tS(f)),{select:!0}),document.activeElement===j&&Mn(f))}return()=>{f.removeEventListener(qO,p),setTimeout(()=>{const k=new CustomEvent(MO,J1);f.addEventListener(MO,x),f.dispatchEvent(k),k.defaultPrevented||Mn(j??document.body,{select:!0}),f.removeEventListener(MO,x),t0.remove(S)},0)}}},[f,p,x,S]);const w=y.useCallback(j=>{if(!s&&!l||S.paused)return;const $=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,k=document.activeElement;if($&&k){const N=j.currentTarget,[R,A]=s_(N);R&&A?!j.shiftKey&&k===A?(j.preventDefault(),s&&Mn(R,{select:!0})):j.shiftKey&&k===R&&(j.preventDefault(),s&&Mn(A,{select:!0})):k===N&&j.preventDefault()}},[s,l,S.paused]);return o.jsx(We.div,{tabIndex:-1,...d,ref:b,onKeyDown:w})});eS.displayName=a_;function n_(t,{select:n=!1}={}){const s=document.activeElement;for(const l of t)if(Mn(l,{select:n}),document.activeElement!==s)return}function s_(t){const n=tS(t),s=e0(n,t),l=e0(n.reverse(),t);return[s,l]}function tS(t){const n=[],s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const i=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||i?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n}function e0(t,n){for(const s of t)if(!l_(s,{upTo:n}))return s}function l_(t,{upTo:n}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(n!==void 0&&t===n)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function r_(t){return t instanceof HTMLInputElement&&"select"in t}function Mn(t,{select:n=!1}={}){if(t&&t.focus){const s=document.activeElement;t.focus({preventScroll:!0}),t!==s&&r_(t)&&n&&t.select()}}var t0=i_();function i_(){let t=[];return{add(n){const s=t[0];n!==s&&(s==null||s.pause()),t=a0(t,n),t.unshift(n)},remove(n){var s;t=a0(t,n),(s=t[0])==null||s.resume()}}}function a0(t,n){const s=[...t],l=s.indexOf(n);return l!==-1&&s.splice(l,1),s}function o_(t){return t.filter(n=>n.tagName!=="A")}var YO=0;function c_(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??n0()),document.body.insertAdjacentElement("beforeend",t[1]??n0()),YO++,()=>{YO===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),YO--}},[])}function n0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Qa=function(){return Qa=Object.assign||function(n){for(var s,l=1,i=arguments.length;l<i;l++){s=arguments[l];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(n[u]=s[u])}return n},Qa.apply(this,arguments)};function aS(t,n){var s={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&n.indexOf(l)<0&&(s[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,l=Object.getOwnPropertySymbols(t);i<l.length;i++)n.indexOf(l[i])<0&&Object.prototype.propertyIsEnumerable.call(t,l[i])&&(s[l[i]]=t[l[i]]);return s}function u_(t,n,s){if(s||arguments.length===2)for(var l=0,i=n.length,u;l<i;l++)(u||!(l in n))&&(u||(u=Array.prototype.slice.call(n,0,l)),u[l]=n[l]);return t.concat(u||Array.prototype.slice.call(n))}var Io="right-scroll-bar-position",Fo="width-before-scroll-bar",d_="with-scroll-bars-hidden",O_="--removed-body-scroll-bar-size";function VO(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function f_(t,n){var s=y.useState(function(){return{value:t,callback:n,facade:{get current(){return s.value},set current(l){var i=s.value;i!==l&&(s.value=l,s.callback(l,i))}}}})[0];return s.callback=n,s.facade}var h_=typeof window<"u"?y.useLayoutEffect:y.useEffect,s0=new WeakMap;function m_(t,n){var s=f_(null,function(l){return t.forEach(function(i){return VO(i,l)})});return h_(function(){var l=s0.get(s);if(l){var i=new Set(l),u=new Set(t),d=s.current;i.forEach(function(f){u.has(f)||VO(f,null)}),u.forEach(function(f){i.has(f)||VO(f,d)})}s0.set(s,t)},[t]),s}function p_(t){return t}function x_(t,n){n===void 0&&(n=p_);var s=[],l=!1,i={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:t},useMedium:function(u){var d=n(u,l);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(l=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(f){return u(f)},filter:function(){return s}}},assignMedium:function(u){l=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(u),d=s}var m=function(){var x=d;d=[],x.forEach(u)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(x){d.push(x),p()},filter:function(x){return d=d.filter(x),s}}}};return i}function g_(t){t===void 0&&(t={});var n=x_(null);return n.options=Qa({async:!0,ssr:!1},t),n}var nS=function(t){var n=t.sideCar,s=aS(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=n.read();if(!l)throw new Error("Sidecar medium not found");return y.createElement(l,Qa({},s))};nS.isSideCarExport=!0;function b_(t,n){return t.useMedium(n),nS}var sS=g_(),UO=function(){},Vc=y.forwardRef(function(t,n){var s=y.useRef(null),l=y.useState({onScrollCapture:UO,onWheelCapture:UO,onTouchMoveCapture:UO}),i=l[0],u=l[1],d=t.forwardProps,f=t.children,m=t.className,p=t.removeScrollBar,x=t.enabled,g=t.shards,b=t.sideCar,S=t.noRelative,w=t.noIsolation,j=t.inert,$=t.allowPinchZoom,k=t.as,N=k===void 0?"div":k,R=t.gapMode,A=aS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=b,X=m_([s,n]),z=Qa(Qa({},A),i);return y.createElement(y.Fragment,null,x&&y.createElement(U,{sideCar:sS,removeScrollBar:p,shards:g,noRelative:S,noIsolation:w,inert:j,setCallbacks:u,allowPinchZoom:!!$,lockRef:s,gapMode:R}),d?y.cloneElement(y.Children.only(f),Qa(Qa({},z),{ref:X})):y.createElement(N,Qa({},z,{className:m,ref:X}),f))});Vc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vc.classNames={fullWidth:Fo,zeroRight:Io};var v_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=v_();return n&&t.setAttribute("nonce",n),t}function S_(t,n){t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n))}function Q_(t){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(t)}var j_=function(){var t=0,n=null;return{add:function(s){t==0&&(n=y_())&&(S_(n,s),Q_(n)),t++},remove:function(){t--,!t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},w_=function(){var t=j_();return function(n,s){y.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&s])}},lS=function(){var t=w_(),n=function(s){var l=s.styles,i=s.dynamic;return t(l,i),null};return n},$_={left:0,top:0,right:0,gap:0},GO=function(t){return parseInt(t||"",10)||0},k_=function(t){var n=window.getComputedStyle(document.body),s=n[t==="padding"?"paddingLeft":"marginLeft"],l=n[t==="padding"?"paddingTop":"marginTop"],i=n[t==="padding"?"paddingRight":"marginRight"];return[GO(s),GO(l),GO(i)]},T_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return $_;var n=k_(t),s=document.documentElement.clientWidth,l=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,l-s+n[2]-n[0])}},P_=lS(),Ql="data-scroll-locked",N_=function(t,n,s,l){var i=t.left,u=t.top,d=t.right,f=t.gap;return s===void 0&&(s="margin"),`
525
+ `,{label:"if",detail:"block",type:"keyword"}),He("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),He("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),He("import ${module}",{label:"import",detail:"statement",type:"keyword"}),He("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],VR=g0(ky,b0(MR.concat(YR)));function _O(t){let{node:n,pos:s}=t,l=t.lineIndent(s,-1),i=null;for(;;){let u=n.childBefore(s);if(u)if(u.name=="Comment")s=u.from;else if(u.name=="Body"||u.name=="MatchBody")t.baseIndentFor(u)+t.unit<=l&&(i=u),n=u;else if(u.name=="MatchClause")n=u;else if(u.type.is("Statement"))n=u;else break;else break}return i}function CO(t,n){let s=t.baseIndentFor(n),l=t.lineAt(t.pos,-1),i=l.from+l.text.length;return/^\s*($|#)/.test(l.text)&&t.node.to<i+100&&!/\S/.test(t.state.sliceDoc(i,t.node.to))&&t.lineIndent(t.pos,-1)<=s||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>s?null:s+t.unit}const ZO=ti.define({name:"python",parser:AR.configure({props:[zl.add({Body:t=>{var n;let s=/^\s*(#|$)/.test(t.textAfter)&&_O(t)||t.node;return(n=CO(t,s))!==null&&n!==void 0?n:t.continue()},MatchBody:t=>{var n;let s=_O(t);return(n=CO(t,s||t.node))!==null&&n!==void 0?n:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Uo({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Uo({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Uo({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var n;let s=_O(t);return(n=s&&CO(t,s))!==null&&n!==void 0?n:t.continue()}}),ks.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Sc,Body:(t,n)=>({from:t.from+1,to:t.to-(t.to==n.doc.length?0:1)}),"String FormatString":(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function UR(){return new vs(ZO,[ZO.data.of({autocomplete:qR}),ZO.data.of({autocomplete:VR})])}const Ao={javascript:()=>of({jsx:!0,typescript:!1}),typescript:()=>of({jsx:!0,typescript:!0}),css:()=>jv(),html:()=>Uv(),json:()=>Ez(),markdown:()=>Q4(),python:()=>UR()},GR=jl.theme({"&":{backgroundColor:"#24282f",color:"#bcc2cd",fontFamily:"var(--font-mono)",fontSize:"13px",height:"100%"},".cm-scroller":{overflow:"auto"},".cm-content":{caretColor:"#33afbc"},".cm-cursor":{borderLeftColor:"#33afbc"},".cm-gutters":{backgroundColor:"#24282f",borderRight:"1px solid #2c313a",color:"#505862"},".cm-activeLineGutter":{backgroundColor:"#2c313a"},".cm-activeLine":{backgroundColor:"rgba(44, 49, 58, 0.5)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}},{dark:!0});function LR({content:t,language:n,onChange:s,onSave:l}){const i=y.useRef(null),u=y.useRef(null),d=y.useRef(new Tj),f=y.useRef(s),m=y.useRef(l);return f.current=s,m.current=l,y.useEffect(()=>{if(!i.current)return;const p=Ao[n]||Ao.javascript,x=BO.of([{key:"Mod-s",run:()=>{var S;return(S=m.current)==null||S.call(m),!0}}]),g=Q0.create({doc:t||"",extensions:[Nj(),zj(),Rj(),Xj(),_j(),Cj(),Zj(),BO.of([...Aj,...Ej,...qj]),x,Pj,GR,d.current.of(p()),jl.updateListener.of(S=>{var w;S.docChanged&&((w=f.current)==null||w.call(f,S.state.doc.toString()))})]}),b=new jl({state:g,parent:i.current});return u.current=b,()=>{b.destroy(),u.current=null}},[]),y.useEffect(()=>{const p=u.current;if(!p)return;const x=p.state.doc.toString();t!==x&&p.dispatch({changes:{from:0,to:x.length,insert:t||""}})},[t]),y.useEffect(()=>{const p=u.current;if(!p)return;const x=Ao[n]||Ao.javascript;p.dispatch({effects:d.current.reconfigure(x())})},[n]),o.jsx("div",{ref:i,className:"w-full h-full overflow-hidden"})}const DR=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],Ty=["mp4","webm","mov","avi","mkv","ogv"];function WR(t){var s;const n=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return DR.includes(n)||Ty.includes(n)}function BR({path:t}){var u;const n=(u=t.split(".").pop())==null?void 0:u.toLowerCase(),s=`/api/files/raw?path=${encodeURIComponent(t)}`,l=t.split("/").pop(),i=Ty.includes(n);return o.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[o.jsx(De,{children:n==null?void 0:n.toUpperCase()}),o.jsx("span",{className:"font-mono",children:l}),o.jsx("a",{href:s,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:o.jsx(ic,{size:12})})]}),i?o.jsx("video",{src:s,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):o.jsx("img",{src:s,alt:l,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}function HR(){const t=D(b=>b.editorActiveFile),n=D(b=>b.editorFiles),s=D(b=>b.editorChangedFiles),l=D(b=>b.updateFileContent),i=D(b=>b.saveFile),u=D(b=>b.reloadFile),d=D(b=>b.dismissFileChange),[f,m]=y.useState("");y.useEffect(()=>{J.get("/files/root").then(b=>m(b.root||"")).catch(()=>{})},[]);const p=t?n[t]:null,x=t&&WR(t),g=t&&s[t];return o.jsxs("div",{className:"flex h-full",children:[o.jsx("div",{className:"w-60 flex-shrink-0 border-r border-border",children:o.jsx(fN,{rootDir:f})}),o.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[o.jsx(hN,{}),o.jsxs("div",{className:"flex-1 relative min-h-0",children:[g&&o.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center gap-2 px-4 py-2 bg-warning/10 border-b border-warning/20",children:[o.jsx(Xc,{size:14,className:"text-warning"}),o.jsx("span",{className:"text-xs text-warning font-sans flex-1",children:"File modified externally"}),o.jsxs(Se,{variant:"ghost",size:"sm",onClick:()=>u(t),children:[o.jsx(_l,{size:12})," Reload"]}),o.jsxs(Se,{variant:"ghost",size:"sm",onClick:()=>d(t),children:[o.jsx(Nt,{size:12})," Dismiss"]})]}),!t&&o.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx(Ta,{size:32,className:"mx-auto"}),o.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&x&&o.jsx(BR,{path:t}),t&&!x&&p&&o.jsx(LR,{content:p.content,language:p.language,onChange:b=>l(t,b),onSave:()=>i(t)})]})]})]})}function IR(){const t=D(p=>p.connected),n=D(p=>p.agents),[s,l]=y.useState(null),[i,u]=y.useState(!0),[d,f]=y.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[]}),m=y.useRef(0);return y.useEffect(()=>{if(!t)return;let p=!0;async function x(){try{const b=await J.get("/dashboard");if(!p)return;l(b),u(!1),m.current=Date.now(),f(S=>{var $,k,N,R;const w=Date.now(),j=(A,U)=>[...A.slice(-59),{t:w,v:U||0}];return{tokens:j(S.tokens,($=b.tokens)==null?void 0:$.totalUsed),cost:j(S.cost,(k=b.tokens)==null?void 0:k.totalCostUsd),saved:j(S.saved,(N=b.tokens)==null?void 0:N.totalSaved),efficiency:j(S.efficiency,(()=>{var U,X,z;const A=(((U=b.tokens)==null?void 0:U.totalUsed)||0)+(((X=b.tokens)==null?void 0:X.totalSaved)||0);return A>0?(((z=b.tokens)==null?void 0:z.totalSaved)||0)/A*100:0})()),cache:j(S.cache,(R=b.tokens)==null?void 0:R.cacheHitRate)}})}catch{p&&u(!1)}}x();const g=setInterval(x,4e3);return()=>{p=!1,clearInterval(g)}},[t]),{data:s,loading:i,agents:n,connected:t,kpiHistory:d,lastFetch:m.current}}function D1({connected:t,runningCount:n,totalCount:s,uptime:l,lastFetch:i}){return o.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border",children:[o.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Command Center"}),o.jsx("div",{className:"flex-1"}),t&&o.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[o.jsxs("span",{children:[n,"/",s," agents"]}),l>0&&o.jsxs("span",{children:["Up ",Cc(l)]}),i>0&&o.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[o.jsx(_l,{size:10})," ",Wt(i)]})]}),o.jsx(Qs,{status:t?"running":"crashed",size:"sm"})]})}const Ie={surface4:"#2c313a",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd"};function FR({data:t,color:n=Ie.accent,width:s=80,height:l=24}){if(!t||t.length<2)return o.jsx("div",{style:{width:s,height:l}});const i=t.map(p=>p.v),u=Math.min(...i),f=Math.max(...i)-u||1,m=t.map((p,x)=>{const g=x/(t.length-1)*s,b=l-(p.v-u)/f*(l-2)-1;return`${g},${b}`}).join(" ");return o.jsxs("svg",{width:s,height:l,className:"flex-shrink-0",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:`kpi-${n}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:n,stopOpacity:"0.3"}),o.jsx("stop",{offset:"100%",stopColor:n,stopOpacity:"0"})]})}),o.jsx("polygon",{points:`0,${l} ${m} ${s},${l}`,fill:`url(#kpi-${n})`}),o.jsx("polyline",{points:m,fill:"none",stroke:n,strokeWidth:"1.5",strokeLinejoin:"round"})]})}function Ar({label:t,value:n,sparkData:s,color:l=Ie.accent,className:i}){return o.jsxs("div",{className:se("flex items-center gap-3 px-4 py-3 bg-surface-1 border-b border-border-subtle min-w-0",i),children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-2xs text-text-3 font-sans uppercase tracking-wider mb-0.5 truncate",children:t}),o.jsx("div",{className:"text-lg font-semibold font-mono text-text-0 tabular-nums",children:n})]}),o.jsx(FR,{data:s,color:l})]})}function KR(t){return t?t.split(/[\s\-_]+/).map(n=>n[0]).join("").toUpperCase().slice(0,2):"?"}function JR({name:t,role:n,size:s="md",spinning:l,className:i}){const u=Gf(n),d={sm:"w-6 h-6 text-2xs",md:"w-7 h-7 text-xs",lg:"w-10 h-10 text-sm"};return o.jsxs("div",{className:se("relative inline-flex",i),children:[l&&o.jsx("div",{className:"absolute inset-[-2px] rounded-full animate-[spin-slow_3s_linear_infinite]",style:{background:`conic-gradient(${u.border}, transparent, ${u.border})`,mask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",WebkitMask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))"}}),o.jsx("div",{className:se("rounded-full flex items-center justify-center font-semibold font-sans select-none",d[s]),style:{background:u.bg,color:u.text},children:KR(t)})]})}function eX({agents:t}){if(!(t!=null&&t.length))return o.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-4 font-sans p-4",children:"No agents running"});const n={};for(const s of t){const l=s.teamId||"Ungrouped";n[l]||(n[l]=[]),n[l].push(s)}return o.jsx(Na,{className:"flex-1",children:o.jsx("div",{className:"p-3 space-y-4",children:Object.entries(n).map(([s,l])=>o.jsxs("div",{children:[o.jsx("div",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2",children:s}),o.jsx("div",{className:"space-y-1",children:l.map(i=>o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-5 transition-colors",children:[o.jsx(Qs,{status:i.status,size:"sm"}),o.jsx(JR,{name:i.name,role:i.role,size:"sm"}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx("div",{className:"text-xs text-text-0 font-sans truncate",children:i.name})}),o.jsx("span",{className:"text-2xs font-mono text-text-3",children:Dt(i.tokensUsed||0)}),o.jsx("div",{className:"w-10 h-1 bg-surface-0 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(i.contextUsage||0,100)}%`,background:(i.contextUsage||0)>=80?"var(--color-danger)":(i.contextUsage||0)>=60?"var(--color-warning)":"var(--color-success)"}})})]},i.id))})]},s))})})}function AO({label:t,value:n,total:s,color:l}){const i=s>0?n/s*100:0;return o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs font-sans",children:[o.jsx("span",{className:"text-text-2",children:t}),o.jsx("span",{className:"text-text-0 font-mono",children:Dt(n)})]}),o.jsx("div",{className:"h-1.5 bg-surface-0 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(i,100)}%`,background:l}})})]})}function xs({label:t,value:n}){return o.jsxs("div",{className:"flex items-center justify-between text-xs font-sans",children:[o.jsx("span",{className:"text-text-3",children:t}),o.jsx("span",{className:"text-text-0 font-mono",children:n})]})}function tX({data:t,rotation:n,routing:s,adaptive:l}){var x,g;if(!t)return null;const{totalSaved:i=0,rotationSaved:u=0,conflictSaved:d=0,coldStartSaved:f=0,totalUsed:m=0}=t,p=m+i;return o.jsxs("div",{className:"p-4 space-y-5 overflow-y-auto h-full",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-xl font-semibold font-mono text-success",children:Dt(i)}),o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"tokens saved"}),p>0&&o.jsxs("span",{className:"text-xs text-text-4 font-sans",children:["(",qr(i/p*100),")"]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(AO,{label:"Rotation savings",value:u,total:p,color:Ie.accent}),o.jsx(AO,{label:"Conflict prevention",value:d,total:p,color:Ie.purple}),o.jsx(AO,{label:"Cold-start prevention",value:f,total:p,color:Ie.info})]}),n&&(n.totalRotations>0||((x=n.history)==null?void 0:x.length)>0)&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Rotations"}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(xs,{label:"Total rotations",value:n.totalRotations||0}),o.jsx(xs,{label:"Tokens saved",value:Dt(n.totalTokensSaved||0)})]}),((g=n.history)==null?void 0:g.length)>0&&o.jsx("div",{className:"space-y-1 mt-2",children:n.history.slice(-5).reverse().map((b,S)=>o.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-3 font-sans px-2 py-1 bg-surface-0 rounded",children:[o.jsx("span",{className:"text-text-1 font-medium capitalize",children:b.agentName||b.role}),o.jsx("span",{className:"font-mono",children:qr((b.contextUsage||0)*100)}),o.jsx("span",{className:"ml-auto text-text-4",children:Wt(b.timestamp)})]},S))})]}),s&&s.totalDecisions>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Model Routing"}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(xs,{label:"Auto-routed agents",value:s.autoRoutedCount||0}),o.jsx(xs,{label:"Total decisions",value:s.totalDecisions||0}),s.byTier&&o.jsxs(o.Fragment,{children:[o.jsx(xs,{label:"Heavy (Opus)",value:s.byTier.heavy||0}),o.jsx(xs,{label:"Medium (Sonnet)",value:s.byTier.medium||0}),o.jsx(xs,{label:"Light (Haiku)",value:s.byTier.light||0})]})]})]}),(l==null?void 0:l.length)>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Adaptive Thresholds"}),o.jsx("div",{className:"space-y-1",children:l.map(b=>o.jsxs("div",{className:"flex items-center gap-2 text-2xs font-sans px-2 py-1 bg-surface-0 rounded",children:[o.jsx("span",{className:"text-text-1 font-mono flex-1 truncate",children:b.key}),o.jsx("span",{className:"font-mono text-text-0",children:qr(b.threshold*100)}),o.jsx("span",{className:se("text-2xs",b.converged?"text-success":"text-text-4"),children:b.converged?"converged":`${b.adjustments} adj`})]},b.key))})]})]})}function aX({data:t,width:n,height:s}){const l=y.useRef(null);return y.useEffect(()=>{const i=l.current;if(!i||!(t!=null&&t.length))return;const u=i.getContext("2d"),d=window.devicePixelRatio||1;i.width=n*d,i.height=s*d,u.scale(d,d),u.clearRect(0,0,n,s);const f={top:12,right:60,bottom:28,left:60},m=n-f.left-f.right,p=s-f.top-f.bottom,x=t.map(j=>j.tokens||0),g=t.map(j=>j.costUsd||0),b=Math.max(...x,1),S=Math.max(...g,.01);u.strokeStyle=Ie.surface4,u.lineWidth=.5;for(let j=0;j<=4;j++){const $=f.top+p/4*j;u.beginPath(),u.moveTo(f.left,$),u.lineTo(f.left+m,$),u.stroke()}u.beginPath(),u.moveTo(f.left,f.top+p),t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.tokens||0)/b*p;u.lineTo(k,N)}),u.lineTo(f.left+m,f.top+p),u.closePath();const w=u.createLinearGradient(0,f.top,0,f.top+p);w.addColorStop(0,"rgba(51, 175, 188, 0.2)"),w.addColorStop(1,"rgba(51, 175, 188, 0.01)"),u.fillStyle=w,u.fill(),u.beginPath(),u.strokeStyle=Ie.accent,u.lineWidth=1.5,t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.tokens||0)/b*p;$===0?u.moveTo(k,N):u.lineTo(k,N)}),u.stroke(),u.beginPath(),u.strokeStyle=Ie.warning,u.lineWidth=1,u.setLineDash([4,3]),t.forEach((j,$)=>{const k=f.left+$/(t.length-1)*m,N=f.top+p-(j.costUsd||0)/S*p;$===0?u.moveTo(k,N):u.lineTo(k,N)}),u.stroke(),u.setLineDash([]),u.fillStyle=Ie.text3,u.font="10px var(--font-mono)",u.textAlign="right";for(let j=0;j<=4;j++){const $=b/4*(4-j);u.fillText(Dt($),f.left-6,f.top+p/4*j+4)}u.textAlign="left",u.fillStyle=Ie.text4;for(let j=0;j<=4;j++){const $=S/4*(4-j);u.fillText(Lf($),f.left+m+6,f.top+p/4*j+4)}u.font="10px sans-serif",u.fillStyle=Ie.accent,u.fillText("● Tokens",f.left,s-6),u.fillStyle=Ie.warning,u.fillText("● Cost",f.left+70,s-6)},[t,n,s]),o.jsx("canvas",{ref:l,style:{width:n,height:s},className:"block"})}const W1={spawn:iP,rotation:ii,completion:Lr,error:Xc,default:In},B1={spawn:"text-accent",rotation:"text-purple",completion:"text-success",error:"text-danger",default:"text-text-3"};function nX({events:t=[]}){return t.length?o.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:t.slice(-10).reverse().map((n,s)=>{const l=W1[n.type]||W1.default,i=B1[n.type]||B1.default;return o.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0 text-2xs font-sans",children:[o.jsx(l,{size:12,className:i}),o.jsx("span",{className:"text-text-2 whitespace-nowrap",children:n.text}),o.jsx("span",{className:"text-text-4",children:Wt(n.timestamp)})]},s)})}):o.jsx("div",{className:"text-xs text-text-4 font-sans py-3 text-center",children:"No recent activity"})}function ra({className:t,...n}){return o.jsx("div",{className:se("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...n})}function sX(){return o.jsxs("div",{className:"flex-1 flex flex-col p-4 gap-3",children:[o.jsx("div",{className:"flex gap-3",children:[...Array(5)].map((t,n)=>o.jsx(ra,{className:"h-16 flex-1 rounded-md"},n))}),o.jsxs("div",{className:"flex gap-3 flex-1",children:[o.jsx(ra,{className:"flex-[5] rounded-md"}),o.jsx(ra,{className:"flex-[3] rounded-md"}),o.jsx(ra,{className:"flex-[3] rounded-md"})]})]})}function lX(){const{data:t,loading:n,agents:s,connected:l,kpiHistory:i,lastFetch:u}=IR(),d=y.useRef(null),[f,m]=y.useState({width:400,height:200}),p=s.filter(w=>w.status==="running").length;if(y.useEffect(()=>{if(!d.current)return;const w=new ResizeObserver(j=>{const{width:$,height:k}=j[0].contentRect;m({width:Math.floor($),height:Math.floor(k)})});return w.observe(d.current),()=>w.disconnect()},[]),!l)return o.jsx("div",{className:"w-full h-full flex items-center justify-center",children:o.jsxs("div",{className:"text-center space-y-2 text-text-4 font-sans",children:[o.jsx(Nc,{size:32,className:"mx-auto"}),o.jsx("p",{className:"text-sm",children:"Connecting to daemon..."})]})});if(n||!t)return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx(D1,{connected:l,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),o.jsx(sX,{})]});const x=t.tokens||{},g=t.timeline||[],b=(x.totalUsed||0)+(x.totalSaved||0),S=b>0?(x.totalSaved||0)/b*100:0;return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx(D1,{connected:l,runningCount:p,totalCount:s.length,uptime:t.uptime||0,lastFetch:u}),o.jsxs("div",{className:"flex flex-shrink-0 border-b border-border",children:[o.jsx(Ar,{label:"Tokens Used",value:Dt(x.totalUsed),sparkData:i.tokens,color:Ie.accent,className:"flex-1"}),o.jsx(Ar,{label:"Total Cost",value:Lf(x.totalCostUsd),sparkData:i.cost,color:Ie.warning,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Tokens Saved",value:Dt(x.totalSaved),sparkData:i.saved,color:Ie.success,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Efficiency",value:qr(S),sparkData:i.efficiency,color:Ie.purple,className:"flex-1 border-l border-border-subtle"}),o.jsx(Ar,{label:"Cache Rate",value:qr(x.cacheHitRate),sparkData:i.cache,color:Ie.info,className:"flex-1 border-l border-border-subtle"})]}),o.jsxs("div",{className:"flex-1 flex min-h-0",children:[o.jsx("div",{ref:d,className:"flex-[5] min-w-0 bg-surface-1 border-r border-border-subtle",children:f.width>0&&o.jsx(aX,{data:g,width:f.width,height:f.height})}),o.jsxs("div",{className:"flex-[3] flex flex-col min-w-0 bg-surface-1 border-r border-border-subtle",children:[o.jsx("div",{className:"px-3 py-2 border-b border-border-subtle",children:o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Agent Fleet"})}),o.jsx(eX,{agents:s})]}),o.jsxs("div",{className:"flex-[3] flex flex-col min-w-0 bg-surface-1",children:[o.jsx("div",{className:"px-3 py-2 border-b border-border-subtle",children:o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Savings"})}),o.jsx(tX,{data:x,rotation:t.rotation,routing:t.routing,adaptive:t.adaptive})]})]}),o.jsx("div",{className:"flex-shrink-0 border-t border-border bg-surface-1",children:o.jsx(nX,{events:t.events||[]})})]})}const H1={sm:12,md:16,lg:20};function rX({fill:t="full",size:n,color:s="#fbbf24",emptyColor:l="rgba(255,255,255,0.4)"}){const i=`star-${Math.random().toString(36).slice(2,8)}`;return o.jsxs("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&o.jsx("defs",{children:o.jsxs("linearGradient",{id:i,children:[o.jsx("stop",{offset:"50%",stopColor:s}),o.jsx("stop",{offset:"50%",stopColor:l})]})}),o.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?s:t==="half"?`url(#${i})`:l})]})}function Py({rating:t=0,count:n,size:s="sm"}){const l=H1[s]||H1.sm,i=[];for(let u=1;u<=5;u++)t>=u?i.push("full"):t>=u-.5?i.push("half"):i.push("empty");return o.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[i.map((u,d)=>o.jsx(rX,{fill:u,size:l},d)),n!=null&&o.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",n,")"]})]})}const I1={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function Ny({label:t,variant:n,className:s}){const l=I1[n]||I1.draft;return o.jsx("span",{className:se("inline-flex items-center whitespace-nowrap font-sans select-none",s),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:l.color,background:l.bg},children:t})}function zy({price:t=0,size:n="sm"}){const s=!t||t===0,l={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return o.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${l[n]||l.sm} ${s?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:s?"Free":`$${t.toFixed(2)}`})}function Ry({type:t="verified",size:n=12}){const s=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return o.jsxs("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[o.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:s}),o.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Xy="groove_favorites";function uh(){try{return JSON.parse(localStorage.getItem(Xy)||"[]")}catch{return[]}}function iX(t){return uh().includes(t)}function oX(t){const n=uh(),s=n.indexOf(t);return s>=0?n.splice(s,1):n.push(t),localStorage.setItem(Xy,JSON.stringify(n)),s<0}function cX(t){const n=new Set(uh());return t.map(s=>({...s,favorited:n.has(s.id)}))}function uX({filled:t,size:n=16}){return o.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:o.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function dX(){return o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"7 10 12 15 17 10"}),o.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function OX({skill:t,onClick:n}){var u,d;const[s,l]=y.useState(()=>iX(t.id));function i(f){f.stopPropagation(),l(oX(t.id))}return o.jsxs("div",{onClick:()=>n==null?void 0:n(t),className:se("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((d=(u=t.name)==null?void 0:u[0])==null?void 0:d.toUpperCase())||"?"}),o.jsx("button",{onClick:i,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:o.jsx(uX,{filled:s})})]}),o.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[o.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&o.jsx(Ry,{type:t.source,size:12})]}),o.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),o.jsx("div",{className:"mt-3",children:o.jsx(Ny,{label:t.category||"general",variant:t.category||"draft"})}),o.jsx("div",{className:"h-px bg-border-subtle my-3"}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx(Py,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),o.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[o.jsx(dX,{}),Dt(t.downloads||0)]}),o.jsx(zy,{price:t.price||0,size:"sm"})]})]})}function _y(){return o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[o.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),o.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),o.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),o.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),o.jsx("div",{className:"h-px bg-surface-4 my-3"}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),o.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),o.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const fX={slack:"https://cdn.simpleicons.org/slack/E01E5A",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",discord:"https://cdn.simpleicons.org/discord/5865F2",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2"};function hX({item:t,size:n=40}){const s=fX[t.id];if(s)return o.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:n,height:n},children:[o.jsx("img",{src:s,alt:t.name,className:"w-5 h-5",onError:u=>{u.target.style.display="none",u.target.nextSibling.style.display="flex"}}),o.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const l=(t.name||"?")[0].toUpperCase(),i=t.name?t.name.charCodeAt(0)*37%360:200;return o.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:n,height:n,background:`hsl(${i}, 40%, 18%)`,color:`hsl(${i}, 60%, 65%)`},children:l})}function mX({item:t,onClick:n,className:s}){var i;const l=t.installed;return o.jsxs("button",{onClick:()=>n(t),className:se("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",s),style:{minHeight:200},children:[o.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[o.jsx(hX,{item:t,size:36}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&o.jsx(Lr,{size:11,className:"text-accent flex-shrink-0"})]}),o.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),o.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),o.jsx("div",{className:"h-px bg-border-subtle my-2"}),o.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Ef,{size:10}),Dt(t.downloads||0)]}),(t.rating||0)>0&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Yb,{size:10,className:"text-warning",fill:"currentColor"}),(i=t.rating)==null?void 0:i.toFixed(1)]}),o.jsx("span",{className:"flex-1"}),l&&o.jsx(De,{variant:"accent",className:"text-2xs",children:"Installed"})]})]})}function Cy({value:t,onChange:n,placeholder:s="Search skills, tags, authors...",large:l}){const[i,u]=y.useState(t||""),d=y.useRef(null);y.useEffect(()=>{u(t||"")},[t]);function f(m){const p=m.target.value;u(p),clearTimeout(d.current),d.current=setTimeout(()=>n(p),300)}return o.jsxs("div",{className:"relative w-full",children:[o.jsx(Cl,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),o.jsx("input",{value:i,onChange:f,placeholder:s,className:se("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",l?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),l&&o.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const pX=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function xX({selected:t="",categories:n=pX,onSelect:s}){return o.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:n.map(l=>{const i=t===l.id;return o.jsx("button",{onClick:()=>s(l.id),className:se("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",i?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:l.label},l.id)})})}function Mc(){const t=D(n=>n.addToast);return{success:(n,s)=>t("success",n,s),error:(n,s)=>t("error",n,s),info:(n,s)=>t("info",n,s),warning:(n,s)=>t("warning",n,s)}}function gX({skill:t,onBack:n}){var j,$,k;const s=Mc(),[l,i]=y.useState(""),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,x]=y.useState(t.installed),[g,b]=y.useState(!0);y.useEffect(()=>{b(!0),J.get(`/skills/${t.id}/content`).then(N=>{i(N.content||""),d(N.requiresPurchase||!1)}).catch(()=>{}).finally(()=>b(!1))},[t.id]);async function S(){m(!0);try{await J.post(`/skills/${t.id}/install`),x(!0),s.success(`${t.name} installed`)}catch(N){s.error("Install failed",N.message)}m(!1)}async function w(){const{marketplaceAuthenticated:N,marketplaceLogin:R,marketplaceCheckout:A}=D.getState();if(!N){R();return}try{await A(t.id)}catch{}}return o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-6 py-5",children:[o.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[o.jsx(yT,{size:14})," Back"]}),o.jsxs("div",{className:"flex gap-8",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||(($=(j=t.name)==null?void 0:j[0])==null?void 0:$.toUpperCase())}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[o.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&o.jsx(Ry,{type:t.source,size:13})]})]})]}),o.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((k=t.tags)==null?void 0:k.length)>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(N=>o.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:N},N))}),o.jsx("div",{className:"h-px bg-border-subtle my-5"}),g?o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),o.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),o.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):l?o.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[o.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),o.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:l})]}):u?o.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[o.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):o.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),o.jsx("div",{className:"w-[240px] flex-shrink-0",children:o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[o.jsx(zy,{price:t.price||0,size:"md"}),u&&!p?o.jsxs("button",{onClick:w,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):o.jsx("button",{onClick:S,disabled:f||p,className:`w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border ${p?"bg-success/15 text-success border-success/20":"bg-accent/15 text-accent border-accent/20 hover:bg-accent/25"}`,children:f?"Installing...":p?"✓ Installed":"Install"}),o.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",o.jsx("span",{className:"font-mono text-text-0",children:Dt(t.downloads||0)},"d")],["Rating",o.jsx(Py,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",o.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",o.jsx(Ny,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",o.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([N,R])=>o.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[o.jsx("span",{className:"text-text-3",children:N}),R]},N))})]})})]})]})})}function bX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),[i,u]=y.useState(""),[d,f]=y.useState(""),[m,p]=y.useState("popular"),[x,g]=y.useState(null);return y.useEffect(()=>{l(!0);const b=new URLSearchParams;i&&b.set("search",i),d&&b.set("category",d),m&&b.set("sort",m),J.get(`/skills/registry?${b}`).then(S=>n(cX(S.skills||S.items||(Array.isArray(S)?S:[])))).catch(()=>n([])).finally(()=>l(!1))},[i,d,m]),x?o.jsx(gX,{skill:x,onBack:()=>g(null)}):o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-72",children:o.jsx(Cy,{value:i,onChange:u})}),o.jsx(xX,{selected:d,onSelect:f}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"relative flex-shrink-0",children:[o.jsxs("select",{value:m,onChange:b=>p(b.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[o.jsx("option",{value:"popular",children:"Popular"}),o.jsx("option",{value:"rating",children:"Top Rated"}),o.jsx("option",{value:"newest",children:"Newest"}),o.jsx("option",{value:"name",children:"A-Z"})]}),o.jsx(Dn,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),o.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),o.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:8}).map((b,S)=>o.jsx(_y,{},S)):t.map(b=>o.jsx(OX,{skill:b,onClick:g},b.id))}),!s&&t.length===0&&o.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}function vX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),[i,u]=y.useState(""),d=Mc();return y.useEffect(()=>{l(!0),J.get(`/integrations/registry?search=${encodeURIComponent(i)}`).then(f=>n(f.integrations||f.items||(Array.isArray(f)?f:[]))).catch(()=>n([])).finally(()=>l(!1))},[i]),o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-72",children:o.jsx(Cy,{value:i,onChange:u,placeholder:"Search integrations..."})}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),o.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:6}).map((f,m)=>o.jsx(_y,{},m)):t.map(f=>o.jsx(mX,{item:f,onClick:()=>d.info(`${f.name} — install via CLI: groove integrations install ${f.id}`)},f.id))}),!s&&t.length===0&&o.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]})})}function yX(){const t=D(g=>g.marketplaceAuthenticated),n=D(g=>g.marketplaceLogin),[s,l]=y.useState([]),[i,u]=y.useState([]),[d,f]=y.useState(!0),m=Mc(),p=y.useRef(null);y.useEffect(()=>{f(!0),Promise.all([t?J.get("/auth/purchases").then(g=>g.purchases||[]).catch(()=>[]):Promise.resolve([]),J.get("/skills/installed").then(g=>Array.isArray(g)?g:g.skills||[]).catch(()=>[])]).then(([g,b])=>{l(g),u(b)}).finally(()=>f(!1))},[t]);async function x(g){var S;const b=(S=g.target.files)==null?void 0:S[0];if(b){try{const w=await b.text(),j=b.name.replace(/\.md$/i,"");await J.post("/skills/import",{name:j,content:w}),m.success(`Imported "${j}"`);const $=await J.get("/skills/installed");u(Array.isArray($)?$:$.skills||[])}catch(w){m.error("Import failed",w.message)}g.target.value=""}}return d?o.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map((g,b)=>o.jsx(ra,{className:"h-14 rounded-md"},b))}):o.jsx(Na,{className:"h-full",children:o.jsxs("div",{className:"px-5 py-4 space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{ref:p,type:"file",accept:".md",onChange:x,className:"hidden"}),o.jsxs(Se,{variant:"secondary",size:"md",onClick:()=>{var g;return(g=p.current)==null?void 0:g.click()},className:"gap-1.5",children:[o.jsx(nP,{size:13}),"Import .md Skill"]}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Drop a markdown skill file to install locally"})]}),t&&s.length>0&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[o.jsx(mO,{size:12}),"Purchases (",s.length,")"]}),o.jsx("div",{className:"space-y-1.5",children:s.map(g=>{var b,S;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:g.skill_icon||((S=(b=g.skill_name)==null?void 0:b[0])==null?void 0:S.toUpperCase())||"?"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:g.skill_name||g.skill_id}),o.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",(g.amount||0).toFixed(2)," · ",Wt(g.created_at)]})]}),o.jsx(De,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},g.id||g.skill_id)})})]}),t&&s.length===0&&o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(mO,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(mO,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),o.jsxs(Se,{variant:"primary",size:"sm",onClick:n,className:"gap-1.5 mx-auto",children:[o.jsx(Mf,{size:12})," Sign in"]})]}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[o.jsx(zb,{size:12}),"Installed (",i.length,")"]}),i.length===0?o.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[o.jsx(Ef,{size:20,className:"mx-auto text-text-4 mb-2"}),o.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No skills installed — browse the Skills tab or import a .md file"})]}):o.jsx("div",{className:"space-y-1.5",children:i.map(g=>{var b,S;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle group",children:[o.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:g.icon||((S=(b=g.name)==null?void 0:b[0])==null?void 0:S.toUpperCase())||"?"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:g.name||g.id}),o.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:g.description||g.category||"local skill"})]}),o.jsx(De,{variant:"accent",className:"text-2xs flex-shrink-0",children:"Installed"})]},g.id)})})]})]})})}function SX(){const t=D(i=>i.marketplaceAuthenticated),n=D(i=>i.marketplaceUser),s=D(i=>i.marketplaceLogin),l=D(i=>i.marketplaceLogout);return t?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-surface-3 border border-border-subtle",children:[o.jsx("div",{className:"w-4 h-4 rounded-full bg-accent/20 flex items-center justify-center",children:o.jsx(Vb,{size:9,className:"text-accent"})}),o.jsx("span",{className:"text-xs text-text-0 font-sans font-medium max-w-[120px] truncate",children:(n==null?void 0:n.displayName)||(n==null?void 0:n.id)||"Account"})]}),o.jsx("button",{onClick:l,className:"flex items-center gap-1 px-2 py-1.5 rounded text-xs text-text-3 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:o.jsx(Tb,{size:11})})]}):o.jsxs("button",{onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans text-text-0 bg-accent/15 border border-accent/25 rounded hover:bg-accent/25 cursor-pointer transition-colors",children:[o.jsx(Mf,{size:12}),"Sign in"]})}function QX(){const[t,n]=y.useState("skills"),s=[{id:"skills",label:"Skills",icon:Mb},{id:"integrations",label:"Integrations",icon:Rb},{id:"library",label:"My Library",icon:zb}];return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:o.jsxs("div",{className:"flex items-center px-5 h-11",children:[o.jsx("div",{className:"flex items-center",children:s.map(l=>{const i=l.icon;return o.jsxs("button",{onClick:()=>n(l.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===l.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[o.jsx(i,{size:12}),l.label]},l.id)})}),o.jsx("div",{className:"flex-1"}),o.jsx(SX,{})]})}),o.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&o.jsx(bX,{}),t==="integrations"&&o.jsx(vX,{}),t==="library"&&o.jsx(yX,{})]})]})}function jX(t){const n=t+"CollectionProvider",[s,l]=Ts(n),[i,u]=s(n,{collectionRef:{current:null},itemMap:new Map}),d=j=>{const{scope:$,children:k}=j,N=qn.useRef(null),R=qn.useRef(new Map).current;return o.jsx(i,{scope:$,itemMap:R,collectionRef:N,children:k})};d.displayName=n;const f=t+"CollectionSlot",m=Ko(f),p=qn.forwardRef((j,$)=>{const{scope:k,children:N}=j,R=u(f,k),A=rt($,R.collectionRef);return o.jsx(m,{ref:A,children:N})});p.displayName=f;const x=t+"CollectionItemSlot",g="data-radix-collection-item",b=Ko(x),S=qn.forwardRef((j,$)=>{const{scope:k,children:N,...R}=j,A=qn.useRef(null),U=rt($,A),X=u(x,k);return qn.useEffect(()=>(X.itemMap.set(A,{ref:A,...R}),()=>void X.itemMap.delete(A))),o.jsx(b,{[g]:"",ref:U,children:N})});S.displayName=x;function w(j){const $=u(t+"CollectionConsumer",j);return qn.useCallback(()=>{const N=$.collectionRef.current;if(!N)return[];const R=Array.from(N.querySelectorAll(`[${g}]`));return Array.from($.itemMap.values()).sort((X,z)=>R.indexOf(X.ref.current)-R.indexOf(z.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:d,Slot:p,ItemSlot:S},w,l]}var EO="rovingFocusGroup.onEntryFocus",wX={bubbles:!1,cancelable:!0},ci="RovingFocusGroup",[xf,Zy,$X]=jX(ci),[kX,Ay]=Ts(ci,[$X]),[TX,PX]=kX(ci),Ey=y.forwardRef((t,n)=>o.jsx(xf.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(xf.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(NX,{...t,ref:n})})}));Ey.displayName=ci;var NX=y.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:s,orientation:l,loop:i=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...g}=t,b=y.useRef(null),S=rt(n,b),w=Df(u),[j,$]=kc({prop:d,defaultProp:f??null,onChange:m,caller:ci}),[k,N]=y.useState(!1),R=Pt(p),A=Zy(s),U=y.useRef(!1),[X,z]=y.useState(0);return y.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(EO,R),()=>T.removeEventListener(EO,R)},[R]),o.jsx(TX,{scope:s,orientation:l,dir:w,loop:i,currentTabStopId:j,onItemFocus:y.useCallback(T=>$(T),[$]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>z(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>z(T=>T-1),[]),children:o.jsx(We.div,{tabIndex:k||X===0?-1:0,"data-orientation":l,...g,ref:S,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{U.current=!0}),onFocus:Ce(t.onFocus,T=>{const B=!U.current;if(T.target===T.currentTarget&&B&&!k){const V=new CustomEvent(EO,wX);if(T.currentTarget.dispatchEvent(V),!V.defaultPrevented){const le=A().filter(Z=>Z.focusable),Oe=le.find(Z=>Z.active),be=le.find(Z=>Z.id===j),K=[Oe,be,...le].filter(Boolean).map(Z=>Z.ref.current);Yy(K,x)}}U.current=!1}),onBlur:Ce(t.onBlur,()=>N(!1))})})}),qy="RovingFocusGroupItem",My=y.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:s,focusable:l=!0,active:i=!1,tabStopId:u,children:d,...f}=t,m=vl(),p=u||m,x=PX(qy,s),g=x.currentTabStopId===p,b=Zy(s),{onFocusableItemAdd:S,onFocusableItemRemove:w,currentTabStopId:j}=x;return y.useEffect(()=>{if(l)return S(),()=>w()},[l,S,w]),o.jsx(xf.ItemSlot,{scope:s,id:p,focusable:l,active:i,children:o.jsx(We.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...f,ref:n,onMouseDown:Ce(t.onMouseDown,$=>{l?x.onItemFocus(p):$.preventDefault()}),onFocus:Ce(t.onFocus,()=>x.onItemFocus(p)),onKeyDown:Ce(t.onKeyDown,$=>{if($.key==="Tab"&&$.shiftKey){x.onItemShiftTab();return}if($.target!==$.currentTarget)return;const k=XX($,x.orientation,x.dir);if(k!==void 0){if($.metaKey||$.ctrlKey||$.altKey||$.shiftKey)return;$.preventDefault();let R=b().filter(A=>A.focusable).map(A=>A.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const A=R.indexOf($.currentTarget);R=x.loop?_X(R,A+1):R.slice(A+1)}setTimeout(()=>Yy(R))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:j!=null}):d})})});My.displayName=qy;var zX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RX(t,n){return n!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function XX(t,n,s){const l=RX(t.key,s);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return zX[l]}function Yy(t,n=!1){const s=document.activeElement;for(const l of t)if(l===s||(l.focus({preventScroll:n}),document.activeElement!==s))return}function _X(t,n){return t.map((s,l)=>t[(n+l)%t.length])}var CX=Ey,ZX=My,Yc="Tabs",[AX]=Ts(Yc,[Ay]),Vy=Ay(),[EX,dh]=AX(Yc),Uy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,onValueChange:i,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:m="automatic",...p}=t,x=Df(f),[g,b]=kc({prop:l,onChange:i,defaultProp:u??"",caller:Yc});return o.jsx(EX,{scope:s,baseId:vl(),value:g,onValueChange:b,orientation:d,dir:x,activationMode:m,children:o.jsx(We.div,{dir:x,"data-orientation":d,...p,ref:n})})});Uy.displayName=Yc;var Gy="TabsList",Ly=y.forwardRef((t,n)=>{const{__scopeTabs:s,loop:l=!0,...i}=t,u=dh(Gy,s),d=Vy(s);return o.jsx(CX,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:o.jsx(We.div,{role:"tablist","aria-orientation":u.orientation,...i,ref:n})})});Ly.displayName=Gy;var Dy="TabsTrigger",Wy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,disabled:i=!1,...u}=t,d=dh(Dy,s),f=Vy(s),m=Iy(d.baseId,l),p=Fy(d.baseId,l),x=l===d.value;return o.jsx(ZX,{asChild:!0,...f,focusable:!i,active:x,children:o.jsx(We.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:m,...u,ref:n,onMouseDown:Ce(t.onMouseDown,g=>{!i&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:Ce(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:Ce(t.onFocus,()=>{const g=d.activationMode!=="manual";!x&&!i&&g&&d.onValueChange(l)})})})});Wy.displayName=Dy;var By="TabsContent",Hy=y.forwardRef((t,n)=>{const{__scopeTabs:s,value:l,forceMount:i,children:u,...d}=t,f=dh(By,s),m=Iy(f.baseId,l),p=Fy(f.baseId,l),x=l===f.value,g=y.useRef(x);return y.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),o.jsx(xa,{present:i||x,children:({present:b})=>o.jsx(We.div,{"data-state":x?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:p,tabIndex:0,...d,ref:n,style:{...t.style,animationDuration:g.current?"0s":void 0},children:b&&u})})});Hy.displayName=By;function Iy(t,n){return`${t}-trigger-${n}`}function Fy(t,n){return`${t}-content-${n}`}var qX=Uy,MX=Ly,YX=Wy,VX=Hy;function UX({children:t,...n}){return o.jsx(qX,{...n,children:t})}function GX({children:t,className:n,...s}){return o.jsx(MX,{className:se("flex items-center gap-0 border-b border-border-subtle",n),...s,children:t})}function F1({children:t,className:n,...s}){return o.jsx(YX,{className:se("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",n),...s,children:t})}function K1({children:t,className:n,...s}){return o.jsx(VX,{className:se("flex-1 min-h-0",n),...s,children:t})}function LX({children:t,className:n,hover:s,...l}){return o.jsx("div",{className:se("rounded-md border border-border bg-surface-1",s&&"hover:border-accent/50 hover:bg-surface-2 transition-all duration-150 cursor-pointer",n),...l,children:t})}function DX(){const t=D(l=>l.pendingApprovals),n=D(l=>l.approveRequest),s=D(l=>l.rejectRequest);return t.length===0?null:o.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Xc,{size:13,className:"text-warning"}),o.jsxs("span",{className:"text-xs font-semibold text-warning font-sans",children:["Pending Approval (",t.length,")"]})]}),t.map(l=>{var i,u,d;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-warning/5 border border-warning/20",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[l.agentName,": ",((i=l.action)==null?void 0:i.description)||((u=l.action)==null?void 0:u.type)||"action"]}),((d=l.action)==null?void 0:d.filePath)&&o.jsx("div",{className:"text-2xs text-text-3 font-mono truncate mt-0.5",children:l.action.filePath}),o.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:Wt(l.requestedAt)})]}),o.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[o.jsxs(Se,{variant:"primary",size:"sm",onClick:()=>n(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[o.jsx(Eb,{size:11})," Approve"]}),o.jsxs(Se,{variant:"danger",size:"sm",onClick:()=>s(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[o.jsx(D5,{size:11})," Reject"]})]})]},l.id)})]})}function WX(){const t=D(m=>m.resolvedApprovals),[n,s]=y.useState([]),[l,i]=y.useState(!0);y.useEffect(()=>{const m=setInterval(u,4e3);return u(),()=>clearInterval(m)},[]);async function u(){try{const m=await J.get("/pm/history");s(m.history||m||[])}catch{}i(!1)}const d=new Set,f=[...t,...n].filter(m=>{const p=m.id||`${m.agentName}-${m.timestamp}`;return d.has(p)?!1:(d.add(p),!0)});return l&&f.length===0?o.jsx("div",{className:"p-4 space-y-2",children:[...Array(4)].map((m,p)=>o.jsx(ra,{className:"h-12 rounded-md"},p))}):o.jsxs(Na,{className:"flex-1",children:[o.jsx(DX,{}),o.jsxs("div",{className:"p-4 space-y-2",children:[f.length===0&&o.jsxs("div",{className:"text-center py-12 text-text-4 font-sans",children:[o.jsx(Lr,{size:32,className:"mx-auto mb-2"}),o.jsx("p",{className:"text-sm",children:"No approval history"}),o.jsx("p",{className:"text-2xs text-text-4 mt-1",children:'Approvals appear when agents use "Agent Approve" permission mode'})]}),f.map((m,p)=>{var x;return o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-surface-1 border border-border-subtle",children:[m.status==="approved"||m.verdict==="approved"?o.jsx(Lr,{size:14,className:"text-success flex-shrink-0"}):o.jsx(TT,{size:14,className:"text-danger flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"text-xs text-text-0 font-sans truncate",children:[m.agentName,": ",((x=m.action)==null?void 0:x.description)||m.action||"action"]}),m.reason&&o.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:m.reason})]}),o.jsx("span",{className:"text-2xs text-text-4 font-sans flex-shrink-0",children:Wt(m.resolvedAt||m.timestamp)})]},m.id||p)})]})]})}function BX(){const[t,n]=y.useState([]),[s,l]=y.useState(!0),i=Mc();y.useEffect(()=>{const f=setInterval(u,1e4);return u(),()=>clearInterval(f)},[]);async function u(){try{const f=await J.get("/schedules");n(f.schedules||f||[])}catch{}l(!1)}async function d(f,m){try{await J.post(`/schedules/${f}/${m?"disable":"enable"}`),u()}catch(p){i.error("Failed to toggle schedule",p.message)}}return s?o.jsx("div",{className:"p-4 space-y-2",children:[...Array(3)].map((f,m)=>o.jsx(ra,{className:"h-16 rounded-md"},m))}):o.jsx(Na,{className:"flex-1",children:o.jsxs("div",{className:"p-4 space-y-2",children:[t.length===0&&o.jsxs("div",{className:"text-center py-12 text-text-4 font-sans",children:[o.jsx(rc,{size:32,className:"mx-auto mb-2"}),o.jsx("p",{className:"text-sm",children:"No schedules configured"})]}),t.map(f=>o.jsx(LX,{className:"p-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:f.name}),o.jsx(De,{variant:f.enabled?"success":"default",children:f.enabled?"Active":"Paused"})]}),o.jsxs("div",{className:"text-2xs text-text-3 font-mono mt-0.5",children:[f.cron," · ",f.role]})]}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>d(f.id,f.enabled),children:f.enabled?"Pause":"Enable"})]})},f.id))]})})}function HX(){return o.jsxs(UX,{defaultValue:"approvals",className:"flex flex-col h-full",children:[o.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[o.jsx("div",{className:"flex items-center gap-4 mb-0",children:o.jsx("h2",{className:"text-base font-semibold text-text-0 font-sans",children:"Management"})}),o.jsxs(GX,{className:"border-b-0",children:[o.jsx(F1,{value:"approvals",children:"Approvals"}),o.jsx(F1,{value:"schedules",children:"Schedules"})]})]}),o.jsx(K1,{value:"approvals",className:"flex-1 min-h-0",children:o.jsx(WX,{})}),o.jsx(K1,{value:"schedules",className:"flex-1 min-h-0",children:o.jsx(BX,{})})]})}const IX={code:"Code",general:"General"},FX={light:"text-success",medium:"text-accent",heavy:"text-warning"};function KX(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function Ky({hardware:t}){if(!t)return null;const{totalRamGb:n,gpu:s,isAppleSilicon:l}=t;return o.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[o.jsx(Yf,{size:14,className:"text-text-3 flex-shrink-0"}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[o.jsxs("span",{className:"text-text-0 font-semibold",children:[n," GB RAM"]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-text-4",children:"·"}),o.jsx("span",{className:"text-text-2",children:s.name})]}),l&&o.jsx(De,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function JX({onRecheck:t}){const[n,s]=y.useState(null),[l,i]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),p=D(A=>A.addToast);y.useEffect(()=>{J.post("/providers/ollama/check").then(s).catch(()=>{})},[]);async function x(){i(!0);try{const A=await J.post("/providers/ollama/check");s(A),A.installed&&A.serverRunning?(p("success","Ollama is ready!"),t()):A.installed?p("info","Ollama installed — server needs to start"):p("info","Ollama not found — install and try again")}catch{}i(!1)}async function g(){d(!0);try{if((await J.post("/providers/ollama/serve")).ok){p("success","Ollama server started!");const U=await J.post("/providers/ollama/check");s(U),U.serverRunning&&t()}}catch(A){p("error","Could not start server",A.message)}d(!1)}function b(A){navigator.clipboard.writeText(A),m(!0),setTimeout(()=>m(!1),2e3)}if(!n)return o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:S,install:w,requirements:j,installed:$,serverRunning:k}=n,N=S.totalRamGb>=j.minRAM,R=S.recommended;return o.jsxs("div",{className:"space-y-3 p-3",children:[o.jsx(Ky,{hardware:S}),N?o.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[o.jsx(la,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans",children:[o.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),o.jsx("span",{className:"text-text-2 ml-1",children:R.code?`Recommended: ${R.code}`:`${S.totalRamGb} GB RAM available`})]})]}):o.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[o.jsx(Ss,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans text-text-2",children:[o.jsxs("span",{className:"text-warning font-semibold",children:[S.totalRamGb," GB RAM detected."]})," ","Minimum ",j.minRAM," GB needed. Smallest models may still work."]})]}),$&&!k&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[o.jsx(Ss,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-xs font-sans text-text-2",children:[o.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),o.jsxs(Se,{variant:"primary",size:"md",onClick:g,disabled:u,className:"w-full gap-1.5",children:[o.jsx(In,{size:12}),u?"Starting...":"Start Ollama Server"]})]}),!$&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:w.command}),o.jsxs(Se,{variant:"secondary",size:"sm",onClick:()=>b(w.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[f?o.jsx(la,{size:12}):o.jsx(nf,{size:12}),f?"Copied":"Copy"]})]}),w.alt&&o.jsx("p",{className:"text-2xs text-text-4 font-sans",children:w.alt})]}),o.jsxs(Se,{variant:"secondary",size:"md",onClick:x,disabled:l,className:"w-full gap-1.5",children:[o.jsx(_l,{size:12,className:l?"animate-spin":""}),l?"Checking...":$?"Check again":"I installed it — check again"]})]})}function e_({model:t,isInstalled:n,isRecommended:s,canRun:l,onPull:i,onDelete:u,pulling:d}){const f=d===t.id;return o.jsxs("div",{className:se("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!l&&"opacity-40"),children:[n?o.jsx(la,{size:12,className:"text-success flex-shrink-0"}):o.jsx("div",{className:"w-3"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),s&&o.jsx(Yb,{size:10,className:"text-warning flex-shrink-0"})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[o.jsx("span",{className:se("text-2xs font-semibold font-sans",FX[t.tier]),children:t.tier}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:KX(t.sizeGb)}),o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),n?o.jsx("button",{onClick:()=>u(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:o.jsx(Rc,{size:12})}):l?o.jsx(Se,{variant:"secondary",size:"sm",onClick:()=>i(t.id),disabled:!!d,className:"h-7 px-2 text-2xs gap-1",children:f?o.jsxs(o.Fragment,{children:[o.jsx(_l,{size:10,className:"animate-spin"})," Pulling..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Ef,{size:10})," Pull"]})}):o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function t_({onModelChange:t}){var U,X;const[n,s]=y.useState(null),[l,i]=y.useState(null),[u,d]=y.useState("code"),[f,m]=y.useState(!1),p=D(z=>z.addToast);function x(){J.get("/providers/ollama/models").then(s).catch(()=>{})}y.useEffect(()=>{x()},[]);async function g(z){i(z);try{await J.post("/providers/ollama/pull",{model:z}),p("success",`Pulled ${z}`),x(),t&&t()}catch(T){p("error",`Pull failed: ${T.message}`)}i(null)}async function b(z){try{await J.delete(`/providers/ollama/models/${encodeURIComponent(z)}`),p("info",`Removed ${z}`),x(),t&&t()}catch(T){p("error",`Delete failed: ${T.message}`)}}if(!n)return o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:S,catalog:w,hardware:j}=n,$=new Set(S.map(z=>z.id)),k=j.totalRamGb,N=[(U=j.recommended)==null?void 0:U.code,(X=j.recommended)==null?void 0:X.general].filter(Boolean),R=w.filter(z=>z.category===u),A=f?R:R.filter(z=>z.ramGb<=k);return o.jsxs("div",{className:"space-y-2 p-3",children:[o.jsx(Ky,{hardware:j}),S.length>0&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[o.jsx(wb,{size:12,className:"text-text-3"}),o.jsx("span",{className:"font-semibold",children:S.length})," model",S.length!==1?"s":""," installed"]}),o.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(IX).map(([z,T])=>o.jsx("button",{onClick:()=>d(z),className:se("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",u===z?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:T},z))}),o.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[A.map(z=>o.jsx(e_,{model:z,isInstalled:$.has(z.id),isRecommended:N.includes(z.id),canRun:z.ramGb<=k,onPull:g,onDelete:b,pulling:l},z.id)),A.length===0&&o.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",u," models available for your hardware"]})]}),!f&&R.length>A.length&&o.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[o.jsx(Dn,{size:10}),"Show ",R.length-A.length," more (exceed your RAM)"]})]})}function Jy({isInstalled:t,onModelChange:n}){const[s,l]=y.useState(!1),[i,u]=y.useState(!1);return y.useEffect(()=>{t?J.post("/providers/ollama/check").then(d=>{l(d.installed&&d.serverRunning),u(!0)}).catch(()=>u(!0)):u(!0)},[t]),i?s?o.jsx(t_,{onModelChange:n}):o.jsx(JX,{onRecheck:()=>{l(!0),n&&n()}}):o.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}var qO="focusScope.autoFocusOnMount",MO="focusScope.autoFocusOnUnmount",J1={bubbles:!1,cancelable:!0},a_="FocusScope",eS=y.forwardRef((t,n)=>{const{loop:s=!1,trapped:l=!1,onMountAutoFocus:i,onUnmountAutoFocus:u,...d}=t,[f,m]=y.useState(null),p=Pt(i),x=Pt(u),g=y.useRef(null),b=rt(n,j=>m(j)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(l){let j=function(R){if(S.paused||!f)return;const A=R.target;f.contains(A)?g.current=A:Mn(g.current,{select:!0})},$=function(R){if(S.paused||!f)return;const A=R.relatedTarget;A!==null&&(f.contains(A)||Mn(g.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const U of R)U.removedNodes.length>0&&Mn(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",$);const N=new MutationObserver(k);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",$),N.disconnect()}}},[l,f,S.paused]),y.useEffect(()=>{if(f){t0.add(S);const j=document.activeElement;if(!f.contains(j)){const k=new CustomEvent(qO,J1);f.addEventListener(qO,p),f.dispatchEvent(k),k.defaultPrevented||(n_(o_(tS(f)),{select:!0}),document.activeElement===j&&Mn(f))}return()=>{f.removeEventListener(qO,p),setTimeout(()=>{const k=new CustomEvent(MO,J1);f.addEventListener(MO,x),f.dispatchEvent(k),k.defaultPrevented||Mn(j??document.body,{select:!0}),f.removeEventListener(MO,x),t0.remove(S)},0)}}},[f,p,x,S]);const w=y.useCallback(j=>{if(!s&&!l||S.paused)return;const $=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,k=document.activeElement;if($&&k){const N=j.currentTarget,[R,A]=s_(N);R&&A?!j.shiftKey&&k===A?(j.preventDefault(),s&&Mn(R,{select:!0})):j.shiftKey&&k===R&&(j.preventDefault(),s&&Mn(A,{select:!0})):k===N&&j.preventDefault()}},[s,l,S.paused]);return o.jsx(We.div,{tabIndex:-1,...d,ref:b,onKeyDown:w})});eS.displayName=a_;function n_(t,{select:n=!1}={}){const s=document.activeElement;for(const l of t)if(Mn(l,{select:n}),document.activeElement!==s)return}function s_(t){const n=tS(t),s=e0(n,t),l=e0(n.reverse(),t);return[s,l]}function tS(t){const n=[],s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const i=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||i?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n}function e0(t,n){for(const s of t)if(!l_(s,{upTo:n}))return s}function l_(t,{upTo:n}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(n!==void 0&&t===n)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function r_(t){return t instanceof HTMLInputElement&&"select"in t}function Mn(t,{select:n=!1}={}){if(t&&t.focus){const s=document.activeElement;t.focus({preventScroll:!0}),t!==s&&r_(t)&&n&&t.select()}}var t0=i_();function i_(){let t=[];return{add(n){const s=t[0];n!==s&&(s==null||s.pause()),t=a0(t,n),t.unshift(n)},remove(n){var s;t=a0(t,n),(s=t[0])==null||s.resume()}}}function a0(t,n){const s=[...t],l=s.indexOf(n);return l!==-1&&s.splice(l,1),s}function o_(t){return t.filter(n=>n.tagName!=="A")}var YO=0;function c_(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??n0()),document.body.insertAdjacentElement("beforeend",t[1]??n0()),YO++,()=>{YO===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),YO--}},[])}function n0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Qa=function(){return Qa=Object.assign||function(n){for(var s,l=1,i=arguments.length;l<i;l++){s=arguments[l];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(n[u]=s[u])}return n},Qa.apply(this,arguments)};function aS(t,n){var s={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&n.indexOf(l)<0&&(s[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,l=Object.getOwnPropertySymbols(t);i<l.length;i++)n.indexOf(l[i])<0&&Object.prototype.propertyIsEnumerable.call(t,l[i])&&(s[l[i]]=t[l[i]]);return s}function u_(t,n,s){if(s||arguments.length===2)for(var l=0,i=n.length,u;l<i;l++)(u||!(l in n))&&(u||(u=Array.prototype.slice.call(n,0,l)),u[l]=n[l]);return t.concat(u||Array.prototype.slice.call(n))}var Io="right-scroll-bar-position",Fo="width-before-scroll-bar",d_="with-scroll-bars-hidden",O_="--removed-body-scroll-bar-size";function VO(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function f_(t,n){var s=y.useState(function(){return{value:t,callback:n,facade:{get current(){return s.value},set current(l){var i=s.value;i!==l&&(s.value=l,s.callback(l,i))}}}})[0];return s.callback=n,s.facade}var h_=typeof window<"u"?y.useLayoutEffect:y.useEffect,s0=new WeakMap;function m_(t,n){var s=f_(null,function(l){return t.forEach(function(i){return VO(i,l)})});return h_(function(){var l=s0.get(s);if(l){var i=new Set(l),u=new Set(t),d=s.current;i.forEach(function(f){u.has(f)||VO(f,null)}),u.forEach(function(f){i.has(f)||VO(f,d)})}s0.set(s,t)},[t]),s}function p_(t){return t}function x_(t,n){n===void 0&&(n=p_);var s=[],l=!1,i={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:t},useMedium:function(u){var d=n(u,l);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(l=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(f){return u(f)},filter:function(){return s}}},assignMedium:function(u){l=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(u),d=s}var m=function(){var x=d;d=[],x.forEach(u)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(x){d.push(x),p()},filter:function(x){return d=d.filter(x),s}}}};return i}function g_(t){t===void 0&&(t={});var n=x_(null);return n.options=Qa({async:!0,ssr:!1},t),n}var nS=function(t){var n=t.sideCar,s=aS(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=n.read();if(!l)throw new Error("Sidecar medium not found");return y.createElement(l,Qa({},s))};nS.isSideCarExport=!0;function b_(t,n){return t.useMedium(n),nS}var sS=g_(),UO=function(){},Vc=y.forwardRef(function(t,n){var s=y.useRef(null),l=y.useState({onScrollCapture:UO,onWheelCapture:UO,onTouchMoveCapture:UO}),i=l[0],u=l[1],d=t.forwardProps,f=t.children,m=t.className,p=t.removeScrollBar,x=t.enabled,g=t.shards,b=t.sideCar,S=t.noRelative,w=t.noIsolation,j=t.inert,$=t.allowPinchZoom,k=t.as,N=k===void 0?"div":k,R=t.gapMode,A=aS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=b,X=m_([s,n]),z=Qa(Qa({},A),i);return y.createElement(y.Fragment,null,x&&y.createElement(U,{sideCar:sS,removeScrollBar:p,shards:g,noRelative:S,noIsolation:w,inert:j,setCallbacks:u,allowPinchZoom:!!$,lockRef:s,gapMode:R}),d?y.cloneElement(y.Children.only(f),Qa(Qa({},z),{ref:X})):y.createElement(N,Qa({},z,{className:m,ref:X}),f))});Vc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vc.classNames={fullWidth:Fo,zeroRight:Io};var v_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=v_();return n&&t.setAttribute("nonce",n),t}function S_(t,n){t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n))}function Q_(t){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(t)}var j_=function(){var t=0,n=null;return{add:function(s){t==0&&(n=y_())&&(S_(n,s),Q_(n)),t++},remove:function(){t--,!t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},w_=function(){var t=j_();return function(n,s){y.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&s])}},lS=function(){var t=w_(),n=function(s){var l=s.styles,i=s.dynamic;return t(l,i),null};return n},$_={left:0,top:0,right:0,gap:0},GO=function(t){return parseInt(t||"",10)||0},k_=function(t){var n=window.getComputedStyle(document.body),s=n[t==="padding"?"paddingLeft":"marginLeft"],l=n[t==="padding"?"paddingTop":"marginTop"],i=n[t==="padding"?"paddingRight":"marginRight"];return[GO(s),GO(l),GO(i)]},T_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return $_;var n=k_(t),s=document.documentElement.clientWidth,l=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,l-s+n[2]-n[0])}},P_=lS(),Ql="data-scroll-locked",N_=function(t,n,s,l){var i=t.left,u=t.top,d=t.right,f=t.gap;return s===void 0&&(s="margin"),`
526
526
  .`.concat(d_,` {
527
527
  overflow: hidden `).concat(l,`;
528
528
  padding-right: `).concat(f,"px ").concat(l,`;
@@ -568,7 +568,7 @@ If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHid
568
568
 
569
569
  For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(s))},[s,t]),null},sC="DialogDescriptionWarning",lC=({contentRef:t,descriptionId:n})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wS(sC).contentName}}.`;return y.useEffect(()=>{var u;const i=(u=t.current)==null?void 0:u.getAttribute("aria-describedby");n&&i&&(document.getElementById(n)||console.warn(l))},[l,t,n]),null},$S=OS,kS=mS,TS=pS,PS=xS,NS=bS,zS=yS,RS=QS;function rC({children:t,...n}){return o.jsx($S,{...n,children:t})}function iC({children:t,className:n,title:s,description:l,...i}){return o.jsxs(kS,{children:[o.jsx(TS,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.jsxs(PS,{className:se("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full max-w-lg max-h-[85vh] overflow-y-auto","bg-surface-1 border border-border rounded-lg shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n),...i,children:[s&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle",children:[o.jsx(NS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),o.jsx(RS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors",children:o.jsx(Nt,{size:16})})]}),l&&o.jsx(zS,{className:"sr-only",children:l}),t]})]})}var c0={};function oC({path:t,onNavigate:n}){const s=t.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-x-auto py-1.5 scrollbar-none",children:[o.jsx("button",{onClick:()=>n("/"),className:"flex-shrink-0 p-1 rounded hover:bg-surface-5 cursor-pointer text-text-3 hover:text-text-0 transition-colors",children:o.jsx(wb,{size:13})}),s.map((l,i)=>{const u="/"+s.slice(0,i+1).join("/"),d=i===s.length-1;return o.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[o.jsx(si,{size:11,className:"text-text-4"}),o.jsx("button",{onClick:()=>n(u),className:se("px-1.5 py-0.5 rounded text-xs font-mono cursor-pointer transition-colors",d?"text-text-0 bg-surface-4 font-medium":"text-text-3 hover:text-text-0 hover:bg-surface-5"),children:l})]},i)})]})}function XS({open:t,onOpenChange:n,currentPath:s,onSelect:l}){const[i,u]=y.useState(s||c0.HOME||"/"),[d,f]=y.useState([]),[m,p]=y.useState(!1),[x,g]=y.useState(null);y.useEffect(()=>{t&&b(s||"/")},[t]);async function b($){p(!0),g(null);try{const k=await J.get(`/browse-system?path=${encodeURIComponent($)}`);u(k.current||$),f(k.dirs||[])}catch(k){g(k.message),f([])}p(!1)}function S(){const $=i==="/"?"/":i.split("/").slice(0,-1).join("/")||"/";b($)}function w(){b(c0.HOME||"/Users")}function j(){l(i),n(!1)}return o.jsx(rC,{open:t,onOpenChange:n,children:o.jsx(iC,{title:"Select Working Directory",description:"Choose a directory for this agent to work in",className:"max-w-[520px]",children:o.jsxs("div",{className:"px-5 py-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:S,disabled:i==="/",className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:o.jsx(dT,{size:14})}),o.jsx("button",{onClick:w,className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:o.jsx(u5,{size:14})}),o.jsx("div",{className:"flex-1 min-w-0 bg-surface-0 rounded-md border border-border-subtle px-2",children:o.jsx(oC,{path:i,onNavigate:b})})]}),o.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle overflow-hidden",children:o.jsxs("div",{className:"max-h-[340px] overflow-y-auto",children:[m&&o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(kb,{size:18,className:"text-text-3 animate-spin"})}),x&&o.jsx("div",{className:"px-4 py-6 text-center",children:o.jsx("p",{className:"text-xs text-danger font-sans",children:x})}),!m&&!x&&d.length===0&&o.jsx("div",{className:"px-4 py-6 text-center",children:o.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No subdirectories"})}),!m&&!x&&d.map($=>o.jsxs("button",{onClick:()=>b($.path),className:se("w-full flex items-center gap-2.5 px-3.5 py-2 text-left cursor-pointer","hover:bg-surface-4 transition-colors border-b border-border-subtle last:border-0"),children:[$.hasChildren?o.jsx(FT,{size:15,className:"text-warning flex-shrink-0"}):o.jsx(Dr,{size:15,className:"text-text-3 flex-shrink-0"}),o.jsx("span",{className:"text-sm text-text-0 font-sans truncate flex-1",children:$.name}),$.hasChildren&&o.jsx(si,{size:12,className:"text-text-4 flex-shrink-0"})]},$.path))]})}),o.jsxs("div",{className:"flex items-center gap-3 bg-surface-4/50 rounded-lg px-3.5 py-2.5 border border-border-subtle",children:[o.jsx(Dr,{size:16,className:"text-accent flex-shrink-0"}),o.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:i})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Se,{variant:"ghost",size:"md",onClick:()=>n(!1),children:"Cancel"}),o.jsxs(Se,{variant:"primary",size:"md",onClick:j,className:"gap-1.5",children:[o.jsx(la,{size:14})," Select Folder"]})]})]})})})}function _S({children:t,...n}){return o.jsx($S,{...n,children:t})}function CS({children:t,className:n,title:s,side:l="right",width:i=400,...u}){return o.jsxs(kS,{children:[o.jsx(TS,{className:"fixed inset-0 z-40 bg-black/30"}),o.jsxs(PS,{className:se("fixed top-0 z-50 h-full overflow-y-auto","bg-surface-1 border-l border-border shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out",l==="right"&&"right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",l==="left"&&"left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",n),style:{width:i},...u,children:[s&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle sticky top-0 bg-surface-1 z-10",children:[o.jsx(NS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),o.jsx(RS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:o.jsx(Nt,{size:16})})]}),o.jsx(zS,{className:"sr-only",children:"Panel"}),t]})]})}function cC({value:t,onChange:n}){return o.jsx("button",{onClick:()=>n(!t),className:se("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer",t?"bg-accent":"bg-surface-5"),children:o.jsx("div",{className:se("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}function uC({user:t}){const[n,s]=y.useState(!1),l=(t==null?void 0:t.avatar)||(t==null?void 0:t.picture)||(t==null?void 0:t.photoURL)||(t==null?void 0:t.photo);return l&&!n?o.jsx("img",{src:l,alt:"",className:"w-6 h-6 rounded-full",referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:()=>s(!0)}):o.jsx("div",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center",children:o.jsx(Vb,{size:12,className:"text-accent"})})}function dC({provider:t,onKeyChange:n}){var $,k;const[s,l]=y.useState(!1),[i,u]=y.useState(""),[d,f]=y.useState(!1),[m,p]=y.useState(!1),x=D(N=>N.addToast),g=t.authType==="local",b=t.authType==="subscription",S=g||b?t.installed:t.hasKey;async function w(){if(i.trim())try{await J.post(`/credentials/${t.id}`,{key:i.trim()}),x("success",`API key set for ${t.name}`),u(""),l(!1),n&&n()}catch(N){x("error","Failed to set key",N.message)}}async function j(){try{await J.delete(`/credentials/${t.id}`),x("info",`Removed ${t.name} key`),n&&n()}catch(N){x("error","Remove failed",N.message)}}return g?o.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[o.jsx(Qs,{status:S?"running":"crashed",size:"sm"}),o.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),o.jsx("div",{className:"flex-1"}),S?o.jsxs(De,{variant:"success",className:"text-2xs gap-1",children:[o.jsx(la,{size:8})," Ready"]}):o.jsx(De,{variant:"default",className:"text-2xs",children:"Not installed"})]}),o.jsx("div",{className:"flex-1",children:m?o.jsx(Jy,{isInstalled:S,onModelChange:n}):o.jsxs("div",{className:"px-4 py-3 flex flex-col h-full",children:[o.jsx("div",{className:"text-xs text-text-3 font-sans flex-1",children:S?`${(($=t.models)==null?void 0:$.length)||0} models available`:"Local AI models — free, private, no API key"}),o.jsxs(Se,{variant:S?"secondary":"primary",size:"sm",onClick:()=>p(!0),className:"w-full h-7 text-2xs gap-1.5 mt-3",children:[o.jsx(Af,{size:11}),S?"Manage Models":"Set Up Ollama"]})]})})]}):o.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[o.jsx(Qs,{status:S?"running":"crashed",size:"sm"}),o.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),o.jsx("div",{className:"flex-1"}),S?o.jsxs(De,{variant:"success",className:"text-2xs gap-1",children:[o.jsx(la,{size:8})," Ready"]}):o.jsx(De,{variant:"default",className:"text-2xs",children:b?"Not installed":"No key"})]}),o.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[120px]",children:[((k=t.models)==null?void 0:k.length)>0&&o.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.models.map(N=>o.jsx("span",{className:"px-1.5 py-0.5 rounded bg-surface-4 text-2xs font-mono text-text-3",children:N.name||N.id},N.id))}),b&&S&&!t.hasKey&&!s&&o.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-accent/8 border border-accent/20 rounded-md text-2xs font-sans text-accent mb-3",children:[o.jsx(la,{size:10})," Subscription active"]}),t.hasKey&&!s&&o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsxs("div",{className:"flex-1 flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success",children:[o.jsx(la,{size:10})," API Connected"]}),o.jsx("button",{onClick:()=>{l(!0),f(!1),u("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Edit"}),o.jsx("button",{onClick:j,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Remove"})]}),o.jsx("div",{className:"flex-1"}),s&&o.jsxs("div",{className:"space-y-2.5 pt-1",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:t.hasKey?"Update API Key":`${t.name} API Key`}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{value:i,onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&w(),type:d?"text":"password",placeholder:"sk-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),o.jsx("button",{onClick:()=>f(!d),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:d?o.jsx(qf,{size:12}):o.jsx(li,{size:12})})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Se,{variant:"primary",size:"sm",onClick:w,disabled:!i.trim(),className:"flex-1 h-8 text-xs",children:"Save Key"}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&!t.hasKey&&o.jsxs(Se,{variant:b?"secondary":"primary",size:"sm",onClick:()=>{l(!0),f(!1),u("")},className:"w-full h-8 text-2xs gap-1.5 mt-2",children:[o.jsx(oc,{size:11}),b?"Add API key for headless mode":"Add API Key"]})]})]})}function xl({icon:t,label:n,description:s,children:l}){return o.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:o.jsx(t,{size:12,className:"text-accent"})}),o.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:n})]}),o.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed",children:s}),o.jsx("div",{className:"mt-auto pt-1",children:l})]})}const ZS={telegram:Vf,discord:ri,slack:Pb},bs={telegram:"Telegram",discord:"Discord",slack:"Slack"},OC={telegram:"Bot token from @BotFather",discord:"Bot token from Developer Portal",slack:"Bot token (xoxb-...)"},fC=["critical","lifecycle","all"];function hC({type:t,open:n,onOpenChange:s}){if(!t)return null;const i={telegram:{title:"Set Up Telegram",icon:Vf,intro:"Create a Telegram bot and connect it to Groove in under 2 minutes. No dependencies required.",sections:[{title:"Create Your Bot",steps:[{text:"Open Telegram on any device and search for",link:"https://t.me/BotFather",linkText:"@BotFather"},{text:"Send /newbot to start the setup"},{text:"Choose a display name — we suggest GroovePilot"},{text:'Choose a username (must end in "bot") — e.g. GroovePilot_bot'},{text:"BotFather will reply with your bot token — copy it"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Telegram card"},{text:"Paste your bot token and click Save"},{text:"The gateway will connect automatically"}]},{title:"Link a Chat",steps:[{text:"Open a chat with your new bot in Telegram"},{text:'Send any message (e.g. "hello") — Groove captures the chat ID automatically'},{text:"Click Test in the gateway card to verify"}]},{title:"Commands",note:"All commands use / prefix in Telegram:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},discord:{title:"Set Up Discord",icon:ri,intro:"Create a Discord bot and add it to your server. Requires discord.js (installed automatically with Groove).",sections:[{title:"Create the Application",steps:[{text:"Go to the",link:"https://discord.com/developers/applications",linkText:"Discord Developer Portal"},{text:"Click New Application and name it GroovePilot"},{text:"Go to the Bot tab in the left sidebar"},{text:"Click Reset Token and copy the bot token"}]},{title:"Set Permissions & Invite",steps:[{text:"Go to OAuth2 > URL Generator"},{text:"Under Scopes, check bot"},{text:"Under Bot Permissions, check:"}],scopes:["Send Messages","Read Message History","Embed Links","Use External Emojis"],after:[{text:"Copy the generated URL at the bottom and open it in your browser"},{text:"Select your server and click Authorize"}]},{title:"Enable Message Content Intent",steps:[{text:"Go back to the Bot tab in the Developer Portal"},{text:"Scroll to Privileged Gateway Intents"},{text:"Enable Message Content Intent — required for the bot to read commands"},{text:"Click Save Changes"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Discord card"},{text:"Paste your bot token and click Save"},{text:"Send a message in any channel where the bot is — Groove captures the channel automatically"}]},{title:"Commands",note:"All commands use / prefix in Discord:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},slack:{title:"Set Up Slack",icon:Pb,intro:"Create a Slack app with Socket Mode — no public URL needed. Requires @slack/bolt (installed automatically with Groove).",sections:[{title:"Create the App",steps:[{text:"Go to",link:"https://api.slack.com/apps",linkText:"api.slack.com/apps"},{text:"Click Create New App > From scratch"},{text:"Name it GroovePilot and select your workspace"}]},{title:"Enable Socket Mode",steps:[{text:"In the left sidebar, go to Settings > Socket Mode"},{text:"Toggle Enable Socket Mode to on"},{text:"It will ask you to create an App-Level Token"},{text:'Name it "groove", add the connections:write scope'},{text:"Click Generate — copy the xapp-... token (this is your App Token)"}],important:"Save this token now — you can't view it again after closing the dialog."},{title:"Set Bot Token Scopes",steps:[{text:"Go to Features > OAuth & Permissions"},{text:"Scroll to Bot Token Scopes and add all of these:"}],scopes:["chat:write","channels:read","channels:history","groups:read","groups:history","im:history","app_mentions:read"],after:[{text:"Scroll up and click Install to Workspace"},{text:"Click Allow to grant permissions"},{text:"Copy the Bot User OAuth Token (xoxb-...) — this is your Bot Token"}]},{title:"Enable Events",steps:[{text:"Go to Features > Event Subscriptions"},{text:"Toggle Enable Events to on"},{text:"Under Subscribe to bot events, add:"}],scopes:["message.channels","message.im","app_mention"],after:[{text:"Click Save Changes at the bottom"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Slack card"},{text:"Paste your Bot Token (xoxb-...) in the first field"},{text:"Paste your App Token (xapp-...) in the second field"},{text:"Click Save — Groove will auto-connect"}]},{title:"Link a Channel",steps:[{text:"Invite the bot to a channel: /invite @GroovePilot"},{text:"Select the channel from the dropdown in the gateway card"},{text:"Or @mention the bot — it will auto-capture the channel"},{text:"Click Test to verify"}],important:"For private channels, make sure you added the groups:read scope."},{title:"Commands",note:"In Slack, use plain text commands (no / prefix) or @mention the bot:",commands:["instruct <team> <msg>","query <team> <question>","plan <description>","log <team>","brief","tokens","status","agents","help","@GroovePilot status"]}]}}[t];if(!i)return null;const u=i.icon;return o.jsx(_S,{open:n,onOpenChange:s,children:o.jsx(CS,{title:i.title,width:480,children:o.jsxs("div",{className:"px-5 py-4 space-y-5",children:[o.jsxs("div",{className:"flex items-start gap-3 p-3 bg-accent/5 border border-accent/15 rounded-lg",children:[o.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:o.jsx(u,{size:16,className:"text-accent"})}),o.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:i.intro})]}),i.sections.map((d,f)=>{var m;return o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xs font-semibold text-text-0 font-sans mb-2.5 flex items-center gap-2",children:[o.jsx("span",{className:"w-5 h-5 rounded-full bg-accent/10 flex items-center justify-center text-2xs font-bold text-accent",children:f+1}),d.title]}),d.note&&o.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:d.note}),d.steps&&o.jsx("ol",{className:"space-y-2 mb-2",children:d.steps.map((p,x)=>o.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[o.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[x+1,"."]}),o.jsxs("span",{children:[p.text,p.link&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:p.link,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-0.5 font-medium",children:[p.linkText,o.jsx(ic,{size:9})]})]})]})]},x))}),d.scopes&&o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 ml-6",children:d.scopes.map(p=>o.jsx("code",{className:"px-2 py-0.5 rounded bg-surface-4 text-2xs font-mono text-accent",children:p},p))}),d.after&&o.jsx("ol",{className:"space-y-2 mb-2",start:(((m=d.steps)==null?void 0:m.length)||0)+1,children:d.after.map((p,x)=>{var g;return o.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[o.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[(((g=d.steps)==null?void 0:g.length)||0)+x+1,"."]}),o.jsx("span",{children:p.text})]},x)})}),d.important&&o.jsx("div",{className:"ml-6 p-2 bg-warning/8 border border-warning/20 rounded-md text-2xs text-warning font-sans",children:d.important}),d.commands&&o.jsx("div",{className:"ml-6 p-2.5 bg-surface-0 border border-border-subtle rounded-md space-y-1",children:d.commands.map(p=>o.jsx("code",{className:"block text-2xs font-mono text-text-1",children:p},p))})]},f)}),o.jsxs("a",{href:"https://docs.groovedev.ai/guide/gateways",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium mt-2",children:[o.jsx(ic,{size:10}),"Full documentation at docs.groovedev.ai"]})]})})})}function mC({gateway:t,onRefresh:n}){var be,pe;const[s,l]=y.useState(!1),[i,u]=y.useState(""),[d,f]=y.useState(""),[m,p]=y.useState(!1),[x,g]=y.useState(!1),[b,S]=y.useState(!1),[w,j]=y.useState([]),[$,k]=y.useState(!1),N=D(K=>K.addToast);y.useEffect(()=>{t.connected&&!t.chatId&&t.type==="slack"&&J.get(`/gateways/${t.id}/channels`).then(K=>j(Array.isArray(K)?K:[])).catch(()=>{})},[t.connected,t.chatId,t.id,t.type]);const R=ZS[t.type]||_b,A=t.type==="slack";async function U(){if(i.trim())try{await J.post(`/gateways/${t.id}/credentials`,{key:"bot_token",value:i.trim()}),A&&d.trim()&&await J.post(`/gateways/${t.id}/credentials`,{key:"app_token",value:d.trim()}),N("success","Token saved — connecting..."),u(""),f(""),l(!1);try{await J.post(`/gateways/${t.id}/connect`),N("success",`${bs[t.type]} connected!`)}catch(K){N("error","Token saved but connect failed",K.message)}n()}catch(K){N("error","Failed to save token",K.message)}}async function X(){g(!0);try{await J.post(`/gateways/${t.id}/test`),N("success","Test message sent!")}catch(K){N("error","Test failed",K.message)}g(!1)}async function z(){S(!0);try{t.connected?(await J.post(`/gateways/${t.id}/disconnect`),N("info",`${bs[t.type]} disconnected`)):(await J.post(`/gateways/${t.id}/connect`),N("success",`${bs[t.type]} connected!`)),n()}catch(K){N("error",t.connected?"Disconnect failed":"Connect failed",K.message)}S(!1)}async function T(K){try{await J.patch(`/gateways/${t.id}`,{enabled:K}),n()}catch(Z){N("error","Update failed",Z.message)}}async function B(K){try{await J.patch(`/gateways/${t.id}`,{notifications:{preset:K}}),n()}catch(Z){N("error","Update failed",Z.message)}}async function V(K){try{await J.patch(`/gateways/${t.id}`,{commandPermission:K}),n()}catch(Z){N("error","Update failed",Z.message)}}async function le(){try{await J.delete(`/gateways/${t.id}`),N("info",`${bs[t.type]} gateway removed`),n()}catch(K){N("error","Delete failed",K.message)}}const Oe=((be=t.notifications)==null?void 0:be.preset)||"critical";return o.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[o.jsx(Qs,{status:t.connected?"running":"crashed",size:"sm"}),o.jsx(R,{size:13,className:"text-text-2"}),o.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:bs[t.type]}),o.jsx("div",{className:"flex-1"}),t.connected?o.jsxs(De,{variant:"success",className:"text-2xs gap-1",children:[o.jsx(Gg,{size:8})," Connected"]}):t.enabled?o.jsx(De,{variant:"warning",className:"text-2xs",children:"Disconnected"}):o.jsx(De,{variant:"default",className:"text-2xs",children:"Disabled"})]}),o.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[140px]",children:[t.connected&&!s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success mb-3",children:[o.jsx(la,{size:10})," Gateway active",t.botUsername&&o.jsxs("span",{className:"text-text-4 ml-1",children:["@",t.botUsername]}),t.botTag&&o.jsx("span",{className:"text-text-4 ml-1",children:t.botTag})]}),o.jsxs("div",{className:"mb-3",children:[o.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:t.type==="slack"?"Channel":"Chat ID"}),t.chatId?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("code",{className:"flex-1 flex items-center h-7 px-2 bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2",children:t.type==="slack"&&w.length>0?`#${((pe=w.find(K=>K.id===t.chatId))==null?void 0:pe.name)||t.chatId}`:t.chatId}),o.jsx("button",{onClick:async()=>{try{await J.patch(`/gateways/${t.id}`,{chatId:null}),n()}catch(K){N("error","Failed",K.message)}},className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans",children:"Change"})]}):t.type==="slack"&&w.length>0?o.jsxs("select",{onChange:async K=>{if(K.target.value)try{await J.patch(`/gateways/${t.id}`,{chatId:K.target.value}),n()}catch(Z){N("error","Failed to set channel",Z.message)}},className:"w-full h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",defaultValue:"",children:[o.jsx("option",{value:"",disabled:!0,children:"Select a channel..."}),w.map(K=>o.jsxs("option",{value:K.id,children:["#",K.name]},K.id))]}):o.jsxs("div",{className:"text-2xs text-warning font-sans",children:[t.type==="slack"?"No channels found — invite the bot to a channel first.":"Send a message to the bot to auto-capture, or enter manually:",o.jsx("input",{placeholder:t.type==="slack"?"C0123456789":"Chat ID",className:"mt-1 w-full h-7 px-2 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",onKeyDown:async K=>{if(K.key==="Enter"&&K.target.value.trim())try{await J.patch(`/gateways/${t.id}`,{chatId:K.target.value.trim()}),n()}catch(Z){N("error","Failed to set channel",Z.message)}}})]})]}),o.jsxs("div",{className:"mb-3",children:[o.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Notifications"}),o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:fC.map(K=>o.jsx("button",{onClick:()=>B(K),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",Oe===K?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:K},K))})]}),o.jsxs("div",{className:"mb-3",children:[o.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Commands"}),o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["full","read-only"].map(K=>o.jsx("button",{onClick:()=>V(K),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",(t.commandPermission||"full")===K?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:K==="full"?"Full Access":"Read Only"},K))})]})]}),!t.connected&&!s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-xs text-text-3 font-sans mb-2",children:t.enabled?t.hasCredentials?"Tokens saved — click Connect.":"Configure bot token to connect.":"Gateway is disabled."}),!t.hasCredentials&&o.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer mb-2",children:[o.jsx(lc,{size:11}),"How to set up",o.jsx(ic,{size:9})]})]}),o.jsx(hC,{type:t.type,open:$,onOpenChange:k}),o.jsx("div",{className:"flex-1"}),s&&o.jsxs("div",{className:"space-y-2.5 pt-1",children:[o.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer",children:[o.jsx(lc,{size:11}),"Where do I get these?"]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"Bot Token"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{value:i,onChange:K=>u(K.target.value),onKeyDown:K=>K.key==="Enter"&&!A&&U(),type:m?"text":"password",placeholder:OC[t.type],className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),o.jsx("button",{onClick:()=>p(!m),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:m?o.jsx(qf,{size:12}):o.jsx(li,{size:12})})]})]}),A&&o.jsxs("div",{children:[o.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"App Token (Socket Mode)"}),o.jsx("input",{value:d,onChange:K=>f(K.target.value),onKeyDown:K=>K.key==="Enter"&&U(),type:m?"text":"password",placeholder:"xapp-...",className:"w-full h-9 px-3 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Se,{variant:"primary",size:"sm",onClick:U,disabled:!i.trim(),className:"flex-1 h-8 text-xs",children:"Save Token"}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u(""),f("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&o.jsxs("div",{className:"flex gap-2 mt-2",children:[!t.connected&&o.jsxs(Se,{variant:"primary",size:"sm",onClick:()=>l(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[o.jsx(oc,{size:11}),t.enabled?"Set Token":"Configure"]}),t.connected&&o.jsxs(o.Fragment,{children:[o.jsxs(Se,{variant:"secondary",size:"sm",onClick:X,disabled:x,className:"flex-1 h-7 text-2xs gap-1.5",children:[o.jsx(Uf,{size:11}),x?"Sending...":"Test"]}),o.jsx(Se,{variant:"secondary",size:"sm",onClick:()=>l(!0),className:"h-7 text-2xs px-2.5",children:o.jsx(oc,{size:11})})]}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:z,disabled:b,className:"h-7 text-2xs px-2.5",title:t.connected?"Disconnect":"Connect",children:t.connected?o.jsx(Rb,{size:11}):o.jsx(Gg,{size:11})}),o.jsx(cC,{value:t.enabled,onChange:T}),o.jsx("button",{onClick:le,className:"text-text-4 hover:text-danger cursor-pointer p-1",title:"Remove gateway",children:o.jsx(Rc,{size:11})})]})]})]})}function pC({existingTypes:t,onAdd:n}){const[s,l]=y.useState(!1),i=["telegram","discord","slack"].filter(u=>!t.includes(u));return i.length===0?null:s?o.jsxs("div",{className:"flex flex-col rounded-lg border border-accent/30 bg-surface-1 overflow-hidden min-w-[220px]",children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[o.jsx(_b,{size:13,className:"text-accent"}),o.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:"Add Gateway"}),o.jsx("div",{className:"flex-1"}),o.jsx("button",{onClick:()=>l(!1),className:"text-text-4 hover:text-text-1 cursor-pointer",children:o.jsx(Nt,{size:12})})]}),o.jsx("div",{className:"p-3 space-y-2",children:i.map(u=>{const d=ZS[u];return o.jsxs("button",{onClick:()=>{n(u),l(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 hover:bg-accent/8 border border-border-subtle hover:border-accent/20 cursor-pointer transition-all group",children:[o.jsx(d,{size:14,className:"text-text-3 group-hover:text-accent"}),o.jsx("span",{className:"text-xs font-medium text-text-1 group-hover:text-accent font-sans",children:bs[u]})]},u)})})]}):o.jsxs("button",{onClick:()=>l(!0),className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border-subtle bg-surface-1/50 hover:bg-surface-1 hover:border-accent/30 min-h-[140px] min-w-[220px] cursor-pointer transition-all group",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/8 group-hover:bg-accent/15 flex items-center justify-center mb-2 transition-colors",children:o.jsx(Wn,{size:14,className:"text-accent"})}),o.jsx("span",{className:"text-2xs font-semibold text-text-3 group-hover:text-text-1 font-sans transition-colors",children:"Add Gateway"})]})}function xC(){const[t,n]=y.useState([]),[s,l]=y.useState(null),[i,u]=y.useState(null),[d,f]=y.useState([]),[m,p]=y.useState(!0),[x,g]=y.useState(!1),b=D(z=>z.addToast),S=D(z=>z.marketplaceUser),w=D(z=>z.marketplaceAuthenticated),j=D(z=>z.marketplaceLogin),$=D(z=>z.marketplaceLogout);function k(){J.get("/providers").then(z=>n(Array.isArray(z)?z:[])).catch(()=>{})}function N(){J.get("/gateways").then(z=>f(Array.isArray(z)?z:[])).catch(()=>{})}y.useEffect(()=>{Promise.all([J.get("/providers"),J.get("/config"),J.get("/status"),J.get("/gateways")]).then(([z,T,B,V])=>{n(Array.isArray(z)?z:[]),l(T),u(B),f(Array.isArray(V)?V:[]),p(!1)}).catch(()=>p(!1))},[]);async function R(z){try{await J.post("/gateways",{type:z}),b("success",`${bs[z]} gateway added`),N()}catch(T){b("error","Failed to add gateway",T.message)}}async function A(z,T){try{const B=await J.patch("/config",{[z]:T});l(B)}catch(B){b("error","Update failed",B.message)}}if(m)return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx("div",{className:"h-12 bg-surface-1 border-b border-border"}),o.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[o.jsx("div",{className:"grid grid-cols-4 gap-3",children:[...Array(4)].map((z,T)=>o.jsx(ra,{className:"h-40 rounded-lg"},T))}),o.jsx("div",{className:"grid grid-cols-3 gap-3",children:[...Array(6)].map((z,T)=>o.jsx(ra,{className:"h-28 rounded-lg"},T))})]})]});const U=t.filter(z=>z.authType==="local"||z.authType==="subscription"?z.installed:z.hasKey).length,X=(s==null?void 0:s.rotationThreshold)||0;return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border flex-shrink-0",children:[o.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Settings"}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[(i==null?void 0:i.version)&&o.jsxs("span",{children:["v",i.version]}),(i==null?void 0:i.port)&&o.jsxs("span",{children:[":",i.port]}),(i==null?void 0:i.uptime)>0&&o.jsxs("span",{children:["Up ",Cc(i.uptime)]})]}),o.jsx("div",{className:"w-px h-4 bg-border-subtle"}),w?o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(uC,{user:S}),o.jsx("span",{className:"text-xs font-medium text-text-0 font-sans",children:(S==null?void 0:S.displayName)||"User"}),o.jsxs("button",{onClick:$,className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans flex items-center gap-1",children:[o.jsx(Tb,{size:10})," Sign out"]})]}):o.jsxs(Se,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-2xs gap-1.5 text-text-3",children:[o.jsx(Mf,{size:11})," Sign in"]}),o.jsx(Qs,{status:"running",size:"sm"})]}),o.jsx(Na,{className:"flex-1",children:o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Providers"}),o.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[U,"/",t.length," connected"]})]}),o.jsx("div",{className:"grid grid-cols-4 gap-3",children:t.map(z=>o.jsx(dC,{provider:z,onKeyChange:k},z.id))})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Gateways"}),o.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),o.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[d.filter(z=>z.connected).length,"/",d.length," connected"]})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.map(z=>o.jsx(mC,{gateway:z,onRefresh:N},z.id)),o.jsx(pC,{existingTypes:d.map(z=>z.type),onAdd:R})]})]}),s&&o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Configuration"}),o.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Auto-saves"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsx(xl,{icon:Af,label:"Default Provider",description:"Provider used when spawning new agents.",children:o.jsx("select",{value:s.defaultProvider||"claude-code",onChange:z=>A("defaultProvider",z.target.value),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:t.filter(z=>z.installed||z.hasKey).map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))})}),o.jsx(xl,{icon:Dr,label:"Working Directory",description:"Default root directory for new agents.",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("code",{className:"flex-1 h-8 px-2 flex items-center bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2 truncate min-w-0",children:s.defaultWorkingDir||"Project root"}),o.jsx(Se,{variant:"secondary",size:"sm",onClick:()=>g(!0),className:"h-8 px-2 flex-shrink-0",children:o.jsx(Qb,{size:12})})]})}),o.jsx(xl,{icon:jb,label:"Rotation Threshold",description:"Context usage that triggers auto-rotation.",children:o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["auto","50%","65%","75%","85%"].map(z=>{const T=z==="auto"?0:parseInt(z,10)/100,B=X===T;return o.jsx("button",{onClick:()=>A("rotationThreshold",T),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",B?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:z==="auto"?"Auto":z},z)})})}),o.jsx(xl,{icon:Eb,label:"QC Threshold",description:"Running agents count that triggers auto-QC.",children:o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[2,3,4,6,8].map(z=>{const T=(s.qcThreshold||2)===z;return o.jsx("button",{onClick:()=>A("qcThreshold",z),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:z},z)})})}),o.jsx(xl,{icon:_c,label:"Max Agents",description:"Concurrent agent limit. 0 = unlimited.",children:o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[0,4,8,12,20].map(z=>{const T=(s.maxAgents||0)===z;return o.jsx("button",{onClick:()=>A("maxAgents",z),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:z===0?"∞":z},z)})})}),o.jsx(xl,{icon:Wr,label:"Journalist Interval",description:"Seconds between synthesis cycles.",children:o.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[60,120,300,600].map(z=>{const T=(s.journalistInterval||120)===z,B=z<60?`${z}s`:`${z/60}m`;return o.jsx("button",{onClick:()=>A("journalistInterval",z),className:se("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:B},z)})})})]})]})]})}),o.jsx(XS,{open:x,onOpenChange:g,currentPath:(s==null?void 0:s.defaultWorkingDir)||"/",onSelect:z=>A("defaultWorkingDir",z)})]})}const bf=[];function AS(t){const n=(t||"").toLowerCase();return n.includes("reading")||n.includes("read ")?{icon:li,color:"text-info",label:"Reading"}:n.includes("editing")||n.includes("wrote")||n.includes("writing")||n.includes("edit ")?{icon:Sb,color:"text-warning",label:"Editing"}:n.includes("searching")||n.includes("search")||n.includes("grep")||n.includes("glob")?{icon:Cl,color:"text-purple",label:"Searching"}:n.includes("running")||n.includes("bash")||n.includes("command")||n.includes("exec")?{icon:oi,color:"text-orange",label:"Running"}:n.includes("test")||n.includes("pass")?{icon:af,color:"text-success",label:"Testing"}:n.includes("error")||n.includes("fail")||n.includes("crash")?{icon:Ss,color:"text-danger",label:"Error"}:n.includes("rotat")?{icon:ii,color:"text-accent",label:"Rotating"}:n.includes("spawn")||n.includes("start")?{icon:In,color:"text-success",label:"Spawned"}:n.includes("tool")||n.includes("function")?{icon:dP,color:"text-text-2",label:"Tool"}:n.includes("complet")||n.includes("done")||n.includes("finish")?{icon:af,color:"text-success",label:"Done"}:{icon:Ta,color:"text-text-3",label:"Activity"}}function gl({text:t}){return t?t.split(/(\*\*[^*]+\*\*|`[^`]+`)/g).map((n,s)=>n.startsWith("**")&&n.endsWith("**")?o.jsx("strong",{className:"font-semibold text-text-0",children:n.slice(2,-2)},s):n.startsWith("`")&&n.endsWith("`")?o.jsx("code",{className:"px-1 py-px rounded bg-accent/8 text-[11px] font-mono text-accent",children:n.slice(1,-1)},s):o.jsx("span",{children:n},s)):null}function gC({text:t}){if(!t)return null;const n=[],s=t.split(`
570
570
  `);let l=0;for(;l<s.length;){const i=s[l];if(i.trimStart().startsWith("```")){const d=[],f=i.trim().slice(3);for(l++;l<s.length&&!s[l].trimStart().startsWith("```");)d.push(s[l]),l++;l++,n.push({type:"code",content:d.join(`
571
- `),lang:f});continue}if(/^#{1,3}\s/.test(i)||/^\*\*[^*]+:\*\*\s*$/.test(i.trim())){const d=i.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();n.push({type:"heading",content:d}),l++;continue}if(/^\s*[-*]\s/.test(i)){const d=[];for(;l<s.length&&/^\s*[-*]\s/.test(s[l]);)d.push(s[l].replace(/^\s*[-*]\s+/,"").trim()),l++;n.push({type:"list",items:d});continue}if(/^\s*\d+[\.)]\s/.test(i)){const d=[];for(;l<s.length&&/^\s*\d+[\.)]\s/.test(s[l]);)d.push(s[l].replace(/^\s*\d+[\.)]\s+/,"").trim()),l++;n.push({type:"numbered",items:d});continue}if(!i.trim()){l++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(i.trim())){n.push({type:"note",content:i.trim()}),l++;continue}const u=[];for(;l<s.length&&s[l].trim()&&!/^#{1,3}\s/.test(s[l])&&!/^\s*[-*]\s/.test(s[l])&&!/^\s*\d+[\.)]\s/.test(s[l])&&!s[l].trimStart().startsWith("```");)u.push(s[l].trim()),l++;u.length>0&&n.push({type:"para",content:u.join(" ")})}return o.jsx("div",{className:"space-y-2",children:n.map((i,u)=>{switch(i.type){case"heading":return o.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[o.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),o.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:o.jsx(gl,{text:i.content})})]},u);case"list":return o.jsx("div",{className:"space-y-1 pl-2",children:i.items.map((d,f)=>o.jsxs("div",{className:"flex gap-2 text-[12px] text-text-2 font-sans leading-relaxed",children:[o.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),o.jsx("span",{className:"min-w-0",children:o.jsx(gl,{text:d})})]},f))},u);case"numbered":return o.jsx("div",{className:"space-y-1 pl-2",children:i.items.map((d,f)=>o.jsxs("div",{className:"flex gap-2 text-[12px] text-text-2 font-sans leading-relaxed",children:[o.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[f+1,"."]}),o.jsx("span",{className:"min-w-0",children:o.jsx(gl,{text:d})})]},f))},u);case"code":return o.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:i.content},u);case"note":return o.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[o.jsx(Ss,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),o.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:o.jsx(gl,{text:i.content})})]},u);case"para":default:return o.jsx("p",{className:"text-[12px] text-text-2 font-sans leading-relaxed",children:o.jsx(gl,{text:i.content})},u)}})})}function bC({text:t}){if(!t)return null;const n=t.split(/(```[\s\S]*?```)/g);return o.jsx("span",{children:n.map((s,l)=>{if(s.startsWith("```")&&s.endsWith("```")){const i=s.slice(3,-3).replace(/^\w+\n/,"");return o.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:i},l)}return o.jsx("span",{children:o.jsx(gl,{text:s})},l)})})}function vC({msg:t}){const n=t.isQuery;return o.jsx("div",{className:"flex justify-end pl-8",children:o.jsxs("div",{className:"max-w-[90%]",children:[n&&o.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[o.jsx(lc,{size:9,className:"text-info"}),o.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),o.jsx("div",{className:se("px-3.5 py-2.5 rounded-2xl rounded-br-md",n?"bg-info/10 border border-info/15":"bg-accent/10 border border-accent/15"),children:o.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:o.jsx(bC,{text:t.text})})}),o.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:Wt(t.timestamp)})]})})}function yC({msg:t,agent:n}){var u,d;const[s,l]=y.useState(((u=t.text)==null?void 0:u.length)>600),i=((d=t.text)==null?void 0:d.length)>600;return o.jsxs("div",{className:"pr-2",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[o.jsx("div",{className:"w-5 h-5 rounded-md bg-accent/12 flex items-center justify-center flex-shrink-0",children:o.jsx(Ta,{size:10,className:"text-accent"})}),o.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(n==null?void 0:n.name)||"Agent"}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:n==null?void 0:n.role})]}),o.jsxs("div",{className:se("ml-7 px-3.5 py-3 rounded-xl bg-surface-2/40 border border-border-subtle/50 overflow-hidden",s&&"max-h-[200px] relative"),children:[o.jsx(gC,{text:s?t.text.slice(0,600):t.text}),s&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-16 bg-gradient-to-t from-surface-2/90 to-transparent flex items-end justify-center pb-2",children:o.jsxs("button",{onClick:()=>l(!1),className:"flex items-center gap-1 px-3 py-1 rounded-full bg-surface-3 border border-border-subtle text-2xs text-text-2 font-sans hover:text-text-0 cursor-pointer transition-colors",children:[o.jsx(Dn,{size:10}),"Show full response"]})})]}),i&&!s&&o.jsx("button",{onClick:()=>l(!0),className:"ml-7 mt-1 text-[10px] text-text-4 hover:text-text-2 font-sans cursor-pointer",children:"Collapse"}),o.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 ml-7",children:Wt(t.timestamp)})]})}function SC({msg:t}){return o.jsxs("div",{className:"flex items-center gap-3 py-2",children:[o.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),o.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),o.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function u0({entry:t}){var i;const n=AS(t.text),s=n.icon,l=((i=t.text)==null?void 0:i.length)>120?t.text.slice(0,120)+"...":t.text;return o.jsxs("div",{className:"flex items-center gap-2 py-0.5 group",children:[o.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0",children:o.jsx(s,{size:10,className:se(n.color,"opacity-70")})}),o.jsx("p",{className:"text-[11px] text-text-3 font-sans truncate flex-1 min-w-0",children:l}),o.jsx("span",{className:"text-[10px] text-text-4 font-mono opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:Wt(t.timestamp)})]})}function QC({entries:t}){const[n,s]=y.useState(!1);if(t.length===1)return o.jsx("div",{className:"ml-7",children:o.jsx(u0,{entry:t[0]})});const l=n?t:t.slice(0,2),i=t.length-2;return o.jsxs("div",{className:"ml-7 py-1 pl-3 border-l border-border-subtle/50 space-y-px",children:[l.map((u,d)=>o.jsx(u0,{entry:u},d)),!n&&i>0&&o.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 text-[11px] text-text-4 hover:text-text-2 font-sans cursor-pointer py-0.5 ml-6",children:[o.jsx(Dn,{size:9}),o.jsxs("span",{children:[i," more"]})]})]})}function jC({agent:t}){const n=D(m=>m.activityLog[t.id])||bf,s=n[n.length-1],l=s?AS(s.text):null,i=(l==null?void 0:l.icon)||Ta,u=s&&Date.now()-s.timestamp<1e4,d=u&&s.text?s.text.length>60?s.text.slice(0,60)+"...":s.text:null,f=Math.round((t.contextUsage||0)*100);return o.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[o.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[o.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),o.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),u?o.jsxs(o.Fragment,{children:[o.jsx(i,{size:10,className:se(l.color,"flex-shrink-0")}),o.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:d})]}):o.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[o.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:wC(t.tokensUsed)}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-14 h-1 rounded-full bg-surface-4 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${f}%`,background:f>=75?"var(--color-danger)":f>=50?"var(--color-warning)":"var(--color-accent)"}})}),o.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[f,"%"]})]})]})]})}function wC(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function $C({agent:t}){const n=D(k=>k.chatHistory[t.id])||bf,s=D(k=>k.activityLog[t.id])||bf,l=D(k=>k.instructAgent),i=D(k=>k.queryAgent),[u,d]=y.useState(""),[f,m]=y.useState("instruct"),[p,x]=y.useState(!1),g=y.useRef(null),b=y.useRef(null),S=y.useMemo(()=>{const k=[],N=new Set(n.map(X=>X.text));for(const X of n)k.push({...X,kind:"chat",ts:X.timestamp});const R=s.slice(-30);for(const X of R)(X.text||"").trim()&&!N.has(X.text)&&k.push({...X,kind:"activity",ts:X.timestamp});k.sort((X,z)=>X.ts-z.ts);const A=[];let U=[];for(const X of k)X.kind==="activity"?U.push(X):(U.length>0&&(A.push({kind:"activity-group",entries:U}),U=[]),A.push(X));return U.length>0&&A.push({kind:"activity-group",entries:U}),A},[n,s]);y.useEffect(()=>{g.current&&requestAnimationFrame(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)})},[S.length]);async function w(){var N;const k=u.trim();if(!(!k||p)){if(k==="/rotate"){const R=D.getState().rotateAgent;d("");try{await R(t.id)}catch{}return}d(""),x(!0);try{f==="query"?await i(t.id,k):await l(t.id,k)}catch{}x(!1),(N=b.current)==null||N.focus()}}function j(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),w())}const $=t.status==="running"||t.status==="starting";return o.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[$&&o.jsx(jC,{agent:t}),o.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[S.length===0&&o.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:$?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative w-12 h-12 mb-4",children:[o.jsx("span",{className:"absolute inset-0 rounded-full border border-accent/20 animate-ping",style:{animationDuration:"2.5s"}}),o.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/6 flex items-center justify-center",children:o.jsx("span",{className:"w-2 h-2 rounded-full bg-accent animate-pulse"})})]}),o.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Initializing session..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-3 flex items-center justify-center mb-3",children:o.jsx(ri,{size:18,className:"text-text-4"})}),o.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Session complete — send a message to continue"})]})}),S.map((k,N)=>k.kind==="activity-group"?o.jsx(QC,{entries:k.entries},`grp-${N}`):k.from==="user"?o.jsx(vC,{msg:k},`msg-${N}`):k.from==="system"?o.jsx(SC,{msg:k},`msg-${N}`):o.jsx(yC,{msg:k,agent:t},`msg-${N}`)),p&&o.jsxs("div",{className:"flex items-center gap-2 ml-7 py-2",children:[o.jsx("div",{className:"w-5 h-5 rounded-md bg-accent/12 flex items-center justify-center",children:o.jsx(Ta,{size:10,className:"text-accent"})}),o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-2xl bg-surface-2/60 border border-border-subtle",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"200ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"400ms"}})]})]})]}),o.jsxs("div",{className:"border-t border-border px-4 py-3 bg-surface-1/50 flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[o.jsxs("button",{onClick:()=>m("instruct"),className:se("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",f==="instruct"?"bg-accent/12 text-accent border border-accent/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[o.jsx(zc,{size:10}),"Instruct"]}),o.jsxs("button",{onClick:()=>m("query"),className:se("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",f==="query"?"bg-info/12 text-info border border-info/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[o.jsx(lc,{size:10}),"Query"]}),o.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:f==="query"?"Read-only — agent keeps working":$?"Directs the agent":"Continues the session"})]}),o.jsxs("div",{className:se("flex items-end gap-2 rounded-xl border bg-surface-0 p-1 transition-colors",f==="query"?"border-info/20 focus-within:border-info/40":"border-border-subtle focus-within:border-accent/30"),children:[o.jsx("textarea",{ref:b,value:u,onChange:k=>d(k.target.value),onKeyDown:j,placeholder:f==="query"?"Ask about this agent's work...":$?"Send an instruction...":"Continue this session...",rows:1,className:se("flex-1 resize-none px-3 py-2 text-[13px]","bg-transparent text-text-0 font-sans","placeholder:text-text-4","focus:outline-none","max-h-[120px] min-h-[36px]"),style:{height:Math.min(Math.max(36,u.split(`
571
+ `),lang:f});continue}if(/^#{1,3}\s/.test(i)||/^\*\*[^*]+:\*\*\s*$/.test(i.trim())){const d=i.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();n.push({type:"heading",content:d}),l++;continue}if(/^\s*[-*]\s/.test(i)){const d=[];for(;l<s.length&&/^\s*[-*]\s/.test(s[l]);)d.push(s[l].replace(/^\s*[-*]\s+/,"").trim()),l++;n.push({type:"list",items:d});continue}if(/^\s*\d+[\.)]\s/.test(i)){const d=[];for(;l<s.length&&/^\s*\d+[\.)]\s/.test(s[l]);)d.push(s[l].replace(/^\s*\d+[\.)]\s+/,"").trim()),l++;n.push({type:"numbered",items:d});continue}if(!i.trim()){l++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(i.trim())){n.push({type:"note",content:i.trim()}),l++;continue}const u=[];for(;l<s.length&&s[l].trim()&&!/^#{1,3}\s/.test(s[l])&&!/^\s*[-*]\s/.test(s[l])&&!/^\s*\d+[\.)]\s/.test(s[l])&&!s[l].trimStart().startsWith("```");)u.push(s[l].trim()),l++;u.length>0&&n.push({type:"para",content:u.join(" ")})}return o.jsx("div",{className:"space-y-2",children:n.map((i,u)=>{switch(i.type){case"heading":return o.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[o.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),o.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:o.jsx(gl,{text:i.content})})]},u);case"list":return o.jsx("div",{className:"space-y-1 pl-2",children:i.items.map((d,f)=>o.jsxs("div",{className:"flex gap-2 text-[12px] text-text-2 font-sans leading-relaxed",children:[o.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),o.jsx("span",{className:"min-w-0",children:o.jsx(gl,{text:d})})]},f))},u);case"numbered":return o.jsx("div",{className:"space-y-1 pl-2",children:i.items.map((d,f)=>o.jsxs("div",{className:"flex gap-2 text-[12px] text-text-2 font-sans leading-relaxed",children:[o.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[f+1,"."]}),o.jsx("span",{className:"min-w-0",children:o.jsx(gl,{text:d})})]},f))},u);case"code":return o.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:i.content},u);case"note":return o.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[o.jsx(Ss,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),o.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:o.jsx(gl,{text:i.content})})]},u);case"para":default:return o.jsx("p",{className:"text-[12px] text-text-2 font-sans leading-relaxed",children:o.jsx(gl,{text:i.content})},u)}})})}function bC({text:t}){if(!t)return null;const n=t.split(/(```[\s\S]*?```)/g);return o.jsx("span",{children:n.map((s,l)=>{if(s.startsWith("```")&&s.endsWith("```")){const i=s.slice(3,-3).replace(/^\w+\n/,"");return o.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:i},l)}return o.jsx("span",{children:o.jsx(gl,{text:s})},l)})})}function vC({msg:t}){const n=t.isQuery;return o.jsx("div",{className:"flex justify-end pl-8",children:o.jsxs("div",{className:"max-w-[90%]",children:[n&&o.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[o.jsx(lc,{size:9,className:"text-info"}),o.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),o.jsx("div",{className:se("px-3.5 py-2.5 rounded-2xl rounded-br-md",n?"bg-info/10 border border-info/15":"bg-accent/10 border border-accent/15"),children:o.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:o.jsx(bC,{text:t.text})})}),o.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:Wt(t.timestamp)})]})})}function yC({msg:t,agent:n}){var u,d;const[s,l]=y.useState(((u=t.text)==null?void 0:u.length)>600),i=((d=t.text)==null?void 0:d.length)>600;return o.jsxs("div",{className:"pr-2",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[o.jsx("div",{className:"w-5 h-5 rounded-md bg-accent/12 flex items-center justify-center flex-shrink-0",children:o.jsx(Ta,{size:10,className:"text-accent"})}),o.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(n==null?void 0:n.name)||"Agent"}),o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:n==null?void 0:n.role})]}),o.jsxs("div",{className:se("ml-7 px-3.5 py-3 rounded-xl bg-accent/[0.06] border border-accent/10 overflow-hidden",s&&"max-h-[200px] relative"),children:[o.jsx(gC,{text:s?t.text.slice(0,600):t.text}),s&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-16 bg-gradient-to-t from-surface-2/90 to-transparent flex items-end justify-center pb-2",children:o.jsxs("button",{onClick:()=>l(!1),className:"flex items-center gap-1 px-3 py-1 rounded-full bg-surface-3 border border-border-subtle text-2xs text-text-2 font-sans hover:text-text-0 cursor-pointer transition-colors",children:[o.jsx(Dn,{size:10}),"Show full response"]})})]}),i&&!s&&o.jsx("button",{onClick:()=>l(!0),className:"ml-7 mt-1 text-[10px] text-text-4 hover:text-text-2 font-sans cursor-pointer",children:"Collapse"}),o.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 ml-7",children:Wt(t.timestamp)})]})}function SC({msg:t}){return o.jsxs("div",{className:"flex items-center gap-3 py-2",children:[o.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),o.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),o.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function u0({entry:t}){var i;const n=AS(t.text),s=n.icon,l=((i=t.text)==null?void 0:i.length)>120?t.text.slice(0,120)+"...":t.text;return o.jsxs("div",{className:"flex items-center gap-2 py-0.5 group",children:[o.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0",children:o.jsx(s,{size:10,className:se(n.color,"opacity-70")})}),o.jsx("p",{className:"text-[11px] text-text-3 font-sans truncate flex-1 min-w-0",children:l}),o.jsx("span",{className:"text-[10px] text-text-4 font-mono opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:Wt(t.timestamp)})]})}function QC({entries:t}){const[n,s]=y.useState(!1);if(t.length===1)return o.jsx("div",{className:"ml-7",children:o.jsx(u0,{entry:t[0]})});const l=n?t:t.slice(0,2),i=t.length-2;return o.jsxs("div",{className:"ml-7 py-1 pl-3 border-l border-border-subtle/50 space-y-px",children:[l.map((u,d)=>o.jsx(u0,{entry:u},d)),!n&&i>0&&o.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 text-[11px] text-text-4 hover:text-text-2 font-sans cursor-pointer py-0.5 ml-6",children:[o.jsx(Dn,{size:9}),o.jsxs("span",{children:[i," more"]})]})]})}function jC({agent:t}){const n=D(m=>m.activityLog[t.id])||bf,s=n[n.length-1],l=s?AS(s.text):null,i=(l==null?void 0:l.icon)||Ta,u=s&&Date.now()-s.timestamp<1e4,d=u&&s.text?s.text.length>60?s.text.slice(0,60)+"...":s.text:null,f=Math.round((t.contextUsage||0)*100);return o.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[o.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[o.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),o.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),u?o.jsxs(o.Fragment,{children:[o.jsx(i,{size:10,className:se(l.color,"flex-shrink-0")}),o.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:d})]}):o.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[o.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:wC(t.tokensUsed)}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-14 h-1 rounded-full bg-surface-4 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${f}%`,background:f>=75?"var(--color-danger)":f>=50?"var(--color-warning)":"var(--color-accent)"}})}),o.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[f,"%"]})]})]})]})}function wC(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function $C({agent:t}){const n=D(k=>k.chatHistory[t.id])||bf,s=D(k=>k.activityLog[t.id])||bf,l=D(k=>k.instructAgent),i=D(k=>k.queryAgent),[u,d]=y.useState(""),[f,m]=y.useState("instruct"),[p,x]=y.useState(!1),g=y.useRef(null),b=y.useRef(null),S=y.useMemo(()=>{const k=[],N=new Set(n.map(X=>X.text));for(const X of n)k.push({...X,kind:"chat",ts:X.timestamp});const R=s.slice(-30);for(const X of R)(X.text||"").trim()&&!N.has(X.text)&&k.push({...X,kind:"activity",ts:X.timestamp});k.sort((X,z)=>X.ts-z.ts);const A=[];let U=[];for(const X of k)X.kind==="activity"?U.push(X):(U.length>0&&(A.push({kind:"activity-group",entries:U}),U=[]),A.push(X));return U.length>0&&A.push({kind:"activity-group",entries:U}),A},[n,s]);y.useEffect(()=>{g.current&&requestAnimationFrame(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)})},[S.length]);async function w(){var N;const k=u.trim();if(!(!k||p)){if(k==="/rotate"){const R=D.getState().rotateAgent;d("");try{await R(t.id)}catch{}return}d(""),x(!0);try{f==="query"?await i(t.id,k):await l(t.id,k)}catch{}x(!1),(N=b.current)==null||N.focus()}}function j(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),w())}const $=t.status==="running"||t.status==="starting";return o.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[$&&o.jsx(jC,{agent:t}),o.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[S.length===0&&o.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:$?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative w-12 h-12 mb-4",children:[o.jsx("span",{className:"absolute inset-0 rounded-full border border-accent/20 animate-ping",style:{animationDuration:"2.5s"}}),o.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/6 flex items-center justify-center",children:o.jsx("span",{className:"w-2 h-2 rounded-full bg-accent animate-pulse"})})]}),o.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Initializing session..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-3 flex items-center justify-center mb-3",children:o.jsx(ri,{size:18,className:"text-text-4"})}),o.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),o.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Session complete — send a message to continue"})]})}),S.map((k,N)=>k.kind==="activity-group"?o.jsx(QC,{entries:k.entries},`grp-${N}`):k.from==="user"?o.jsx(vC,{msg:k},`msg-${N}`):k.from==="system"?o.jsx(SC,{msg:k},`msg-${N}`):o.jsx(yC,{msg:k,agent:t},`msg-${N}`)),p&&o.jsxs("div",{className:"flex items-center gap-2 ml-7 py-2",children:[o.jsx("div",{className:"w-5 h-5 rounded-md bg-accent/12 flex items-center justify-center",children:o.jsx(Ta,{size:10,className:"text-accent"})}),o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-2xl bg-surface-2/60 border border-border-subtle",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"200ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent/60 animate-pulse",style:{animationDelay:"400ms"}})]})]})]}),o.jsxs("div",{className:"border-t border-border px-4 py-3 bg-surface-1/50 flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[o.jsxs("button",{onClick:()=>m("instruct"),className:se("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",f==="instruct"?"bg-accent/12 text-accent border border-accent/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[o.jsx(zc,{size:10}),"Instruct"]}),o.jsxs("button",{onClick:()=>m("query"),className:se("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",f==="query"?"bg-info/12 text-info border border-info/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[o.jsx(lc,{size:10}),"Query"]}),o.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:f==="query"?"Read-only — agent keeps working":$?"Directs the agent":"Continues the session"})]}),o.jsxs("div",{className:se("flex items-end gap-2 rounded-xl border bg-surface-0 p-1 transition-colors",f==="query"?"border-info/20 focus-within:border-info/40":"border-border-subtle focus-within:border-accent/30"),children:[o.jsx("textarea",{ref:b,value:u,onChange:k=>d(k.target.value),onKeyDown:j,placeholder:f==="query"?"Ask about this agent's work...":$?"Send an instruction...":"Continue this session...",rows:1,className:se("flex-1 resize-none px-3 py-2 text-[13px]","bg-transparent text-text-0 font-sans","placeholder:text-text-4","focus:outline-none","max-h-[120px] min-h-[36px]"),style:{height:Math.min(Math.max(36,u.split(`
572
572
  `).length*20),120)}}),o.jsx("button",{onClick:w,disabled:!u.trim()||p,className:se("w-9 h-9 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0 mb-px","disabled:opacity-15 disabled:cursor-not-allowed",u.trim()?f==="query"?"bg-info text-white hover:bg-info/85":"bg-accent text-white hover:bg-accent/85":"bg-transparent text-text-4"),children:p?o.jsx(kb,{size:15,className:"animate-spin"}):o.jsx(Vf,{size:15})})]})]})]})}function DO({options:t,value:n,onChange:s}){return o.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:t.map(l=>o.jsx("button",{onClick:()=>s(l.value),className:se("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",n===l.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:l.label},l.value))})}function Oa({label:t,icon:n,children:s,description:l}){return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-semibold text-text-1 font-sans",children:[n&&o.jsx(n,{size:13,className:"text-text-3"}),t]}),l&&o.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:l})]}),s]})}function kC({agent:t}){const n=D(w=>w.killAgent),s=D(w=>w.rotateAgent),l=D(w=>w.spawnAgent),i=D(w=>w.closeDetail),u=D(w=>w.addToast),[d,f]=y.useState(null),[m,p]=y.useState(!1),x=t.status==="running"||t.status==="starting";async function g(){f("rotate");try{await s(t.id)}catch{}f(null)}async function b(){if(!m){p(!0),setTimeout(()=>p(!1),3e3);return}f("kill");try{await n(t.id),i()}catch{}f(null),p(!1)}async function S(){f("clone");try{await l({role:t.role,provider:t.provider,model:t.model,name:`${t.name}-clone`,scope:t.scope,workingDir:t.workingDir}),u("success",`Cloned ${t.name}`)}catch{}f(null)}return x?o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsxs(Se,{variant:"primary",size:"md",onClick:g,disabled:d==="rotate",className:"gap-1.5",children:[o.jsx(ii,{size:12,className:d==="rotate"?"animate-spin":""}),"Rotate"]}),o.jsxs(Se,{variant:"info",size:"md",onClick:S,disabled:!!d,className:"gap-1.5",children:[o.jsx(nf,{size:12})," Clone"]}),o.jsxs(Se,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[o.jsx(qb,{size:12}),m?"Confirm":"Kill"]})]})}):o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs(Se,{variant:"info",size:"md",onClick:S,disabled:!!d,className:"gap-1.5",children:[o.jsx(nf,{size:12})," Clone"]}),o.jsxs(Se,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[o.jsx(Rc,{size:12}),m?"Confirm":"Remove"]})]})}function TC({agent:t}){var Ye;const n=D(L=>L.addToast),[s,l]=y.useState([]),[i,u]=y.useState(t.model||""),[d,f]=y.useState(""),[m,p]=y.useState(t.effort||"default"),[x,g]=y.useState(!1),[b,S]=y.useState(""),[w,j]=y.useState(null),[$,k]=y.useState(!1),[N,R]=y.useState(null),[A,U]=y.useState("fixed"),[X,z]=y.useState([]),[T,B]=y.useState("hr"),[V,le]=y.useState("1"),[Oe,be]=y.useState(!1),pe=t.status==="running"||t.status==="starting";y.useEffect(()=>{K(),J.get("/skills/installed").then(ce=>z(Array.isArray(ce)?ce:ce.skills||[])).catch(()=>{});function L(){K()}return window.addEventListener("groove:providers-changed",L),()=>window.removeEventListener("groove:providers-changed",L)},[]);function K(){J.get("/providers").then(L=>l(Array.isArray(L)?L:[])).catch(()=>{})}y.useEffect(()=>{u(t.model||""),J.get(`/agents/${t.id}/routing/recommend`).then(L=>{U((L==null?void 0:L.mode)||"fixed")}).catch(()=>{})},[t.id,t.model]);const Z=s.find(L=>L.id===t.provider);async function F(L,ce){u(ce);try{await J.patch(`/agents/${t.id}`,{model:ce}),n("success",`Model → ${ce}`)}catch(Pe){n("error","Model swap failed",Pe.message)}}async function ee(L){try{await J.patch(`/agents/${t.id}`,{workingDir:L}),n("success",`Working dir → ${L.split("/").pop()||L}`)}catch(ce){n("error","Update failed",ce.message)}}async function he(L){p(L);try{await J.patch(`/agents/${t.id}`,{effort:L}),n("success",`Effort → ${L}`)}catch(ce){n("error","Update failed",ce.message)}}async function te(L){if(!L.trim())return;const ce=[...t.scope||[],L.trim()];try{await J.patch(`/agents/${t.id}`,{scope:ce}),f("")}catch(Pe){n("error","Scope update failed",Pe.message)}}async function Ue(L){const ce=(t.scope||[]).filter((Pe,dt)=>dt!==L);try{await J.patch(`/agents/${t.id}`,{scope:ce})}catch(Pe){n("error","Scope update failed",Pe.message)}}async function Re(L){if(b.trim())try{await J.post(`/credentials/${L}`,{key:b.trim()}),n("success",`API key set for ${L}`),S(""),j(null),K(),window.dispatchEvent(new CustomEvent("groove:providers-changed"))}catch(ce){n("error","Failed to set key",ce.message)}}const ye=t.spawnedAt||t.createdAt;return o.jsxs("div",{className:"px-5 py-5 space-y-6 overflow-y-auto h-full",children:[o.jsx(Oa,{label:"Active Model",icon:Af,children:o.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-bold font-mono text-text-0",children:t.model||"auto"}),o.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:(Z==null?void 0:Z.name)||t.provider})]}),(Z==null?void 0:Z.canHotSwap)&&pe&&o.jsxs(De,{variant:"accent",className:"text-2xs gap-1",children:[o.jsx(In,{size:8})," Hot-swap"]})]}),((Ye=Z==null?void 0:Z.models)==null?void 0:Ye.length)>1&&o.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border-subtle",children:Z.models.map(L=>{const ce=L.id===t.model,Pe=!pe||Z.canHotSwap;return o.jsx("button",{onClick:()=>Pe&&F(t.provider,L.id),disabled:!Pe,className:se("px-2.5 py-1 rounded-md text-xs font-mono transition-all",Pe?"cursor-pointer":"cursor-not-allowed opacity-40",ce?"bg-accent/15 text-accent font-semibold":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:L.name||L.id},L.id)})})]})}),o.jsx(kC,{agent:t}),o.jsxs(Oa,{label:"Providers",icon:Ug,description:"Click a provider to see its models and connection status.",children:[o.jsx("div",{className:"space-y-1.5",children:s.map(L=>{const ce=L.id===t.provider,Pe=L.installed||L.hasKey,dt=N===L.id,Xe=L.models||[];return o.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[o.jsxs("button",{onClick:()=>R(dt?null:L.id),className:"w-full flex items-center gap-2.5 px-3 py-2 cursor-pointer hover:bg-surface-4/50 transition-colors",children:[o.jsx("div",{className:se("w-2 h-2 rounded-full flex-shrink-0",Pe?"bg-success":"bg-text-4")}),o.jsx("span",{className:se("text-xs font-semibold font-sans flex-1 text-left",Pe?"text-text-0":"text-text-3"),children:L.name||L.id}),ce&&o.jsx(De,{variant:"accent",className:"text-2xs",children:"Active"}),!Pe&&o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:L.authType==="local"?"Not installed":"No key"}),o.jsx(Dn,{size:12,className:se("text-text-4 transition-transform",dt&&"rotate-180")})]}),dt&&L.authType==="local"&&o.jsx("div",{className:"border-t border-border-subtle",children:o.jsx(Jy,{isInstalled:Pe,onModelChange:K})}),dt&&L.authType!=="local"&&o.jsxs("div",{className:"border-t border-border-subtle",children:[(!Pe||L.hasKey)&&o.jsx("div",{className:"px-3 py-2 bg-surface-1/50",children:w===L.id?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx("input",{value:b,onChange:tt=>S(tt.target.value),onKeyDown:tt=>tt.key==="Enter"&&Re(L.id),type:$?"text":"password",placeholder:`${L.name||L.id} API key...`,className:"w-full h-7 px-2.5 pr-7 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),o.jsx("button",{onClick:()=>k(!$),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:$?o.jsx(qf,{size:10}):o.jsx(li,{size:10})})]}),o.jsx(Se,{variant:"primary",size:"sm",onClick:()=>Re(L.id),disabled:!b.trim(),className:"h-7 px-2 text-2xs",children:"Save"}),o.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{j(null),S("")},className:"h-7 px-2 text-2xs",children:"Cancel"})]}):o.jsxs("button",{onClick:()=>{j(L.id),S(""),k(!1)},className:"flex items-center gap-1.5 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[o.jsx(oc,{size:10}),Pe?"Update API key":"Add API key to enable"]})}),Pe&&Xe.length>0&&Xe.map(tt=>{const gt=L.id===t.provider&&tt.id===t.model,bt=!pe;return o.jsxs("button",{onClick:()=>bt&&F(L.id,tt.id),disabled:!bt,className:se("w-full flex items-center gap-2 px-3 py-2 text-left text-xs font-sans transition-colors","border-t border-border-subtle",bt?"cursor-pointer hover:bg-surface-4/50":"cursor-not-allowed opacity-40",gt?"text-accent":"text-text-2"),children:[gt?o.jsx(la,{size:11,className:"text-accent flex-shrink-0"}):o.jsx("div",{className:"w-[11px]"}),o.jsx("span",{className:"font-mono flex-1 truncate",children:tt.name||tt.id}),o.jsx(De,{variant:gt?"accent":"default",className:"text-2xs",children:tt.tier})]},tt.id)})]})]},L.id)})}),pe&&o.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans mt-1.5",children:[o.jsx(Ss,{size:10}),o.jsx("span",{children:"Stop agent to switch providers."})]})]}),o.jsx(Oa,{label:"Working Directory",icon:Dr,description:"The root directory this agent operates in.",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 bg-surface-0 rounded-lg px-3 py-2.5 text-sm font-mono text-text-1 border border-border-subtle truncate min-w-0",children:t.workingDir||"Project root"}),o.jsxs(Se,{variant:"secondary",size:"md",onClick:()=>g(!0),className:"gap-1.5 flex-shrink-0",children:[o.jsx(Qb,{size:14})," Browse"]})]})}),o.jsx(Oa,{label:"Permission Mode",icon:Br,description:"Full Send = no approvals. Agent Approve = Fullstack Manager reviews risky operations.",children:o.jsx(DO,{options:[{value:"full",label:"Full Send"},{value:"auto",label:"Agent Approve"}],value:t.permission||"full",onChange:async L=>{try{await J.patch(`/agents/${t.id}`,{permission:L}),n("success",`Permission → ${L==="full"?"Full Send":"Agent Approve"}`)}catch(ce){n("error","Update failed",ce.message)}}})}),o.jsxs(Oa,{label:"Model Routing",icon:sc,description:"How Groove selects models for this agent's tasks.",children:[o.jsx(DO,{options:[{value:"fixed",label:"Fixed"},{value:"auto",label:"Auto"},{value:"auto-floor",label:"Auto + Floor"}],value:A,onChange:async L=>{U(L);try{await J.post(`/agents/${t.id}/routing`,{mode:L}),n("success",`Routing → ${L}`)}catch(ce){n("error","Update failed",ce.message)}}}),o.jsxs("div",{className:"text-2xs text-text-4 font-sans mt-1",children:[A==="fixed"&&"Uses the selected model for all tasks.",A==="auto"&&"Groove picks Opus/Sonnet/Haiku based on task complexity.",A==="auto-floor"&&"Auto-routes but never drops below Sonnet."]})]}),o.jsx(Oa,{label:"File Scope",icon:Br,description:"Restrict which files this agent can access. Empty = unrestricted.",children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[(t.scope||[]).map((L,ce)=>o.jsxs(De,{variant:"default",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[L,o.jsx("button",{onClick:()=>Ue(ce),className:"hover:text-danger cursor-pointer",children:o.jsx(Nt,{size:10})})]},ce)),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("input",{value:d,onChange:L=>f(L.target.value),onKeyDown:L=>L.key==="Enter"&&te(d),placeholder:"e.g. src/**",className:"w-28 h-7 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),o.jsx("button",{onClick:()=>te(d),disabled:!d.trim(),className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:o.jsx(Wn,{size:12})})]})]})}),o.jsx(Oa,{label:"Effort Level",icon:jb,description:"Controls how deep the agent reasons. Higher = more tokens but better results.",children:o.jsx(DO,{options:[{value:"min",label:"Min"},{value:"low",label:"Low"},{value:"default",label:"Default"},{value:"high",label:"High"},{value:"max",label:"Max"}],value:m,onChange:he})}),o.jsx(Oa,{label:"Agent Details",icon:Ug,children:o.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle divide-y divide-border-subtle",children:[o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"ID"}),o.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.id})]}),o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Role"}),o.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.role})]}),o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Provider"}),o.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.provider})]}),o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Model"}),o.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.model||"auto"})]}),o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Status"}),o.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.status})]}),o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Spawned"}),o.jsx("span",{className:"text-xs text-text-1 font-sans",children:ye?Wt(ye):"—"})]}),t.sessionId&&o.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Session"}),o.jsxs("span",{className:"text-xs text-text-1 font-mono",children:[t.sessionId.slice(0,16),"..."]})]})]})}),o.jsx(Oa,{label:"Skills",icon:Mb,description:"Attach installed skills to this agent's context.",children:o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.skills||[]).map(L=>o.jsxs(De,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[L,o.jsx("button",{onClick:async()=>{try{await J.delete(`/agents/${t.id}/skills/${L}`),n("success",`Detached ${L}`)}catch(ce){n("error","Detach failed",ce.message)}},className:"hover:text-danger cursor-pointer",children:o.jsx(Nt,{size:10})})]},L)),X.filter(L=>!(t.skills||[]).includes(L.id)).length>0&&o.jsxs("div",{className:"relative group",children:[o.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:o.jsx(Wn,{size:12})}),o.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[160px]",children:X.filter(L=>!(t.skills||[]).includes(L.id)).map(L=>o.jsx("button",{onClick:async()=>{try{await J.post(`/agents/${t.id}/skills/${L.id}`),n("success",`Attached ${L.name||L.id}`)}catch(ce){n("error","Attach failed",ce.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:L.name||L.id},L.id))})]}),(t.skills||[]).length===0&&X.length===0&&o.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No skills installed — browse the Marketplace"})]})}),o.jsx(Oa,{label:"Schedule",icon:Vg,description:"Run this agent on a recurring schedule.",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-text-2 font-sans",children:"Every"}),o.jsx("input",{value:V,onChange:L=>le(L.target.value.replace(/\D/g,"").slice(0,3)),className:"w-12 h-7 px-2 text-xs text-center bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent",placeholder:"1"}),o.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:[{value:"min",label:"Min"},{value:"hr",label:"Hr"},{value:"day",label:"Day"},{value:"wk",label:"Wk"},{value:"mo",label:"Mo"}].map(L=>o.jsx("button",{onClick:()=>B(L.value),className:se("px-2 py-1 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",T===L.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:L.label},L.value))}),o.jsxs(Se,{variant:"primary",size:"sm",disabled:Oe||!V||parseInt(V,10)<1,onClick:async()=>{const L=parseInt(V,10);if(!L||L<1)return;const ce={min:L===1?"* * * * *":`*/${L} * * * *`,hr:L===1?"0 * * * *":`0 */${L} * * *`,day:L===1?"0 0 * * *":`0 0 */${L} * *`,wk:`0 0 * * ${L===1?"1":"*"}`,mo:`0 0 ${L===1?"1":L} * *`};be(!0);try{await J.post("/schedules",{name:`${t.name} schedule`,cron:ce[T],agentConfig:{role:t.role,provider:t.provider,model:t.model,scope:t.scope,workingDir:t.workingDir,prompt:t.prompt}}),n("success",`Scheduled every ${L} ${T}`)}catch(Pe){n("error","Schedule failed",Pe.message)}be(!1)},className:"h-7 px-3 text-2xs gap-1",children:[o.jsx(Vg,{size:10}),Oe?"...":"Set"]})]})}),t.prompt&&o.jsx(Oa,{label:"Original Prompt",icon:sc,children:o.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3 py-3 text-xs text-text-2 font-sans leading-relaxed max-h-40 overflow-y-auto",children:t.prompt})}),o.jsx(XS,{open:x,onOpenChange:g,currentPath:t.workingDir||"/",onSelect:ee})]})}const d0=[];function PC({data:t,isAlive:n,height:s=48}){const l=y.useRef(null);return y.useEffect(()=>{const i=l.current;if(!i||!t.length)return;const u=i.getContext("2d"),d=window.devicePixelRatio||1,f=i.clientWidth,m=i.clientHeight;i.width=f*d,i.height=m*d,u.scale(d,d),u.clearRect(0,0,f,m);const p=t.map(w=>w.v),x=Math.min(...p),b=Math.max(...p,1)-x||1;u.beginPath(),u.moveTo(0,m),t.forEach((w,j)=>{const $=j/(t.length-1)*f,k=m-(w.v-x)/b*(m-4)-2;u.lineTo($,k)}),u.lineTo(f,m),u.closePath();const S=u.createLinearGradient(0,0,0,m);if(S.addColorStop(0,n?"rgba(51,175,188,0.15)":"rgba(110,118,129,0.08)"),S.addColorStop(1,"rgba(0,0,0,0)"),u.fillStyle=S,u.fill(),u.beginPath(),u.strokeStyle=n?Ie.accent:Ie.text3,u.lineWidth=1.5,t.forEach((w,j)=>{const $=j/(t.length-1)*f,k=m-(w.v-x)/b*(m-4)-2;j===0?u.moveTo($,k):u.lineTo($,k)}),u.stroke(),t.length>1&&n){const w=t[t.length-1],j=f-1,$=m-(w.v-x)/b*(m-4)-2;u.beginPath(),u.arc(j,$,5,0,Math.PI*2),u.fillStyle="rgba(51,175,188,0.3)",u.fill(),u.beginPath(),u.arc(j,$,2.5,0,Math.PI*2),u.fillStyle=Ie.accent,u.fill()}},[t,n]),o.jsx("div",{className:"w-full rounded-lg bg-surface-0 overflow-hidden border border-border-subtle",style:{height:s},children:o.jsx("canvas",{ref:l,className:"w-full h-full"})})}function Vo({icon:t,label:n,value:s,color:l,sub:i}){return o.jsxs("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 border border-border-subtle",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(t,{size:12,className:l||"text-text-3"}),o.jsx("span",{className:"text-2xs text-text-4 font-sans uppercase tracking-wider",children:n})]}),o.jsx("div",{className:se("text-lg font-bold font-mono tabular-nums",l||"text-text-0"),children:s}),i&&o.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:i})]})}function NC({score:t}){const n=Math.min(Math.max(t,0),100);let s=Ie.success,l="Healthy";return n<40?(s=Ie.danger,l="Degraded"):n<70&&(s=Ie.warning,l="Fair"),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[o.jsxs("span",{className:"text-2xs text-text-3 font-sans flex items-center gap-1.5",children:[o.jsx(o5,{size:11}),"Session Health"]}),o.jsxs("span",{className:"text-xs font-bold font-mono",style:{color:s},children:[n,"/100"]})]}),o.jsx("div",{className:"h-2 bg-surface-0 rounded-full overflow-hidden border border-border-subtle",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${n}%`,background:s}})}),o.jsx("span",{className:"text-2xs font-sans mt-1 block",style:{color:s},children:l})]})}function zC(t){const n=(t||"").toLowerCase();return n.includes("edit")||n.includes("writ")?{icon:Sb,color:"text-warning"}:n.includes("read")||n.includes("view")?{icon:li,color:"text-info"}:n.includes("search")||n.includes("grep")||n.includes("glob")?{icon:Cl,color:"text-purple"}:n.includes("bash")||n.includes("command")||n.includes("terminal")?{icon:oi,color:"text-orange"}:n.includes("error")||n.includes("fail")?{icon:Ss,color:"text-danger"}:n.includes("spawn")||n.includes("start")?{icon:In,color:"text-success"}:n.includes("complet")||n.includes("done")?{icon:af,color:"text-success"}:{icon:rc,color:"text-text-4"}}function RC({agent:t}){const n=D(d=>d.tokenTimeline[t.id])||d0,s=D(d=>d.activityLog[t.id])||d0,l=t.status==="running"||t.status==="starting",i=y.useMemo(()=>{if(n.length<2)return 0;const d=n.slice(-10),f=(d[d.length-1].t-d[0].t)/6e4,m=d[d.length-1].v-d[0].v;return f>0?Math.round(m/f):0},[n]),u=y.useMemo(()=>{const d=t.contextUsage||0;let f=100;return d>90?f-=50:d>70?f-=25:d>50&&(f-=10),i>5e3?f-=15:i>3e3&&(f-=8),t.status==="crashed"&&(f=10),t.status==="completed"&&(f=95),Math.max(0,Math.min(100,f))},[t.contextUsage,t.status,i]);return o.jsxs("div",{className:"px-5 py-5 space-y-5 overflow-y-auto h-full",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Token Burn"}),l&&o.jsx("span",{className:"text-2xs text-accent font-mono animate-pulse",children:"LIVE"})]}),o.jsx(PC,{data:n,isAlive:l,height:56})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(Vo,{icon:HT,label:"Burn Rate",value:i>0?`${Dt(i)}/m`:"—",color:i>5e3?"text-danger":i>2e3?"text-warning":"text-text-0"}),o.jsx(Vo,{icon:ET,label:"Cost",value:Lf(t.costUsd||0),color:"text-text-0"}),o.jsx(Vo,{icon:ii,label:"Rotations",value:t.rotations||"0",color:"text-text-0"}),o.jsx(Vo,{icon:In,label:"Turns",value:t.turns||"0",color:"text-text-0"})]}),o.jsx(NC,{score:u}),t.prompt&&o.jsxs("div",{children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-1.5",children:"Task"}),o.jsx("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 text-xs text-text-2 font-sans leading-relaxed max-h-28 overflow-y-auto border border-border-subtle",children:t.prompt})]}),s.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-2",children:"Activity"}),o.jsxs("div",{className:"space-y-0 relative",children:[o.jsx("div",{className:"absolute left-[9px] top-2 bottom-2 w-px bg-border-subtle"}),s.slice(-12).reverse().map((d,f)=>{const m=zC(d.text),p=m.icon;return o.jsxs("div",{className:"flex items-start gap-3 py-1.5 relative",children:[o.jsx("div",{className:se("w-[18px] h-[18px] rounded-full flex items-center justify-center flex-shrink-0 z-10","bg-surface-1 border border-border-subtle"),children:o.jsx(p,{size:9,className:m.color})}),o.jsx("span",{className:"text-2xs text-text-2 font-sans flex-1 line-clamp-1 pt-0.5",children:d.text}),o.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0 pt-0.5",children:Wt(d.timestamp)})]},f)})]})]})]})}const XC={running:"success",starting:"warning",stopped:"default",crashed:"danger",completed:"accent",killed:"default",rotating:"purple"},_C={running:"Running",starting:"Starting",stopped:"Stopped",crashed:"Crashed",completed:"Done",killed:"Killed",rotating:"Rotating"},CC=[{id:"command",label:"Chat",icon:ri},{id:"config",label:"Config",icon:Ab},{id:"telemetry",label:"Monitor",icon:sc}];function ZC({agent:t}){const n=D(m=>m.addToast),[s,l]=y.useState(!1),[i,u]=y.useState(t.name),d=y.useRef(null);async function f(){const m=i.trim();if(!m||m===t.name){l(!1);return}try{await J.patch(`/agents/${t.id}`,{name:m.replace(/\s+/g,"-")}),n("success",`Renamed → ${m}`)}catch(p){n("error","Rename failed",p.message),u(t.name)}l(!1)}return s?o.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[o.jsx("input",{ref:d,value:i,onChange:m=>u(m.target.value),onKeyDown:m=>{m.key==="Enter"&&f(),m.key==="Escape"&&(u(t.name),l(!1))},className:"flex-1 min-w-0 h-6 px-1.5 text-sm font-bold bg-surface-0 border border-accent/30 rounded text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent/40",autoFocus:!0}),o.jsx("button",{onClick:f,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:o.jsx(la,{size:12})}),o.jsx("button",{onClick:()=>{u(t.name),l(!1)},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:o.jsx(Nt,{size:12})})]}):o.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 group",children:[o.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans truncate",children:t.name}),o.jsx("button",{onClick:()=>{u(t.name),l(!0)},className:"p-0.5 text-text-4 opacity-0 group-hover:opacity-100 hover:text-text-1 cursor-pointer transition-opacity",children:o.jsx(zc,{size:10})})]})}function AC(){const t=D(p=>p.detailPanel),n=D(p=>p.agents),[s,l]=y.useState("command");if((t==null?void 0:t.type)!=="agent")return null;const i=n.find(p=>p.id===t.agentId);if(!i)return null;const u=i.status==="running"||i.status==="starting",d=Math.round((i.contextUsage||0)*100),f=i.spawnedAt||i.createdAt,m=f?Math.floor((Date.now()-new Date(f).getTime())/1e3):0;return Gf(i.role),o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex-shrink-0",children:[o.jsxs("div",{className:"pl-4 pr-10 pt-3 pb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ZC,{agent:i}),o.jsx(De,{variant:XC[i.status]||"default",dot:u?"pulse":void 0,className:"text-2xs flex-shrink-0",children:_C[i.status]||i.status})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-1 text-2xs text-text-3 font-mono",children:[o.jsx("span",{className:"capitalize",children:i.role}),o.jsx("span",{className:"text-text-4",children:"·"}),o.jsxs("span",{children:[i.provider,":",i.model||"auto"]}),o.jsx("span",{className:"text-text-4",children:"·"}),o.jsxs("span",{children:[Dt(i.tokensUsed||0)," tok"]}),d>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-text-4",children:"·"}),o.jsxs("span",{className:se(d>80?"text-danger":d>60?"text-warning":"text-text-3"),children:[d,"% ctx"]})]}),o.jsx("span",{className:"text-text-4",children:"·"}),o.jsx("span",{children:Cc(m)})]})]}),o.jsx("div",{className:"flex items-center px-4 border-b border-border-subtle",children:CC.map(p=>{const x=p.icon,g=s===p.id;return o.jsxs("button",{onClick:()=>l(p.id),className:se("flex items-center gap-1.5 px-3 py-2 text-2xs font-semibold font-sans transition-all cursor-pointer select-none border-b-2 -mb-px",g?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"),children:[o.jsx(x,{size:11}),p.label]},p.id)})})]}),o.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[s==="command"&&o.jsx($C,{agent:i}),s==="config"&&o.jsx(TC,{agent:i}),s==="telemetry"&&o.jsx(RC,{agent:i})]})]})}const vf=y.forwardRef(({className:t,label:n,error:s,mono:l,...i},u)=>o.jsxs("div",{className:"flex flex-col gap-1",children:[n&&o.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:n}),o.jsx("input",{ref:u,className:se("h-8 w-full rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...i}),s&&o.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));vf.displayName="Input";const ES=y.forwardRef(({className:t,label:n,error:s,mono:l,...i},u)=>o.jsxs("div",{className:"flex flex-col gap-1",children:[n&&o.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:n}),o.jsx("textarea",{ref:u,className:se("w-full rounded-md px-3 py-2 text-sm resize-none","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...i}),s&&o.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));ES.displayName="Textarea";const EC=[{id:"planner",label:"Planner",desc:"Plans the team and tasks",icon:Cb,tier:"Heavy"},{id:"backend",label:"Backend",desc:"APIs, services, databases",icon:Zb,tier:"Medium"},{id:"frontend",label:"Frontend",desc:"UI, components, styling",icon:Yf,tier:"Medium"},{id:"fullstack",label:"Fullstack",desc:"End-to-end implementation",icon:Ta,tier:"Heavy"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA",icon:Uf,tier:"Medium"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment",icon:zT,tier:"Medium"},{id:"docs",label:"Docs",desc:"Documentation, guides",icon:sf,tier:"Light"},{id:"security",label:"Security",desc:"Audits, vulnerabilities",icon:Br,tier:"Medium"},{id:"database",label:"Database",desc:"Schema, migrations, queries",icon:ZT,tier:"Medium"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth",icon:S5,tier:"Medium"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting",icon:mT,tier:"Medium"},{id:"ea",label:"EA",desc:"Executive assistant, scheduling",icon:lP,tier:"Light"},{id:"support",label:"Support",desc:"Customer support, FAQs",icon:r5,tier:"Medium"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights",icon:Nc,tier:"Medium"}];function qC(){const t=D(V=>V.detailPanel),n=D(V=>V.closeDetail),s=D(V=>V.spawnAgent),l=D(V=>V.fetchProviders),i=(t==null?void 0:t.type)==="spawn",[u,d]=y.useState(""),[f,m]=y.useState(""),[p,x]=y.useState(""),[g,b]=y.useState(""),[S,w]=y.useState(""),[j,$]=y.useState(""),[k,N]=y.useState([]),[R,A]=y.useState(!1);y.useEffect(()=>{i&&(l().then(V=>{N(Array.isArray(V)?V:V.providers||[])}).catch(()=>{}),d(""),m(""),x(""),b(""),w(""),$(""))},[i,l]);const U=u||f,X=k.find(V=>V.id===g),z=(X==null?void 0:X.models)||[],T=k.filter(V=>V.installed);async function B(){if(U){A(!0);try{const V={role:U,...p&&{name:p.replace(/\s+/g,"-")},...g&&{provider:g},...S&&{model:S},...j&&{prompt:j}};await s(V),n()}catch{}A(!1)}}return o.jsx(_S,{open:i,onOpenChange:V=>{V||n()},children:o.jsx(CS,{title:"Spawn Agent",width:480,children:o.jsxs("div",{className:"flex flex-col h-[calc(100%-57px)]",children:[o.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-3",children:"Choose Role"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:EC.map(V=>{const le=Gf(V.id),Oe=u===V.id;return o.jsxs("button",{onClick:()=>{d(V.id),m("")},className:se("flex items-center gap-2.5 p-3 rounded-md border text-left transition-all cursor-pointer",Oe?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-2"),children:[o.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{background:le.bg},children:o.jsx(V.icon,{size:16,style:{color:le.text}})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans",children:V.label}),o.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:V.desc})]})]},V.id)})}),o.jsx("div",{className:"mt-3",children:o.jsx(vf,{placeholder:"or type a custom role...",value:f,onChange:V=>{m(V.target.value),d("")},className:"text-xs"})})]}),U&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block",children:"Configuration"}),o.jsx(vf,{label:"Name (optional)",value:p,onChange:V=>x(V.target.value),placeholder:`${U}-1`}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Provider"}),o.jsxs("div",{className:"relative",children:[o.jsxs("select",{value:g,onChange:V=>{b(V.target.value),w("")},className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[o.jsx("option",{value:"",children:"Auto"}),T.map(V=>o.jsx("option",{value:V.id,children:V.name},V.id))]}),o.jsx(Dn,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Model"}),o.jsxs("div",{className:"relative",children:[o.jsxs("select",{value:S,onChange:V=>w(V.target.value),disabled:!g,className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-40",children:[o.jsx("option",{value:"",children:"Auto"}),z.map(V=>o.jsx("option",{value:V.id,children:V.name},V.id))]}),o.jsx(Dn,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})]}),g&&X&&o.jsx("div",{className:"text-2xs text-text-3 font-sans flex items-center gap-2",children:X.hasKey?o.jsx(De,{variant:"success",children:"API key set"}):X.authType==="subscription"?o.jsx(De,{variant:"accent",children:"Subscription"}):o.jsxs(De,{variant:"warning",children:["No API key — set with: groove set-key ",g," YOUR_KEY"]})}),o.jsx(ES,{label:"Prompt (optional)",value:j,onChange:V=>$(V.target.value),placeholder:"What should this agent work on?",rows:3})]})]}),o.jsxs("div",{className:"border-t border-border-subtle px-5 py-4 bg-surface-1",children:[U&&o.jsxs("div",{className:"flex items-center gap-2 mb-3 text-xs text-text-3 font-sans",children:[o.jsx("span",{children:"Spawning"}),o.jsx(De,{variant:"accent",children:U}),g&&o.jsxs("span",{children:["on ",(X==null?void 0:X.name)||g]}),p&&o.jsxs("span",{children:["as ",p.replace(/\s+/g,"-")]})]}),o.jsx(Se,{variant:"primary",size:"lg",onClick:B,disabled:!U||R,className:"w-full",children:R?"Spawning...":"Spawn Agent"})]})]})})})}function O0({title:t,icon:n,defaultOpen:s=!1,badge:l,children:i,className:u}){const[d,f]=y.useState(s);return o.jsxs("div",{className:se("border-t border-border-subtle",u),children:[o.jsxs("button",{onClick:()=>f(!d),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors group",children:[o.jsx(si,{size:12,className:se("text-text-4 transition-transform duration-200 flex-shrink-0",d&&"rotate-90")}),n&&o.jsx(n,{size:13,className:"text-text-3 flex-shrink-0"}),o.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:t}),l&&o.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:l})]}),d&&o.jsx("div",{className:"px-5 pb-4",children:i})]})}function MC(){const t=D(g=>g.journalistStatus),n=D(g=>g.fetchJournalist),s=D(g=>g.triggerJournalistCycle),[l,i]=y.useState(!0),[u,d]=y.useState(!1);y.useEffect(()=>{n().then(()=>i(!1));const g=setInterval(n,1e4);return()=>clearInterval(g)},[n]);async function f(){d(!0);try{await s()}catch{}d(!1)}if(l)return o.jsxs("div",{className:"p-5 space-y-4",children:[o.jsx(ra,{className:"h-6 w-32 rounded"}),o.jsx(ra,{className:"h-20 rounded-md"}),o.jsx(ra,{className:"h-20 rounded-md"})]});const m=t||{},p=m.lastSynthesis,x=m.history||[];return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center gap-2",children:[o.jsx(Wr,{size:16,className:"text-accent"}),o.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Journalist"}),o.jsxs(Se,{variant:"secondary",size:"sm",onClick:f,disabled:u,className:"gap-1.5 text-2xs",children:[o.jsx(_l,{size:11,className:u?"animate-spin":""}),u?"Running...":"Run Synthesis"]})]}),o.jsx(Na,{className:"flex-1",children:o.jsxs("div",{className:"px-5 py-4 space-y-5",children:[o.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(sc,{size:10}),o.jsxs("span",{children:[m.cycleCount||0," cycles"]})]}),m.lastCycleTime&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(rc,{size:10}),o.jsxs("span",{children:["Last: ",Wt(m.lastCycleTime)]})]}),o.jsx(De,{variant:m.cycleCount>0?"success":"default",className:"text-2xs",children:m.cycleCount>0?"Active":"Idle"})]}),(p==null?void 0:p.summary)&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[o.jsx(sf,{size:12,className:"text-text-3"}),"Latest Summary"]}),o.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-sans leading-relaxed",children:p.summary})]}),(p==null?void 0:p.projectMap)&&o.jsx(O0,{title:"Project Map",icon:g5,children:o.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.projectMap})}),(p==null?void 0:p.decisions)&&o.jsx(O0,{title:"Decisions Log",icon:sf,children:o.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.decisions})}),x.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[o.jsx(rc,{size:12,className:"text-text-3"}),"History (",x.length,")"]}),o.jsx("div",{className:"space-y-1.5",children:x.slice().reverse().slice(0,20).map((g,b)=>o.jsxs("div",{className:"bg-surface-0 rounded-md border border-border-subtle px-3 py-2",children:[o.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[o.jsxs(De,{variant:"default",className:"text-2xs",children:["Cycle ",g.cycle]}),o.jsxs("span",{className:"text-text-4 font-sans",children:[g.agentCount," agent",g.agentCount!==1?"s":""]}),o.jsx("span",{className:"text-text-4 font-sans ml-auto",children:Wt(g.timestamp)})]}),g.summary&&o.jsx("p",{className:"text-xs text-text-2 font-sans mt-1 leading-relaxed",children:g.summary})]},b))})]}),!p&&x.length===0&&o.jsxs("div",{className:"text-center py-8 text-text-4 font-sans",children:[o.jsx(Wr,{size:28,className:"mx-auto mb-2"}),o.jsx("p",{className:"text-sm",children:"No synthesis data yet"}),o.jsx("p",{className:"text-2xs mt-1",children:"The journalist runs automatically when agents are active, or trigger manually above"})]})]})})]})}function YC({children:t,height:n,onHeightChange:s,visible:l,fullHeight:i,tabs:u,activeTab:d,onSelectTab:f,onAddTab:m,onCloseTab:p,onToggleFullHeight:x,onMinimize:g}){const b=y.useRef(!1),S=y.useRef(0),w=y.useRef(0),j=y.useCallback(k=>{if(i)return;k.preventDefault(),b.current=!0,S.current=k.clientY,w.current=n;function N(A){if(!b.current)return;const U=S.current-A.clientY,X=Math.min(Math.max(w.current+U,120),600);s(X)}function R(){b.current=!1,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R)}document.addEventListener("mousemove",N),document.addEventListener("mouseup",R)},[n,s,i]);if(!l)return null;const $=u||[{id:"default",label:"Terminal"}];return o.jsxs("div",{className:"flex flex-col border-t border-border bg-surface-0 relative",style:i?{flex:1,minHeight:0}:{height:n,flexShrink:0},children:[!i&&o.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-row-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:j}),o.jsxs("div",{className:"flex items-center h-9 bg-surface-1 border-b border-border-subtle flex-shrink-0 pl-3 pr-1.5",children:[o.jsxs("div",{className:"flex items-center gap-0 flex-1 min-w-0 overflow-x-auto scrollbar-none",children:[$.map(k=>o.jsxs("button",{onClick:()=>f==null?void 0:f(k.id),className:se("flex items-center gap-1.5 pl-2.5 pr-1 h-7 text-2xs font-sans cursor-pointer select-none transition-colors flex-shrink-0 rounded-t",k.id===d?"text-text-0 bg-surface-0":"text-text-3 hover:text-text-1 hover:bg-surface-0/50"),children:[o.jsx(oi,{size:10}),o.jsx("span",{className:"truncate max-w-[80px]",children:k.label}),$.length>1&&o.jsx("button",{onClick:N=>{N.stopPropagation(),p==null||p(k.id)},className:"ml-0.5 p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",children:o.jsx(Nt,{size:9})})]},k.id)),o.jsx("button",{onClick:m,className:"flex items-center justify-center w-6 h-6 text-text-4 hover:text-text-1 hover:bg-surface-0/50 rounded cursor-pointer transition-colors flex-shrink-0 ml-0.5",title:"New terminal",children:o.jsx(Wn,{size:11})})]}),o.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0 ml-2",children:i?o.jsx("button",{onClick:g,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Restore",children:o.jsx($5,{size:12})}):o.jsx("button",{onClick:x,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Maximize",children:o.jsx(v5,{size:12})})})]}),o.jsx("div",{className:"flex-1 min-h-0 p-2",children:t})]})}const VC={background:"#1a1e25",foreground:"#bcc2cd",cursor:"#33afbc",cursorAccent:"#1a1e25",selectionBackground:"rgba(51, 175, 188, 0.25)",black:"#1a1e25",red:"#e06c75",green:"#4ae168",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#33afbc",white:"#bcc2cd",brightBlack:"#505862",brightRed:"#e06c75",brightGreen:"#4ae168",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#33afbc",brightWhite:"#e6e6e6"};let WO=0;function UC({tabId:t,visible:n}){const s=y.useRef(null),l=y.useRef(null),i=y.useRef(null),u=y.useRef(null),d=y.useRef(!1);return y.useEffect(()=>{if(!s.current||d.current)return;d.current=!0;const f=new Mj({theme:VC,fontFamily:"'JetBrains Mono Variable', 'SF Mono', monospace",fontSize:13,lineHeight:1.4,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,allowProposedApi:!0}),m=new Yj;f.loadAddon(m),f.loadAddon(new Vj),f.open(s.current),l.current=f,requestAnimationFrame(()=>m.fit());function p(){const g=D.getState().ws;if(!g||g.readyState!==WebSocket.OPEN){setTimeout(p,500);return}g.send(JSON.stringify({type:"terminal:spawn",cols:f.cols,rows:f.rows}));function b(S){let w;try{w=JSON.parse(S.data)}catch{return}w.type==="terminal:spawned"&&!i.current?i.current=w.id:w.type==="terminal:output"&&w.id===i.current?f.write(w.data):w.type==="terminal:exit"&&w.id===i.current&&(f.write(`\r
573
573
  \x1B[90m[session ended]\x1B[0m\r
574
574
  `),i.current=null)}g.addEventListener("message",b),u.current={ws:g,handler:b},f.onData(S=>{const w=D.getState().ws;(w==null?void 0:w.readyState)===WebSocket.OPEN&&i.current&&w.send(JSON.stringify({type:"terminal:input",id:i.current,data:S}))}),f.onResize(({cols:S,rows:w})=>{const j=D.getState().ws;(j==null?void 0:j.readyState)===WebSocket.OPEN&&i.current&&j.send(JSON.stringify({type:"terminal:resize",id:i.current,rows:w,cols:S}))})}p();const x=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{m.fit()}catch{}})});return x.observe(s.current),()=>{x.disconnect();const g=D.getState().ws;(g==null?void 0:g.readyState)===WebSocket.OPEN&&i.current&&g.send(JSON.stringify({type:"terminal:kill",id:i.current})),u.current&&u.current.ws.removeEventListener("message",u.current.handler),f.dispose(),d.current=!1}},[]),y.useEffect(()=>{n&&l.current&&requestAnimationFrame(()=>{var f,m,p,x,g;try{(g=(x=(p=(m=(f=l.current._addonManager)==null?void 0:f._addons)==null?void 0:m[0])==null?void 0:p.instance)==null?void 0:x.fit)==null||g.call(x)}catch{}})},[n]),o.jsx("div",{ref:s,className:"w-full h-full",style:{display:n?"block":"none"}})}function GC(){const t=D(b=>b.terminalVisible),n=D(b=>b.terminalHeight),s=D(b=>b.setTerminalVisible),l=D(b=>b.setTerminalHeight),i=D(b=>b.terminalFullHeight),u=D(b=>b.setTerminalFullHeight),[d,f]=y.useState([{id:"term-0",label:"Terminal"}]),[m,p]=y.useState("term-0"),x=y.useCallback(()=>{WO++;const b=`term-${WO}`;f(S=>[...S,{id:b,label:`Terminal ${WO+1}`}]),p(b)},[]),g=y.useCallback(b=>{f(S=>{const w=S.filter(j=>j.id!==b);if(w.length===0)return s(!1),S;if(m===b){const j=S.findIndex(k=>k.id===b),$=w[Math.min(j,w.length-1)];p($.id)}return w})},[m,s]);return o.jsx(YC,{visible:t,height:n,onHeightChange:l,fullHeight:i,tabs:d,activeTab:m,onSelectTab:p,onAddTab:x,onCloseTab:g,onToggleFullHeight:()=>u(!0),onMinimize:()=>u(!1),children:d.map(b=>o.jsx(UC,{tabId:b.id,visible:b.id===m},b.id))})}class LC extends qn.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}render(){return this.state.error?o.jsxs("div",{className:"h-screen bg-surface-0 p-10 font-sans",children:[o.jsx("h2",{className:"text-lg font-semibold text-text-0 mb-4",children:"Groove — Render Error"}),o.jsx("pre",{className:"text-sm text-danger whitespace-pre-wrap mb-4",children:this.state.error.message}),o.jsx("pre",{className:"text-xs text-text-3 whitespace-pre-wrap",children:this.state.error.stack}),o.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-6 px-4 py-2 bg-accent text-surface-0 rounded-md font-medium text-sm cursor-pointer",children:"Try Again"})]}):this.props.children}}function DC(){const t=D(i=>i.activeView),n=D(i=>i.detailPanel);let s;switch(t){case"agents":s=o.jsx(Bg,{});break;case"editor":s=o.jsx(HR,{});break;case"dashboard":s=o.jsx(lX,{});break;case"marketplace":s=o.jsx(QX,{});break;case"teams":s=o.jsx(HX,{});break;case"settings":s=o.jsx(xC,{});break;default:s=o.jsx(Bg,{})}let l=null;if(n)switch(n.type){case"agent":l=o.jsx(AC,{});break;case"journalist":l=o.jsx(MC,{});break;case"spawn":l=null;break}return o.jsxs(zP,{detailContent:l,terminalContent:o.jsx(GC,{}),children:[s,o.jsx(qC,{})]})}function WC(){return o.jsxs("div",{className:"h-screen bg-surface-0 flex flex-col items-center justify-center gap-4",children:[o.jsx("img",{src:"/favicon.png",alt:"",className:"w-10 h-10 opacity-60 animate-pulse"}),o.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Connecting..."})]})}function BC(){const t=D(s=>s.connect),n=D(s=>s.hydrated);return y.useEffect(()=>{t()},[t]),n?o.jsx(LC,{children:o.jsx(DC,{})}):o.jsx(WC,{})}Wj.createRoot(document.getElementById("root")).render(o.jsx(y.StrictMode,{children:o.jsx(BC,{})}));