@deepseekcode/cli 1.0.0 → 1.0.1

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 (37) hide show
  1. package/dist/cli.js +941 -757
  2. package/package.json +1 -1
  3. package/web/dist/assets/AgentFlowView-Co1aujcZ.js +1 -0
  4. package/web/dist/assets/{AgentsView-DvSlePx6.js → AgentsView-CHvg1cY0.js} +1 -1
  5. package/web/dist/assets/{AskQuestionModal-bOMD8fv0.js → AskQuestionModal-nAvPzz0y.js} +1 -1
  6. package/web/dist/assets/ChannelConfigView-DPg31Ui7.js +8 -0
  7. package/web/dist/assets/{FileTreeView-DtYvBKee.js → FileTreeView-DA87bArS.js} +3 -3
  8. package/web/dist/assets/HookApprovalModal-qN4gBTAu.js +1 -0
  9. package/web/dist/assets/HookConfigView-CBzuNojA.js +3 -0
  10. package/web/dist/assets/ModelsView-D4X70i7U.js +1 -0
  11. package/web/dist/assets/SessionGrid-CG6wC-sh.js +20 -0
  12. package/web/dist/assets/{SettingsPanel-N5qcaI8b.js → SettingsPanel-UUAdnvtB.js} +3 -3
  13. package/web/dist/assets/SkillsView-C1s0EA-r.js +1 -0
  14. package/web/dist/assets/{TerminalView-BFjl4bGT.js → TerminalView-DJitpAf8.js} +2 -2
  15. package/web/dist/assets/Toast-DJAVHqFo.js +1 -0
  16. package/web/dist/assets/ToolsView-DvbfsrpK.js +1 -0
  17. package/web/dist/assets/{hookRisk-DECuVQpA.js → hookRisk-CbXD9F3U.js} +1 -1
  18. package/web/dist/assets/{icons-B_rAQLge.js → icons-CjYP2PII.js} +146 -86
  19. package/web/dist/assets/index-B-DFEdP3.js +21 -0
  20. package/web/dist/assets/index-D2PsJB4J.css +1 -0
  21. package/web/dist/assets/{markdown-BAhUvdx-.js → markdown-CIsUyqRd.js} +1 -1
  22. package/web/dist/assets/panels-DP49kN7A.js +1 -0
  23. package/web/dist/assets/{react-vendor-meeTdQCf.js → react-vendor-DuqM3ddv.js} +1 -1
  24. package/web/dist/assets/{state-Cke1lss7.js → state-BCeK45RP.js} +1 -1
  25. package/web/dist/index.html +6 -6
  26. package/web/dist/assets/AgentFlowView-Cq5rwwHO.js +0 -1
  27. package/web/dist/assets/ChannelConfigView-ByhL7_5W.js +0 -8
  28. package/web/dist/assets/HookApprovalModal-BOSEvhFh.js +0 -1
  29. package/web/dist/assets/HookConfigView-DIytJ_Pb.js +0 -3
  30. package/web/dist/assets/ModelsView-DOUNg5rX.js +0 -1
  31. package/web/dist/assets/SessionGrid-DS1RanMd.js +0 -17
  32. package/web/dist/assets/SkillsView-H0sCdR5e.js +0 -1
  33. package/web/dist/assets/Toast-DowV4l0w.js +0 -1
  34. package/web/dist/assets/ToolsView-DSl95dvA.js +0 -1
  35. package/web/dist/assets/index-BhVUD1px.css +0 -1
  36. package/web/dist/assets/index-BtIzCXfW.js +0 -20
  37. package/web/dist/assets/panels-p9MZH4aX.js +0 -1
@@ -0,0 +1 @@
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:SF Mono,Monaco,Menlo,Consolas,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.bottom-6{bottom:1.5rem}.bottom-full{bottom:100%}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-2{left:.5rem}.left-3{left:.75rem}.left-7{left:1.75rem}.left-\[18px\]{left:18px}.left-\[2px\]{left:2px}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[110\]{z-index:110}.col-span-2{grid-column:span 2 / span 2}.col-span-full{grid-column:1 / -1}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-ml-2{margin-left:-.5rem}.-ml-3{margin-left:-.75rem}.-ml-4{margin-left:-1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[260px\]{height:260px}.h-\[520px\]{height:520px}.h-full{height:100%}.h-screen{height:100vh}.max-h-24{max-height:6rem}.max-h-36{max-height:9rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-96{max-height:24rem}.max-h-\[200px\]{max-height:200px}.max-h-\[260px\]{max-height:260px}.max-h-\[280px\]{max-height:280px}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[40vh\]{max-height:40vh}.max-h-\[480px\]{max-height:480px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[60vh\]{max-height:60vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-0{min-height:0px}.min-h-\[180px\]{min-height:180px}.min-h-\[200px\]{min-height:200px}.min-h-\[240px\]{min-height:240px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-\[44px\]{min-height:44px}.min-h-\[520px\]{min-height:520px}.min-h-\[55vh\]{min-height:55vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[260px\]{width:260px}.w-\[380px\]{width:380px}.w-\[440px\]{width:440px}.w-\[560px\]{width:560px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[18px\]{min-width:18px}.min-w-\[20px\]{min-width:20px}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[10rem\]{max-width:10rem}.max-w-\[120px\]{max-width:120px}.max-w-\[140px\]{max-width:140px}.max-w-\[14rem\]{max-width:14rem}.max-w-\[160px\]{max-width:160px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.max-w-\[320px\]{max-width:320px}.max-w-\[60\%\]{max-width:60%}.max-w-\[90\%\]{max-width:90%}.max-w-\[90vw\]{max-width:90vw}.max-w-\[92\%\]{max-width:92%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes blink{0%,to{opacity:1}50%{opacity:.2}}.animate-blink{animation:blink 1.2s ease-in-out infinite}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in-up{animation:fadeInUp .4s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slideIn{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}@keyframes spin{to{transform:rotate(360deg)}}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-wait{cursor:wait}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[320px_minmax\(0\,1fr\)\]{grid-template-columns:320px minmax(0,1fr)}.grid-rows-\[0fr\]{grid-template-rows:0fr}.grid-rows-\[1fr\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\[2px\]{gap:2px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-dark-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-divide-opacity, 1))}.divide-dark-border\/20>:not([hidden])~:not([hidden]){border-color:rgb(var(--color-border) / .2)}.divide-dark-border\/70>:not([hidden])~:not([hidden]){border-color:rgb(var(--color-border) / .7)}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:var(--radius-md)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-t{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#3c3c3c\]{--tw-border-opacity: 1;border-color:rgb(60 60 60 / var(--tw-border-opacity, 1))}.border-accent-blue{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-blue) / var(--tw-border-opacity, 1))}.border-accent-blue\/30{border-color:rgb(var(--color-accent-blue) / .3)}.border-accent-blue\/40{border-color:rgb(var(--color-accent-blue) / .4)}.border-accent-blue\/50{border-color:rgb(var(--color-accent-blue) / .5)}.border-accent-blue\/60{border-color:rgb(var(--color-accent-blue) / .6)}.border-accent-cyan\/30{border-color:#39c5cf4d}.border-accent-green{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-green) / var(--tw-border-opacity, 1))}.border-accent-green\/30{border-color:rgb(var(--color-accent-green) / .3)}.border-accent-green\/40{border-color:rgb(var(--color-accent-green) / .4)}.border-accent-green\/50{border-color:rgb(var(--color-accent-green) / .5)}.border-accent-purple\/30{border-color:rgb(var(--color-accent-purple) / .3)}.border-accent-red{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-red) / var(--tw-border-opacity, 1))}.border-accent-red\/30{border-color:rgb(var(--color-accent-red) / .3)}.border-accent-red\/40{border-color:rgb(var(--color-accent-red) / .4)}.border-accent-red\/60{border-color:rgb(var(--color-accent-red) / .6)}.border-accent-yellow\/20{border-color:rgb(var(--color-accent-yellow) / .2)}.border-accent-yellow\/30{border-color:rgb(var(--color-accent-yellow) / .3)}.border-accent-yellow\/40{border-color:rgb(var(--color-accent-yellow) / .4)}.border-accent-yellow\/50{border-color:rgb(var(--color-accent-yellow) / .5)}.border-accent-yellow\/60{border-color:rgb(var(--color-accent-yellow) / .6)}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-400\/30{border-color:#60a5fa4d}.border-blue-500\/25{border-color:#3b82f640}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-cyan-500\/30{border-color:#06b6d44d}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1))}.border-dark-border\/30{border-color:rgb(var(--color-border) / .3)}.border-dark-border\/40{border-color:rgb(var(--color-border) / .4)}.border-dark-border\/50{border-color:rgb(var(--color-border) / .5)}.border-dark-border\/60{border-color:rgb(var(--color-border) / .6)}.border-dark-border\/70{border-color:rgb(var(--color-border) / .7)}.border-emerald-500\/30{border-color:#10b9814d}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-green-400\/30{border-color:#4ade804d}.border-green-500\/30{border-color:#22c55e4d}.border-green-600\/40{border-color:#16a34a66}.border-indigo-500\/30{border-color:#6366f14d}.border-lime-500\/30{border-color:#84cc164d}.border-orange-500\/30{border-color:#f973164d}.border-purple-500\/30{border-color:#a855f74d}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/40{border-color:#ef444466}.border-transparent{border-color:transparent}.border-yellow-500\/25{border-color:#eab30840}.border-l-accent-blue{--tw-border-opacity: 1;border-left-color:rgb(var(--color-accent-blue) / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-transparent{border-right-color:transparent}.border-t-accent-blue{--tw-border-opacity: 1;border-top-color:rgb(var(--color-accent-blue) / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-\[\#1e1e1e\]{--tw-bg-opacity: 1;background-color:rgb(30 30 30 / var(--tw-bg-opacity, 1))}.bg-\[\#252526\]{--tw-bg-opacity: 1;background-color:rgb(37 37 38 / var(--tw-bg-opacity, 1))}.bg-accent-blue{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-blue) / var(--tw-bg-opacity, 1))}.bg-accent-blue\/10{background-color:rgb(var(--color-accent-blue) / .1)}.bg-accent-blue\/15{background-color:rgb(var(--color-accent-blue) / .15)}.bg-accent-blue\/20{background-color:rgb(var(--color-accent-blue) / .2)}.bg-accent-blue\/5{background-color:rgb(var(--color-accent-blue) / .05)}.bg-accent-cyan\/10{background-color:#39c5cf1a}.bg-accent-cyan\/15{background-color:#39c5cf26}.bg-accent-green{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-green) / var(--tw-bg-opacity, 1))}.bg-accent-green\/10{background-color:rgb(var(--color-accent-green) / .1)}.bg-accent-green\/15{background-color:rgb(var(--color-accent-green) / .15)}.bg-accent-green\/20{background-color:rgb(var(--color-accent-green) / .2)}.bg-accent-green\/5{background-color:rgb(var(--color-accent-green) / .05)}.bg-accent-orange\/15{background-color:#d7775326}.bg-accent-purple{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-purple) / var(--tw-bg-opacity, 1))}.bg-accent-purple\/10{background-color:rgb(var(--color-accent-purple) / .1)}.bg-accent-purple\/15{background-color:rgb(var(--color-accent-purple) / .15)}.bg-accent-purple\/20{background-color:rgb(var(--color-accent-purple) / .2)}.bg-accent-red{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-red) / var(--tw-bg-opacity, 1))}.bg-accent-red\/10{background-color:rgb(var(--color-accent-red) / .1)}.bg-accent-red\/15{background-color:rgb(var(--color-accent-red) / .15)}.bg-accent-red\/20{background-color:rgb(var(--color-accent-red) / .2)}.bg-accent-red\/5{background-color:rgb(var(--color-accent-red) / .05)}.bg-accent-yellow{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-yellow) / var(--tw-bg-opacity, 1))}.bg-accent-yellow\/10{background-color:rgb(var(--color-accent-yellow) / .1)}.bg-accent-yellow\/15{background-color:rgb(var(--color-accent-yellow) / .15)}.bg-accent-yellow\/20{background-color:rgb(var(--color-accent-yellow) / .2)}.bg-accent-yellow\/5{background-color:rgb(var(--color-accent-yellow) / .05)}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-blue-400\/15{background-color:#60a5fa26}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/10{background-color:#1e3a8a1a}.bg-blue-900\/30{background-color:#1e3a8a4d}.bg-cyan-500\/15{background-color:#06b6d426}.bg-cyan-500\/20{background-color:#06b6d433}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1))}.bg-dark-bg\/50{background-color:rgb(var(--color-bg) / .5)}.bg-dark-bg\/60{background-color:rgb(var(--color-bg) / .6)}.bg-dark-bg\/70{background-color:rgb(var(--color-bg) / .7)}.bg-dark-border{--tw-bg-opacity: 1;background-color:rgb(var(--color-border) / var(--tw-bg-opacity, 1))}.bg-dark-border\/50{background-color:rgb(var(--color-border) / .5)}.bg-dark-border\/70{background-color:rgb(var(--color-border) / .7)}.bg-dark-hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1))}.bg-dark-hover\/40{background-color:rgb(var(--color-hover) / .4)}.bg-dark-muted\/40{background-color:rgb(var(--color-muted) / .4)}.bg-dark-surface{--tw-bg-opacity: 1;background-color:rgb(var(--color-surface) / var(--tw-bg-opacity, 1))}.bg-dark-surface\/50{background-color:rgb(var(--color-surface) / .5)}.bg-dark-surface\/60{background-color:rgb(var(--color-surface) / .6)}.bg-dark-surface\/80{background-color:rgb(var(--color-surface) / .8)}.bg-dark-surface\/95{background-color:rgb(var(--color-surface) / .95)}.bg-dark-text{--tw-bg-opacity: 1;background-color:rgb(var(--color-text) / var(--tw-bg-opacity, 1))}.bg-dark-text\/70{background-color:rgb(var(--color-text) / .7)}.bg-emerald-500\/15{background-color:#10b98126}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/10{background-color:#6b72801a}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-500\/5{background-color:#6b72800d}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-green-400\/15{background-color:#4ade8026}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-600\/15{background-color:#16a34a26}.bg-green-600\/90{background-color:#16a34ae6}.bg-green-900\/20{background-color:#14532d33}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-indigo-500\/15{background-color:#6366f126}.bg-indigo-500\/20{background-color:#6366f133}.bg-lime-500\/15{background-color:#84cc1626}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-orange-500\/20{background-color:#f9731633}.bg-orange-900\/15{background-color:#7c2d1226}.bg-orange-900\/30{background-color:#7c2d124d}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-pink-500\/20{background-color:#ec489933}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/15{background-color:#a855f726}.bg-purple-500\/20{background-color:#a855f733}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-teal-500\/20{background-color:#14b8a633}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/15{background-color:#eab30826}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-900\/10{background-color:#713f121a}.bg-yellow-900\/30{background-color:#713f124d}.fill-gray-500{fill:#6b7280}.fill-green-500{fill:#22c55e}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.\!px-0{padding-left:0!important;padding-right:0!important}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[7px\]{padding-top:7px;padding-bottom:7px}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-2\.5{padding-bottom:.625rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-10{padding-left:2.5rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pl-7{padding-left:1.75rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.pt-4{padding-top:1rem}.pt-\[12vh\]{padding-top:12vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:SF Mono,Monaco,Menlo,Consolas,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-accent-blue{--tw-text-opacity: 1;color:rgb(var(--color-accent-blue) / var(--tw-text-opacity, 1))}.text-accent-blue\/90{color:rgb(var(--color-accent-blue) / .9)}.text-accent-cyan{--tw-text-opacity: 1;color:rgb(57 197 207 / var(--tw-text-opacity, 1))}.text-accent-green{--tw-text-opacity: 1;color:rgb(var(--color-accent-green) / var(--tw-text-opacity, 1))}.text-accent-orange{--tw-text-opacity: 1;color:rgb(215 119 83 / var(--tw-text-opacity, 1))}.text-accent-purple{--tw-text-opacity: 1;color:rgb(var(--color-accent-purple) / var(--tw-text-opacity, 1))}.text-accent-red{--tw-text-opacity: 1;color:rgb(var(--color-accent-red) / var(--tw-text-opacity, 1))}.text-accent-red\/70{color:rgb(var(--color-accent-red) / .7)}.text-accent-yellow{--tw-text-opacity: 1;color:rgb(var(--color-accent-yellow) / var(--tw-text-opacity, 1))}.text-accent-yellow\/70{color:rgb(var(--color-accent-yellow) / .7)}.text-accent-yellow\/80{color:rgb(var(--color-accent-yellow) / .8)}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-dark-bg{--tw-text-opacity: 1;color:rgb(var(--color-bg) / var(--tw-text-opacity, 1))}.text-dark-border{--tw-text-opacity: 1;color:rgb(var(--color-border) / var(--tw-text-opacity, 1))}.text-dark-muted{--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.text-dark-muted\/40{color:rgb(var(--color-muted) / .4)}.text-dark-muted\/50{color:rgb(var(--color-muted) / .5)}.text-dark-muted\/60{color:rgb(var(--color-muted) / .6)}.text-dark-muted\/70{color:rgb(var(--color-muted) / .7)}.text-dark-muted\/80{color:rgb(var(--color-muted) / .8)}.text-dark-text{--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.text-dark-text\/70{color:rgb(var(--color-text) / .7)}.text-dark-text\/80{color:rgb(var(--color-text) / .8)}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-indigo-300{--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-lime-400{--tw-text-opacity: 1;color:rgb(163 230 53 / var(--tw-text-opacity, 1))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-pink-300{--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-teal-300{--tw-text-opacity: 1;color:rgb(94 234 212 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600\/70{color:#ca8a04b3}.placeholder-dark-muted::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--color-muted) / var(--tw-placeholder-opacity, 1))}.placeholder-dark-muted::placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--color-muted) / var(--tw-placeholder-opacity, 1))}.placeholder-dark-muted\/50::-moz-placeholder{color:rgb(var(--color-muted) / .5)}.placeholder-dark-muted\/50::placeholder{color:rgb(var(--color-muted) / .5)}.placeholder-dark-muted\/60::-moz-placeholder{color:rgb(var(--color-muted) / .6)}.placeholder-dark-muted\/60::placeholder{color:rgb(var(--color-muted) / .6)}.caret-dark-text{caret-color:rgb(var(--color-text) / 1)}.accent-accent-blue{accent-color:rgb(var(--color-accent-blue) / 1)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: var(--shadow-xl);--tw-shadow-colored: var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-accent-blue{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--color-accent-blue) / var(--tw-ring-opacity, 1))}.ring-accent-blue\/30{--tw-ring-color: rgb(var(--color-accent-blue) / .3)}.ring-accent-blue\/60{--tw-ring-color: rgb(var(--color-accent-blue) / .6)}.\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-\[2px\]{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[grid-template-rows\]{transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--color-bg: 255 255 255;--color-surface: 246 246 247;--color-border: 228 228 232;--color-hover: 240 240 243;--color-text: 24 24 27;--color-muted: 113 113 122;--color-accent-blue: 94 106 210;--color-accent-green: 22 163 74;--color-accent-red: 220 38 38;--color-accent-yellow: 180 83 9;--color-accent-purple: 124 58 237;--radius-xs: .125rem;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1)}.light{--color-bg: 255 255 255;--color-surface: 246 246 247;--color-border: 228 228 232;--color-hover: 240 240 243;--color-text: 24 24 27;--color-muted: 113 113 122;--color-accent-blue: 94 106 210;--color-accent-green: 22 163 74;--color-accent-red: 220 38 38;--color-accent-yellow: 180 83 9;--color-accent-purple: 124 58 237}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden;overscroll-behavior:none}body{font-family:Inter,ui-sans-serif,system-ui,PingFang SC,-apple-system,BlinkMacSystemFont,Segoe UI,Microsoft YaHei,sans-serif;background-color:rgb(var(--color-bg));color:rgb(var(--color-text));line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"cv02","cv03","cv04","cv11"}button,input,textarea,select{font:inherit}*{scrollbar-width:thin;scrollbar-color:rgb(var(--color-border)) transparent}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background-color:rgb(var(--color-border));border:3px solid transparent;border-radius:999px;background-clip:padding-box}::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--color-muted))}::-webkit-scrollbar-corner{background:transparent}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgb(var(--color-border)) transparent}.custom-scrollbar::-webkit-scrollbar{width:10px;height:10px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--color-border));border:3px solid transparent;border-radius:999px;background-clip:padding-box}.custom-scrollbar::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--color-muted))}.scrollbar-none{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}::-moz-selection{background-color:rgb(var(--color-accent-blue) / .18)}::selection{background-color:rgb(var(--color-accent-blue) / .18)}:focus-visible{outline:2px solid rgb(var(--color-accent-blue) / .7);outline-offset:1px}.btn{display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;justify-content:center;gap:.5rem;border-radius:var(--radius-lg);padding:.5rem .875rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn:disabled{cursor:not-allowed;opacity:.4}.btn-primary{--tw-bg-opacity: 1;background-color:rgb(var(--color-text) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-bg) / var(--tw-text-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.btn-primary:hover{opacity:.85}.btn-accent{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-blue) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.btn-accent:hover{opacity:.9}.btn-secondary{border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1))}.btn-ghost{--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.btn-ghost:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.btn-danger{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-red) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.btn-danger:hover{opacity:.9}.input{width:100%;border-radius:var(--radius-lg);border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1));padding:.625rem .875rem;font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.input::-moz-placeholder{color:rgb(var(--color-muted) / .7)}.input::placeholder{color:rgb(var(--color-muted) / .7)}.input{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input:focus{border-color:rgb(var(--color-accent-blue) / .6);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(var(--color-accent-blue) / .15)}.card,.panel-surface{border-radius:var(--radius-xl);border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.paper-surface{background:rgb(var(--color-bg) / .85);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.app-shell{background-color:rgb(var(--color-bg))}.workbench-frame{border:1px solid rgb(var(--color-border));background:rgb(var(--color-bg) / .85);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.mimo-tab{display:inline-flex;align-items:center;gap:.5rem;border-radius:var(--radius-lg);border-width:1px;border-color:transparent;padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mimo-tab[data-active=true]{--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1));--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mimo-tab[data-active=false]{--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.mimo-tab[data-active=false]:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.side-nav-item{position:relative;display:flex;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:.625rem;border-radius:var(--radius-lg);padding-left:.625rem;padding-right:.625rem;padding-top:7px;padding-bottom:7px;font-size:13px;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.side-nav-item[data-active=true]{background-color:rgb(var(--color-accent-blue) / .1);--tw-text-opacity: 1;color:rgb(var(--color-accent-blue) / var(--tw-text-opacity, 1))}.side-nav-item[data-active=false]{--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.side-nav-item[data-active=false]:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.side-nav-item[data-active=true]:before{content:"";position:absolute;left:-10px;top:50%;transform:translateY(-50%);width:3px;height:16px;border-radius:999px;background:rgb(var(--color-accent-blue))}.side-group-label{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:1rem .625rem .25rem;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:rgb(var(--color-muted) / .7)}.section-title{font-size:.875rem;line-height:1.25rem;font-weight:600;letter-spacing:.025em;--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.subtle-label{font-size:11px;text-transform:uppercase;letter-spacing:.18em;--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes slideInRight{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@keyframes pulse-soft{0%,to{opacity:1}50%{opacity:.72}}@keyframes blink{0%,to{opacity:1}50%{opacity:.35}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.animate-fade-in{animation:fadeIn .3s ease-out}.animate-slide-in{animation:slideIn .3s ease-out}.animate-slide-in-right{animation:slideInRight .3s ease-out}.animate-pulse-soft{animation:pulse-soft 2s ease-in-out infinite}.animate-blink{animation:blink 1s infinite}.animate-spin{animation:spin 1s linear infinite}.skeleton-shimmer{background-image:linear-gradient(90deg,rgb(var(--color-border) / .34) 25%,rgb(var(--color-muted) / .18) 37%,rgb(var(--color-border) / .34) 63%);background-size:200% 100%;animation:shimmer 1.4s ease-in-out infinite}.markdown-content{white-space:normal;word-break:break-word}.markdown-content h1{margin-top:1rem;margin-bottom:.5rem;font-size:1.5rem;line-height:2rem;font-weight:700;--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.markdown-content h2{margin-top:1rem;margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.markdown-content h3{margin-top:.75rem;margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.markdown-content p{margin-top:.5rem;margin-bottom:.5rem}.markdown-content ul,.markdown-content ol{margin-top:.5rem;margin-bottom:.5rem;padding-left:1.5rem}.markdown-content li{margin-top:.25rem;margin-bottom:.25rem}.markdown-content code{border-radius:var(--radius-md);--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1));padding:.125rem .375rem;font-family:SF Mono,Monaco,Menlo,Consolas,monospace;font-size:.85em}.markdown-content pre{margin-top:.75rem;margin-bottom:.75rem;overflow-x:auto;border-radius:var(--radius-xl);border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(var(--color-surface) / var(--tw-bg-opacity, 1));padding:.875rem}.markdown-content pre code{background-color:transparent;padding:0}.markdown-content blockquote{margin-top:.75rem;margin-bottom:.75rem;border-left-width:3px;border-color:rgb(var(--color-accent-blue) / .4);padding-left:1rem;--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.markdown-content a{--tw-text-opacity: 1;color:rgb(var(--color-accent-blue) / var(--tw-text-opacity, 1));text-decoration-line:underline;text-decoration-color:rgb(var(--color-accent-blue) / .3);text-underline-offset:2px}.markdown-content a:hover{text-decoration-color:rgb(var(--color-accent-blue) / .6)}.markdown-content table{margin-top:.75rem;margin-bottom:.75rem;width:100%;border-collapse:collapse;overflow:hidden;border-radius:var(--radius-lg)}.markdown-content th,.markdown-content td{border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1));padding:.5rem .75rem;text-align:left}.markdown-content th{--tw-bg-opacity: 1;background-color:rgb(var(--color-surface) / var(--tw-bg-opacity, 1));font-weight:600}code[class*=language-],pre[class*=language-]{font-family:SF Mono,Monaco,Menlo,Consolas,monospace;font-size:.875rem;line-height:1.25rem}.token.comment,.token.prolog,.token.doctype,.token.cdata{--tw-text-opacity: 1;color:rgb(var(--color-muted) / var(--tw-text-opacity, 1))}.token.punctuation{--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{--tw-text-opacity: 1;color:rgb(var(--color-accent-red) / var(--tw-text-opacity, 1))}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{--tw-text-opacity: 1;color:rgb(var(--color-accent-green) / var(--tw-text-opacity, 1))}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{--tw-text-opacity: 1;color:rgb(var(--color-accent-yellow) / var(--tw-text-opacity, 1))}.token.atrule,.token.attr-value,.token.keyword{--tw-text-opacity: 1;color:rgb(var(--color-accent-blue) / var(--tw-text-opacity, 1))}.token.function,.token.class-name{color:rgb(var(--color-accent-purple))}.token.regex,.token.important,.token.variable{--tw-text-opacity: 1;color:rgb(var(--color-accent-yellow) / var(--tw-text-opacity, 1))}.last\:mb-0:last-child{margin-bottom:0}.last\:border-0:last-child{border-width:0px}.last\:border-b-0:last-child{border-bottom-width:0px}.focus-within\:border-accent-blue\/50:focus-within{border-color:rgb(var(--color-accent-blue) / .5)}.focus-within\:ring-4:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-accent-blue\/10:focus-within{--tw-ring-color: rgb(var(--color-accent-blue) / .1)}.hover\:-translate-y-px:hover{--tw-translate-y: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-accent-blue:hover{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-blue) / var(--tw-border-opacity, 1))}.hover\:border-accent-blue\/30:hover{border-color:rgb(var(--color-accent-blue) / .3)}.hover\:border-accent-blue\/40:hover{border-color:rgb(var(--color-accent-blue) / .4)}.hover\:border-accent-blue\/50:hover{border-color:rgb(var(--color-accent-blue) / .5)}.hover\:border-accent-green\/40:hover{border-color:rgb(var(--color-accent-green) / .4)}.hover\:border-accent-green\/50:hover{border-color:rgb(var(--color-accent-green) / .5)}.hover\:border-dark-border:hover{--tw-border-opacity: 1;border-color:rgb(var(--color-border) / var(--tw-border-opacity, 1))}.hover\:border-dark-border\/50:hover{border-color:rgb(var(--color-border) / .5)}.hover\:border-dark-hover:hover{--tw-border-opacity: 1;border-color:rgb(var(--color-hover) / var(--tw-border-opacity, 1))}.hover\:border-dark-muted\/40:hover{border-color:rgb(var(--color-muted) / .4)}.hover\:bg-\[\#3c3c3c\]:hover{--tw-bg-opacity: 1;background-color:rgb(60 60 60 / var(--tw-bg-opacity, 1))}.hover\:bg-accent-blue:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-blue) / var(--tw-bg-opacity, 1))}.hover\:bg-accent-blue\/10:hover{background-color:rgb(var(--color-accent-blue) / .1)}.hover\:bg-accent-blue\/20:hover{background-color:rgb(var(--color-accent-blue) / .2)}.hover\:bg-accent-blue\/80:hover{background-color:rgb(var(--color-accent-blue) / .8)}.hover\:bg-accent-blue\/90:hover{background-color:rgb(var(--color-accent-blue) / .9)}.hover\:bg-accent-green\/10:hover{background-color:rgb(var(--color-accent-green) / .1)}.hover\:bg-accent-green\/25:hover{background-color:rgb(var(--color-accent-green) / .25)}.hover\:bg-accent-green\/30:hover{background-color:rgb(var(--color-accent-green) / .3)}.hover\:bg-accent-purple\/10:hover{background-color:rgb(var(--color-accent-purple) / .1)}.hover\:bg-accent-red\/10:hover{background-color:rgb(var(--color-accent-red) / .1)}.hover\:bg-accent-red\/20:hover{background-color:rgb(var(--color-accent-red) / .2)}.hover\:bg-accent-red\/25:hover{background-color:rgb(var(--color-accent-red) / .25)}.hover\:bg-accent-red\/30:hover{background-color:rgb(var(--color-accent-red) / .3)}.hover\:bg-accent-red\/90:hover{background-color:rgb(var(--color-accent-red) / .9)}.hover\:bg-accent-yellow\/10:hover{background-color:rgb(var(--color-accent-yellow) / .1)}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/10:hover{background-color:#3b82f61a}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-bg:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-bg) / var(--tw-bg-opacity, 1))}.hover\:bg-dark-border:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-border) / var(--tw-bg-opacity, 1))}.hover\:bg-dark-hover:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-hover) / var(--tw-bg-opacity, 1))}.hover\:bg-dark-hover\/30:hover{background-color:rgb(var(--color-hover) / .3)}.hover\:bg-dark-hover\/50:hover{background-color:rgb(var(--color-hover) / .5)}.hover\:bg-dark-hover\/60:hover{background-color:rgb(var(--color-hover) / .6)}.hover\:bg-dark-surface:hover{--tw-bg-opacity: 1;background-color:rgb(var(--color-surface) / var(--tw-bg-opacity, 1))}.hover\:bg-dark-surface\/40:hover{background-color:rgb(var(--color-surface) / .4)}.hover\:bg-dark-surface\/50:hover{background-color:rgb(var(--color-surface) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-green-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.hover\:bg-green-500\/10:hover{background-color:#22c55e1a}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600\/25:hover{background-color:#16a34a40}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:text-accent-blue:hover{--tw-text-opacity: 1;color:rgb(var(--color-accent-blue) / var(--tw-text-opacity, 1))}.hover\:text-accent-green:hover{--tw-text-opacity: 1;color:rgb(var(--color-accent-green) / var(--tw-text-opacity, 1))}.hover\:text-accent-red:hover{--tw-text-opacity: 1;color:rgb(var(--color-accent-red) / var(--tw-text-opacity, 1))}.hover\:text-accent-yellow:hover{--tw-text-opacity: 1;color:rgb(var(--color-accent-yellow) / var(--tw-text-opacity, 1))}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(var(--color-text) / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-85:hover{opacity:.85}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-md:hover{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-accent-blue:focus{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-blue) / var(--tw-border-opacity, 1))}.focus\:border-accent-blue\/50:focus{border-color:rgb(var(--color-accent-blue) / .5)}.focus\:border-accent-blue\/60:focus{border-color:rgb(var(--color-accent-blue) / .6)}.focus\:border-accent-red:focus{--tw-border-opacity: 1;border-color:rgb(var(--color-accent-red) / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-accent-blue\/15:focus{--tw-ring-color: rgb(var(--color-accent-blue) / .15)}.focus\:ring-accent-blue\/20:focus{--tw-ring-color: rgb(var(--color-accent-blue) / .2)}.focus\:ring-accent-blue\/50:focus{--tw-ring-color: rgb(var(--color-accent-blue) / .5)}.focus\:ring-accent-red\/20:focus{--tw-ring-color: rgb(var(--color-accent-red) / .2)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-25:disabled{opacity:.25}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\:opacity-100{opacity:1}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-gray-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1e3a8a33}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-900\/30:hover:is(.dark *){background-color:#1e3a8a4d}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}@media not all and (min-width: 1024px){.max-lg\:hidden{display:none}}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:px-4{padding-left:1rem;padding-right:1rem}}@media (min-width: 768px){.md\:block{display:block}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:max-w-\[78\%\]{max-width:78%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_1\.2fr\]{grid-template-columns:1fr 1.2fr}}@media (min-width: 1024px){.lg\:inline{display:inline}.lg\:flex{display:flex}.lg\:w-20{width:5rem}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:flex{display:flex}.xl\:w-\[420px\]{width:420px}.xl\:grid-cols-\[minmax\(0\,1fr\)_320px\]{grid-template-columns:minmax(0,1fr) 320px}}@media (min-width: 1536px){.\32xl\:inline{display:inline}.\32xl\:w-80{width:20rem}}.\[\&\:\:-webkit-slider-thumb\]\:h-3::-webkit-slider-thumb{height:.75rem}.\[\&\:\:-webkit-slider-thumb\]\:w-3::-webkit-slider-thumb{width:.75rem}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:9999px}.\[\&\:\:-webkit-slider-thumb\]\:bg-accent-blue::-webkit-slider-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--color-accent-blue) / var(--tw-bg-opacity, 1))}
@@ -1,4 +1,4 @@
1
- import{r as Pr,c as Fe,g as An}from"./icons-B_rAQLge.js";var Nt={exports:{}},Qe={};/**
1
+ import{r as Pr,c as Fe,g as An}from"./icons-CjYP2PII.js";var Nt={exports:{}},Qe={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -0,0 +1 @@
1
+ import"./icons-CjYP2PII.js";
@@ -1,4 +1,4 @@
1
- import{r as _a,g as Na}from"./icons-B_rAQLge.js";var Co={exports:{}},ve={},xo={exports:{}},_o={};/**
1
+ import{r as _a,g as Na}from"./icons-CjYP2PII.js";var Co={exports:{}},ve={},xo={exports:{}},_o={};/**
2
2
  * @license React
3
3
  * scheduler.production.min.js
4
4
  *
@@ -1,4 +1,4 @@
1
- import{r as _,g as R,R as x}from"./icons-B_rAQLge.js";var w={exports:{}},D={};/**
1
+ import{r as _,g as R,R as x}from"./icons-CjYP2PII.js";var w={exports:{}},D={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -12,12 +12,12 @@
12
12
  <meta name="theme-color" content="#0d1117" />
13
13
  <meta name="color-scheme" content="dark light" />
14
14
  <title>DeepSeekCode Web</title>
15
- <script type="module" crossorigin src="/assets/index-BtIzCXfW.js"></script>
16
- <link rel="modulepreload" crossorigin href="/assets/icons-B_rAQLge.js">
17
- <link rel="modulepreload" crossorigin href="/assets/markdown-BAhUvdx-.js">
18
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-meeTdQCf.js">
19
- <link rel="modulepreload" crossorigin href="/assets/state-Cke1lss7.js">
20
- <link rel="stylesheet" crossorigin href="/assets/index-BhVUD1px.css">
15
+ <script type="module" crossorigin src="/assets/index-B-DFEdP3.js"></script>
16
+ <link rel="modulepreload" crossorigin href="/assets/icons-CjYP2PII.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/markdown-CIsUyqRd.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-DuqM3ddv.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/state-BCeK45RP.js">
20
+ <link rel="stylesheet" crossorigin href="/assets/index-D2PsJB4J.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{j as e}from"./markdown-BAhUvdx-.js";import{r as b,a0 as m,f as p,b as f,d as h,a1 as j,a as v}from"./icons-B_rAQLge.js";import{c as k,d as u}from"./index-BtIzCXfW.js";import"./react-vendor-meeTdQCf.js";import"./state-Cke1lss7.js";const y=["Orchestrator","Explorer","Architect","Coder","Tester","Reviewer","Debug","Documenter","Evaluator"],w=t=>t==="running"||t==="scheduled"?e.jsx(f,{size:10,className:"animate-spin text-accent-blue"}):t==="completed"?e.jsx(h,{size:10,className:"text-accent-green"}):t==="failed"?e.jsx(j,{size:10,className:"text-accent-red"}):e.jsx(p,{size:10,className:"text-dark-muted"}),z=t=>t==="running"||t==="scheduled"?"Running":t==="completed"?"Complete":t==="failed"?"Failed":"Idle",l=t=>t.toLowerCase();function A({agent:t}){const n=t.status==="running"||t.status==="scheduled";return e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded border transition-colors ${n?"bg-accent-blue/10 border-accent-blue/40":t.status==="completed"?"bg-accent-green/10 border-accent-green/30":t.status==="failed"?"bg-accent-red/10 border-accent-red/30":"border-dark-border"}`,children:[w(t.status),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-semibold truncate",children:t.name}),e.jsx("span",{className:"text-[9px] text-dark-muted shrink-0",children:z(t.status)})]}),t.currentTask&&e.jsx("div",{className:"text-[9px] text-dark-muted truncate mt-0.5",children:t.currentTask})]})]})}function F(){const[t,n]=b.useState(!1),r=k(s=>s.activeSessionId),d=u(s=>r?s.getAgentsForSession(r):[]),c=u(s=>r?s.getEventsForSession(r).filter(a=>a.source==="agent"||a.source==="plan").slice(0,50):[]),o=new Map(d.map(s=>[l(s.name),s])),x=y.map(s=>o.get(l(s))||o.get(l(s.replace("Orchestrator","orchestrator")))).filter(Boolean),g=d.filter(s=>!x.some(a=>a.id===s.id)),i=[...x,...g],N=i.filter(s=>s.status==="running"||s.status==="scheduled").length;return e.jsxs("div",{className:"h-full flex flex-col bg-dark-bg",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2.5 border-b border-dark-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(m,{size:14,className:"text-accent-purple"}),e.jsx("span",{className:"text-xs font-semibold text-dark-text",children:"Agent Flow"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-dark-muted",children:[e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(p,{size:8})," Idle"]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(f,{size:8,className:"animate-spin text-accent-blue"})," Running"]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(h,{size:8,className:"text-accent-green"})," Done"]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(j,{size:8,className:"text-accent-red"})," Failed"]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden custom-scrollbar",children:e.jsx("div",{className:"px-3 py-3 space-y-2",children:i.length===0?e.jsx("div",{className:"min-h-[180px] flex items-center justify-center text-center text-dark-muted text-xs",children:e.jsxs("div",{children:[e.jsx(m,{size:28,className:"mx-auto mb-2 opacity-50"}),e.jsx("div",{children:"Waiting for agent activity"})]})}):i.map(s=>e.jsx(A,{agent:s},s.id))})}),e.jsxs("div",{className:"shrink-0 border-t border-dark-border transition-all duration-300",style:{height:t?180:32},children:[e.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center justify-between px-3 py-1.5 hover:bg-dark-hover/30 transition-colors",children:[e.jsxs("span",{className:"text-[10px] font-semibold text-dark-text flex items-center gap-1.5",children:["Event Log",e.jsx("span",{className:"px-1 py-0.5 rounded text-[8px] bg-dark-surface text-dark-muted",children:c.length}),N>0&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-blue animate-pulse"})]}),e.jsx(v,{size:12,className:"text-dark-muted transition-transform duration-300",style:{transform:t?"rotate(180deg)":"rotate(0deg)"}})]}),t&&e.jsx("div",{className:"overflow-y-auto custom-scrollbar px-2",style:{height:146},children:c.length===0?e.jsx("div",{className:"py-4 text-[10px] text-dark-muted text-center",children:"No flow events yet."}):e.jsx("div",{className:"space-y-1 pb-2",children:c.map(s=>e.jsxs("div",{className:"px-2 py-1.5 rounded border border-dark-border bg-dark-surface",children:[e.jsxs("div",{className:"flex items-center gap-1 text-[9px]",children:[e.jsx("span",{className:"font-medium text-dark-text truncate",children:s.title||s.type}),e.jsx("span",{className:"text-dark-muted/70 ml-auto",children:new Date(s.timestamp).toLocaleTimeString()})]}),s.message&&e.jsx("p",{className:"text-[8px] text-dark-muted/80 mt-0.5 truncate",children:s.message}),e.jsx("div",{className:"text-[8px] text-dark-muted/60 mt-0.5",children:s.source})]},s.id))})})]})]})]})}export{F as AgentFlowView,F as default};
@@ -1,8 +0,0 @@
1
- import{j as i}from"./markdown-BAhUvdx-.js";import{r as v,aA as Ie,Y as Me,V as Pe,aB as Ze,P as ee,aC as Re,K as Le,a4 as Xe,m as et}from"./icons-B_rAQLge.js";import{s as de,M as tt,a as xe}from"./index-BtIzCXfW.js";import"./react-vendor-meeTdQCf.js";import"./state-Cke1lss7.js";const pe=new Set(["mattermost","msteams","googlechat","irc","imessage","sms","nextcloud-talk","nostr","synology-chat","tlon","twitch","zalo","zalouser","clickclack","raft","qa-channel"]),be={wechat:"微信",feishu:"飞书",dingtalk:"钉钉",telegram:"Telegram",discord:"Discord",slack:"Slack",signal:"Signal",whatsapp:"WhatsApp",line:"LINE",qqbot:"QQ Bot",matrix:"Matrix",mattermost:"Mattermost",msteams:"Teams",googlechat:"Google Chat",irc:"IRC",imessage:"iMessage",sms:"SMS","nextcloud-talk":"Nextcloud Talk",nostr:"Nostr","synology-chat":"Synology Chat",tlon:"Tlon",twitch:"Twitch",zalo:"Zalo",zalouser:"ZaloUser",clickclack:"ClickClack",raft:"Raft","qa-channel":"QA"},we={wechat:"💬",feishu:"📘",dingtalk:"🔔",telegram:"✈️",discord:"🎮",slack:"💼",signal:"🔒",whatsapp:"📱",line:"🟢",qqbot:"🐧",matrix:"🧩",mattermost:"🏢",msteams:"📋",googlechat:"📧",irc:"💻",imessage:"✉️",sms:"📨"},ye=[{label:"即时通讯",types:["wechat","feishu","dingtalk"]},{label:"国际主流",types:["telegram","discord","slack","signal","whatsapp"]},{label:"东亚",types:["line","qqbot"]},{label:"协作平台",types:["matrix","mattermost","msteams","googlechat"]},{label:"经典协议",types:["irc","imessage","sms"]},{label:"其他",types:["nextcloud-talk","nostr","synology-chat","tlon","twitch","zalo","zalouser"]},{label:"内置",types:["clickclack","raft","qa-channel"]}];function nt(){const{channels:t,selectedType:e,selectType:o}=de(),r=v.useMemo(()=>{const n=new Map;for(const s of t){const a=n.get(s.type)??{count:0,connected:0};n.set(s.type,{count:a.count+1,connected:a.connected+(s.connected?1:0)})}return n},[t]);return i.jsxs("div",{className:"flex flex-col h-full min-h-0 border-r border-dark-border bg-dark-surface",children:[i.jsxs("div",{className:"shrink-0 px-4 py-3 border-b border-dark-border",children:[i.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-dark-muted",children:"频道列表"}),i.jsx("p",{className:"text-[11px] text-dark-muted mt-0.5",children:t.length>0?`${t.length} 个已配置`:"点击下方频道开始配置"})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:[ye.map(n=>{const s=n.types.filter(a=>r.has(a));return s.length===0?null:i.jsxs("div",{children:[i.jsx("div",{className:"sticky top-0 bg-dark-surface/95 backdrop-blur px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-dark-muted/60",children:n.label}),s.map(a=>{const l=r.get(a);return i.jsx(Ne,{label:be[a]??a,icon:we[a]??"📡",isSelected:e===a,experimental:pe.has(a),info:l,onClick:()=>o(a)},a)})]},n.label)}),(()=>{const n=ye.flatMap(s=>s.types).filter(s=>!r.has(s));return n.length===0?null:i.jsxs("div",{children:[i.jsx("div",{className:"sticky top-0 bg-dark-surface/95 backdrop-blur px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-dark-muted/60",children:"未配置"}),n.map(s=>i.jsx(Ne,{label:be[s]??s,icon:we[s]??"📡",isSelected:e===s,experimental:pe.has(s),onClick:()=>o(s)},s))]})})()]})]})}function Ne({label:t,icon:e,isSelected:o,experimental:r,info:n,onClick:s}){return i.jsxs("button",{onClick:s,className:`w-full flex items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-dark-hover ${o?"bg-accent-blue/10 border-l-2 border-accent-blue":"border-l-2 border-transparent"}`,children:[i.jsx("span",{className:"text-lg shrink-0 w-7 h-7 flex items-center justify-center rounded-md bg-dark-bg",children:e}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-sm font-medium text-dark-text truncate",children:t}),r&&i.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] text-yellow-500 bg-yellow-500/10 px-1 py-0.5 rounded shrink-0",title:"实验性实现,功能不完整",children:[i.jsx(Ie,{className:"w-2.5 h-2.5"})," 实验"]}),n&&i.jsx("span",{className:"text-[10px] text-dark-muted bg-dark-hover px-1.5 py-0.5 rounded shrink-0",children:n.count})]}),i.jsx("div",{className:"flex items-center gap-1 mt-0.5",children:n?n.connected>0?i.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-green-400",children:[i.jsx(Me,{className:"w-3 h-3"}),n.connected===n.count?"已连接":`${n.connected}/${n.count} 已连接`]}):i.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-dark-muted",children:[i.jsx(Pe,{className:"w-3 h-3"}),"未连接"]}):i.jsx("span",{className:"text-[11px] text-dark-muted",children:"未配置"})})]})]})}const Ce=new Set(["mattermost","msteams","googlechat","irc","imessage","sms","nextcloud-talk","nostr","synology-chat","tlon","twitch","zalo","zalouser","clickclack","raft","qa-channel"]),ke={wechat:"微信",feishu:"飞书",dingtalk:"钉钉",telegram:"Telegram",discord:"Discord",slack:"Slack",signal:"Signal",whatsapp:"WhatsApp",line:"LINE",qqbot:"QQ Bot",matrix:"Matrix",mattermost:"Mattermost",msteams:"Microsoft Teams",googlechat:"Google Chat",irc:"IRC",imessage:"iMessage",sms:"SMS","nextcloud-talk":"Nextcloud Talk",nostr:"Nostr","synology-chat":"Synology Chat",tlon:"Tlon",twitch:"Twitch",zalo:"Zalo",zalouser:"ZaloUser",clickclack:"ClickClack",raft:"Raft","qa-channel":"QA Channel"},je={wechat:"💬",feishu:"📘",dingtalk:"🔔",telegram:"✈️",discord:"🎮",slack:"💼",signal:"🔒",whatsapp:"📱",line:"🟢",qqbot:"🐧",matrix:"🧩",mattermost:"🏢",msteams:"📋",googlechat:"📧",irc:"💻",imessage:"✉️",sms:"📨"},L={name:"",type:"wechat",appId:"",appSecret:"",token:"",encodingAESKey:"",enabled:!0};function rt(){const{channels:t,selectedType:e,create:o,update:r,remove:n,toggle:s,error:a,clearError:l,openQr:c,load:u}=de(),d=v.useMemo(()=>e?t.filter(N=>N.type===e):[],[t,e]),[y,g]=v.useState(""),[h,x]=v.useState(L),[C,j]=v.useState(!1),p=y==="__new__",m=v.useMemo(()=>p?null:d.find(N=>N.id===y)??null,[d,y,p]);v.useEffect(()=>{g(""),x(L),j(!1),l()},[e]),v.useEffect(()=>{m?x({name:m.name,type:m.type,appId:m.appId||"",appSecret:"",token:"",encodingAESKey:m.encodingAESKey||"",enabled:m.enabled}):p&&x(N=>({...N,type:e}))},[y]);const b=(N,A)=>{l(),x(z=>({...z,[N]:A}))},f=N=>{g(N),l()},w=()=>{g("__new__"),x({...L,type:e}),l()},k=()=>{g(""),x(L),l()},E=async()=>{if(!h.name.trim())return;j(!0);const N=m?await r(m.id,h):await o(h);j(!1),N&&(g(""),x(L))},S=async N=>{if(!confirm("确认删除该频道?"))return;await n(N)&&y===N&&(g(""),x(L))},B=(N,A)=>{s(N,A)};return e?i.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[i.jsx("div",{className:"shrink-0 px-6 py-4 border-b border-dark-border",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"text-2xl",children:je[e]??"📡"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"font-semibold text-base text-dark-text",children:ke[e]??e}),Ce.has(e)&&i.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-yellow-500 bg-yellow-500/10 px-1.5 py-0.5 rounded",title:"实验性实现,功能不完整",children:[i.jsx(Ie,{className:"w-3 h-3"})," 实验性"]})]}),i.jsx("p",{className:"text-xs text-dark-muted mt-0.5",children:d.length>0?`${d.length} 个配置实例`:"尚未配置"}),Ce.has(e)&&i.jsx("p",{className:"text-[10px] text-yellow-600/70 mt-1",children:"此频道为基础适配器封装,支持基础消息收发,部分高级功能可能不完整"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>u(),className:"text-xs px-3 py-1.5 rounded-lg border border-dark-border text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:"刷新"}),i.jsxs("button",{onClick:w,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent-blue hover:bg-accent-blue/90 text-white transition-colors",children:[i.jsx(ee,{className:"w-3.5 h-3.5"})," 新建实例"]})]})]})}),a&&i.jsxs("div",{className:"shrink-0 mx-6 mt-3 bg-red-500/10 border border-red-500/40 text-red-400 px-3 py-2 rounded-lg text-sm flex justify-between items-center",children:[i.jsx("span",{children:a}),i.jsx("button",{onClick:l,className:"text-red-400 hover:text-red-300",children:i.jsx("span",{className:"w-4 h-4 inline-flex items-center justify-center",children:"×"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6",children:[d.length>1&&!p&&i.jsxs("div",{className:"mb-4",children:[i.jsx("label",{className:"block text-xs text-dark-muted mb-1.5",children:"选择实例"}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.map(N=>i.jsxs("button",{onClick:()=>f(N.id),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs border transition-colors ${y===N.id?"bg-accent-blue/10 border-accent-blue/40 text-accent-blue":"border-dark-border text-dark-muted hover:text-dark-text hover:bg-dark-hover"}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.connected?"bg-green-500":"bg-gray-500"}`}),N.name]},N.id)),i.jsxs("button",{onClick:w,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs border border-dashed border-dark-border text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:[i.jsx(ee,{className:"w-3 h-3"})," 新建"]})]})]}),d.length===0&&y===""&&i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i.jsx("div",{className:"text-4xl mb-3",children:je[e]??"📡"}),i.jsxs("p",{className:"text-dark-text font-medium",children:["还没有配置 ",ke[e]??e]}),i.jsx("p",{className:"text-sm text-dark-muted mt-1 mb-4",children:"点击上方「新建实例」开始配置"}),i.jsxs("button",{onClick:w,className:"flex items-center gap-1.5 text-sm px-4 py-2 rounded-lg bg-accent-blue hover:bg-accent-blue/90 text-white transition-colors",children:[i.jsx(ee,{className:"w-4 h-4"})," 新建实例"]})]}),d.length===1&&y===""&&d[0]&&i.jsx(Ee,{channel:d[0],onEdit:()=>f(d[0].id),onDelete:()=>S(d[0].id),onToggle:N=>B(d[0].id,N),onQr:()=>c(d[0])}),d.length>1&&y===""&&i.jsx("div",{className:"space-y-3",children:d.map(N=>i.jsx(Ee,{channel:N,onEdit:()=>f(N.id),onDelete:()=>S(N.id),onToggle:A=>B(N.id,A),onQr:()=>c(N)},N.id))}),y!==""&&(p||m)&&i.jsx(st,{form:h,upd:b,saving:C,editing:!!m,channel:m??void 0,onSave:E,onCancel:k,onDelete:m?()=>S(m.id):void 0,onQr:m?()=>c(m):void 0})]})]}):i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Ze,{className:"w-12 h-12 mx-auto mb-3 text-dark-muted/40"}),i.jsx("p",{className:"text-dark-muted text-sm",children:"请从左侧选择一个频道类型"})]})})}function Ee({channel:t,onEdit:e,onDelete:o,onToggle:r,onQr:n}){return i.jsxs("div",{className:"border border-dark-border rounded-lg bg-dark-surface overflow-hidden",children:[i.jsx("div",{className:"p-5",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-dark-text",children:t.name}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("span",{className:`flex items-center gap-1 text-xs ${t.connected?"text-green-400":"text-dark-muted"}`,children:t.connected?i.jsxs(i.Fragment,{children:[i.jsx(Me,{className:"w-3 h-3"})," 已连接"]}):i.jsxs(i.Fragment,{children:[i.jsx(Pe,{className:"w-3 h-3"})," 未连接"]})}),i.jsxs("span",{className:"text-xs text-dark-muted",children:["AppID: ",t.appId||"—"]})]})]}),i.jsx("button",{onClick:()=>r(!t.enabled),className:`w-9 h-5 rounded-full relative transition-colors shrink-0 ${t.enabled?"bg-green-600":"bg-gray-600"}`,children:i.jsx("span",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all ${t.enabled?"left-[18px]":"left-0.5"}`})})]})}),i.jsxs("div",{className:"flex items-center gap-1 px-5 py-2.5 bg-dark-bg/50 border-t border-dark-border",children:[t.type==="wechat"&&i.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-md text-green-400 hover:bg-green-500/10 transition-colors",children:[i.jsx(Re,{className:"w-3.5 h-3.5"})," 扫码登录"]}),i.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-md text-accent-blue hover:bg-accent-blue/10 transition-colors",children:[i.jsx("span",{className:"w-3.5 h-3.5 inline-flex items-center justify-center",children:"✎"})," 编辑"]}),i.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-md text-red-400 hover:bg-red-500/10 transition-colors ml-auto",children:[i.jsx(Le,{className:"w-3.5 h-3.5"})," 删除"]})]})]})}function st({form:t,upd:e,saving:o,editing:r,channel:n,onSave:s,onCancel:a,onDelete:l,onQr:c}){return i.jsxs("div",{className:"border border-dark-border rounded-lg bg-dark-surface overflow-hidden",children:[i.jsx("div",{className:"px-5 py-4 border-b border-dark-border",children:i.jsx("h3",{className:"font-medium text-dark-text",children:r?"编辑配置":"新建配置"})}),i.jsxs("div",{className:"p-5 space-y-4",children:[i.jsx(ve,{label:"频道名称",required:!0,children:i.jsx("input",{value:t.name,onChange:u=>e("name",u.target.value),placeholder:"例如:研发群机器人",className:$})}),i.jsxs(ve,{label:"接入凭证",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-[10px] text-dark-muted mb-1",children:"AppID / 企业ID"}),i.jsx("input",{value:t.appId,onChange:u=>e("appId",u.target.value),placeholder:"AppID",className:$})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[10px] text-dark-muted mb-1",children:"AppSecret"}),i.jsx("input",{type:"password",value:t.appSecret,onChange:u=>e("appSecret",u.target.value),placeholder:r?"留空不修改":"应用密钥",className:$})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[10px] text-dark-muted mb-1",children:"Token"}),i.jsx("input",{value:t.token,onChange:u=>e("token",u.target.value),placeholder:r?"留空不修改":"回调校验 Token",className:$})]}),t.type==="wechat"&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-[10px] text-dark-muted mb-1",children:"EncodingAESKey"}),i.jsx("input",{value:t.encodingAESKey,onChange:u=>e("encodingAESKey",u.target.value),placeholder:"选填",className:$})]})]}),t.type==="wechat"&&i.jsx("p",{className:"text-xs text-dark-muted mt-2",children:"微信 iLink 机器人通过扫码授权,凭证可留空,保存后扫码登录即可。"})]}),i.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-dark-border px-3 py-2.5",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm text-dark-text",children:"启用频道"}),i.jsx("p",{className:"text-xs text-dark-muted",children:"关闭后停止收发消息"})]}),i.jsx("button",{onClick:()=>e("enabled",!t.enabled),className:`w-9 h-5 rounded-full relative transition-colors shrink-0 ${t.enabled?"bg-green-600":"bg-gray-600"}`,children:i.jsx("span",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all ${t.enabled?"left-[18px]":"left-0.5"}`})})]}),r&&(n==null?void 0:n.type)==="wechat"&&c&&i.jsxs("button",{onClick:c,className:"w-full flex items-center justify-center gap-2 text-sm bg-green-600/15 hover:bg-green-600/25 text-green-400 border border-green-600/40 px-3 py-2.5 rounded-lg transition-colors",children:[i.jsx(Re,{className:"w-4 h-4"})," 扫码登录 / 重新授权"]})]}),i.jsxs("div",{className:"flex items-center justify-between px-5 py-3 bg-dark-bg/50 border-t border-dark-border",children:[i.jsx("div",{children:r&&l&&i.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-md text-red-400 hover:bg-red-500/10 transition-colors",children:[i.jsx(Le,{className:"w-3.5 h-3.5"})," 删除"]})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:a,className:"px-4 py-2 text-sm text-dark-muted hover:text-dark-text transition-colors",children:"取消"}),i.jsxs("button",{onClick:s,disabled:o||!t.name.trim(),className:"flex items-center gap-1.5 px-4 py-2 text-sm bg-accent-blue hover:bg-accent-blue/90 text-white rounded-lg disabled:opacity-50 transition-colors",children:[i.jsx(Xe,{className:"w-3.5 h-3.5"}),o?"保存中...":"保存"]})]})]})]})}function ve({label:t,required:e,children:o}){return i.jsxs("div",{children:[i.jsxs("label",{className:"block text-xs text-dark-muted mb-1.5",children:[t,e&&i.jsx("span",{className:"text-red-400 ml-0.5",children:"*"})]}),o]})}const $="w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-sm text-dark-text placeholder-dark-muted/60 focus:outline-none focus:border-accent-blue transition-colors";var V={},ot=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},_e={},T={};let ue;const it=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];T.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};T.getSymbolTotalCodewords=function(e){return it[e]};T.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};T.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ue=e};T.isKanjiModeEnabled=function(){return typeof ue<"u"};T.toSJIS=function(e){return ue(e)};var G={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+o)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,n){if(t.isValid(r))return r;try{return e(r)}catch{return n}}})(G);function De(){this.buffer=[],this.length=0}De.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let o=0;o<e;o++)this.putBit((t>>>e-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var at=De;function q(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}q.prototype.set=function(t,e,o,r){const n=t*this.size+e;this.data[n]=o,r&&(this.reservedBit[n]=!0)};q.prototype.get=function(t,e){return this.data[t*this.size+e]};q.prototype.xor=function(t,e,o){this.data[t*this.size+e]^=o};q.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var lt=q,Ue={};(function(t){const e=T.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,s=e(r),a=s===145?26:Math.ceil((s-13)/(2*n-2))*2,l=[s-7];for(let c=1;c<n-1;c++)l[c]=l[c-1]-a;return l.push(6),l.reverse()},t.getPositions=function(r){const n=[],s=t.getRowColCoords(r),a=s.length;for(let l=0;l<a;l++)for(let c=0;c<a;c++)l===0&&c===0||l===0&&c===a-1||l===a-1&&c===0||n.push([s[l],s[c]]);return n}})(Ue);var Fe={};const ct=T.getSymbolSize,Se=7;Fe.getPositions=function(e){const o=ct(e);return[[0,0],[o-Se,0],[0,o-Se]]};var ze={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const s=n.size;let a=0,l=0,c=0,u=null,d=null;for(let y=0;y<s;y++){l=c=0,u=d=null;for(let g=0;g<s;g++){let h=n.get(y,g);h===u?l++:(l>=5&&(a+=e.N1+(l-5)),u=h,l=1),h=n.get(g,y),h===d?c++:(c>=5&&(a+=e.N1+(c-5)),d=h,c=1)}l>=5&&(a+=e.N1+(l-5)),c>=5&&(a+=e.N1+(c-5))}return a},t.getPenaltyN2=function(n){const s=n.size;let a=0;for(let l=0;l<s-1;l++)for(let c=0;c<s-1;c++){const u=n.get(l,c)+n.get(l,c+1)+n.get(l+1,c)+n.get(l+1,c+1);(u===4||u===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const s=n.size;let a=0,l=0,c=0;for(let u=0;u<s;u++){l=c=0;for(let d=0;d<s;d++)l=l<<1&2047|n.get(u,d),d>=10&&(l===1488||l===93)&&a++,c=c<<1&2047|n.get(d,u),d>=10&&(c===1488||c===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let s=0;const a=n.data.length;for(let c=0;c<a;c++)s+=n.data[c];return Math.abs(Math.ceil(s*100/a/5)-10)*e.N4};function o(r,n,s){switch(r){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(n,s){const a=s.size;for(let l=0;l<a;l++)for(let c=0;c<a;c++)s.isReserved(c,l)||s.xor(c,l,o(n,c,l))},t.getBestMask=function(n,s){const a=Object.keys(t.Patterns).length;let l=0,c=1/0;for(let u=0;u<a;u++){s(u),t.applyMask(u,n);const d=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),d<c&&(c=d,l=u)}return l}})(ze);var W={};const P=G,O=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Q=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];W.getBlocksCount=function(e,o){switch(o){case P.L:return O[(e-1)*4+0];case P.M:return O[(e-1)*4+1];case P.Q:return O[(e-1)*4+2];case P.H:return O[(e-1)*4+3];default:return}};W.getTotalCodewordsCount=function(e,o){switch(o){case P.L:return Q[(e-1)*4+0];case P.M:return Q[(e-1)*4+1];case P.Q:return Q[(e-1)*4+2];case P.H:return Q[(e-1)*4+3];default:return}};var $e={},Z={};const K=new Uint8Array(512),J=new Uint8Array(256);(function(){let e=1;for(let o=0;o<255;o++)K[o]=e,J[e]=o,e<<=1,e&256&&(e^=285);for(let o=255;o<512;o++)K[o]=K[o-255]})();Z.log=function(e){if(e<1)throw new Error("log("+e+")");return J[e]};Z.exp=function(e){return K[e]};Z.mul=function(e,o){return e===0||o===0?0:K[J[e]+J[o]]};(function(t){const e=Z;t.mul=function(r,n){const s=new Uint8Array(r.length+n.length-1);for(let a=0;a<r.length;a++)for(let l=0;l<n.length;l++)s[a+l]^=e.mul(r[a],n[l]);return s},t.mod=function(r,n){let s=new Uint8Array(r);for(;s.length-n.length>=0;){const a=s[0];for(let c=0;c<n.length;c++)s[c]^=e.mul(n[c],a);let l=0;for(;l<s.length&&s[l]===0;)l++;s=s.slice(l)}return s},t.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let s=0;s<r;s++)n=t.mul(n,new Uint8Array([1,e.exp(s)]));return n}})($e);const Ke=$e;function fe(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}fe.prototype.initialize=function(e){this.degree=e,this.genPoly=Ke.generateECPolynomial(this.degree)};fe.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(e.length+this.degree);o.set(e);const r=Ke.mod(o,this.genPoly),n=this.degree-r.length;if(n>0){const s=new Uint8Array(this.degree);return s.set(r,n),s}return r};var dt=fe,He={},R={},he={};he.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var I={};const Ve="[0-9]+",ut="[A-Z $%*+\\-./:]+";let H="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";H=H.replace(/u/g,"\\u");const ft="(?:(?![A-Z0-9 $%*+\\-./:]|"+H+`)(?:.|[\r
2
- ]))+`;I.KANJI=new RegExp(H,"g");I.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");I.BYTE=new RegExp(ft,"g");I.NUMERIC=new RegExp(Ve,"g");I.ALPHANUMERIC=new RegExp(ut,"g");const ht=new RegExp("^"+H+"$"),gt=new RegExp("^"+Ve+"$"),mt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");I.testKanji=function(e){return ht.test(e)};I.testNumeric=function(e){return gt.test(e)};I.testAlphanumeric=function(e){return mt.test(e)};(function(t){const e=he,o=I;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return o.testNumeric(s)?t.NUMERIC:o.testAlphanumeric(s)?t.ALPHANUMERIC:o.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,a){if(t.isValid(s))return s;try{return r(s)}catch{return a}}})(R);(function(t){const e=T,o=W,r=G,n=R,s=he,a=7973,l=e.getBCHDigit(a);function c(g,h,x){for(let C=1;C<=40;C++)if(h<=t.getCapacity(C,x,g))return C}function u(g,h){return n.getCharCountIndicator(g,h)+4}function d(g,h){let x=0;return g.forEach(function(C){const j=u(C.mode,h);x+=j+C.getBitsLength()}),x}function y(g,h){for(let x=1;x<=40;x++)if(d(g,x)<=t.getCapacity(x,h,n.MIXED))return x}t.from=function(h,x){return s.isValid(h)?parseInt(h,10):x},t.getCapacity=function(h,x,C){if(!s.isValid(h))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=n.BYTE);const j=e.getSymbolTotalCodewords(h),p=o.getTotalCodewordsCount(h,x),m=(j-p)*8;if(C===n.MIXED)return m;const b=m-u(C,h);switch(C){case n.NUMERIC:return Math.floor(b/10*3);case n.ALPHANUMERIC:return Math.floor(b/11*2);case n.KANJI:return Math.floor(b/13);case n.BYTE:default:return Math.floor(b/8)}},t.getBestVersionForData=function(h,x){let C;const j=r.from(x,r.M);if(Array.isArray(h)){if(h.length>1)return y(h,j);if(h.length===0)return 1;C=h[0]}else C=h;return c(C.mode,C.getLength(),j)},t.getEncodedBits=function(h){if(!s.isValid(h)||h<7)throw new Error("Invalid QR Code version");let x=h<<12;for(;e.getBCHDigit(x)-l>=0;)x^=a<<e.getBCHDigit(x)-l;return h<<12|x}})(He);var qe={};const ie=T,Oe=1335,xt=21522,Te=ie.getBCHDigit(Oe);qe.getEncodedBits=function(e,o){const r=e.bit<<3|o;let n=r<<10;for(;ie.getBCHDigit(n)-Te>=0;)n^=Oe<<ie.getBCHDigit(n)-Te;return(r<<10|n)^xt};var Qe={};const pt=R;function _(t){this.mode=pt.NUMERIC,this.data=t.toString()}_.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(e){let o,r,n;for(o=0;o+3<=this.data.length;o+=3)r=this.data.substr(o,3),n=parseInt(r,10),e.put(n,10);const s=this.data.length-o;s>0&&(r=this.data.substr(o),n=parseInt(r,10),e.put(n,s*3+1))};var bt=_;const wt=R,te=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function D(t){this.mode=wt.ALPHANUMERIC,this.data=t}D.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(e){let o;for(o=0;o+2<=this.data.length;o+=2){let r=te.indexOf(this.data[o])*45;r+=te.indexOf(this.data[o+1]),e.put(r,11)}this.data.length%2&&e.put(te.indexOf(this.data[o]),6)};var yt=D;const Nt=R;function U(t){this.mode=Nt.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}U.getBitsLength=function(e){return e*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(t){for(let e=0,o=this.data.length;e<o;e++)t.put(this.data[e],8)};var Ct=U;const kt=R,jt=T;function F(t){this.mode=kt.KANJI,this.data=t}F.getBitsLength=function(e){return e*13};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let o=jt.toSJIS(this.data[e]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
- Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),t.put(o,13)}};var Et=F,Je={exports:{}};(function(t){var e={single_source_shortest_paths:function(o,r,n){var s={},a={};a[r]=0;var l=e.PriorityQueue.make();l.push(r,0);for(var c,u,d,y,g,h,x,C,j;!l.empty();){c=l.pop(),u=c.value,y=c.cost,g=o[u]||{};for(d in g)g.hasOwnProperty(d)&&(h=g[d],x=y+h,C=a[d],j=typeof a[d]>"u",(j||C>x)&&(a[d]=x,l.push(d,x),s[d]=u))}if(typeof n<"u"&&typeof a[n]>"u"){var p=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(p)}return s},extract_shortest_path_from_predecessor_list:function(o,r){for(var n=[],s=r;s;)n.push(s),o[s],s=o[s];return n.reverse(),n},find_path:function(o,r,n){var s=e.single_source_shortest_paths(o,r,n);return e.extract_shortest_path_from_predecessor_list(s,n)},PriorityQueue:{make:function(o){var r=e.PriorityQueue,n={},s;o=o||{};for(s in r)r.hasOwnProperty(s)&&(n[s]=r[s]);return n.queue=[],n.sorter=o.sorter||r.default_sorter,n},default_sorter:function(o,r){return o.cost-r.cost},push:function(o,r){var n={value:o,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Je);var vt=Je.exports;(function(t){const e=R,o=bt,r=yt,n=Ct,s=Et,a=I,l=T,c=vt;function u(p){return unescape(encodeURIComponent(p)).length}function d(p,m,b){const f=[];let w;for(;(w=p.exec(b))!==null;)f.push({data:w[0],index:w.index,mode:m,length:w[0].length});return f}function y(p){const m=d(a.NUMERIC,e.NUMERIC,p),b=d(a.ALPHANUMERIC,e.ALPHANUMERIC,p);let f,w;return l.isKanjiModeEnabled()?(f=d(a.BYTE,e.BYTE,p),w=d(a.KANJI,e.KANJI,p)):(f=d(a.BYTE_KANJI,e.BYTE,p),w=[]),m.concat(b,f,w).sort(function(E,S){return E.index-S.index}).map(function(E){return{data:E.data,mode:E.mode,length:E.length}})}function g(p,m){switch(m){case e.NUMERIC:return o.getBitsLength(p);case e.ALPHANUMERIC:return r.getBitsLength(p);case e.KANJI:return s.getBitsLength(p);case e.BYTE:return n.getBitsLength(p)}}function h(p){return p.reduce(function(m,b){const f=m.length-1>=0?m[m.length-1]:null;return f&&f.mode===b.mode?(m[m.length-1].data+=b.data,m):(m.push(b),m)},[])}function x(p){const m=[];for(let b=0;b<p.length;b++){const f=p[b];switch(f.mode){case e.NUMERIC:m.push([f,{data:f.data,mode:e.ALPHANUMERIC,length:f.length},{data:f.data,mode:e.BYTE,length:f.length}]);break;case e.ALPHANUMERIC:m.push([f,{data:f.data,mode:e.BYTE,length:f.length}]);break;case e.KANJI:m.push([f,{data:f.data,mode:e.BYTE,length:u(f.data)}]);break;case e.BYTE:m.push([{data:f.data,mode:e.BYTE,length:u(f.data)}])}}return m}function C(p,m){const b={},f={start:{}};let w=["start"];for(let k=0;k<p.length;k++){const E=p[k],S=[];for(let B=0;B<E.length;B++){const N=E[B],A=""+k+B;S.push(A),b[A]={node:N,lastCount:0},f[A]={};for(let z=0;z<w.length;z++){const M=w[z];b[M]&&b[M].node.mode===N.mode?(f[M][A]=g(b[M].lastCount+N.length,N.mode)-g(b[M].lastCount,N.mode),b[M].lastCount+=N.length):(b[M]&&(b[M].lastCount=N.length),f[M][A]=g(N.length,N.mode)+4+e.getCharCountIndicator(N.mode,m))}}w=S}for(let k=0;k<w.length;k++)f[w[k]].end=0;return{map:f,table:b}}function j(p,m){let b;const f=e.getBestModeForData(p);if(b=e.from(m,f),b!==e.BYTE&&b.bit<f.bit)throw new Error('"'+p+'" cannot be encoded with mode '+e.toString(b)+`.
4
- Suggested mode is: `+e.toString(f));switch(b===e.KANJI&&!l.isKanjiModeEnabled()&&(b=e.BYTE),b){case e.NUMERIC:return new o(p);case e.ALPHANUMERIC:return new r(p);case e.KANJI:return new s(p);case e.BYTE:return new n(p)}}t.fromArray=function(m){return m.reduce(function(b,f){return typeof f=="string"?b.push(j(f,null)):f.data&&b.push(j(f.data,f.mode)),b},[])},t.fromString=function(m,b){const f=y(m,l.isKanjiModeEnabled()),w=x(f),k=C(w,b),E=c.find_path(k.map,"start","end"),S=[];for(let B=1;B<E.length-1;B++)S.push(k.table[E[B]].node);return t.fromArray(h(S))},t.rawSplit=function(m){return t.fromArray(y(m,l.isKanjiModeEnabled()))}})(Qe);const X=T,ne=G,St=at,Tt=lt,At=Ue,Bt=Fe,ae=ze,le=W,It=dt,Y=He,Mt=qe,Pt=R,re=Qe;function Rt(t,e){const o=t.size,r=Bt.getPositions(e);for(let n=0;n<r.length;n++){const s=r[n][0],a=r[n][1];for(let l=-1;l<=7;l++)if(!(s+l<=-1||o<=s+l))for(let c=-1;c<=7;c++)a+c<=-1||o<=a+c||(l>=0&&l<=6&&(c===0||c===6)||c>=0&&c<=6&&(l===0||l===6)||l>=2&&l<=4&&c>=2&&c<=4?t.set(s+l,a+c,!0,!0):t.set(s+l,a+c,!1,!0))}}function Lt(t){const e=t.size;for(let o=8;o<e-8;o++){const r=o%2===0;t.set(o,6,r,!0),t.set(6,o,r,!0)}}function _t(t,e){const o=At.getPositions(e);for(let r=0;r<o.length;r++){const n=o[r][0],s=o[r][1];for(let a=-2;a<=2;a++)for(let l=-2;l<=2;l++)a===-2||a===2||l===-2||l===2||a===0&&l===0?t.set(n+a,s+l,!0,!0):t.set(n+a,s+l,!1,!0)}}function Dt(t,e){const o=t.size,r=Y.getEncodedBits(e);let n,s,a;for(let l=0;l<18;l++)n=Math.floor(l/3),s=l%3+o-8-3,a=(r>>l&1)===1,t.set(n,s,a,!0),t.set(s,n,a,!0)}function se(t,e,o){const r=t.size,n=Mt.getEncodedBits(e,o);let s,a;for(s=0;s<15;s++)a=(n>>s&1)===1,s<6?t.set(s,8,a,!0):s<8?t.set(s+1,8,a,!0):t.set(r-15+s,8,a,!0),s<8?t.set(8,r-s-1,a,!0):s<9?t.set(8,15-s-1+1,a,!0):t.set(8,15-s-1,a,!0);t.set(r-8,8,1,!0)}function Ut(t,e){const o=t.size;let r=-1,n=o-1,s=7,a=0;for(let l=o-1;l>0;l-=2)for(l===6&&l--;;){for(let c=0;c<2;c++)if(!t.isReserved(n,l-c)){let u=!1;a<e.length&&(u=(e[a]>>>s&1)===1),t.set(n,l-c,u),s--,s===-1&&(a++,s=7)}if(n+=r,n<0||o<=n){n-=r,r=-r;break}}}function Ft(t,e,o){const r=new St;o.forEach(function(c){r.put(c.mode.bit,4),r.put(c.getLength(),Pt.getCharCountIndicator(c.mode,t)),c.write(r)});const n=X.getSymbolTotalCodewords(t),s=le.getTotalCodewordsCount(t,e),a=(n-s)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const l=(a-r.getLengthInBits())/8;for(let c=0;c<l;c++)r.put(c%2?17:236,8);return zt(r,t,e)}function zt(t,e,o){const r=X.getSymbolTotalCodewords(e),n=le.getTotalCodewordsCount(e,o),s=r-n,a=le.getBlocksCount(e,o),l=r%a,c=a-l,u=Math.floor(r/a),d=Math.floor(s/a),y=d+1,g=u-d,h=new It(g);let x=0;const C=new Array(a),j=new Array(a);let p=0;const m=new Uint8Array(t.buffer);for(let E=0;E<a;E++){const S=E<c?d:y;C[E]=m.slice(x,x+S),j[E]=h.encode(C[E]),x+=S,p=Math.max(p,S)}const b=new Uint8Array(r);let f=0,w,k;for(w=0;w<p;w++)for(k=0;k<a;k++)w<C[k].length&&(b[f++]=C[k][w]);for(w=0;w<g;w++)for(k=0;k<a;k++)b[f++]=j[k][w];return b}function $t(t,e,o,r){let n;if(Array.isArray(t))n=re.fromArray(t);else if(typeof t=="string"){let u=e;if(!u){const d=re.rawSplit(t);u=Y.getBestVersionForData(d,o)}n=re.fromString(t,u||40)}else throw new Error("Invalid data");const s=Y.getBestVersionForData(n,o);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+s+`.
7
- `);const a=Ft(e,o,n),l=X.getSymbolSize(e),c=new Tt(l);return Rt(c,e),Lt(c),_t(c,e),se(c,o,0),e>=7&&Dt(c,e),Ut(c,a),isNaN(r)&&(r=ae.getBestMask(c,se.bind(null,c,o))),ae.applyMask(r,c),se(c,o,r),{modules:c,version:e,errorCorrectionLevel:o,maskPattern:r,segments:n}}_e.create=function(e,o){if(typeof e>"u"||e==="")throw new Error("No input text");let r=ne.M,n,s;return typeof o<"u"&&(r=ne.from(o.errorCorrectionLevel,ne.M),n=Y.from(o.version),s=ae.from(o.maskPattern),o.toSJISFunc&&X.setToSJISFunction(o.toSJISFunc)),$t(e,n,r,s)};var Ye={},ge={};(function(t){function e(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let r=o.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+o);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const n=parseInt(r.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:s,scale:s?4:a,margin:n,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,n){return n.width&&n.width>=r+n.margin*2?n.width/(r+n.margin*2):n.scale},t.getImageWidth=function(r,n){const s=t.getScale(r,n);return Math.floor((r+n.margin*2)*s)},t.qrToImageData=function(r,n,s){const a=n.modules.size,l=n.modules.data,c=t.getScale(a,s),u=Math.floor((a+s.margin*2)*c),d=s.margin*c,y=[s.color.light,s.color.dark];for(let g=0;g<u;g++)for(let h=0;h<u;h++){let x=(g*u+h)*4,C=s.color.light;if(g>=d&&h>=d&&g<u-d&&h<u-d){const j=Math.floor((g-d)/c),p=Math.floor((h-d)/c);C=y[l[j*a+p]?1:0]}r[x++]=C.r,r[x++]=C.g,r[x++]=C.b,r[x]=C.a}}})(ge);(function(t){const e=ge;function o(n,s,a){n.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,a,l){let c=l,u=a;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),a||(u=r()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),y=u.getContext("2d"),g=y.createImageData(d,d);return e.qrToImageData(g.data,s,c),o(y,u,d),y.putImageData(g,0,0),u},t.renderToDataURL=function(s,a,l){let c=l;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),c||(c={});const u=t.render(s,a,c),d=c.type||"image/png",y=c.rendererOpts||{};return u.toDataURL(d,y.quality)}})(Ye);var Ge={};const Kt=ge;function Ae(t,e){const o=t.a/255,r=e+'="'+t.hex+'"';return o<1?r+" "+e+'-opacity="'+o.toFixed(2).slice(1)+'"':r}function oe(t,e,o){let r=t+e;return typeof o<"u"&&(r+=" "+o),r}function Ht(t,e,o){let r="",n=0,s=!1,a=0;for(let l=0;l<t.length;l++){const c=Math.floor(l%e),u=Math.floor(l/e);!c&&!s&&(s=!0),t[l]?(a++,l>0&&c>0&&t[l-1]||(r+=s?oe("M",c+o,.5+u+o):oe("m",n,0),n=0,s=!1),c+1<e&&t[l+1]||(r+=oe("h",a),a=0)):n++}return r}Ge.render=function(e,o,r){const n=Kt.getOptions(o),s=e.modules.size,a=e.modules.data,l=s+n.margin*2,c=n.color.light.a?"<path "+Ae(n.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",u="<path "+Ae(n.color.dark,"stroke")+' d="'+Ht(a,s,n.margin)+'"/>',d='viewBox="0 0 '+l+" "+l+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+c+u+`</svg>
8
- `;return typeof r=="function"&&r(null,g),g};const Vt=ot,ce=_e,We=Ye,qt=Ge;function me(t,e,o,r,n){const s=[].slice.call(arguments,1),a=s.length,l=typeof s[a-1]=="function";if(!l&&!Vt())throw new Error("Callback required as last argument");if(l){if(a<2)throw new Error("Too few arguments provided");a===2?(n=o,o=e,e=r=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=r,r=void 0):(n=r,r=o,o=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(o=e,e=r=void 0):a===2&&!e.getContext&&(r=o,o=e,e=void 0),new Promise(function(c,u){try{const d=ce.create(o,r);c(t(d,e,r))}catch(d){u(d)}})}try{const c=ce.create(o,r);n(null,t(c,e,r))}catch(c){n(c)}}V.create=ce.create;V.toCanvas=me.bind(null,We.render);V.toDataURL=me.bind(null,We.renderToDataURL);V.toString=me.bind(null,function(t,e,o){return qt.render(t,o)});const Ot=2e3,Be=5;function Qt({channel:t,onClose:e}){const[o,r]=v.useState("loading"),[n,s]=v.useState(null),[a,l]=v.useState(null),[c,u]=v.useState(""),d=v.useRef(null),y=v.useRef(0),g=v.useRef(null),h=v.useRef(!1),x=()=>{g.current&&(clearTimeout(g.current),g.current=null),h.current=!0},C=async f=>{if(d.current)try{await V.toCanvas(d.current,f,{width:240,margin:2,color:{dark:"#000000ff",light:"#ffffffff"}})}catch(w){console.warn("[WechatQr] Canvas QR generation failed, falling back to URL:",w)}},j=async()=>{if(!(h.current||!a))try{const f=await xe.channels.weixin.bindStatus(a),w=(f==null?void 0:f.data)??f,k=(w==null?void 0:w.status)??"";if(y.current=0,k==="confirmed"){r("confirmed"),setTimeout(e,1200);return}if(k==="scaned")r("scanned");else if(k==="expired"){r("expired");return}h.current||(g.current=setTimeout(j,Ot))}catch(f){if(y.current++,console.warn("[WechatQr] poll error ("+y.current+"/"+Be+")",f),y.current>=Be)r("error"),u("轮询状态失败次数过多,请刷新二维码重试");else if(!h.current){const w=Math.min(1e3*Math.pow(2,y.current),1e4);g.current=setTimeout(j,w)}}},p=()=>{x(),h.current=!1,y.current=0,g.current=setTimeout(j,1e3)},m=async()=>{r("loading"),s(null),l(null),u(""),y.current=0;try{const f=await xe.channels.weixin.bind(),w=(f==null?void 0:f.data)??f,k=(w==null?void 0:w.qrcode_img_content)??"",E=(w==null?void 0:w.qrcode)??"";if(!k||!E){r("error"),u(`二维码数据缺失: ${JSON.stringify(w)}`);return}s(k),l(E),await C(k),r("waiting")}catch(f){r("error"),u(String((f==null?void 0:f.message)??f))}},b=()=>{m()};return v.useEffect(()=>(m(),x),[]),v.useEffect(()=>(a&&p(),x),[a]),i.jsx(tt,{isOpen:!0,onClose:e,title:`扫码绑定 · ${t.name}`,size:"sm",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 py-2",children:[i.jsxs("div",{className:"relative w-60 h-60 rounded-lg bg-white flex items-center justify-center overflow-hidden",children:[o==="loading"&&i.jsx("span",{className:"text-gray-400 text-sm",children:"二维码生成中..."}),o!=="error"&&o!=="expired"&&i.jsx("canvas",{ref:d,width:240,height:240,className:`w-full h-full object-contain ${o==="waiting"?"":"opacity-30"}`}),o==="scanned"&&i.jsxs("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-white gap-1",children:[i.jsx("span",{className:"text-2xl",children:"✓"}),i.jsx("span",{className:"text-sm",children:"已扫描,请在手机上确认"})]}),o==="confirmed"&&i.jsxs("div",{className:"absolute inset-0 bg-green-600/90 flex flex-col items-center justify-center text-white gap-1",children:[i.jsx("span",{className:"text-2xl",children:"🎉"}),i.jsx("span",{className:"text-sm",children:"绑定成功"})]}),o==="expired"&&i.jsxs("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center text-white gap-2",children:[i.jsx("span",{className:"text-sm",children:"二维码已失效"}),i.jsx("button",{onClick:b,className:"text-xs bg-green-600 hover:bg-green-500 px-3 py-1 rounded",children:"点击刷新"})]}),o==="error"&&i.jsxs("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center text-red-300 gap-2 px-4 text-center",children:[i.jsx("span",{className:"text-xs",children:c||"未知错误"}),i.jsx("button",{onClick:b,className:"text-xs bg-blue-600 hover:bg-blue-500 px-3 py-1 rounded text-white",children:"重试"})]})]}),i.jsxs("p",{className:"text-sm text-dark-muted text-center",children:[o==="waiting"&&"请使用微信扫描二维码授权机器人",o==="scanned"&&"已扫描,请在手机上确认...",o==="confirmed"&&"机器人已授权并启动",o==="loading"&&"正在连接 iLink 服务...",(o==="expired"||o==="error")&&(o==="expired"?"二维码已失效":"")]}),n&&o==="waiting"&&i.jsxs("button",{onClick:()=>window.open(n,"_blank","width=480,height=600,noopener"),className:"w-full flex items-center justify-center gap-2 text-sm bg-green-600/15 hover:bg-green-600/25 text-green-400 border border-green-600/40 px-3 py-2.5 rounded-lg transition-colors",children:[i.jsx("span",{children:"🔔"})," 在新标签页打开(备用)"]})]})})}function Xt(){const{load:t,loading:e,qrChannel:o,closeQr:r}=de();return v.useEffect(()=>{t()},[]),i.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-dark-bg text-dark-text",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-dark-border shrink-0",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-semibold text-base",children:"频道管理"}),i.jsx("p",{className:"text-xs text-dark-muted mt-0.5",children:"接入微信、飞书、钉钉,用户可通过频道发送任务并实时接收进度与结果"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("button",{onClick:()=>t(),title:"刷新",className:"p-2 rounded-lg text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:i.jsx(et,{className:`w-4 h-4 ${e?"animate-spin":""}`})})})]}),i.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden",children:[i.jsx("div",{className:"w-[260px] shrink-0",children:i.jsx(nt,{})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(rt,{})})]}),o&&i.jsx(Qt,{channel:o,onClose:r})]})}export{Xt as ChannelConfigView};
@@ -1 +0,0 @@
1
- import{j as t}from"./markdown-BAhUvdx-.js";import{r,ak as K,l as W,am as z}from"./icons-B_rAQLge.js";import{e as G,i as U,w as k,o as F,c as Q,j as V,u as q,M as B,A as b,p as X}from"./index-BtIzCXfW.js";import{c as Y,R as Z,e as ee}from"./hookRisk-DECuVQpA.js";import"./react-vendor-meeTdQCf.js";import"./state-Cke1lss7.js";const g=15;function oe({isOpen:x,onCloseModal:j}){const{t:o}=G("hook"),i=U(),p=i.pendingApprovals,E=i.autoMode,R=i.setAutoMode,[w,M]=r.useState(0),[n,_]=r.useState(!1),[m,I]=r.useState(g),l=r.useRef(null),d=r.useRef(!1);r.useEffect(()=>{if(p.length!==0){if(E){p.forEach(s=>{k.send({type:"hook_allow",data:JSON.stringify({approvalId:s.approvalId})})}),i.clearApprovals();return}M(s=>Math.min(s,p.length-1))}},[p.length,E]);const e=p[w]??null,y=p.length>0&&e!==null,H=p.length,T=y?H-w-1:0;r.useEffect(()=>{if(!(!y||n||!x||!e))return I(g),l.current=setInterval(()=>{I(s=>s<=1?(l.current&&clearInterval(l.current),0):s-1)},1e3),()=>{l.current&&clearInterval(l.current)}},[y,n,x,e==null?void 0:e.approvalId]);const c=e?Y(e.toolName,e.askPayload):{level:"MEDIUM",reasonKey:"risk_default"},f=Z[c.level],L=F[c.level==="CRITICAL"?"critical":c.level==="HIGH"?"high":c.level==="LOW"?"low":"medium"],$=e?ee(e.toolName,e.askPayload):null,O=m/g*100,S=m<=5,J=X(g-m),P=r.useCallback((s,a)=>{const N=Q.getState().activeSessionId;N&&V.getState().updateHookApprovalStatus(N,s,a)},[]),u=r.useCallback(s=>{e&&(s&&P(e.approvalId,s),_(!0),setTimeout(()=>{i.removeApproval(e.approvalId),M(0),_(!1),d.current=!1,I(g)},200))},[e==null?void 0:e.approvalId,i,P]),v=r.useCallback(()=>{!e||n||d.current||(d.current=!0,l.current&&clearInterval(l.current),k.send({type:"hook_allow",data:JSON.stringify({approvalId:e.approvalId})}),u("approved"))},[e,u,n]),h=r.useCallback(()=>{!e||n||d.current||(d.current=!0,l.current&&clearInterval(l.current),k.send({type:"hook_deny",data:JSON.stringify({approvalId:e.approvalId})}),u("denied"))},[e,u,n]),A=r.useCallback(()=>{!e||n||d.current||(d.current=!0,l.current&&clearInterval(l.current),i.addToSessionAllowList(e.toolName),k.send({type:"hook_allow",data:JSON.stringify({approvalId:e.approvalId})}),u("approved"))},[e,u,i,n]),C=r.useCallback(()=>{!e||n||d.current||(d.current=!0,l.current&&clearInterval(l.current),R(!0),q.getState().setAuto(!0),k.send({type:"hook_allow",data:JSON.stringify({approvalId:e.approvalId})}),u("approved"))},[e,u,n,R]),D=(e==null?void 0:e.timeoutAction)==="deny"?h:v;return r.useEffect(()=>{m===0&&x&&!n&&e&&D()},[m,x,n,e,D]),r.useEffect(()=>{if(!x)return;const s=a=>{a.key==="Escape"?(a.preventDefault(),a.stopPropagation(),h()):a.key==="Enter"?(a.preventDefault(),v()):a.key==="1"?v():a.key==="2"?h():a.key==="3"?A():a.key==="4"&&C()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[x,v,h,A,C]),!y||!e?null:t.jsx(B,{isOpen:x,onClose:()=>j==null?void 0:j(),title:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(z,{className:"w-4 h-4 text-yellow-400"}),t.jsx("span",{children:o("hookApproval")}),t.jsxs("span",{className:"text-xs text-dark-muted",children:["(",w+1,"/",H,")"]})]}),size:"lg",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg ${f.bg} border ${f.border}`,children:[t.jsxs("span",{className:`px-1.5 py-0.5 rounded text-xs font-bold border ${f.badge}`,children:[f.icon," ",c.level]}),t.jsx("span",{className:"text-xs text-dark-muted",children:o(c.reasonKey)}),t.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[t.jsx(K,{size:12,className:S?"text-accent-red":"text-dark-muted"}),t.jsxs("span",{className:`text-xs font-mono ${S?"text-accent-red animate-pulse":"text-dark-muted"}`,children:[m,"s"]}),t.jsx("div",{className:"w-12 h-1.5 bg-dark-border rounded-full overflow-hidden",children:t.jsx("div",{className:`h-full rounded-full transition-all duration-700 ${S?"bg-accent-red":m<=8?"bg-accent-yellow":"bg-accent-green"}`,style:{width:`${O}%`}})})]})]}),t.jsxs("div",{className:"grid gap-3 md:grid-cols-[1fr_1.2fr]",children:[t.jsxs("div",{className:"bg-dark-bg rounded-lg p-3 border border-dark-border space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-dark-muted shrink-0",children:o("tool")}),t.jsx("code",{className:"text-accent-blue font-mono text-xs bg-dark-surface px-1.5 py-0.5 rounded truncate",children:e.toolName})]}),t.jsx("div",{className:"text-xs text-dark-muted",children:J}),t.jsx("div",{className:"text-xs text-dark-muted",children:L.label}),e.timeoutAction&&t.jsxs("div",{className:`text-xs ${e.timeoutAction==="deny"?"text-accent-red":"text-accent-green"}`,children:["timeout: ",e.timeoutAction==="allow"?"auto-allow":"auto-deny",e.timeoutMs?` (${(e.timeoutMs/1e3).toFixed(0)}s)`:""]})]}),t.jsxs("div",{className:"bg-dark-bg rounded-lg p-3 border border-dark-border space-y-2",children:[$&&t.jsx("pre",{className:"text-xs font-mono text-dark-text whitespace-pre-wrap break-all leading-relaxed max-h-36 overflow-y-auto custom-scrollbar",children:$}),(c.level==="CRITICAL"||c.level==="HIGH")&&t.jsxs("div",{className:`flex items-center gap-1.5 text-xs px-2 py-1.5 rounded ${f.bg} ${f.text}`,children:[t.jsx(W,{size:13}),t.jsx("span",{children:c.level==="CRITICAL"?o("highRiskWarning"):o("mediumRiskConfirm")})]})]})]}),t.jsx("div",{className:"grid gap-2 md:grid-cols-2",children:[b.allow,b.deny,b.allow_session,b.auto].map((s,a)=>{const N=[v,h,A,C][a];return t.jsxs("button",{onClick:N,disabled:n,className:"w-full text-left px-3 py-2 rounded-lg hover:bg-dark-hover transition-colors disabled:opacity-50 border border-transparent hover:border-dark-border/50",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsxs("span",{className:"text-xs text-dark-muted font-mono shrink-0",children:[a+1,"."]}),t.jsx("span",{className:"text-sm text-dark-text",children:s.label}),t.jsxs("span",{className:"text-xs text-dark-muted",children:["[",s.key,"]"]})]}),t.jsx("div",{className:"text-xs text-dark-muted/60 ml-5 mt-0.5",children:a===0?o("optionAllowHint"):a===1?o("optionDenyHint"):a===2?o("optionAllowAlwaysHint",{tool:e.toolName}):o("optionAutoModeHint")})]},s.key)})}),t.jsxs("div",{className:"flex items-center justify-between text-xs text-dark-muted/60",children:[t.jsx("span",{children:o("shortcutHint")}),t.jsx("span",{children:T>0?o("morePending",{n:T}):o("lastItem")})]})]})})}export{oe as HookApprovalModal};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BtIzCXfW.js","assets/markdown-BAhUvdx-.js","assets/icons-B_rAQLge.js","assets/react-vendor-meeTdQCf.js","assets/state-Cke1lss7.js","assets/index-BhVUD1px.css"])))=>i.map(i=>d[i]);
2
- import{a as j,_ as L}from"./index-BtIzCXfW.js";import{j as e}from"./markdown-BAhUvdx-.js";import{r as N,a7 as z,a8 as _,a9 as M,K as U,X as I,aa as $,h as Y,i as G,ab as J,_ as B,$ as W,m as V,a3 as q,D as K,P as X}from"./icons-B_rAQLge.js";import{c as Q}from"./state-Cke1lss7.js";import"./react-vendor-meeTdQCf.js";const P=Q((l,o)=>({rules:[],stats:null,events:[],agents:[],loading:!1,error:null,fieldErrors:null,formOpen:!1,editingRule:null,dryRunResult:null,loadRules:async()=>{const s=await j.hooks.list();s.success&&Array.isArray(s.data)?l({rules:s.data}):s.success&&s.data&&!Array.isArray(s.data)?l({error:"服务端返回的规则数据格式异常"}):l({error:s.error||"Failed to load rules"})},loadStats:async()=>{const s=await j.hooks.stats();s.success&&s.data&&l({stats:s.data})},loadEvents:async()=>{const s=await j.hooks.events();s.success&&Array.isArray(s.data)?l({events:s.data}):s.success&&s.data&&!Array.isArray(s.data)&&l({error:"服务端返回的事件数据格式异常"})},loadAgents:async()=>{const s=await j.hooks.agents();s.success&&Array.isArray(s.data)?l({agents:s.data}):s.success&&s.data&&!Array.isArray(s.data)&&l({error:"服务端返回的Agent数据格式异常"})},loadAll:async()=>{l({loading:!0,error:null});try{await Promise.all([o().loadRules(),o().loadStats(),o().loadEvents(),o().loadAgents()])}catch(s){l({error:String(s)})}finally{l({loading:!1})}},createRule:async s=>{l({fieldErrors:null});const r=await j.hooks.create(s);if(r.success)return await o().loadRules(),await o().loadStats(),l({formOpen:!1,editingRule:null}),!0;if(r.error){l({error:r.error});try{const m=JSON.parse(r.error);m.fieldErrors&&l({fieldErrors:m.fieldErrors})}catch{}}return!1},updateRule:async(s,r)=>{l({fieldErrors:null});const m=await j.hooks.update(s,r);return m.success?(await o().loadRules(),l({formOpen:!1,editingRule:null}),!0):(l({error:m.error||"Update failed"}),!1)},deleteRule:async s=>{const r=await j.hooks.delete(s);return r.success?(await o().loadRules(),await o().loadStats(),!0):(l({error:r.error||"Delete failed"}),!1)},batchDelete:async s=>{const r=await j.hooks.batchDelete(s);return r.success?(await o().loadRules(),await o().loadStats(),!0):(l({error:r.error||"Batch delete failed"}),!1)},toggleRule:async(s,r)=>(await j.hooks.toggle(s,r)).success?(l(v=>({rules:v.rules.map(d=>d.name===s?{...d,enabled:r}:d)})),!0):(await o().loadRules(),!1),batchToggle:async(s,r)=>(await j.hooks.batchToggle(s,r)).success?(l(v=>({rules:v.rules.map(d=>s.includes(d.name)?{...d,enabled:r}:d)})),!0):(await o().loadRules(),!1),dryRun:async s=>{const r=await j.hooks.dryRun(s);return r.success&&r.data?(l({dryRunResult:r.data}),r.data):(l({error:r.error||"Dry-run failed"}),null)},openForm:s=>l({formOpen:!0,editingRule:s||null,dryRunResult:null,fieldErrors:null}),closeForm:()=>l({formOpen:!1,editingRule:null,dryRunResult:null,fieldErrors:null}),setDryRunResult:s=>l({dryRunResult:s}),clearError:()=>l({error:null}),clearFieldErrors:()=>l({fieldErrors:null})})),Z={SYSTEM:"bg-accent-red/15 text-accent-red",SECURITY:"bg-accent-orange/15 text-accent-orange",PROJECT:"bg-accent-blue/15 text-accent-blue",USER:"bg-accent-green/15 text-accent-green",PLUGIN:"bg-accent-purple/15 text-accent-purple"},ee={SHELL:"bg-accent-yellow/15 text-accent-yellow",HTTP:"bg-accent-cyan/15 text-accent-cyan",PROMPT:"bg-accent-purple/15 text-accent-purple",AGENT:"bg-accent-blue/15 text-accent-blue"};function te({rules:l,onEdit:o}){const{toggleRule:s,deleteRule:r,batchDelete:m,batchToggle:v}=P(),[d,h]=N.useState(new Set),[T,k]=N.useState(!1),y=Array.isArray(l)?l:[];if(y.length===0)return e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 py-16 text-dark-muted",children:[e.jsx("div",{className:"text-4xl opacity-60",children:"🪝"}),e.jsx("p",{className:"text-sm",children:"暂无 Hook 规则"}),e.jsx("p",{className:"text-xs text-dark-muted/70",children:'点击右上角"新增规则"创建第一个 Hook'})]});const S=t=>{const i=new Set(d);i.has(t)?i.delete(t):i.add(t),h(i),k(i.size===y.length)},f=()=>{T?(h(new Set),k(!1)):(h(new Set(y.map(t=>t.name))),k(!0))},x=()=>{d.size!==0&&confirm(`确认删除 ${d.size} 条规则?`)&&(m(Array.from(d)),h(new Set),k(!1))},p=t=>{d.size!==0&&(v(Array.from(d),t),h(new Set),k(!1))};return e.jsxs("div",{className:"flex flex-1 flex-col min-h-0",children:[d.size>0&&e.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded-lg border border-accent-blue/30 bg-accent-blue/5 px-3 py-1.5 text-sm",children:[e.jsxs("span",{className:"text-dark-muted",children:["已选 ",d.size," 项"]}),e.jsx("button",{onClick:()=>p(!0),className:"rounded bg-accent-green/15 px-2 py-0.5 text-accent-green transition-colors hover:bg-accent-green/25",children:"全部启用"}),e.jsx("button",{onClick:()=>p(!1),className:"rounded bg-dark-hover px-2 py-0.5 text-dark-text transition-colors hover:bg-dark-border",children:"全部禁用"}),e.jsx("button",{onClick:x,className:"rounded bg-accent-red/15 px-2 py-0.5 text-accent-red transition-colors hover:bg-accent-red/25",children:"删除"})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar rounded-xl border border-dark-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"sticky top-0 bg-dark-hover text-dark-muted",children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-8 p-2.5",children:e.jsx("button",{onClick:f,children:T?e.jsx(z,{size:14}):e.jsx(_,{size:14})})}),e.jsx("th",{className:"p-2.5 text-left font-medium",children:"名称"}),e.jsx("th",{className:"p-2.5 text-left font-medium",children:"事件"}),e.jsx("th",{className:"p-2.5 text-left font-medium",children:"类型"}),e.jsx("th",{className:"p-2.5 text-left font-medium",children:"优先级"}),e.jsx("th",{className:"p-2.5 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-2.5 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-dark-border",children:y.map(t=>e.jsxs("tr",{className:"transition-colors hover:bg-dark-hover/50",children:[e.jsx("td",{className:"p-2.5",children:e.jsx("button",{onClick:()=>S(t.name),children:d.has(t.name)?e.jsx(z,{size:14,className:"text-accent-blue"}):e.jsx(_,{size:14,className:"text-dark-muted"})})}),e.jsxs("td",{className:"p-2.5",children:[e.jsx("div",{className:"font-medium text-dark-text",children:t.name}),t.description&&e.jsx("div",{className:"mt-0.5 max-w-[220px] truncate text-xs text-dark-muted",children:t.description})]}),e.jsx("td",{className:"p-2.5",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[Array.isArray(t.events)&&t.events.slice(0,3).map(i=>e.jsx("span",{className:"rounded bg-dark-hover px-1.5 py-0.5 text-xs text-dark-text",children:i},i)),Array.isArray(t.events)&&t.events.length>3&&e.jsxs("span",{className:"px-1 py-0.5 text-xs text-dark-muted",children:["+",t.events.length-3]})]})}),e.jsx("td",{className:"p-2.5",children:e.jsx("span",{className:`rounded px-1.5 py-0.5 text-xs font-medium ${ee[t.implementationType]||"bg-dark-hover text-dark-muted"}`,children:t.implementationType})}),e.jsx("td",{className:"p-2.5",children:e.jsx("span",{className:`rounded px-1.5 py-0.5 text-xs font-medium ${Z[t.priority]||"bg-dark-hover text-dark-muted"}`,children:t.priority})}),e.jsx("td",{className:"p-2.5",children:e.jsx("button",{onClick:()=>s(t.name,!t.enabled),className:`relative h-5 w-9 rounded-full transition-colors ${t.enabled?"bg-accent-green":"bg-dark-border"}`,title:t.enabled?"点击禁用":"点击启用",children:e.jsx("span",{className:`absolute top-0.5 block h-3.5 w-3.5 rounded-full bg-white transition-all ${t.enabled?"left-[18px]":"left-[2px]"}`})})}),e.jsx("td",{className:"p-2.5",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx("button",{onClick:()=>o(t),className:"rounded p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-accent-blue",title:"编辑",children:e.jsx(M,{size:14})}),e.jsx("button",{onClick:()=>{confirm(`删除规则 "${t.name}"?`)&&r(t.name)},className:"rounded p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-accent-red",title:"删除",children:e.jsx(U,{size:14})})]})})]},t.name))})]})})]})}const ae={name:"",description:"",events:[],implementationType:"SHELL",command:"",url:"",promptTemplate:"",agentName:"",priority:"USER",tools:[],matcherToolNamePattern:"",matcherFromState:"",matcherToState:"",timeoutMs:3e4,enabled:!0,failOpen:!0,scope:"project"},se=[{value:"SHELL",label:"Shell 脚本",desc:"执行外部脚本,stdin 接收 JSON,stdout 返回决策"},{value:"HTTP",label:"HTTP 端点",desc:"POST JSON 到外部端点"},{value:"PROMPT",label:"LLM Prompt",desc:"发送单轮 Prompt 给 LLM 做风险评估"},{value:"AGENT",label:"AI Agent",desc:"启动只读子代理做深度调查"}],re=[{value:"SYSTEM",label:"SYSTEM (100)"},{value:"SECURITY",label:"SECURITY (80)"},{value:"PROJECT",label:"PROJECT (60)"},{value:"USER",label:"USER (40)"},{value:"PLUGIN",label:"PLUGIN (20)"}],b=l=>`w-full rounded-lg border bg-dark-bg px-3 py-2 text-sm text-dark-text placeholder-dark-muted/60 transition-colors focus:outline-none focus:ring-2 ${l?"border-accent-red focus:border-accent-red focus:ring-accent-red/20":"border-dark-border focus:border-accent-blue focus:ring-accent-blue/20"}`,g="mb-1 block text-xs font-medium text-dark-muted";function le({events:l,agents:o}){const{editingRule:s,fieldErrors:r,dryRunResult:m,createRule:v,updateRule:d,closeForm:h,dryRun:T,setDryRunResult:k,clearFieldErrors:y}=P(),S=Array.isArray(l)?l:[],f=Array.isArray(o)?o:[],[x,p]=N.useState(0),[t,i]=N.useState(ae),[w,C]=N.useState("");N.useEffect(()=>{var a,n,c;s&&i({name:s.name,description:s.description||"",events:s.events,implementationType:s.implementationType,command:s.command||"",url:s.url||"",promptTemplate:s.promptTemplate||"",agentName:s.agentName||"",priority:s.priority,tools:s.tools||[],matcherToolNamePattern:((a=s.matchers)==null?void 0:a.toolNamePattern)||"",matcherFromState:((n=s.matchers)==null?void 0:n.fromState)||"",matcherToState:((c=s.matchers)==null?void 0:c.toState)||"",timeoutMs:s.timeoutMs,enabled:s.enabled,failOpen:s.failOpen,scope:s.scope||"project"})},[s]);const u=(a,n)=>{i(c=>({...c,[a]:n})),y()},O=a=>{i(n=>({...n,events:n.events.includes(a)?n.events.filter(c=>c!==a):[...n.events,a]}))},A=a=>{const n=a.every(c=>t.events.includes(c));i(n?c=>({...c,events:c.events.filter(R=>!a.includes(R))}):c=>({...c,events:[...new Set([...c.events,...a])]}))},E=async()=>{const a={};t.matcherToolNamePattern&&(a.toolNamePattern=t.matcherToolNamePattern),t.matcherFromState&&(a.fromState=t.matcherFromState),t.matcherToState&&(a.toState=t.matcherToState);const c={...{...t,tools:t.tools.length>0?t.tools:[]}};c.matchers=a,delete c.matcherToolNamePattern,delete c.matcherFromState,delete c.matcherToState,s?await d(s.name,c):await v(c)},D=async()=>{k(null);const a={};t.matcherToolNamePattern&&(a.toolNamePattern=t.matcherToolNamePattern),await T({hook:{name:t.name||"dry-run",description:t.description,events:t.events,implementationType:t.implementationType,command:t.command,url:t.url,promptTemplate:t.promptTemplate,agentName:t.agentName,priority:t.priority,tools:t.tools,matchers:a,timeoutMs:t.timeoutMs,enabled:!0,failOpen:t.failOpen,scope:t.scope},eventType:t.events[0]||"PRE_TOOL_USE",toolName:"",toolInput:""})},F=w?S.map(a=>({...a,events:Array.isArray(a.events)?a.events.filter(n=>n.name.toLowerCase().includes(w.toLowerCase())||n.summary.includes(w)):[]})).filter(a=>a.events.length>0):S,H=[{title:"基本信息",desc:"名称、描述、事件"},{title:"实现配置",desc:"执行方式与参数"},{title:"高级选项",desc:"优先级、过滤、测试"}];return e.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:h}),e.jsxs("div",{className:"relative flex h-full w-[560px] flex-col border-l border-dark-border bg-dark-bg shadow-2xl animate-slide-in-right",children:[e.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-dark-border px-4 py-3.5",children:[e.jsx("h3",{className:"text-base font-semibold text-dark-text",children:s?`编辑: ${s.name}`:"添加 Hook 规则"}),e.jsx("button",{onClick:h,className:"rounded-lg p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",children:e.jsx(I,{size:18})})]}),e.jsx("div",{className:"flex flex-shrink-0 border-b border-dark-border",children:H.map((a,n)=>{const c=n===x,R=n<x;return e.jsxs("button",{onClick:()=>p(n),className:`relative flex-1 border-b-2 px-2 py-2.5 text-center text-xs transition-colors ${c?"border-accent-blue bg-accent-blue/5 text-accent-blue":R?"border-transparent text-dark-text":"border-transparent text-dark-muted hover:text-dark-text"}`,children:[e.jsx("span",{className:`mr-1 inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] ${c?"bg-accent-blue text-white":R?"bg-accent-green text-white":"bg-dark-hover text-dark-muted"}`,children:R?"✓":n+1}),e.jsx("span",{className:"font-medium",children:a.title})]},a.title)})}),e.jsxs("div",{className:"flex-1 min-h-0 space-y-4 overflow-auto custom-scrollbar p-4",children:[r&&Object.keys(r).length>0&&e.jsx("div",{className:"rounded-lg border border-accent-red/40 bg-accent-red/10 p-2.5 text-xs text-accent-red",children:Object.entries(r).map(([a,n])=>e.jsxs("div",{children:[e.jsxs("strong",{children:[a,":"]})," ",n]},a))}),x===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:g,children:"名称 *"}),e.jsx("input",{value:t.name,onChange:a=>u("name",a.target.value),placeholder:"my-custom-hook",className:b(r==null?void 0:r.name)})]}),e.jsxs("div",{children:[e.jsx("label",{className:g,children:"描述"}),e.jsx("textarea",{value:t.description,onChange:a=>u("description",a.target.value),placeholder:"这个 Hook 的作用...",rows:2,className:b()})]}),e.jsxs("div",{children:[e.jsx("label",{className:g,children:"Scope"}),e.jsxs("select",{value:t.scope,onChange:a=>u("scope",a.target.value),className:b(),children:[e.jsx("option",{value:"project",children:"project (.agent/hooks.json)"}),e.jsx("option",{value:"user",children:"user (~/.agent/hooks.json)"}),e.jsx("option",{value:"local",children:"local (.agent/hooks.local.json)"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[e.jsx("label",{className:"text-xs font-medium text-dark-muted",children:"事件 *"}),e.jsxs("span",{className:"text-xs text-accent-blue",children:[t.events.length," 已选"]})]}),e.jsx("input",{value:w,onChange:a=>C(a.target.value),placeholder:"搜索事件...",className:b()+" mb-2"}),e.jsx("div",{className:"max-h-[280px] space-y-2 overflow-auto custom-scrollbar rounded-lg border border-dark-border bg-dark-surface p-2",children:F.map(a=>e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>A(a.events.map(n=>n.name)),className:"mb-1 text-xs font-medium text-dark-muted transition-colors hover:text-dark-text",children:[a.category," — 全选/取消"]}),a.events.map(n=>{const c=t.events.includes(n.name);return e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-1 py-1 transition-colors hover:bg-dark-hover",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:()=>O(n.name),className:"h-3.5 w-3.5 accent-accent-blue"}),e.jsx("span",{className:"text-xs text-dark-text",children:n.name}),e.jsxs("span",{className:"truncate text-xs text-dark-muted",children:["— ",n.summary]})]},n.name)})]},a.category))})]})]}),x===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:g,children:"实现类型 *"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:se.map(a=>{const n=t.implementationType===a.value;return e.jsxs("button",{onClick:()=>u("implementationType",a.value),className:`rounded-lg border p-3 text-left transition-colors ${n?"border-accent-blue bg-accent-blue/10 ring-1 ring-accent-blue/30":"border-dark-border bg-dark-surface hover:bg-dark-hover"}`,children:[e.jsx("div",{className:`text-sm font-medium ${n?"text-accent-blue":"text-dark-text"}`,children:a.label}),e.jsx("div",{className:"mt-1 text-xs text-dark-muted",children:a.desc})]},a.value)})})]}),t.implementationType==="SHELL"&&e.jsxs("div",{children:[e.jsx("label",{className:g,children:"命令 *"}),e.jsx("input",{value:t.command,onChange:a=>u("command",a.target.value),placeholder:"python3 .agent/hooks/audit.py",className:`font-mono ${b(r==null?void 0:r.command)}`})]}),t.implementationType==="HTTP"&&e.jsxs("div",{children:[e.jsx("label",{className:g,children:"URL *"}),e.jsx("input",{value:t.url,onChange:a=>u("url",a.target.value),placeholder:"https://example.com/hooks/audit",className:b(r==null?void 0:r.url)})]}),t.implementationType==="PROMPT"&&e.jsxs("div",{children:[e.jsx("label",{className:g,children:"Prompt 模板 *"}),e.jsx("textarea",{value:t.promptTemplate,onChange:a=>u("promptTemplate",a.target.value),placeholder:"你是一个安全审计专家,请分析以下工具调用...",rows:5,className:`font-mono ${b(r==null?void 0:r.promptTemplate)}`})]}),t.implementationType==="AGENT"&&e.jsxs("div",{children:[e.jsx("label",{className:g,children:"Agent *"}),e.jsxs("select",{value:t.agentName,onChange:a=>u("agentName",a.target.value),className:b(r==null?void 0:r.agentName),children:[e.jsx("option",{value:"",children:"选择 Agent..."}),f.map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.description,")"]},a.id))]}),e.jsx("p",{className:"mt-1 text-xs text-dark-muted",children:"Agent 将以只读模式运行(Read/Grep/Glob),不会修改文件"})]})]}),x===2&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:g,children:"优先级"}),e.jsx("select",{value:t.priority,onChange:a=>u("priority",a.target.value),className:b(),children:re.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:g,children:"超时 (ms)"}),e.jsx("input",{type:"number",value:t.timeoutMs,onChange:a=>u("timeoutMs",parseInt(a.target.value)||3e4),min:100,max:3e5,step:1e3,className:b()})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-dark-text",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:a=>u("enabled",a.target.checked),className:"h-3.5 w-3.5 accent-accent-blue"}),"启用"]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-dark-text",children:[e.jsx("input",{type:"checkbox",checked:t.failOpen,onChange:a=>u("failOpen",a.target.checked),className:"h-3.5 w-3.5 accent-accent-blue"}),"Fail-open(超时放行)"]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:g,children:"工具过滤(正则,可选)"}),e.jsx("input",{value:t.matcherToolNamePattern,onChange:a=>u("matcherToolNamePattern",a.target.value),placeholder:"Bash.*|FileWrite.*",className:`font-mono ${b()}`})]}),t.events.some(a=>a.includes("STATE"))&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:g,children:"From State"}),e.jsx("input",{value:t.matcherFromState,onChange:a=>u("matcherFromState",a.target.value),className:b()})]}),e.jsxs("div",{children:[e.jsx("label",{className:g,children:"To State"}),e.jsx("input",{value:t.matcherToState,onChange:a=>u("matcherToState",a.target.value),className:b()})]})]}),m&&e.jsxs("div",{className:"rounded-lg border border-dark-border bg-dark-surface p-3",children:[e.jsx("div",{className:"mb-2 text-xs font-medium text-dark-text",children:"Dry-run 结果"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-dark-muted",children:"决策: "}),e.jsx("span",{className:m.decision==="ALLOW"?"text-accent-green":m.decision==="DENY"?"text-accent-red":"text-accent-yellow",children:m.decision})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-dark-muted",children:"原因: "}),e.jsx("span",{className:"text-dark-text",children:m.reason})]}),m.contextOutput&&e.jsxs("div",{children:[e.jsx("span",{className:"text-dark-muted",children:"输出: "}),e.jsx("span",{className:"text-dark-text",children:m.contextOutput})]})]})]}),e.jsxs("button",{onClick:D,className:"inline-flex items-center gap-1.5 rounded-lg border border-dark-border bg-dark-surface px-3 py-1.5 text-xs text-dark-text transition-colors hover:bg-dark-hover",children:[e.jsx($,{size:12})," 试运行 (Dry Run)"]})]})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-t border-dark-border px-4 py-3",children:[e.jsx("div",{className:"flex gap-2",children:x>0&&e.jsxs("button",{onClick:()=>p(x-1),className:"inline-flex items-center gap-1 rounded-lg border border-dark-border bg-dark-surface px-3 py-1.5 text-sm text-dark-text transition-colors hover:bg-dark-hover",children:[e.jsx(Y,{size:14})," 上一步"]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:h,className:"rounded-lg border border-dark-border bg-dark-surface px-4 py-1.5 text-sm text-dark-text transition-colors hover:bg-dark-hover",children:"取消"}),x<2?e.jsxs("button",{onClick:()=>p(x+1),className:"inline-flex items-center gap-1 rounded-lg bg-accent-blue px-4 py-1.5 text-sm text-white transition-colors hover:bg-accent-blue/90",children:["下一步 ",e.jsx(G,{size:14})]}):e.jsx("button",{onClick:E,className:"rounded-lg bg-accent-blue px-4 py-1.5 text-sm text-white transition-colors hover:bg-accent-blue/90",children:s?"保存修改":"创建规则"})]})]})]})]})}function ne({stats:l}){if(!l)return null;const o=[{label:"总规则数",value:l.totalHooks,icon:J,iconWrap:"bg-accent-blue/15 text-accent-blue"},{label:"已启用",value:l.enabledCount,icon:B,iconWrap:"bg-accent-green/15 text-accent-green"},{label:"已禁用",value:l.disabledCount,icon:W,iconWrap:"bg-dark-hover text-dark-muted"}];return e.jsx("div",{className:"grid grid-cols-3 gap-3",children:o.map(s=>{const r=s.icon;return e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-dark-border bg-dark-surface px-4 py-3",children:[e.jsx("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg ${s.iconWrap}`,children:e.jsx(r,{size:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xl font-bold text-dark-text",children:s.value}),e.jsx("div",{className:"text-xs text-dark-muted",children:s.label})]})]},s.label)})})}function xe(){const{rules:l,stats:o,events:s,agents:r,loading:m,error:v,formOpen:d,loadAll:h,openForm:T,clearError:k}=P();N.useEffect(()=>{h()},[]);const y=N.useCallback(async()=>{const{api:f}=await L(async()=>{const{api:p}=await import("./index-BtIzCXfW.js").then(t=>t.v);return{api:p}},__vite__mapDeps([0,1,2,3,4,5])),x=await f.hooks.export();if(x.success&&x.data){const p=new Blob([JSON.stringify(x.data,null,2)],{type:"application/json"}),t=URL.createObjectURL(p),i=document.createElement("a");i.href=t,i.download="hooks-export.json",i.click(),URL.revokeObjectURL(t)}},[]),S=N.useCallback(()=>{const f=document.createElement("input");f.type="file",f.accept=".json",f.onchange=async x=>{var i;const p=(i=x.target.files)==null?void 0:i[0];if(!p)return;const t=await p.text();try{const w=JSON.parse(t),{api:C}=await L(async()=>{const{api:A}=await import("./index-BtIzCXfW.js").then(E=>E.v);return{api:A}},__vite__mapDeps([0,1,2,3,4,5])),u=confirm(`合并到现有配置吗?
3
- "确定"=合并 / "取消"=替换`)?"merge":"replace";(await C.hooks.import({...w,mergeMode:u})).success&&h()}catch(w){console.error("Import failed:",w)}},f.click()},[h]);return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-dark-bg text-dark-text",children:[e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-dark-border px-6 py-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-dark-text",children:"Hook 配置"}),e.jsx("p",{className:"mt-0.5 text-xs text-dark-muted",children:"在工具执行、任务流转等生命周期事件上挂载拦截器,实现审批与自定义逻辑"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:h,title:"刷新",className:"rounded-lg p-2 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",children:e.jsx(V,{size:16,className:m?"animate-spin":""})}),e.jsxs("button",{onClick:S,className:"inline-flex items-center gap-1.5 rounded-lg border border-dark-border bg-dark-surface px-3 py-2 text-sm text-dark-text transition-colors hover:bg-dark-hover",children:[e.jsx(q,{size:14}),"导入"]}),e.jsxs("button",{onClick:y,className:"inline-flex items-center gap-1.5 rounded-lg border border-dark-border bg-dark-surface px-3 py-2 text-sm text-dark-text transition-colors hover:bg-dark-hover",children:[e.jsx(K,{size:14}),"导出"]}),e.jsxs("button",{onClick:()=>T(),className:"inline-flex items-center gap-1.5 rounded-lg bg-accent-blue px-3 py-2 text-sm text-white transition-colors hover:bg-accent-blue/90",children:[e.jsx(X,{size:14}),"新增规则"]})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar px-6 py-4",children:[v&&e.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-accent-red/40 bg-accent-red/10 px-4 py-2 text-sm text-accent-red",children:[e.jsx("span",{children:v}),e.jsx("button",{onClick:k,className:"text-accent-red/70 transition-colors hover:text-accent-red",children:e.jsx(I,{size:16})})]}),e.jsx(ne,{stats:o}),e.jsxs("section",{className:"mt-4 min-w-0 rounded-xl border border-dark-border bg-dark-surface p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-dark-text",children:"规则列表"}),e.jsxs("span",{className:"text-xs text-dark-muted",children:[l.length," 条"]})]}),m&&l.length===0?e.jsx("div",{className:"flex h-[520px] items-center justify-center text-dark-muted",children:"加载中..."}):e.jsx("div",{className:"min-h-[520px]",children:e.jsx(te,{rules:l,onEdit:f=>T(f)})})]})]}),d&&e.jsx(le,{events:s,agents:r})]})}export{xe as HookConfigView};
@@ -1 +0,0 @@
1
- import{j as t}from"./markdown-BAhUvdx-.js";import{r as a,m as ae,C as Ye,P as Pe,J as Je,n as re,K as Te,N as Qe,O as Xe,w as Ze,u as et,Q as tt,U as st,D as at,p as rt,V as Se,l as lt,Y as nt}from"./icons-B_rAQLge.js";import"./Toast-DowV4l0w.js";import{a as x,t as C,M as Ke}from"./index-BtIzCXfW.js";import"./react-vendor-meeTdQCf.js";import"./state-Cke1lss7.js";function ot(){const[f,y]=a.useState([]),[k,h]=a.useState("1.0"),[L,d]=a.useState(!0),[K,q]=a.useState(!0),[H,I]=a.useState(null),j=a.useCallback(async()=>{q(!0),I(null);try{const g=await x.providers.presets();g.success&&g.data?(y(Array.isArray(g.data.providers)?g.data.providers:[]),h(g.data.version||"1.0"),d(g.data.customSupported!==!1)):I(g.error||"获取 Provider 列表失败")}catch(g){I(g instanceof Error?g.message:"未知错误")}finally{q(!1)}},[]);return a.useEffect(()=>{j()},[j]),{presets:f,loading:K,error:H,version:k,customSupported:L,reload:j}}const _={provider:"",modelId:"",modelName:"",baseUrl:"",apiKeys:"",apiType:"openai-completions",temperature:1,maxTokens:32768,contextWindow:1e6},ct={providerKey:"",apiKey:"",modelIds:"",baseUrl:"",apiType:"openai-completions",setDefault:!1};function bt(){var Ne,we;const{presets:f,loading:y,reload:k}=ot(),[h,L]=a.useState([]),[d,K]=a.useState(null),[q,H]=a.useState(!0),[I,j]=a.useState(null),[g,ne]=a.useState(null),[Me,M]=a.useState(!1),[P,O]=a.useState(null),[n,m]=a.useState(_),[oe,ce]=a.useState(!1),[de,T]=a.useState(null),[o,De]=a.useState(null),[Ae,D]=a.useState(!1),[ie,W]=a.useState("select"),[N,A]=a.useState(null),[i,w]=a.useState(ct),[ue,xe]=a.useState(!1),[pe,S]=a.useState(null),[me,X]=a.useState(!1),[Z,be]=a.useState(!1),[he,ge]=a.useState({}),[ee,fe]=a.useState(!1),[te,G]=a.useState([]),[$,E]=a.useState(new Set),[ve,U]=a.useState(null),[Y,se]=a.useState(""),B=a.useCallback(async()=>{try{const e=await x.config.provider.get();e.success&&e.data&&De(e.data)}catch{}},[]),b=a.useCallback(async()=>{H(!0),j(null);try{const[e,s]=await Promise.all([x.models.list(),x.system.status()]);if(await B(),e.success&&e.data&&Array.isArray(e.data.models)&&L(e.data.models),s.success&&s.data){const r=s.data.models||{total:0,online:0,offline:0};K({overallStatus:r.offline===0?"healthy":r.online>0?"degraded":"unhealthy",healthRate:r.total>0?r.online/r.total:0,healthyInstances:r.online,totalInstances:r.total,totalRequests:0})}}catch{j("加载模型失败")}finally{H(!1)}},[B]);a.useEffect(()=>{b()},[b]);const z=a.useCallback(e=>`${e.provider}:${e.id}`,[]),$e=a.useCallback(e=>he[z(e)]||{inputTokens:0,outputTokens:0},[z,he]),ye=a.useCallback((e,s,r)=>{const l=z(e);ge(u=>{var c,p;return{...u,[l]:{inputTokens:s==="inputTokens"?r:((c=u[l])==null?void 0:c.inputTokens)||0,outputTokens:s==="outputTokens"?r:((p=u[l])==null?void 0:p.outputTokens)||0}}})},[z]),Ee=a.useCallback(e=>{ge(s=>({...s,[z(e)]:{inputTokens:0,outputTokens:0}}))},[z]),V=a.useMemo(()=>{const e=[...f];return e.find(s=>s.key==="custom")||e.push({key:"custom",name:"Custom",baseUrl:"",apiType:"openai-completions",defaultModel:"",isCustom:!0}),e},[f]),ke=a.useCallback(e=>{var c,p;const s=(c=o==null?void 0:o.providers)==null?void 0:c[e.key],r=h.filter(R=>R.provider===e.key).map(R=>R.id),l=((p=e.models)==null?void 0:p.slice(0,3).join(", "))||e.defaultModel,u=r.length>0?r.join(", "):l;A(e.key),w({providerKey:e.key,apiKey:"",modelIds:u,baseUrl:(s==null?void 0:s.baseUrl)||e.baseUrl,apiType:(s==null?void 0:s.apiType)||e.apiType,setDefault:(o==null?void 0:o.defaultProvider)!==e.key}),W("form"),D(!0),S(null),X(!1),G([]),E(new Set),U(null),se("")},[h,o]),je=a.useCallback(()=>{A("custom"),w({providerKey:"",apiKey:"",modelIds:"",baseUrl:"",apiType:"openai-completions",setDefault:!(o!=null&&o.configured)}),W("form"),D(!0),S(null),X(!1),G([]),E(new Set),U(null),se("")},[o]),Ue=a.useCallback(async()=>{var s;const e=i.baseUrl;if(!e){U("请先填写 Base URL");return}fe(!0),U(null),G([]),E(new Set);try{const r=i.apiKey.replace(/[^\x00-\xFF]/g,"");r!==i.apiKey&&C.warning("API Key 包含非法字符,已自动过滤");const l=await x.models.fetch(e,r);if(l.success&&((s=l.data)!=null&&s.models)){G(l.data.models);const u=new Set(i.modelIds.split(",").map(c=>c.trim()).filter(Boolean));E(u),C.success(`获取到 ${l.data.models.length} 个模型`)}else U(l.error||"获取模型列表失败,请检查 Base URL 和 API Key")}catch(r){U(r instanceof Error?r.message:"请求失败")}finally{fe(!1)}},[i.baseUrl,i.apiKey,i.modelIds]),ze=a.useCallback(e=>{E(s=>{const r=new Set(s);return r.has(e)?r.delete(e):r.add(e),r})},[]),Fe=a.useCallback(()=>{const e=Array.from($).join(", ");w(s=>({...s,modelIds:e}))},[$]),Re=async e=>{const s=h.find(c=>c.id===e);if(!s)return;const r=s.enabled!==!1,l=s.name||e,u=c=>r&&/default model/i.test(c);try{const c=await x.models.toggle(s.provider,e);if(c.success){await b();return}const p=c.error||"";u(p)?C.error(`“${l}” 是默认模型,无法直接禁用。请先在「Provider 配置」中更换默认模型,再进行禁用。`):C.error(p||"操作失败,请重试")}catch(c){const p=c instanceof Error?c.message:"";u(p)?C.error(`“${l}” 是默认模型,无法直接禁用。请先在「Provider 配置」中更换默认模型,再进行禁用。`):C.error(p||"操作失败,请重试")}},Le=async e=>{ne(e);try{await x.models.test(e),await b()}finally{ne(null)}},Oe=async(e,s)=>{if(confirm(`确定要删除模型 "${s}" 吗?此操作不可撤销。`))try{(await x.models.delete(e,s)).success&&await b()}catch{}},We=e=>{O({provider:e.provider,modelId:e.id}),m({provider:e.provider,modelId:e.id,modelName:e.name,baseUrl:"",apiKeys:"",apiType:e.apiType||"openai-completions",temperature:e.temperature??1,maxTokens:e.maxTokens??32768,contextWindow:e.contextWindow??1e6}),T(null),M(!0)},Ge=async()=>{var Ce;const e=V.find(v=>v.key===N)||null,s=N==="custom"?i.providerKey.trim():(e==null?void 0:e.key)||"";if(!s){S("请先输入 Provider 名称");return}if(!i.apiKey.trim()){S("请输入 API Key");return}const r=e||{baseUrl:"",apiType:"openai-completions",defaultModel:""},l=(Ce=o==null?void 0:o.providers)==null?void 0:Ce[s],c=i.apiKey.trim()||(l!=null&&l.hasApiKey?void 0:""),p=c!==void 0&&c!==""?c.replace(/[^\x00-\xFF]/g,""):c,R={provider:s,baseUrl:i.baseUrl||r.baseUrl,apiType:i.apiType||r.apiType,apiKey:p,models:(i.modelIds||r.defaultModel||"").split(",").map((v,He)=>({id:v.trim(),name:v.trim(),enabled:!0,priority:10+He})).filter(v=>v.id.length>0)};(!(o!=null&&o.configured)||i.setDefault)&&(R.setDefault=!0),xe(!0),S(null);try{const v=await x.config.provider.save(R);v.success?(D(!1),W("select"),A(null),await B(),await b()):S(v.error||"保存失败")}catch(v){S(v instanceof Error?v.message:"未知错误")}finally{xe(!1)}},Be=async e=>{if(confirm(`确定要移除 "${e}" 的配置吗?这将删除其 API Key 和模型。`))try{await x.config.provider.delete(e),await B(),await b()}catch{}},Ve=async()=>{if(!n.provider.trim()||!n.modelId.trim()){T("提供商名称和模型 ID 不能为空");return}ce(!0),T(null);try{if(P){const e={name:n.modelName.trim()||n.modelId.trim(),temperature:n.temperature,maxTokens:n.maxTokens,contextWindow:n.contextWindow},s=await x.models.update(P.provider,P.modelId,{model:e});s.success?(M(!1),O(null),m(_),await b()):T(s.error||"保存失败")}else{const e={id:n.modelId.trim(),name:n.modelName.trim()||n.modelId.trim(),temperature:n.temperature,maxTokens:n.maxTokens,contextWindow:n.contextWindow,enabled:!0,apiType:n.apiType};if(n.baseUrl.trim()&&(e.baseUrl=n.baseUrl.trim()),n.apiKeys.trim()){const l=n.apiKeys.split(",").map(u=>u.trim()).filter(Boolean).map(u=>u.replace(/[^\x00-\xFF]/g,""));e.apiKeys=l,e.apiKey=l[0]}const s=await x.models.create({provider:n.provider.trim(),model:e});s.success?(M(!1),m(_),await b()):T(s.error||"保存失败")}}catch(e){T(e instanceof Error?e.message:"未知错误")}finally{ce(!1)}},_e=e=>{switch(e){case"online":return"text-accent-green";case"offline":return"text-dark-muted";case"error":return"text-accent-red";default:return"text-dark-muted"}},qe=e=>{switch(e){case"online":return t.jsx(nt,{size:14});case"offline":return t.jsx(Se,{size:14});case"error":return t.jsx(lt,{size:14});default:return t.jsx(Se,{size:14})}},F=a.useMemo(()=>V.find(e=>e.key===N)||null,[N,V]);return q?t.jsx("div",{className:"flex h-64 items-center justify-center text-dark-muted",children:"加载中..."}):I?t.jsx("div",{className:"flex h-64 items-center justify-center text-accent-red",children:I}):t.jsxs("div",{className:"p-6 space-y-6",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h2",{className:"text-base font-semibold",children:"Provider 配置"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{onClick:async()=>{try{await x.providers.refresh(),C.success("Provider 列表已刷新"),be(!0),await k(),setTimeout(()=>{k()},3e3)}catch{C.error("刷新失败,请稍后重试")}},className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs border border-dark-border rounded hover:bg-dark-hover",title:"从远端刷新 Provider 列表",children:[t.jsx(ae,{size:12}),"刷新列表"]}),t.jsxs("button",{onClick:()=>be(e=>!e),className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-accent-blue text-white rounded hover:opacity-90",children:[Z?t.jsx(Ye,{size:12}):t.jsx(Pe,{size:12}),Z?"收起":"新增 Provider"]})]})]}),Z&&t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:y?t.jsxs("div",{className:"col-span-full flex items-center justify-center py-4 text-dark-muted text-sm",children:[t.jsx(Je,{size:14,className:"mr-2 animate-spin"}),"加载 Provider 列表..."]}):V.map(e=>{var u,c;const s=(u=o==null?void 0:o.providers)==null?void 0:u[e.key],r=s==null?void 0:s.hasApiKey,l=(o==null?void 0:o.defaultProvider)===e.key;return t.jsxs("div",{className:`text-left p-3 rounded-lg border transition-colors relative ${r?"border-accent-green/30 bg-dark-surface hover:border-accent-green/50":"border-dark-border bg-dark-surface hover:border-dark-hover"}`,children:[t.jsxs("div",{onClick:()=>e.key==="custom"?je():ke(e),className:"cursor-pointer",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-sm font-medium",children:e.name}),r&&t.jsx(re,{size:14,className:"text-accent-green"})]}),t.jsxs("div",{className:"text-[10px] text-dark-muted space-y-0.5",children:[t.jsx("div",{children:e.baseUrl||"自定义地址"}),t.jsx("div",{children:e.defaultModel||"无默认模型"}),t.jsxs("div",{children:[s?`${s.modelCount} 已配置`:`${((c=e.models)==null?void 0:c.length)||0} 可用`,e.models&&e.models.length>0&&!s&&t.jsx("span",{className:"text-accent-blue",children:" ✓"})]})]}),l&&t.jsx("div",{className:"mt-1 text-[10px] text-accent-blue",children:"默认 Provider"})]}),r&&t.jsx("button",{onClick:p=>{p.stopPropagation(),Be(e.key)},className:"absolute top-1.5 right-1.5 p-1 rounded text-dark-muted hover:bg-accent-red/10 hover:text-accent-red transition-colors",title:"删除 Provider","aria-label":`删除 ${e.name}`,children:t.jsx(Te,{size:13})})]})})})]}),d&&t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsx(J,{title:"总体状态",value:d.totalInstances===0?"未配置":d.overallStatus==="healthy"?"健康":d.overallStatus==="degraded"?"降级":"异常",color:d.totalInstances===0?"blue":d.overallStatus==="healthy"?"green":d.overallStatus==="degraded"?"yellow":"red"}),t.jsx(J,{title:"健康率",value:d.totalInstances===0?"N/A":`${(d.healthRate*100).toFixed(0)}%`,color:d.totalInstances===0?"blue":d.healthRate>.8?"green":d.healthRate>.5?"yellow":"red"}),t.jsx(J,{title:"在线实例",value:d.totalInstances===0?"无":`${d.healthyInstances}/${d.totalInstances}`,color:d.healthyInstances>0?"green":"red"}),t.jsx(J,{title:"总请求数",value:d.totalRequests>0?d.totalRequests.toLocaleString():"0",color:"blue"})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h3",{className:"text-sm font-medium",children:"已配置模型"}),t.jsxs("button",{onClick:()=>{O(null),m(_),T(null),M(!0)},className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-accent-blue text-white rounded hover:opacity-90",children:[t.jsx(Pe,{size:12}),"添加模型"]})]}),t.jsxs("div",{className:"space-y-2 max-h-[480px] overflow-y-auto custom-scrollbar pr-1",children:[h.map(e=>{const s=$e(e),r=s.inputTokens+s.outputTokens;return t.jsx("div",{className:`bg-dark-surface border rounded-lg p-3 ${e.status==="online"?"border-accent-green":"border-dark-border opacity-70"}`,children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[t.jsx("span",{className:_e(e.status),children:qe(e.status)}),t.jsx("span",{className:"font-medium text-sm",children:e.name}),t.jsx("span",{className:"text-[10px] text-dark-muted px-1.5 py-0.5 bg-dark-bg rounded",children:e.provider}),e.apiType&&t.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${e.apiType==="anthropic-messages"?"bg-accent-purple/20 text-accent-purple":"bg-accent-blue/20 text-accent-blue"}`,children:e.apiType==="anthropic-messages"?"Anthropic":"OpenAI"}),e.isGlobalDefault&&t.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-green/20 text-accent-green font-medium",children:"全局默认"}),e.isPlanDefault&&t.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-blue/20 text-accent-blue font-medium",children:"Plan 默认"}),e.isActDefault&&t.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-yellow/20 text-accent-yellow font-medium",children:"Act 默认"}),e.isGoalDefault&&t.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-purple/20 text-accent-purple font-medium",children:"Goal 默认"})]}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 text-xs",children:[t.jsx(Q,{label:"负载",value:`${e.load}/${e.maxLoad}`}),t.jsx(Q,{label:"Token",value:`${e.tokens}/${e.maxTokens}`}),t.jsx(Q,{label:"输入价格",value:`$${e.price.input}/1K`}),t.jsx(Q,{label:"输出价格",value:`$${e.price.output}/1K`})]}),t.jsxs("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-4 gap-3 items-end",children:[t.jsx(Ie,{label:"输入 token",value:s.inputTokens,onChange:l=>ye(e,"inputTokens",l)}),t.jsx(Ie,{label:"输出 token",value:s.outputTokens,onChange:l=>ye(e,"outputTokens",l)}),t.jsxs("div",{children:[t.jsx("div",{className:"text-[11px] text-dark-muted mb-1",children:"总 token"}),t.jsx("div",{className:"px-3 py-2 rounded border border-dark-border bg-dark-bg text-sm font-mono",children:r.toLocaleString()})]}),t.jsxs("button",{onClick:()=>Ee(e),className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded border border-dark-border text-sm text-dark-muted hover:bg-dark-hover",children:[t.jsx(Qe,{size:13}),"重置"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[!e.isGlobalDefault&&e.enabled!==!1&&t.jsx("button",{onClick:async()=>{try{await x.models.setDefaults({global:`${e.provider}:${e.id}`}),await b()}catch(l){j(l instanceof Error?l.message:"设置全局默认失败")}},className:"px-2 py-1 rounded text-[10px] border border-accent-green/30 text-accent-green hover:bg-accent-green/10",title:"设为全局默认",children:"全局默认"}),!e.isPlanDefault&&e.enabled!==!1&&t.jsx("button",{onClick:async()=>{try{await x.models.setDefaults({plan:`${e.provider}:${e.id}`}),await b()}catch(l){j(l instanceof Error?l.message:"设置 Plan 默认失败")}},className:"px-2 py-1 rounded text-[10px] border border-accent-blue/30 text-accent-blue hover:bg-accent-blue/10",title:"设为 Plan 默认",children:"Plan 默认"}),!e.isActDefault&&e.enabled!==!1&&t.jsx("button",{onClick:async()=>{try{await x.models.setDefaults({act:`${e.provider}:${e.id}`}),await b()}catch(l){j(l instanceof Error?l.message:"设置 Act 默认失败")}},className:"px-2 py-1 rounded text-[10px] border border-accent-yellow/30 text-accent-yellow hover:bg-accent-yellow/10",title:"设为 Act 默认",children:"Act 默认"}),!e.isGoalDefault&&e.enabled!==!1&&t.jsx("button",{onClick:async()=>{try{await x.models.setDefaults({goal:`${e.provider}:${e.id}`}),await b()}catch(l){j(l instanceof Error?l.message:"设置 Goal 默认失败")}},className:"px-2 py-1 rounded text-[10px] border border-accent-purple/30 text-accent-purple hover:bg-accent-purple/10",title:"设为 Goal 默认",children:"Goal 默认"}),t.jsx("button",{onClick:()=>We(e),className:"p-1.5 rounded hover:bg-accent-blue/10 text-dark-muted hover:text-accent-blue",title:"编辑模型",children:t.jsx(Xe,{size:13})}),t.jsx("button",{onClick:()=>Oe(e.provider,e.id),className:"p-1.5 rounded hover:bg-accent-red/10 text-dark-muted hover:text-accent-red",title:"删除模型",children:t.jsx(Te,{size:13})}),t.jsx("button",{onClick:()=>Le(e.id),disabled:g===e.id,className:"p-1.5 rounded hover:bg-dark-hover disabled:opacity-50",title:"刷新",children:t.jsx(ae,{size:13,className:g===e.id?"animate-spin":""})}),t.jsx("button",{onClick:()=>Re(e.id),className:`px-2 py-0.5 rounded text-xs transition-colors ${e.status==="online"?"bg-accent-red/20 text-accent-red hover:bg-accent-red/30":"bg-accent-green/20 text-accent-green hover:bg-accent-green/30"}`,children:e.status==="online"?"禁用":"启用"})]})]})},e.id)}),h.length===0&&t.jsxs("div",{className:"text-center text-dark-muted py-6",children:[t.jsx(Ze,{size:36,className:"mx-auto mb-2 opacity-40"}),t.jsx("p",{className:"text-sm",children:"暂无模型,请先在上方配置 Provider"})]})]})]}),t.jsx(Ke,{isOpen:Ae,onClose:()=>{D(!1),W("select"),A(null)},title:ie==="select"?"选择 Provider":(F==null?void 0:F.name)||"Provider 配置",size:"xl",children:ie==="select"?t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[V.filter(e=>e.key!=="custom").map(e=>t.jsxs("button",{onClick:()=>ke(e),className:"text-left p-3 rounded-lg border border-dark-border bg-dark-bg hover:border-accent-blue transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(re,{size:14,className:"text-accent-blue"}),t.jsx("span",{className:"text-sm font-medium",children:e.name})]}),t.jsx("div",{className:"text-xs text-dark-muted",children:e.defaultModel})]},e.key)),t.jsxs("button",{onClick:je,className:"text-left p-3 rounded-lg border border-dashed border-dark-border bg-dark-bg hover:border-accent-blue transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(et,{size:14,className:"text-accent-blue"}),t.jsx("span",{className:"text-sm font-medium",children:"自定义 Provider"})]}),t.jsx("div",{className:"text-xs text-dark-muted",children:"手动填写 Provider 名称、Base URL 和模型 ID"})]})]})}):t.jsxs("div",{className:"space-y-3",children:[N==="custom"&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Provider 名称 *"}),t.jsx("input",{value:i.providerKey,onChange:e=>w(s=>({...s,providerKey:e.target.value})),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"例如: my-provider"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"API Key *"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:me?"text":"password",value:i.apiKey,onChange:e=>w(s=>({...s,apiKey:e.target.value})),className:"w-full px-3 py-2 pr-10 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"输入 API Key"}),t.jsx("button",{onClick:()=>X(e=>!e),className:"absolute right-2 top-2 text-dark-muted hover:text-white",children:me?t.jsx(tt,{size:14}):t.jsx(st,{size:14})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"模型 ID"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{value:i.modelIds,onChange:e=>w(s=>({...s,modelIds:e.target.value})),className:"flex-1 px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:(F==null?void 0:F.defaultModel)||"gpt-4o, deepseek-chat"}),t.jsxs("button",{onClick:Ue,disabled:ee||!i.baseUrl,className:"inline-flex items-center gap-1 px-3 py-2 rounded text-sm border border-accent-blue/30 text-accent-blue hover:bg-accent-blue/10 disabled:opacity-50 whitespace-nowrap",title:"从 API 获取模型列表",children:[ee?t.jsx(ae,{size:13,className:"animate-spin"}):t.jsx(at,{size:13}),ee?"获取中...":"获取模型列表"]})]}),ve&&t.jsx("div",{className:"mt-1 text-xs text-accent-red",children:ve}),te.length>0&&t.jsxs("div",{className:"mt-2 border border-dark-border rounded-lg bg-dark-bg p-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsxs("span",{className:"text-xs text-dark-muted",children:["已获取 ",t.jsx("strong",{className:"text-dark-text",children:te.length})," 个模型, 已选 ",t.jsx("strong",{className:"text-accent-blue",children:$.size})," 个"]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:Fe,className:"px-2 py-0.5 text-[10px] bg-accent-blue text-white rounded hover:opacity-90",children:"应用选中"}),t.jsx("button",{onClick:()=>{G([]),E(new Set)},className:"px-2 py-0.5 text-[10px] border border-dark-border rounded hover:bg-dark-hover",children:"关闭"})]})]}),t.jsxs("div",{className:"relative mb-2",children:[t.jsx(rt,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-dark-muted"}),t.jsx("input",{value:Y,onChange:e=>se(e.target.value),className:"w-full pl-7 pr-2 py-1 text-xs bg-dark-bg border border-dark-border rounded focus:outline-none focus:border-accent-blue",placeholder:"搜索模型..."})]}),t.jsx("div",{className:"max-h-48 overflow-y-auto custom-scrollbar grid grid-cols-2 sm:grid-cols-3 gap-1",children:te.filter(e=>!Y||e.id.toLowerCase().includes(Y.toLowerCase())||e.name.toLowerCase().includes(Y.toLowerCase())).map(e=>t.jsxs("label",{className:`flex items-center gap-1.5 px-2 py-1 rounded cursor-pointer text-xs transition-colors ${$.has(e.id)?"bg-accent-blue/20 text-accent-blue border border-accent-blue/30":"hover:bg-dark-hover border border-transparent"}`,children:[t.jsx("input",{type:"checkbox",checked:$.has(e.id),onChange:()=>ze(e.id),className:"sr-only"}),$.has(e.id)?t.jsx(re,{size:10}):t.jsx("div",{className:"w-2.5 h-2.5 rounded border border-dark-border"}),t.jsx("span",{className:"truncate",children:e.id})]},e.id))})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Base URL"}),t.jsx("input",{value:i.baseUrl,onChange:e=>w(s=>({...s,baseUrl:e.target.value})),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"https://api.example.com/v1"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"API 类型"}),t.jsx("div",{className:"grid grid-cols-2 gap-2",children:["openai-completions","anthropic-messages"].map(e=>t.jsxs("label",{className:`flex items-center justify-center gap-1.5 px-3 py-2 rounded text-sm cursor-pointer border transition-colors ${i.apiType===e?"bg-accent-blue/20 border-accent-blue text-accent-blue":"bg-dark-bg border-dark-border text-dark-muted hover:border-dark-hover"}`,children:[t.jsx("input",{type:"radio",name:"providerApiType",value:e,checked:i.apiType===e,onChange:s=>w(r=>({...r,apiType:s.target.value})),className:"sr-only"}),e==="openai-completions"?"OpenAI Compatible":"Anthropic Messages"]},e))})]}),t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:i.setDefault,onChange:e=>w(s=>({...s,setDefault:e.target.checked})),className:"accent-accent-blue"}),t.jsx("span",{className:"text-sm text-dark-muted",children:"设为默认 Provider"})]}),pe&&t.jsx("div",{className:"text-sm text-accent-red",children:pe}),t.jsxs("div",{className:"flex justify-between gap-2 pt-2",children:[t.jsx("div",{children:N&&N!=="custom"&&((we=(Ne=o==null?void 0:o.providers)==null?void 0:Ne[N])==null?void 0:we.hasApiKey)&&t.jsx("button",{onClick:async()=>{if(confirm(`确定要删除 "${N}" 的配置吗?`))try{await x.config.provider.delete(N),D(!1),A(null),await B(),await b()}catch{}},className:"px-4 py-2 rounded border border-accent-red/30 text-accent-red hover:bg-accent-red/10 transition-colors text-sm",children:"删除 Provider"})}),t.jsx("button",{onClick:()=>{W("select"),A(null),D(!1)},className:"px-4 py-2 rounded border border-dark-border hover:bg-dark-hover transition-colors text-sm",children:"取消"}),t.jsx("button",{onClick:Ge,disabled:ue,className:"px-4 py-2 bg-accent-blue text-white rounded hover:bg-accent-blue/80 transition-colors text-sm disabled:opacity-50",children:ue?"保存中...":"保存"})]})]})}),t.jsx(Ke,{isOpen:Me,onClose:()=>{M(!1),O(null)},title:P?"编辑模型":"添加模型",size:"lg",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"提供商名称 *"}),t.jsx("input",{value:n.provider,onChange:e=>m(s=>({...s,provider:e.target.value})),disabled:!!P,className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue disabled:opacity-50",placeholder:"例如: openai, deepseek"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"模型 ID *"}),t.jsx("input",{value:n.modelId,onChange:e=>m(s=>({...s,modelId:e.target.value})),disabled:!!P,className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue disabled:opacity-50",placeholder:"例如: gpt-4o, deepseek-chat"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"模型名称"}),t.jsx("input",{value:n.modelName,onChange:e=>m(s=>({...s,modelName:e.target.value})),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"留空则使用模型 ID"})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[t.jsx(le,{label:"温度",value:n.temperature,step:"0.1",min:"0",max:"2",onChange:e=>m(s=>({...s,temperature:e}))}),t.jsx(le,{label:"最大 Token",value:n.maxTokens,onChange:e=>m(s=>({...s,maxTokens:e}))}),t.jsx(le,{label:"上下文窗",value:n.contextWindow,onChange:e=>m(s=>({...s,contextWindow:e}))})]}),!P&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"API 地址"}),t.jsx("input",{value:n.baseUrl,onChange:e=>m(s=>({...s,baseUrl:e.target.value})),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"https://api.example.com/v1"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"API Key(多个用逗号分隔)"}),t.jsx("input",{value:n.apiKeys,onChange:e=>m(s=>({...s,apiKeys:e.target.value})),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue",placeholder:"sk-xxx, sk-yyy"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"API 类型"}),t.jsx("div",{className:"grid grid-cols-2 gap-2",children:["openai-completions","anthropic-messages"].map(e=>t.jsxs("label",{className:`flex items-center justify-center gap-1.5 px-3 py-2 rounded text-sm cursor-pointer border transition-colors ${n.apiType===e?"bg-accent-blue/20 border-accent-blue text-accent-blue":"bg-dark-bg border-dark-border text-dark-muted hover:border-dark-hover"}`,children:[t.jsx("input",{type:"radio",name:"addModelApiType",value:e,checked:n.apiType===e,onChange:s=>m(r=>({...r,apiType:s.target.value})),className:"sr-only"}),e==="openai-completions"?"OpenAI Compatible":"Anthropic Messages"]},e))})]})]}),de&&t.jsx("div",{className:"text-sm text-accent-red bg-accent-red/10 p-2 rounded",children:de}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx("button",{onClick:()=>{M(!1),O(null),m(_)},className:"px-4 py-2 rounded border border-dark-border hover:bg-dark-hover transition-colors text-sm",children:"取消"}),t.jsx("button",{onClick:Ve,disabled:oe,className:"px-4 py-2 bg-accent-blue text-white rounded hover:bg-accent-blue/80 transition-colors text-sm disabled:opacity-50",children:oe?"保存中...":"保存"})]})]})})]})}function J({title:f,value:y,color:k}){const h={green:"bg-accent-green/10 text-accent-green",yellow:"bg-accent-yellow/10 text-accent-yellow",red:"bg-accent-red/10 text-accent-red",blue:"bg-accent-blue/10 text-accent-blue"};return t.jsxs("div",{className:`${h[k]} rounded-lg p-3`,children:[t.jsx("div",{className:"text-xs opacity-70",children:f}),t.jsx("div",{className:"text-xl font-semibold",children:y})]})}function Q({label:f,value:y}){return t.jsxs("div",{children:[t.jsx("div",{className:"text-dark-muted",children:f}),t.jsx("div",{children:y})]})}function Ie({label:f,value:y,onChange:k}){return t.jsxs("div",{children:[t.jsx("label",{className:"block text-[11px] text-dark-muted mb-1",children:f}),t.jsx("input",{type:"number",min:"0",value:y,onChange:h=>k(parseInt(h.target.value,10)||0),className:"w-full px-3 py-2 rounded border border-dark-border bg-dark-bg text-sm focus:outline-none focus:border-accent-blue"})]})}function le({label:f,value:y,onChange:k,min:h,max:L,step:d}){return t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:f}),t.jsx("input",{type:"number",value:y,min:h,max:L,step:d,onChange:K=>k(d?parseFloat(K.target.value)||0:parseInt(K.target.value,10)||0),className:"w-full px-3 py-2 bg-dark-bg border border-dark-border rounded text-sm focus:outline-none focus:border-accent-blue"})]})}export{bt as ModelsView,bt as default};