@witty-ai/skill-insight 0.6.0-beta → 0.7.0-beta

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 (207) hide show
  1. package/.env.example +1 -0
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  14. package/.next/standalone/.next/server/app/_not-found.rsc +4 -4
  15. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  16. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  18. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/config/create/route.js +4 -3
  22. package/.next/standalone/.next/server/app/api/config/create/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/config/route.js +3 -2
  24. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/data/route.js +5 -4
  26. package/.next/standalone/.next/server/app/api/data/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/evaluation/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js +5 -4
  29. package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js +3 -2
  31. package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/proxy/[taskId]/[...path]/route.js +1 -1
  33. package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js +4 -3
  34. package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/rejudge/route.js +5 -4
  36. package/.next/standalone/.next/server/app/api/rejudge/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/session/route.js +4 -4
  38. package/.next/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/download/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/skills/[id]/versions/route.js +5 -2
  42. package/.next/standalone/.next/server/app/api/skills/[id]/versions/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/skills/automation/import/route.js +5 -2
  44. package/.next/standalone/.next/server/app/api/skills/automation/import/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/skills/logs/route.js +5 -4
  46. package/.next/standalone/.next/server/app/api/skills/logs/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/api/skills/upload/route.js +5 -2
  50. package/.next/standalone/.next/server/app/api/skills/upload/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/task-stats/route.js +5 -4
  52. package/.next/standalone/.next/server/app/api/task-stats/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/upload/route.js +4 -3
  54. package/.next/standalone/.next/server/app/api/upload/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/details/page/react-loadable-manifest.json +1 -1
  56. package/.next/standalone/.next/server/app/details/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/details/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/details.html +1 -1
  59. package/.next/standalone/.next/server/app/details.rsc +5 -5
  60. package/.next/standalone/.next/server/app/details.segments/_full.segment.rsc +5 -5
  61. package/.next/standalone/.next/server/app/details.segments/_head.segment.rsc +1 -1
  62. package/.next/standalone/.next/server/app/details.segments/_index.segment.rsc +3 -3
  63. package/.next/standalone/.next/server/app/details.segments/_tree.segment.rsc +2 -2
  64. package/.next/standalone/.next/server/app/details.segments/details/__PAGE__.segment.rsc +2 -2
  65. package/.next/standalone/.next/server/app/details.segments/details.segment.rsc +1 -1
  66. package/.next/standalone/.next/server/app/index.html +1 -1
  67. package/.next/standalone/.next/server/app/index.rsc +5 -5
  68. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  69. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  70. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  71. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  72. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  73. package/.next/standalone/.next/server/app/login/page.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/login.html +1 -1
  76. package/.next/standalone/.next/server/app/login.rsc +5 -5
  77. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +5 -5
  78. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  79. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
  80. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  81. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  82. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  83. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  84. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/skills/page.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/skills.html +1 -1
  88. package/.next/standalone/.next/server/app/skills.rsc +5 -5
  89. package/.next/standalone/.next/server/app/skills.segments/_full.segment.rsc +5 -5
  90. package/.next/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  91. package/.next/standalone/.next/server/app/skills.segments/_index.segment.rsc +3 -3
  92. package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
  93. package/.next/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +2 -2
  94. package/.next/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
  95. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02ddba88._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/[root-of-the-server]__15dbd1f2._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1c95bcde._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/[root-of-the-server]__23efcd78._.js +3 -0
  99. package/.next/standalone/.next/server/chunks/[root-of-the-server]__4a6d443b._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/[root-of-the-server]__53775b48._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5444db55._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/[root-of-the-server]__591248f3._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5d8178f6._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6261d672._.js +3 -0
  105. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6923eecf._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6fc12878._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8402dfd1._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/[root-of-the-server]__863cf6de._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89404730._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/[root-of-the-server]__98b3de5e._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9d551ea2._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a4d3d791._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__aa3d72e3._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b11acc79._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ba01f286._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bd91659b._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c200214a._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c602c518._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d7fab946._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d8c1808b._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9b9fecc._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ddf63a21._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e280561d._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e550423c._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/_33c0c729._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/_46f10554._.js +3 -0
  127. package/.next/standalone/.next/server/chunks/_4c806e26._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/_cd3d20ca._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/src_98433cb8._.js +77 -15
  130. package/.next/standalone/.next/server/chunks/src_c8971a2d._.js +57 -8
  131. package/.next/standalone/.next/server/chunks/src_lib_119f6c7b._.js +3 -0
  132. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__9ab7cc4a._.js → [root-of-the-server]__082c32a2._.js} +2 -2
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__51073007._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/_049876f0._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/_09546b95._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/_8f5379ab._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/_c8c8c083._.js +9 -9
  138. package/.next/standalone/.next/server/chunks/ssr/{_b121f1ae._.js → _e2faf4f5._.js} +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/_fd46f439._.js +2 -2
  140. package/.next/standalone/.next/server/chunks/ssr/src_66a70595._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_app_login_page_tsx_72f58654._.js +1 -1
  142. package/.next/standalone/.next/server/pages/404.html +1 -1
  143. package/.next/standalone/.next/server/pages/500.html +2 -2
  144. package/.next/standalone/.next/static/chunks/{9445b2873a413c58.js → 015467355d3866a3.js} +1 -1
  145. package/.next/standalone/.next/static/chunks/09f192c9b0609ad8.js +1 -0
  146. package/.next/standalone/.next/static/chunks/1945a5514fbc393c.css +1 -0
  147. package/.next/standalone/.next/static/chunks/{07c9f28a269c701a.js → 361e4cf1e9a71ccb.js} +1 -1
  148. package/.next/{static/chunks/5432ce4a494bc74d.js → standalone/.next/static/chunks/60bc50374fd32f20.js} +3 -3
  149. package/.next/standalone/.next/static/chunks/{251551dcdf74a60d.js → 65bac0880a87bff3.js} +1 -1
  150. package/.next/standalone/.next/static/chunks/961f7fa606dd26a8.js +1 -0
  151. package/.next/standalone/.next/static/chunks/bab2ffd4f527acfb.js +1 -0
  152. package/.next/standalone/.next/static/chunks/c513373e5cfedd5b.js +2 -0
  153. package/.next/standalone/.next/static/chunks/ca3017e51e817855.js +1 -0
  154. package/.next/{static/chunks/7e35f4cf2e266022.js → standalone/.next/static/chunks/cb104c3cb4c52833.js} +1 -1
  155. package/.next/standalone/.next/static/chunks/{cd0fde15dc0dfcca.js → f786bb68e17b12b4.js} +1 -1
  156. package/.next/standalone/.next/static/chunks/fc61b990c5ec4ef4.js +109 -0
  157. package/.next/standalone/node_modules/.prisma/client/edge.js +4 -3
  158. package/.next/standalone/node_modules/.prisma/client/index-browser.js +1 -0
  159. package/.next/standalone/node_modules/.prisma/client/index.js +4 -3
  160. package/.next/standalone/node_modules/.prisma/client/package.json +1 -1
  161. package/.next/standalone/node_modules/.prisma/client/schema.prisma +14 -13
  162. package/.next/standalone/node_modules/.prisma/client/wasm.js +1 -0
  163. package/.next/standalone/package.json +1 -1
  164. package/.next/standalone/prisma/schema.prisma +4 -3
  165. package/.next/standalone/scripts/opencode_plugin.ts +135 -45
  166. package/.next/static/chunks/{9445b2873a413c58.js → 015467355d3866a3.js} +1 -1
  167. package/.next/static/chunks/09f192c9b0609ad8.js +1 -0
  168. package/.next/static/chunks/1945a5514fbc393c.css +1 -0
  169. package/.next/static/chunks/{07c9f28a269c701a.js → 361e4cf1e9a71ccb.js} +1 -1
  170. package/.next/{standalone/.next/static/chunks/5432ce4a494bc74d.js → static/chunks/60bc50374fd32f20.js} +3 -3
  171. package/.next/static/chunks/{251551dcdf74a60d.js → 65bac0880a87bff3.js} +1 -1
  172. package/.next/static/chunks/961f7fa606dd26a8.js +1 -0
  173. package/.next/static/chunks/bab2ffd4f527acfb.js +1 -0
  174. package/.next/static/chunks/c513373e5cfedd5b.js +2 -0
  175. package/.next/static/chunks/ca3017e51e817855.js +1 -0
  176. package/.next/{standalone/.next/static/chunks/7e35f4cf2e266022.js → static/chunks/cb104c3cb4c52833.js} +1 -1
  177. package/.next/static/chunks/{cd0fde15dc0dfcca.js → f786bb68e17b12b4.js} +1 -1
  178. package/.next/static/chunks/fc61b990c5ec4ef4.js +109 -0
  179. package/package.json +1 -1
  180. package/prisma/schema.prisma +4 -3
  181. package/scripts/opencode_plugin.ts +135 -45
  182. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1013b265._.js +0 -3
  183. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ce5e3b8._.js +0 -3
  184. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6d8053e2._.js +0 -3
  185. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b835ea7f._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/_41a98bd8._.js +0 -3
  187. package/.next/standalone/.next/server/chunks/src_lib_12408140._.js +0 -3
  188. package/.next/standalone/.next/static/chunks/1e782a49beaf489c.js +0 -1
  189. package/.next/standalone/.next/static/chunks/4ee8dc41c9f15b7b.js +0 -1
  190. package/.next/standalone/.next/static/chunks/67bd1a5de2195779.js +0 -1
  191. package/.next/standalone/.next/static/chunks/94dfb15df65ef720.js +0 -2
  192. package/.next/standalone/.next/static/chunks/9d1c5c3494fa53de.js +0 -109
  193. package/.next/standalone/.next/static/chunks/c6bd2818656b1f20.css +0 -1
  194. package/.next/standalone/.next/static/chunks/dc59a07a8f327b40.js +0 -1
  195. package/.next/static/chunks/1e782a49beaf489c.js +0 -1
  196. package/.next/static/chunks/4ee8dc41c9f15b7b.js +0 -1
  197. package/.next/static/chunks/67bd1a5de2195779.js +0 -1
  198. package/.next/static/chunks/94dfb15df65ef720.js +0 -2
  199. package/.next/static/chunks/9d1c5c3494fa53de.js +0 -109
  200. package/.next/static/chunks/c6bd2818656b1f20.css +0 -1
  201. package/.next/static/chunks/dc59a07a8f327b40.js +0 -1
  202. /package/.next/standalone/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_buildManifest.js +0 -0
  203. /package/.next/standalone/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_clientMiddlewareManifest.json +0 -0
  204. /package/.next/standalone/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_ssgManifest.js +0 -0
  205. /package/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_buildManifest.js +0 -0
  206. /package/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_clientMiddlewareManifest.json +0 -0
  207. /package/.next/static/{0uvhCJooDO_gMNlKOaHwB → iKG72t8Hpebb09DcIpKUJ}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,r,t)=>{r.exports=e.r(76562)},9165,e=>{"use strict";async function r(e,r){return fetch(""+e,r)}function t(e){return""+e}e.s(["apiFetch",()=>r,"getApiUrl",()=>t])},97703,e=>{"use strict";var r=e.i(43476),t=e.i(71645);let a=(0,t.createContext)(void 0);function o({children:e}){let[o,i]=(0,t.useState)("light"),[f,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let e=localStorage.getItem("skill-insight-theme");("dark"===e||"light"===e)&&i(e),n(!0)},[]),(0,t.useEffect)(()=>{f&&(localStorage.setItem("skill-insight-theme",o),document.documentElement.setAttribute("data-theme",o))},[o,f]),(0,t.useEffect)(()=>{document.documentElement.setAttribute("data-theme",o)},[o]),(0,r.jsx)(a.Provider,{value:{theme:o,toggleTheme:()=>{i(e=>"light"===e?"dark":"light")},isDark:"dark"===o},children:e})}function i(){let e=(0,t.useContext)(a);if(void 0===e)throw Error("useTheme must be used within a ThemeProvider");return e}let f={fg:"#18181b",fgSecondary:"#52525b",fgMuted:"#a1a1aa",primary:"#2563eb",primaryHover:"#1d4ed8",primaryForeground:"#ffffff",primarySubtle:"rgba(37, 99, 235, 0.06)",primarySubtleBorder:"rgba(37, 99, 235, 0.15)",secondary:"#7c3aed",secondaryHover:"#6d28d9",accent:"#db2777",success:"#16a34a",successForeground:"#ffffff",successSubtle:"rgba(22, 163, 74, 0.06)",successSubtleBorder:"rgba(22, 163, 74, 0.15)",warning:"#d97706",warningForeground:"#ffffff",warningSubtle:"rgba(217, 119, 6, 0.06)",warningSubtleBorder:"rgba(217, 119, 6, 0.15)",error:"#dc2626",errorForeground:"#ffffff",errorSubtle:"rgba(220, 38, 38, 0.06)",errorSubtleBorder:"rgba(220, 38, 38, 0.15)",bg:"#fafafa",bgSecondary:"#f4f4f5",bgTertiary:"#e4e4e7",border:"#e4e4e7",borderDark:"#d4d4d8",cardBg:"#ffffff",cardBorder:"#e4e4e7",inputBg:"#ffffff",inputBorder:"#d4d4d8",tableHeaderBg:"#f4f4f5",tableBorder:"#e4e4e7",tableRowBorder:"#f4f4f5",codeBlockBg:"#f4f4f5",shadowColor:"rgba(0, 0, 0, 0.04)",shadowColorLg:"rgba(0, 0, 0, 0.08)",ring:"rgba(37, 99, 235, 0.25)",link:"#2563eb",linkHover:"#1d4ed8",overlayBg:"rgba(0, 0, 0, 0.5)"},n={fg:"#fafafa",fgSecondary:"#a1a1aa",fgMuted:"#71717a",primary:"#3b82f6",primaryHover:"#60a5fa",primaryForeground:"#ffffff",primarySubtle:"rgba(59, 130, 246, 0.08)",primarySubtleBorder:"rgba(59, 130, 246, 0.18)",secondary:"#818cf8",secondaryHover:"#a5b4fc",accent:"#f472b6",success:"#22c55e",successForeground:"#ffffff",successSubtle:"rgba(34, 197, 94, 0.08)",successSubtleBorder:"rgba(34, 197, 94, 0.18)",warning:"#f59e0b",warningForeground:"#ffffff",warningSubtle:"rgba(245, 158, 11, 0.08)",warningSubtleBorder:"rgba(245, 158, 11, 0.18)",error:"#ef4444",errorForeground:"#ffffff",errorSubtle:"rgba(239, 68, 68, 0.08)",errorSubtleBorder:"rgba(239, 68, 68, 0.18)",bg:"#09090b",bgSecondary:"#18181b",bgTertiary:"#27272a",border:"#27272a",borderDark:"#3f3f46",cardBg:"#0c0c0e",cardBorder:"#27272a",inputBg:"#09090b",inputBorder:"#27272a",tableHeaderBg:"#18181b",tableBorder:"#27272a",tableRowBorder:"#18181b",codeBlockBg:"#18181b",shadowColor:"rgba(0, 0, 0, 0.3)",shadowColorLg:"rgba(0, 0, 0, 0.5)",ring:"rgba(59, 130, 246, 0.35)",link:"#60a5fa",linkHover:"#93c5fd",overlayBg:"rgba(0, 0, 0, 0.7)"};function u(){let{isDark:e}=i();return e?n:f}e.s(["ThemeProvider",()=>o,"useTheme",()=>i,"useThemeColors",()=>u])},94690,e=>{"use strict";var r=e.i(43476),t=e.i(18566),a=e.i(71645),o=e.i(9165);let i=(0,a.createContext)(void 0);function f({children:e}){let[f,n]=(0,a.useState)(null),[u,s]=(0,a.useState)(null),[l,d]=(0,a.useState)(!1),[c,g]=(0,a.useState)(!1),[b,h]=(0,a.useState)(!1),m=(0,t.useRouter)(),S=(0,t.usePathname)();return(0,a.useEffect)(()=>{(0,o.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>d(e.org_mode||!1)).catch(()=>{}).finally(()=>h(!0))},[]),(0,a.useEffect)(()=>{if(!b)return;let e=localStorage.getItem("user_id"),r=localStorage.getItem("api_key");e?(n(e),r&&s(r)):l&&!c?(g(!0),(0,o.apiFetch)("/api/auth/organization").then(async e=>{let r=await e.json().catch(()=>({}));if(!e.ok)throw Error(r?.error||`Organization auth failed: ${e.status}`);return r}).then(e=>{let r=e?.displayName||e?.username,t=e?.apiKey;if(!r)throw Error("Organization auth response missing username");localStorage.setItem("user_id",r),t&&localStorage.setItem("api_key",t),n(r),t&&s(t)}).catch(e=>console.error("Organization auth failed:",e)).finally(()=>g(!1))):"/login"!==S&&m.push("/login")},[S,m,l,c,b]),(0,r.jsx)(i.Provider,{value:{user:f,apiKey:u,login:(e,r)=>{localStorage.setItem("user_id",e),n(e),r&&(localStorage.setItem("api_key",r),s(r)),m.replace("/")},logout:()=>{localStorage.removeItem("user_id"),localStorage.removeItem("api_key"),n(null),s(null),m.push("/login")}},children:e})}function n(){let e=(0,a.useContext)(i);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}e.s(["AuthProvider",()=>f,"useAuth",()=>n])},1661,e=>{"use strict";var r=e.i(43476),t=e.i(94690),a=e.i(97703);function o({children:e}){return(0,r.jsx)(a.ThemeProvider,{children:(0,r.jsx)(t.AuthProvider,{children:e})})}e.s(["Providers",()=>o])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9665,e=>{"use strict";var s=e.i(43476),t=e.i(18566),n=e.i(71645),a=e.i(97703);function c({skillId:e,skillName:n,version:c,user:r}){let l=(0,t.useRouter)(),{isDark:i}=(0,a.useTheme)();return e||n?(0,s.jsxs)("span",{onClick:s=>{s.preventDefault();let t=new URLSearchParams;e?t.set("id",e):(t.set("name",n),r&&t.set("user",r)),null!=c&&t.set("version",String(c)),l.push(`/skills?${t.toString()}`)},style:{color:i?"#60a5fa":"#2563eb",cursor:"pointer",textDecoration:"none",transition:"color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline",e.currentTarget.style.color=i?"#93c5fd":"#2563eb"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none",e.currentTarget.style.color=i?"#60a5fa":"#2563eb"},children:[n,c?` (v${c})`:""]}):(0,s.jsx)("span",{style:{color:i?"#71717a":"#a1a1aa"},children:"(None)"})}function r({skills:e,skill:t,skillId:r,skillIds:l,skillVersion:i,user:o}){let{isDark:u}=(0,a.useTheme)();return e?.length||t?e?.length?(0,s.jsx)(s.Fragment,{children:e.map((e,t)=>{let a=l?.[t]||null;return(0,s.jsxs)(n.default.Fragment,{children:[t>0&&(0,s.jsx)("span",{style:{color:u?"#3f3f46":"#d4d4d8"},children:", "}),(0,s.jsx)(c,{skillId:a,skillName:e,version:i,user:o})]},t)})}):(0,s.jsx)(c,{skillId:r,skillName:t,version:i,user:o}):(0,s.jsx)("span",{style:{color:u?"#71717a":"#a1a1aa"},children:"(None)"})}e.s(["SkillLinks",()=>r])},95802,e=>{e.v(s=>Promise.all(["static/chunks/f7a6fed60fb079dd.js","static/chunks/60bc50374fd32f20.js","static/chunks/b43afe7d924243d9.js","static/chunks/68e4bccbce97556a.js","static/chunks/21105f8885631d60.js","static/chunks/7a95be670a5c981c.js","static/chunks/aa21d65228612e46.js","static/chunks/07668c4577ece2d3.js","static/chunks/78fd227efc628935.js"].map(s=>e.l(s))).then(()=>s(76913)))},34486,e=>{e.v(s=>Promise.all(["static/chunks/6baf949fafec6be3.js","static/chunks/f786bb68e17b12b4.js","static/chunks/e13d208072a48316.js"].map(s=>e.l(s))).then(()=>s(13143)))},14524,e=>{e.v(s=>Promise.all(["static/chunks/fec58f85bfaa3c39.js"].map(s=>e.l(s))).then(()=>s(17847)))}]);
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,s,t)=>{},98547,(e,s,t)=>{var a=e.i(18392);e.r(16015);var r=e.r(71645),l=r&&"object"==typeof r&&"default"in r?r:{default:r},n=void 0!==a.default&&a.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},i=function(){function e(e){var s=void 0===e?{}:e,t=s.name,a=void 0===t?"stylesheet":t,r=s.optimizeForSpeed,l=void 0===r?n:r;d(o(a),"`name` must be a string"),this._name=a,this._deletedRulePlaceholder="#"+a+"-deleted-rule____{}",d("boolean"==typeof l,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=l,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var s,t=e.prototype;return t.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(n||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(s,t){return"number"==typeof t?e._serverSheet.cssRules[t]={cssText:s}:e._serverSheet.cssRules.push({cssText:s}),t},deleteRule:function(s){e._serverSheet.cssRules[s]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var s=0;s<document.styleSheets.length;s++)if(document.styleSheets[s].ownerNode===e)return document.styleSheets[s]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,s){if(d(o(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof s&&(s=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,s),this._rulesCount++;if(this._optimizeForSpeed){var t=this.getSheet();"number"!=typeof s&&(s=t.cssRules.length);try{t.insertRule(e,s)}catch(s){return n||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var a=this._tags[s];this._tags.push(this.makeStyleTag(this._name,e,a))}return this._rulesCount++},t.replaceRule=function(e,s){if(this._optimizeForSpeed||"u"<typeof window){var t="u">typeof window?this.getSheet():this._serverSheet;if(s.trim()||(s=this._deletedRulePlaceholder),!t.cssRules[e])return e;t.deleteRule(e);try{t.insertRule(s,e)}catch(a){n||console.warn("StyleSheet: illegal rule: \n\n"+s+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),t.insertRule(this._deletedRulePlaceholder,e)}}else{var a=this._tags[e];d(a,"old rule at index `"+e+"` not found"),a.textContent=s}return e},t.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var s=this._tags[e];d(s,"rule at index `"+e+"` not found"),s.parentNode.removeChild(s),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(s,t){return t?s=s.concat(Array.prototype.map.call(e.getSheetForTag(t).cssRules,function(s){return s.cssText===e._deletedRulePlaceholder?null:s})):s.push(null),s},[])},t.makeStyleTag=function(e,s,t){s&&d(o(s),"makeStyleTag accepts only strings as second parameter");var a=document.createElement("style");this._nonce&&a.setAttribute("nonce",this._nonce),a.type="text/css",a.setAttribute("data-"+e,""),s&&a.appendChild(document.createTextNode(s));var r=document.head||document.getElementsByTagName("head")[0];return t?r.insertBefore(a,t):r.appendChild(a),a},s=[{key:"length",get:function(){return this._rulesCount}}],function(e,s){for(var t=0;t<s.length;t++){var a=s[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(e.prototype,s),e}();function d(e,s){if(!e)throw Error("StyleSheet: "+s+".")}var c=function(e){for(var s=5381,t=e.length;t;)s=33*s^e.charCodeAt(--t);return s>>>0},p={};function x(e,s){if(!s)return"jsx-"+e;var t=String(s),a=e+t;return p[a]||(p[a]="jsx-"+c(e+"-"+t)),p[a]}function m(e,s){"u"<typeof window&&(s=s.replace(/\/style/gi,"\\/style"));var t=e+s;return p[t]||(p[t]=s.replace(/__jsx-style-dynamic-selector/g,e)),p[t]}var f=function(){function e(e){var s=void 0===e?{}:e,t=s.styleSheet,a=void 0===t?null:t,r=s.optimizeForSpeed,l=void 0!==r&&r;this._sheet=a||new i({name:"styled-jsx",optimizeForSpeed:l}),this._sheet.inject(),a&&"boolean"==typeof l&&(this._sheet.setOptimizeForSpeed(l),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var s=e.prototype;return s.add=function(e){var s=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,s){return e[s]=0,e},{}));var t=this.getIdAndRules(e),a=t.styleId,r=t.rules;if(a in this._instancesCounts){this._instancesCounts[a]+=1;return}var l=r.map(function(e){return s._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[a]=l,this._instancesCounts[a]=1},s.remove=function(e){var s=this,t=this.getIdAndRules(e).styleId;if(function(e,s){if(!e)throw Error("StyleSheetRegistry: "+s+".")}(t in this._instancesCounts,"styleId: `"+t+"` not found"),this._instancesCounts[t]-=1,this._instancesCounts[t]<1){var a=this._fromServer&&this._fromServer[t];a?(a.parentNode.removeChild(a),delete this._fromServer[t]):(this._indices[t].forEach(function(e){return s._sheet.deleteRule(e)}),delete this._indices[t]),delete this._instancesCounts[t]}},s.update=function(e,s){this.add(s),this.remove(e)},s.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},s.cssRules=function(){var e=this,s=this._fromServer?Object.keys(this._fromServer).map(function(s){return[s,e._fromServer[s]]}):[],t=this._sheet.cssRules();return s.concat(Object.keys(this._indices).map(function(s){return[s,e._indices[s].map(function(e){return t[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},s.styles=function(e){var s,t;return s=this.cssRules(),void 0===(t=e)&&(t={}),s.map(function(e){var s=e[0],a=e[1];return l.default.createElement("style",{id:"__"+s,key:"__"+s,nonce:t.nonce?t.nonce:void 0,dangerouslySetInnerHTML:{__html:a}})})},s.getIdAndRules=function(e){var s=e.children,t=e.dynamic,a=e.id;if(t){var r=x(a,t);return{styleId:r,rules:Array.isArray(s)?s.map(function(e){return m(r,e)}):[m(r,s)]}}return{styleId:x(a),rules:Array.isArray(s)?s:[s]}},s.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,s){return e[s.id.slice(2)]=s,e},{})},e}(),u=r.createContext(null);function h(){return new f}function b(){return r.useContext(u)}u.displayName="StyleSheetContext";var g=l.default.useInsertionEffect||l.default.useLayoutEffect,j="u">typeof window?h():void 0;function y(e){var s=j||b();return s&&("u"<typeof window?s.add(e):g(function(){return s.add(e),function(){s.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return x(e[0],e[1])}).join(" ")},t.StyleRegistry=function(e){var s=e.registry,t=e.children,a=r.useContext(u),n=r.useState(function(){return a||s||h()})[0];return l.default.createElement(u.Provider,{value:n},t)},t.createStyleRegistry=h,t.style=y,t.useStyleRegistry=b},37902,(e,s,t)=>{s.exports=e.r(98547).style},58116,e=>{"use strict";e.i(18392);var s=e.i(43476),t=e.i(37902),a=e.i(71645),r=e.i(74080),l=e.i(75225),n=e.i(9694),o=e.i(72526),i=e.i(59559),d=e.i(31195),c=e.i(34239),p=e.i(85183),x=e.i(93230),m=e.i(9665),f=e.i(97703),u=e.i(9165),h=e.i(94690);function b({onSuccess:e}){let{apiKey:t}=(0,h.useAuth)(),{isDark:r}=(0,f.useTheme)(),l=(0,f.useThemeColors)(),[n,o]=(0,a.useState)(!1),[i,d]=(0,a.useState)(null),[c,p]=(0,a.useState)(""),x=async()=>{o(!0),p("正在从企业同步技能..."),d(null);try{let s=await (0,u.apiFetch)("/api/skills/sync-enterprise",{method:"POST",headers:t?{"x-witty-api-key":t}:{}}),a=await s.json();s.ok?(p("同步完成!"),d(a),e()):(p(`同步失败: ${a.error}`),alert(`同步失败: ${a.error}`))}catch(e){p(`同步出错: ${e.message}`),alert("同步出错")}finally{o(!1)}};return(0,s.jsxs)("div",{className:"upload-card",children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",color:l.fgMuted},children:"🔄"}),(0,s.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:l.fg},children:"从'skill市场--我的skill'同步"}),(0,s.jsxs)("p",{style:{color:l.fgSecondary,marginBottom:"1.5rem",maxWidth:"400px",fontSize:"0.9rem",lineHeight:1.5},children:["从'skill市场--我的skill'自动拉取所有技能。",(0,s.jsx)("br",{}),"同版本号skill将被覆盖。"]}),(0,s.jsx)("button",{className:"btn-primary",onClick:x,disabled:n,style:{opacity:n?.6:1,cursor:n?"not-allowed":"pointer"},children:n?"同步中...":"开始同步"}),c&&(0,s.jsx)("div",{style:{marginTop:"1rem",color:l.fgSecondary,fontSize:"0.9rem"},children:c}),i&&(0,s.jsxs)("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:"#e4e4e7",borderRadius:"0.5rem"},children:[(0,s.jsx)("div",{style:{fontWeight:600,marginBottom:"0.5rem"},children:"同步结果:"}),(0,s.jsxs)("div",{children:["总技能数: ",i.totalSkills]}),(0,s.jsxs)("div",{style:{color:l.success},children:["成功: ",i.successCount]}),(0,s.jsxs)("div",{style:{color:l.error},children:["失败: ",i.failedCount]}),i.failedCount>0&&(0,s.jsxs)("details",{style:{marginTop:"0.5rem"},children:[(0,s.jsx)("summary",{style:{cursor:"pointer",color:l.fgSecondary},children:"查看失败详情"}),(0,s.jsx)("ul",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem"},children:i.results.filter(e=>!e.success).map((e,t)=>(0,s.jsxs)("li",{style:{color:l.error},children:[e.skillName," (v",e.version,"): ",e.error]},t))})]})]})]})}function g({onSuccess:e}){let{isDark:t}=(0,f.useTheme)(),r=(0,f.useThemeColors)(),{user:l}=(0,h.useAuth)(),[n,o]=(0,a.useState)(!1),[i,d]=(0,a.useState)([]),c=(0,a.useRef)(null),p=async s=>{let t=s.target.files;if(!t||0===t.length)return;o(!0),d(["Preparing upload..."]);let a=new FormData;l&&a.append("user",l);for(let e=0;e<t.length;e++)a.append("files",t[e]),a.append("paths",t[e].webkitRelativePath);try{d(e=>[...e,`Uploading ${t.length} files...`]);let s=await (0,u.apiFetch)("/api/skills/upload",{method:"POST",body:a}),r=await s.json();s.ok?(d(e=>[...e,"Upload successful!",`Skill: ${r.skill.name} (v${r.version.version})`]),alert("技能上传成功!"),e()):(d(e=>[...e,`Error: ${r.error}`]),alert(`上传失败: ${r.error}`))}catch(e){d(s=>[...s,`Network Error: ${e.message}`]),alert("上传出错")}finally{o(!1),c.current&&(c.current.value="")}};return(0,s.jsxs)("div",{className:"upload-card",children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",color:r.fgMuted},children:"📂"}),(0,s.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:r.fg},children:"上传 Skill"}),(0,s.jsxs)("p",{style:{color:r.fgSecondary,marginBottom:"1.5rem",maxWidth:"400px",fontSize:"0.9rem",lineHeight:1.5},children:["选择包含 ",(0,s.jsx)("code",{children:"SKILL.md"}),"的文件夹。",(0,s.jsx)("br",{}),(0,s.jsx)("span",{style:{color:r.warning},children:"注意: 请上传整个文件夹"}),(0,s.jsx)("br",{}),(0,s.jsx)("span",{style:{color:r.error,fontWeight:"bold"},children:"重要: 文件夹名称不得包含中文字符。"})]}),(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,s.jsx)("button",{className:"btn-primary",style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.75rem 1.5rem",fontSize:"1rem"},onClick:()=>c.current?.click(),children:(0,s.jsx)("span",{children:"选择文件夹"})}),(0,s.jsx)("input",{ref:c,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:p})]}),i.length>0&&(0,s.jsx)("div",{style:{marginTop:"2rem",width:"100%",maxWidth:"600px",textAlign:"left",background:r.bgSecondary,padding:"1rem",borderRadius:"0.5rem",maxHeight:"150px",overflowY:"auto"},children:i.map((e,t)=>(0,s.jsx)("div",{style:{color:r.fgSecondary,fontSize:"0.8rem",fontFamily:"monospace",marginBottom:"4px",borderBottom:`1px solid ${r.border}`,paddingBottom:"2px"},children:e},t))})]})}function j({skillId:e,version:t,onClose:r}){let{isDark:l}=(0,f.useTheme)(),n=(0,f.useThemeColors)(),{user:o}=(0,h.useAuth)(),[i,d]=(0,a.useState)(null),[c,p]=(0,a.useState)(!0),[x,m]=(0,a.useState)(!1),[b,g]=(0,a.useState)(null),[j,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{p(!0),(0,u.apiFetch)(`/api/skills/${e}/versions/${t}?user=${encodeURIComponent(o||"")}`).then(e=>e.json()).then(e=>{d(e),p(!1)}).catch(e=>{alert("Failed to load details"),p(!1)});let s=null,a=()=>{(0,u.apiFetch)(`/api/skills/${e}/versions/${t}/parse-flow?user=${encodeURIComponent(o||"")}`).then(e=>e.json()).then(e=>{e.parsed?e.flowJson||e.mermaidCode?(v(!1),g(e)):(v(!0),s=setTimeout(a,3e3)):v(!1)}).catch(()=>{v(!1)})};return a(),()=>{s&&clearTimeout(s)}},[e,t]);let k=async()=>{m(!0);try{let s=await (0,u.apiFetch)(`/api/skills/${e}/versions/${t}/parse-flow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user:o})}),a=await s.json();a.success?g({parsed:!0,flowJson:JSON.stringify(a.flow),mermaidCode:a.mermaidCode,parsedAt:new Date().toISOString()}):alert(`解析失败: ${a.error}`)}catch(s){let e=s instanceof Error?s.message:"未知错误";alert(`解析出错: ${e}`)}finally{m(!1)}};return(0,s.jsx)("div",{className:"modal-overlay",onClick:r,style:{zIndex:1100},children:(0,s.jsxs)("div",{className:"modal-content card",onClick:e=>e.stopPropagation(),style:{width:"1200px",maxWidth:"95vw",maxHeight:"90vh",display:"flex",flexDirection:"column",padding:0,overflow:"hidden"},children:[(0,s.jsxs)("div",{className:"modal-header-new",style:{padding:"1rem 1.5rem",background:n.bgSecondary,borderBottom:`1px solid ${n.border}`,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsxs)("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:"bold",color:n.fg},children:["Version Details (v",t,")"]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[(0,s.jsx)("button",{onClick:k,disabled:x,style:{padding:"6px 16px",background:x?"#d4d4d8":"#2563eb",color:x?"#64748b":"#ffffff",border:"none",borderRadius:"4px",cursor:x?"not-allowed":"pointer",fontWeight:"bold",fontSize:"0.9rem"},children:x?"解析中...":b?"重新解析":"解析流程"}),(0,s.jsx)("button",{onClick:r,style:{background:"none",border:"none",color:n.fgSecondary,fontSize:"1.5rem",cursor:"pointer",padding:"0 0.5rem",lineHeight:1},children:"×"})]})]}),(0,s.jsx)("div",{style:{flex:1,display:"flex",gap:"1.5rem",padding:"1.5rem",minHeight:0,overflowY:"auto"},children:c?(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:n.fgSecondary,flex:1},children:"Loading details..."}):i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",gap:"1.5rem",minWidth:0},children:[(0,s.jsx)("div",{style:{background:n.bgSecondary,padding:"1rem",borderRadius:"8px",border:`1px solid ${n.border}`},children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{style:{color:n.fgSecondary,fontSize:"0.85rem",display:"block",marginBottom:"4px"},children:"Created At"}),(0,s.jsx)("div",{style:{color:n.fg,fontWeight:500},children:new Date(i.createdAt).toLocaleString()})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:n.fgSecondary,marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"变更历史"}),(0,s.jsx)("div",{style:{background:n.bgSecondary,padding:"1rem",borderRadius:"6px",color:n.fg,whiteSpace:"pre-wrap",border:`1px solid ${n.border}`,fontSize:"0.9rem",lineHeight:1.6},children:i.changeLog||(0,s.jsx)("span",{style:{color:n.fgMuted,fontStyle:"italic"},children:"无变更历史"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:n.fgSecondary,marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Skill Content (SKILL.md)"}),(0,s.jsx)("pre",{style:{background:n.bgSecondary,padding:"1rem",borderRadius:"6px",color:n.fg,overflowX:"auto",fontFamily:"monospace",fontSize:"0.85rem",border:`1px solid ${n.border}`,maxHeight:"300px",whiteSpace:"pre-wrap"},children:i.content||(0,s.jsx)("span",{style:{color:n.fgMuted,fontStyle:"italic"},children:"(Empty content)"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:n.fgSecondary,marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Included Files"}),(0,s.jsx)("div",{style:{background:n.bgSecondary,padding:"1rem",borderRadius:"6px",border:`1px solid ${n.border}`},children:(()=>{try{let e=i.files?JSON.parse(i.files):[];if(0===e.length)return(0,s.jsx)("span",{style:{color:n.fgMuted,fontSize:"0.9rem",fontStyle:"italic"},children:"No additional files."});return(0,s.jsx)("ul",{style:{margin:0,paddingLeft:"1.2rem",color:n.fgSecondary,fontSize:"0.9rem"},children:e.map((e,t)=>(0,s.jsx)("li",{style:{marginBottom:"4px"},children:e},t))})}catch(e){return(0,s.jsx)("span",{style:{color:n.error,fontSize:"0.9rem"},children:"Error parsing file list."})}})()})]})]}),(0,s.jsxs)("div",{style:{flex:"1 1 50%",minWidth:0,display:"flex",flexDirection:"column"},children:[(0,s.jsx)("h4",{style:{color:n.fgSecondary,marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"预期执行流程"}),b?(0,s.jsxs)("div",{style:{background:n.bgSecondary,padding:"1rem",borderRadius:"6px",border:`1px solid ${n.border}`,flex:1,display:"flex",flexDirection:"column"},children:[(0,s.jsxs)("div",{style:{marginBottom:"0.5rem",fontSize:"0.8rem",color:n.fgMuted,flexShrink:0},children:["解析时间: ",new Date(b.parsedAt).toLocaleString()]}),(0,s.jsx)("div",{style:{flex:1,overflow:"auto"},children:(0,s.jsx)(y,{code:b.mermaidCode})})]}):j?(0,s.jsxs)("div",{style:{background:"#eff6ff",padding:"2rem",borderRadius:"6px",border:"1px solid #bfdbfe",flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"#2563eb",gap:"0.5rem"},children:[(0,s.jsx)("span",{style:{animation:"spin 1s linear infinite",display:"inline-block"},children:"🔄"}),"正在自动解析 Skill 流程,请稍候...模型调用可能需要2-3分钟,如长时间未完成,可点击「解析流程」按钮手动重新解析"]}):(0,s.jsx)("div",{style:{background:n.bgSecondary,padding:"2rem",borderRadius:"6px",border:`1px solid ${n.border}`,flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:n.fgMuted},children:"点击「解析流程」按钮生成预期执行流程图"})]})]}):(0,s.jsx)("div",{style:{color:n.error,textAlign:"center",padding:"2rem",flex:1},children:"Failed to load details."})})]})})}function y({code:t}){let{isDark:r}=(0,f.useTheme)(),l=(0,f.useThemeColors)(),[n,o]=(0,a.useState)(""),[i,d]=(0,a.useState)("");return((0,a.useEffect)(()=>{let s=async()=>{try{let s=(await e.A(95802)).default;s.initialize({startOnLoad:!1,theme:"default",flowchart:{useMaxWidth:!1}});let{svg:a}=await s.render("mermaid-"+Date.now(),t);o(a),d("")}catch(e){console.error("Mermaid render error:",e),d("流程图渲染失败")}};t&&s()},[t]),i)?(0,s.jsx)("div",{style:{color:l.error},children:i}):(0,s.jsx)("div",{style:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start"},dangerouslySetInnerHTML:{__html:n}})}function v({skill:e,onClose:t,onUpdate:r}){let{isDark:l}=(0,f.useTheme)(),n=(0,f.useThemeColors)(),{user:o}=(0,h.useAuth)(),[i,d]=(0,a.useState)([]),[c,p]=(0,a.useState)(e.activeVersion),[x,m]=(0,a.useState)(!1),[b,g]=(0,a.useState)(null),[y,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(o||"")}`).then(e=>e.json()).then(e=>{d(e)})},[e.id]),(0,a.useEffect)(()=>{p(e.activeVersion)},[e.activeVersion]),(0,a.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{v(e.org_mode||!1)}).catch(()=>{})},[]);let k=()=>{x&&r(),t()},S=async s=>{try{let t=await (0,u.apiFetch)(`/api/skills/${e.id}/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:s,user:o})});if(t.ok)p(s),m(!0);else{let e=await t.json();alert(`Failed to activate: ${e.error}`)}}catch(e){alert(`Error: ${e.message}`)}},N=async s=>{let{semanticVersion:t}=i.find(e=>e.version===s)||{},a=t||s;if(confirm(y?`确定要删除版本 ${a} 吗?此操作将同时删除企业中的对应skill(如果存在),无法撤销。`:`Are you sure you want to delete version ${a}? This action cannot be undone.`))try{let t=await (0,u.apiFetch)(`/api/skills/${e.id}/versions/${s}?user=${encodeURIComponent(o||"")}`,{method:"DELETE"});if(t.ok){alert(`Version ${a} deleted successfully!`);let t=await (0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(o||"")}`),r=await t.json();d(r),m(!0),c===s&&r.length>0&&p(r[0].version)}else{let e=await t.json();alert(`Failed to delete version: ${e.error}`)}}catch(e){alert(`Error: ${e.message}`)}},w=(0,a.useRef)(null),_=async s=>{let t=s.target.files;if(!t||0===t.length)return;let a=new FormData;a.append("targetSkillId",e.id),o&&a.append("user",o);for(let e=0;e<t.length;e++)a.append("files",t[e]),a.append("paths",t[e].webkitRelativePath);try{let s=await (0,u.apiFetch)("/api/skills/upload",{method:"POST",body:a}),t=await s.json();if(s.ok){alert(`Version v${t.version.version} uploaded successfully!`);let s=await (0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(o||"")}`);d(await s.json()),m(!0)}else alert(`Upload failed: ${t.error}`)}catch(e){alert(`Upload error: ${e.message}`)}finally{w.current&&(w.current.value="")}};return(0,s.jsx)("div",{className:"modal-overlay",onClick:k,children:(0,s.jsxs)("div",{className:"modal-window-lg",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"modal-header-new",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:"bold",color:n.fg},children:e.name}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginTop:"0.25rem",fontSize:"0.875rem",color:n.fgSecondary},children:[(0,s.jsx)("span",{children:"当前使用:"}),(0,s.jsxs)("span",{style:{color:n.success,fontFamily:"monospace",fontWeight:"bold",background:n.successSubtle,padding:"0 6px",borderRadius:"4px"},children:["v",i.find(e=>e.version===c)?.semanticVersion||c]})]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[(0,s.jsx)("button",{className:"btn-primary",style:{fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"0.5rem"},onClick:()=>w.current?.click(),children:(0,s.jsx)("span",{children:"📤 上传新版本"})}),(0,s.jsx)("button",{onClick:k,style:{background:"none",border:"none",color:n.fgSecondary,fontSize:"1.5rem",cursor:"pointer",padding:"0 0.5rem"},children:"×"})]}),(0,s.jsx)("input",{ref:w,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:_})]}),(0,s.jsxs)("div",{className:"modal-content-scroll",children:[(0,s.jsxs)("table",{className:"version-table w-full text-left order-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{style:{width:"120px"},children:"版本"}),(0,s.jsx)("th",{children:"变更历史"}),(0,s.jsx)("th",{style:{textAlign:"right",width:"220px"},children:"Action"})]})}),(0,s.jsx)("tbody",{children:i.map(e=>{let t=e.version===c;return(0,s.jsxs)("tr",{className:`version-row ${t?"version-active-row":""}`,children:[(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsxs)("span",{style:{fontSize:"1rem",fontFamily:"monospace",fontWeight:"bold",color:t?"#16a34a":"#2563eb"},children:["v",e.semanticVersion||e.version]}),t&&(0,s.jsx)("span",{style:{fontSize:"0.7rem",backgroundColor:"rgba(22, 163, 74, 0.15)",color:n.success,padding:"2px 6px",borderRadius:"4px",fontWeight:"bold",border:"1px solid rgba(22, 163, 74, 0.3)"},children:"ACTIVE"})]}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:n.fgMuted},children:new Date(e.createdAt).toLocaleDateString()})]}),(0,s.jsx)("td",{children:(0,s.jsx)("p",{style:{margin:0,color:n.fg,whiteSpace:"pre-wrap",lineHeight:1.6,fontSize:"0.9rem"},children:e.changeLog||(0,s.jsx)("span",{style:{color:n.fgMuted,fontStyle:"italic"},children:"无变更历史"})})}),(0,s.jsx)("td",{style:{textAlign:"right",minWidth:"280px"},children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",flexWrap:"nowrap",alignItems:"center"},children:[(0,s.jsx)("button",{onClick:()=>g(e.version),className:"btn-sm",style:{background:n.bgTertiary,border:`1px solid ${n.borderDark}`,padding:"6px 12px",color:n.fgSecondary,whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"60px"},children:"查看"}),t?(0,s.jsxs)("span",{style:{padding:"6px 12px",fontSize:"0.85rem",fontFamily:"monospace",color:n.success,display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},children:[(0,s.jsx)("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:n.success}}),"当前"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>S(e.version),className:"btn-sm",style:{background:n.primarySubtle,border:`1px solid ${n.primary}`,padding:"6px 12px",color:n.primary,whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"85px"},children:"激活"}),(0,s.jsx)("button",{onClick:()=>N(e.version),className:"btn-sm",style:{background:n.errorSubtle,border:`1px solid ${n.error}`,padding:"6px 12px",color:n.error,whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"65px"},children:"Delete"})]})]})})]},e.id)})})]}),0===i.length&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:n.fgMuted},children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"1rem",opacity:.5},children:"📂"}),(0,s.jsx)("p",{children:"没有历史版本"})]})]}),null!==b&&(0,s.jsx)(j,{skillId:e.id,version:b,onClose:()=>g(null)})]})})}function k({refresh:e}){let{isDark:t}=(0,f.useTheme)(),r=(0,f.useThemeColors)(),{user:l}=(0,h.useAuth)(),[n,o]=(0,a.useState)([]),[i,d]=(0,a.useState)(!0),[c,p]=(0,a.useState)(null),[x,m]=(0,a.useState)(!1),b=()=>{l&&(d(!0),(0,u.apiFetch)(`/api/skills?user=${encodeURIComponent(l)}`).then(e=>e.json()).then(e=>{o(Array.isArray(e)?e:[]),d(!1)}))};(0,a.useEffect)(()=>{b()},[e]),(0,a.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{m(e.org_mode||!1)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(c){let e=n.find(e=>e.id===c.id);e&&p(e)}},[n]);let g=async e=>{if(confirm(x?"确定要删除这个skill吗?此操作将同时删除企业中的对应skill,无法撤销。":"Are you sure you want to delete this skill? This action cannot be undone."))try{let s=await (0,u.apiFetch)(`/api/skills?id=${e}&user=${encodeURIComponent(l||"")}`,{method:"DELETE"}),t=await s.json();s.ok?b():alert(`Failed to delete skill: ${t.error}`)}catch(e){alert(`Delete error: ${e.message}`)}},j=async(e,s,t)=>{t.stopPropagation();try{(await (0,u.apiFetch)(`/api/skills/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({isUploaded:!s,user:l})})).ok?b():alert("Failed to toggle upload status")}catch(e){alert(`Error: ${e.message}`)}},y=n.length,k=n.filter(e=>e.isUploaded).length;return i?(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"5rem"},children:[(0,s.jsx)("div",{className:"loading-spinner",style:{width:"2rem",height:"2rem",border:`2px solid ${r.border}`,borderTopColor:"#2563eb",borderRadius:"50%",animation:"spin 1s linear infinite"}}),(0,s.jsx)("style",{children:"@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }"})]}):(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"stats-header",style:{display:"flex",gap:"2rem",marginBottom:"2rem",background:r.bgSecondary,padding:"1.5rem",borderRadius:"0.75rem",border:`1px solid ${r.border}`},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)("span",{style:{fontSize:"0.875rem",color:r.fgSecondary,textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Skill 总数"}),(0,s.jsx)("span",{style:{fontSize:"2.5rem",fontWeight:700,color:r.fg,lineHeight:1},children:y})]}),(0,s.jsx)("div",{style:{width:"1px",background:"#e4e4e7"}}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)("span",{style:{fontSize:"0.875rem",color:r.fgSecondary,textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"已上传 Skill"}),(0,s.jsx)("span",{style:{fontSize:"2.5rem",fontWeight:700,color:r.success,lineHeight:1},children:k})]})]}),(0,s.jsxs)("div",{className:"skill-grid",children:[n.map(e=>(0,s.jsxs)("div",{className:"skill-card",children:[(0,s.jsxs)("div",{className:"skill-card-header",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"skill-title",title:e.name,children:e.name}),(0,s.jsxs)("div",{className:"skill-meta",children:[(0,s.jsx)("span",{className:"skill-version-badge",children:e.semanticVersion?`v${e.semanticVersion}`:`v${e.version}`}),(0,s.jsx)("span",{className:"skill-date",children:new Date(e.updatedAt).toLocaleDateString()})]})]}),(0,s.jsx)("div",{className:"skill-icon",children:"🧩"})]}),(0,s.jsxs)("div",{className:"skill-body",children:[(0,s.jsx)("div",{className:"skill-description",children:e.description||(0,s.jsx)("span",{style:{fontStyle:"italic",color:r.fgMuted},children:"No description provided for this skill."})}),(0,s.jsxs)("div",{className:"skill-tags",children:[e.tags?.slice(0,3).map((e,t)=>(0,s.jsxs)("span",{className:"skill-tag",children:["#",e]},t)),(e.tags?.length||0)>3&&(0,s.jsxs)("span",{className:"skill-tag",style:{background:"transparent",border:"none",color:r.fgMuted},children:["+",e.tags.length-3]})]})]}),(0,s.jsxs)("div",{className:"skill-actions",children:[(0,s.jsx)("button",{onClick:s=>j(e.id,e.isUploaded,s),className:`btn-icon ${e.isUploaded?"uploaded":""}`,title:e.isUploaded?"Withdraw Skill (Stop Sync)":"Upload Skill (Enable Sync)",style:{background:e.isUploaded?"rgba(22, 163, 74, 0.1)":"transparent",border:`1px solid ${e.isUploaded?"#16a34a":"#d4d4d8"}`,color:e.isUploaded?"#16a34a":"#64748b",padding:"0.4rem",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:e.isUploaded?"☁️ 激活":"☁️ 未激活"}),(0,s.jsxs)("button",{onClick:()=>p(e),className:"btn-manage",children:[(0,s.jsx)("span",{children:"⚙️"}),(0,s.jsx)("span",{children:"版本管理"})]}),(0,s.jsx)("button",{onClick:()=>g(e.id),className:"btn-delete",title:"Delete Skill",children:(0,s.jsx)("span",{children:"🗑️"})})]})]},e.id)),0===n.length&&(0,s.jsxs)("div",{className:"upload-card",style:{gridColumn:"1 / -1",background:"transparent",borderStyle:"dashed"},children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",opacity:.3},children:"📦"}),(0,s.jsx)("p",{style:{color:r.fgSecondary,fontSize:"1.2rem"},children:"无 skill"}),(0,s.jsx)("p",{style:{color:r.fgMuted,fontSize:"0.9rem",marginTop:"0.5rem"},children:"上传 skill"})]})]}),c&&(0,s.jsx)(v,{skill:c,onClose:()=>p(null),onUpdate:b})]})}function S(){let[e,t]=(0,a.useState)("catalog"),[r,l]=(0,a.useState)(0),[n,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{o(e.org_mode||!1)}).catch(()=>{})},[]),(0,s.jsxs)("div",{style:{marginTop:"1rem"},children:[(0,s.jsxs)("div",{className:"nav-tabs",children:[(0,s.jsx)("button",{onClick:()=>t("catalog"),className:`nav-tab-item ${"catalog"===e?"active":""}`,children:"Skill 管理"}),(0,s.jsx)("button",{onClick:()=>t("upload"),className:`nav-tab-item ${"upload"===e?"active":""}`,children:"上传 Skill"})]}),(0,s.jsxs)("div",{style:{minHeight:"400px"},children:["catalog"===e&&(0,s.jsx)(k,{refresh:r}),"upload"===e&&(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"2rem"},children:[(0,s.jsx)(g,{onSuccess:()=>{l(e=>e+1),t("catalog")}}),n&&(0,s.jsx)(b,{onSuccess:()=>{l(e=>e+1)}})]})]})]})}function N({step:e,currentStep:l,totalSteps:n,onNext:o,onPrev:i,onSkip:d,onDismiss:c,onDontShowAgain:p,isVisible:x}){let[m,u]=(0,a.useState)({top:0,left:0}),[h,b]=(0,a.useState)({top:0,left:0}),g=(0,a.useRef)(null),{isDark:j}=(0,f.useTheme)(),y=(0,f.useThemeColors)(),v=e=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(e).then(()=>{alert("复制成功!")}).catch(()=>{alert("复制失败,请手动复制")});else{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.left="-9999px",s.style.top="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),alert("复制成功!")}catch(e){console.error("Fallback: Fallback: Oops, unable to copy",e),alert("复制失败,请手动复制")}document.body.removeChild(s)}},k=(0,a.useCallback)(()=>{if("center"===e.position){if(!g.current)return;let e=g.current.getBoundingClientRect();u({top:(window.innerHeight-e.height)/2,left:(window.innerWidth-e.width)/2}),b({top:0,left:0});return}let s=document.querySelector(e.target);if(!s||!g.current)return;let t=s.getBoundingClientRect(),a=g.current.getBoundingClientRect(),r=0,l=0,n=0,o=0,i=t.left+t.width/2,d=t.top+t.height/2;switch(e.position){case"top":r=t.top-a.height-12,l=i-a.width/2;break;case"bottom":r=t.bottom+12,l=i-a.width/2;break;case"left":r=d-a.height/2,l=t.left-a.width-12;break;case"right":r=d-a.height/2,l=t.right+12}switch(l<10&&(l=10),l+a.width>window.innerWidth-10&&(l=window.innerWidth-a.width-10),r<10&&(r=10),r+a.height>window.innerHeight-10&&(r=window.innerHeight-a.height-10),e.position){case"top":case"bottom":o=i-l-8,n="top"===e.position?a.height-8:-8;break;case"left":case"right":n=d-r-8,o="left"===e.position?a.width-8:-8}u({top:r,left:l}),b({top:n,left:o})},[e]);if((0,a.useEffect)(()=>{if(x){let e=requestAnimationFrame(()=>{k()});return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}}},[x,k]),!x)return null;let S="center"===e.position;return(0,r.createPortal)((0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.5)",zIndex:9998,pointerEvents:"auto"},onClick:c,className:"jsx-f29a97b83a083e27"}),(0,s.jsxs)("div",{ref:g,style:{position:"fixed",top:m.top,left:m.left,background:S?`linear-gradient(135deg, ${y.bgSecondary} 0%, ${y.bg} 100%)`:y.bgSecondary,border:`1px solid ${y.primary}`,borderRadius:S?"16px":"12px",padding:S?"32px 40px":"20px",maxWidth:S?"480px":"360px",minWidth:S?"320px":"280px",zIndex:9999,boxShadow:S?`0 25px 50px ${y.overlayBg}, 0 0 40px ${y.primarySubtleBorder}`:`0 20px 40px ${y.overlayBg}, 0 0 20px ${y.primarySubtle}`,animation:"fadeInScale 0.3s ease-out",textAlign:S?"center":"left"},className:"jsx-f29a97b83a083e27",children:[!S&&(0,s.jsx)("div",{style:(()=>{if("center"===e.position)return null;let s={position:"absolute",width:0,height:0,borderStyle:"solid"};switch(e.position){case"top":return{...s,top:h.top,left:h.left,borderWidth:"8px 8px 0 8px",borderColor:"#1e293b transparent transparent transparent"};case"bottom":return{...s,top:h.top,left:h.left,borderWidth:"0 8px 8px 8px",borderColor:"transparent transparent #1e293b transparent"};case"left":return{...s,top:h.top,left:h.left,borderWidth:"8px 0 8px 8px",borderColor:"transparent transparent transparent #1e293b"};case"right":return{...s,top:h.top,left:h.left,borderWidth:"8px 8px 8px 0",borderColor:"transparent #1e293b transparent transparent"};default:return null}})()||{},className:"jsx-f29a97b83a083e27"}),S&&(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"16px"},className:"jsx-f29a97b83a083e27",children:"👋"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("h3",{style:{margin:0,color:y.primary,fontSize:S?"1.4rem":"1.1rem",fontWeight:600,width:"100%"},className:"jsx-f29a97b83a083e27",children:e.title}),(0,s.jsx)("button",{onClick:c,style:{background:"transparent",border:"none",color:y.fgMuted,cursor:"pointer",fontSize:"1.2rem",padding:"0",lineHeight:1},className:"jsx-f29a97b83a083e27",children:"✕"})]}),(0,s.jsx)("p",{style:{margin:"0 0 16px 0",color:y.fg,fontSize:"0.9rem",lineHeight:1.6},className:"jsx-f29a97b83a083e27",children:e.content}),e.linkUrl&&e.linkText&&(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-f29a97b83a083e27",children:(0,s.jsxs)("a",{href:e.linkUrl,target:"_blank",rel:"noopener noreferrer",style:{color:y.primary,textDecoration:"none",fontSize:"0.9rem",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",background:"rgba(56, 189, 248, 0.1)",borderRadius:"6px",border:"1px solid rgba(56, 189, 248, 0.3)",transition:"all 0.2s"},onClick:e=>e.stopPropagation(),className:"jsx-f29a97b83a083e27",children:[e.linkText,(0,s.jsx)("span",{style:{fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:"↗"})]})}),e.setupCommands&&(0,s.jsxs)("div",{style:{marginBottom:"16px",textAlign:"left"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:y.fgMuted,fontSize:"0.85rem",marginBottom:"12px",lineHeight:1.5},className:"jsx-f29a97b83a083e27",children:"为了让客户端能够连接到平台并上报数据,需要配置客户端环境。请根据您的操作系统选择以下命令执行:"}),(0,s.jsxs)("div",{style:{marginBottom:"10px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsxs)("div",{style:{color:y.primary,fontSize:"0.85rem",fontWeight:600,marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"🐧"}),(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"Linux / macOS"})]}),(0,s.jsxs)("div",{style:{background:y.bg,border:`1px solid ${y.border}`,borderRadius:"6px",padding:"10px",position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("code",{style:{color:y.fg,fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",display:"block",paddingRight:"40px"},className:"jsx-f29a97b83a083e27",children:e.setupCommands.linux}),(0,s.jsx)("button",{onClick:()=>{v(e.setupCommands.linux)},style:{position:"absolute",top:"8px",right:"8px",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:y.primary,padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]})]}),(0,s.jsxs)("div",{className:"jsx-f29a97b83a083e27",children:[(0,s.jsxs)("div",{style:{color:y.primary,fontSize:"0.85rem",fontWeight:600,marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"🪟"}),(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"Windows"})]}),(0,s.jsxs)("div",{style:{background:y.bg,border:`1px solid ${y.border}`,borderRadius:"6px",padding:"10px",position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("code",{style:{color:y.fg,fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",display:"block",paddingRight:"40px"},className:"jsx-f29a97b83a083e27",children:e.setupCommands.windows}),(0,s.jsx)("button",{onClick:()=>{v(e.setupCommands.windows)},style:{position:"absolute",top:"8px",right:"8px",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:y.primary,padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]})]}),e.apiKey&&(0,s.jsxs)("div",{style:{background:"rgba(56, 189, 248, 0.1)",border:"1px solid rgba(56, 189, 248, 0.3)",borderRadius:"6px",padding:"10px",marginTop:"12px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:y.primary,fontSize:"0.85rem",fontWeight:600,marginBottom:"6px"},className:"jsx-f29a97b83a083e27",children:"🔑 您的密钥"}),(0,s.jsxs)("div",{style:{position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:y.fg,fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",marginBottom:"6px",paddingRight:"50px"},className:"jsx-f29a97b83a083e27",children:e.apiKey}),(0,s.jsx)("button",{onClick:()=>{v(e.apiKey)},style:{position:"absolute",top:"0",right:"0",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:y.primary,padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]}),(0,s.jsx)("div",{style:{color:y.fgMuted,fontSize:"0.75rem",lineHeight:1.4},className:"jsx-f29a97b83a083e27",children:"执行上述命令时,系统会提示您输入 密钥,请复制上面的 Key 粘贴到终端中。"})]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px",gap:"8px"},className:"jsx-f29a97b83a083e27",children:[Array.from({length:n}).map((e,t)=>(0,s.jsx)("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:t===l?"#38bdf8":"#52525b",transition:"background 0.2s"},className:"jsx-f29a97b83a083e27"},t)),(0,s.jsxs)("span",{style:{marginLeft:"auto",color:y.fgMuted,fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:[l+1," / ",n]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},className:"jsx-f29a97b83a083e27",children:[l>0&&(0,s.jsx)("button",{onClick:i,style:{background:"transparent",border:"1px solid #52525b",color:y.fgMuted,padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-f29a97b83a083e27",children:"上一步"}),e.action&&e.actionLabel&&(0,s.jsx)("button",{onClick:()=>{e.action?.(),o()},style:{background:y.primary,border:"none",color:y.bg,padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:e.actionLabel}),l<n-1?(0,s.jsx)("button",{onClick:o,style:{background:y.primary,border:"none",color:y.bg,padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:"下一步"}):(0,s.jsx)("button",{onClick:c,style:{background:y.success,border:"none",color:y.bg,padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:"完成"}),(0,s.jsx)("button",{onClick:d,style:{background:"transparent",border:"none",color:y.fgMuted,padding:"8px 12px",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:"跳过"})]}),(0,s.jsx)("div",{style:{marginTop:"12px",paddingTop:"12px",borderTop:`1px solid ${y.border}`},className:"jsx-f29a97b83a083e27",children:(0,s.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:y.fgMuted,fontSize:"0.8rem",cursor:"pointer"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("input",{type:"checkbox",onChange:e=>{e.target.checked&&p()},style:{accentColor:"#38bdf8"},className:"jsx-f29a97b83a083e27"}),"不再显示指引"]})})]}),(0,s.jsx)(t.default,{id:"f29a97b83a083e27",children:"@keyframes fadeInScale{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}"})]}),document.body)}function w({steps:e,onComplete:t,onSkip:r,onDontShowAgain:l,startStep:n=0}){let[o,i]=(0,a.useState)(n),[d,c]=(0,a.useState)(!0);return 0===e.length||o>=e.length?null:(0,s.jsx)(N,{step:e[o],currentStep:o,totalSteps:e.length,onNext:()=>{o<e.length-1?i(o+1):(c(!1),t())},onPrev:()=>{o>0&&i(o-1)},onSkip:()=>{r(e[o].id),c(!1),t()},onDismiss:()=>{c(!1),t()},onDontShowAgain:l,isVisible:d})}let _=[{id:"welcome",target:"",title:"欢迎使用 Skill-insight",content:"这是智能体技能评估、分析与优化平台。接下来将引导您完成关键配置,帮助您快速上手使用。",position:"center"},{id:"eval-config",target:".controls",title:"配置评测模型",content:"配置评测模型是使用平台核心分析能力的前提,用于:数据集数据项抽取、Skill执行分析、有效性分析。您可以选择 DeepSeek、OpenAI 等模型作为评测引擎。点击⚙️按钮可以配置评测模型的 API Key 和参数。",position:"bottom",actionLabel:"配置模型"},{id:"dataset-config",target:".tabs .tab-btn:nth-child(2)",title:"配置数据集",content:'数据集用于定义测试问题和标准答案。配置数据集后,系统将使用刚才配置的评测模型自动评估 Agent 的回答质量。点击"数据集管理"标签页可以添加和管理您的测试数据集。',position:"bottom",actionLabel:"前往配置"},{id:"skill-upload",target:".tabs .tab-btn:nth-child(3)",title:"上传技能包",content:'Skill(技能包)是 Agent 执行特定任务的指导文档。上传技能包后,您可以评估其在 Agent 中的实际效果。点击"技能管理"标签页可以上传和管理技能包。',position:"bottom",actionLabel:"前往上传"},{id:"user-manual",target:".title",title:"查看用户手册",content:"需要更详细的帮助?您可以查看用户使用手册获取完整的使用说明和最佳实践指南。",position:"bottom",linkUrl:"https://atomgit.com/openeuler/witty-skill-insight/wiki/%E7%94%A8%E6%88%B7%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C",linkText:"📖 查看用户使用手册"}],C=["#2563eb","#7c3aed","#16a34a","#d97706","#db2777","#dc2626"],z=["#3b82f6","#818cf8","#22c55e","#f59e0b","#f472b6","#ef4444"],T=e=>{if(e<1e3)return`${e.toFixed(0)}ms`;let s=e/1e3;if(s>=60){let e=Math.floor(s/60),t=Math.round(s%60);return 0===t?`${e}m`:`${e}m${t}s`}return`${s.toFixed(1)}s`},$=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString(),R=e=>null==e?null:0===e?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`,F=(e,s)=>{switch(s){case"latency":return e.latency;case"accuracy":return e.answer_score??0;case"tokens":return e.tokens;case"cost":return e.cost??0;case"recall":return(e.skill_recall_rate??0)*100}},I=(e,s)=>{switch(s){case"latency":return null!=e.latency;case"accuracy":return null!=e.answer_score;case"tokens":return null!=e.tokens;case"cost":return null!=e.cost;case"recall":return null!=e.skill_recall_rate}},A=e=>{switch(e){case"latency":return"时延";case"accuracy":return"准确率";case"tokens":return"令牌数";case"cost":return"成本";case"recall":return"召回率"}},W=(e,s)=>{switch(s){case"latency":return T(e.latency);case"accuracy":return null===e.answer_score?"--":(e.answer_score||0).toFixed(2);case"tokens":return $(e.tokens);case"cost":return R(e.cost)||"-";case"recall":return null==e.skill_recall_rate?"--":`${((e.skill_recall_rate??0)*100).toFixed(1)}%`}},M=e=>"latency"===e||"tokens"===e||"cost"===e,B=(e,t,a=!1)=>{if(null===e)return null;if(.05>Math.abs(e))return(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:a?"#71717a":"#a1a1aa",marginLeft:"4px"},children:"—"});let r=e>0;return(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:(t?!r:r)?a?"#22c55e":"#16a34a":a?"#ef4444":"#dc2626",marginLeft:"4px"},children:[r?"↑":"↓",Math.abs(e).toFixed(1),"%"]})},D=e=>{let s=e.filter(e=>null!=e.cost);if(0===s.length)return null;let t=s.length,a=s.filter(e=>e.is_answer_correct).length;return 0===a?null:s.reduce((e,s)=>e+(s.cost||0),0)/t/(a/t)},O=e=>{let s=e.filter(e=>null!==e.answer_score&&void 0!==e.answer_score);return 0===s.length?{successRate:null,evaluatedCount:0}:{successRate:s.filter(e=>!0===e.is_answer_correct).length/s.length,evaluatedCount:s.length}},E=e=>{if(!e)return"-";let s=new Date(e);return s.getFullYear()+"/"+String(s.getMonth()+1).padStart(2,"0")+"/"+String(s.getDate()).padStart(2,"0")+" "+String(s.getHours()).padStart(2,"0")+":"+String(s.getMinutes()).padStart(2,"0")+":"+String(s.getSeconds()).padStart(2,"0")},L=({content:e})=>{let t=(0,f.useThemeColors)(),[l,n]=(0,a.useState)(!1),o=(0,a.useRef)(null),[i,d]=(0,a.useState)({top:0,left:0});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{ref:o,style:{marginLeft:"4px",cursor:"help",fontSize:"0.8rem",display:"inline-block"},onMouseEnter:()=>{if(o.current){let e=o.current.getBoundingClientRect();d({top:e.top,left:e.left+e.width/2}),n(!0)}},onMouseLeave:()=>n(!1),children:"ⓘ"}),l&&"u">typeof document&&(0,r.createPortal)((0,s.jsxs)("div",{style:{position:"fixed",top:i.top-8,left:i.left,transform:"translate(-50%, -100%)",background:t.bg,border:`1px solid ${t.border}`,color:t.fg,padding:"6px 10px",borderRadius:"4px",whiteSpace:"pre-wrap",minWidth:"200px",textAlign:"left",zIndex:9999,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",pointerEvents:"none"},children:[e,(0,s.jsx)("div",{style:{position:"absolute",top:"100%",left:"50%",marginLeft:"-4px",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:`4px solid ${t.border}`}})]}),document.body)]})};function P(){let e,r,b,g,j,y,{user:v,apiKey:k}=(0,h.useAuth)(),[N,P]=(0,a.useState)(!1),{theme:U,toggleTheme:q,isDark:H}=(0,f.useTheme)(),K=(0,f.useThemeColors)(),[J,V]=(0,a.useState)(null),{guideState:Y,loading:Q,shouldShowGuide:X,setShouldShowGuide:G,markStepSkipped:Z,disableGuide:ee,dismissForToday:es}=function(e){let[s,t]=(0,a.useState)(null),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(!1),i=(0,a.useCallback)(async()=>{if(!e)return void l(!1);try{let s=await (0,u.apiFetch)("/api/guide",{headers:{"x-user-id":e}});if(s.ok){let e=await s.json(),a={...e,completedSteps:JSON.parse(e.completedSteps||"[]"),skippedSteps:JSON.parse(e.skippedSteps||"[]")};t(a);let r=e.guideDisabled,l=e.dismissedAt&&new Date(e.dismissedAt).toDateString()===new Date().toDateString();o(!r&&!l)}}catch(e){console.error("Failed to fetch guide state:",e)}finally{l(!1)}},[e]);(0,a.useEffect)(()=>{i()},[i]);let d=(0,a.useCallback)(async s=>{if(e)try{let a=await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":e},body:JSON.stringify(s)});if(a.ok){let e=await a.json(),s={...e,completedSteps:JSON.parse(e.completedSteps||"[]"),skippedSteps:JSON.parse(e.skippedSteps||"[]")};return t(s),s}}catch(e){console.error("Failed to update guide state:",e)}},[e]),c=(0,a.useCallback)(async e=>{if(!s)return;let t=[...new Set([...s.completedSteps,e])];await d({completedSteps:t})},[s,d]),p=(0,a.useCallback)(async e=>{if(!s)return;let t=[...new Set([...s.skippedSteps,e])];await d({skippedSteps:t})},[s,d]),x=(0,a.useCallback)(async()=>{await d({guideDisabled:!0}),o(!1)},[d]),m=(0,a.useCallback)(async()=>{await d({guideDisabled:!1,dismissedAt:null}),o(!0)},[d]),f=(0,a.useCallback)(async()=>{await d({dismissedAt:new Date().toISOString()}),o(!1)},[d]),h=(0,a.useCallback)(async()=>{await d({currentStep:0,completedSteps:[],skippedSteps:[],guideDisabled:!1,dismissedAt:null}),o(!0)},[d]);return{guideState:s,loading:r,shouldShowGuide:n,setShouldShowGuide:o,markStepCompleted:c,markStepSkipped:p,disableGuide:x,enableGuide:m,dismissForToday:f,resetGuide:h,setCurrentStep:(0,a.useCallback)(async e=>{await d({currentStep:e})},[d]),refresh:i}}(v),[et,ea]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(Y){var e,s;ea((e=Y.completedSteps,s=Y.skippedSteps,_.filter(t=>!e.includes(t.id)&&!s.includes(t.id))).map(e=>{if("welcome"===e.id&&k&&1){let s=window.location.host,t=window.location.protocol,a=`${t}//${s}`,r=(0,u.getApiUrl)("/api/setup"),l=`curl -sSf "${a}${r}" | bash`,n=`irm "${a}${r}" | iex`;return{...e,setupCommands:{linux:l,windows:n},apiKey:k}}return e}))}},[Y,k]),(0,a.useEffect)(()=>{if(k)V(k);else if(1){let e=localStorage.getItem("api_key");e&&V(e)}},[k]);let[er,el]=(0,a.useState)("dashboard"),[en,eo]=(0,a.useState)(!1);(0,a.useEffect)(()=>{en&&v&&(0,u.apiFetch)("/api/auth/apikey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:v})}).then(e=>e.json()).then(e=>{e.apiKey&&(V(e.apiKey),localStorage.setItem("api_key",e.apiKey))}).catch(e=>console.error("Failed to fetch fresh API key",e))},[en,v]);let[ei,ed]=(0,a.useState)([]),[ec,ep]=(0,a.useState)(!0),[ex,em]=(0,a.useState)([]),[ef,eu]=(0,a.useState)([]),[eh,eb]=(0,a.useState)(new Set),[eg,ej]=(0,a.useState)(null),[ey,ev]=(0,a.useState)(null),[ek,eS]=(0,a.useState)(""),[eN,ew]=(0,a.useState)("all"),[e_,eC]=(0,a.useState)("latest_10"),[ez,eT]=(0,a.useState)(""),[e$,eR]=(0,a.useState)(""),[eF,eI]=(0,a.useState)(""),[eA,eW]=(0,a.useState)(""),[eM,eB]=(0,a.useState)(!1),[eD,eO]=(0,a.useState)([]),[eE,eL]=(0,a.useState)("framework"),[eP,eU]=(0,a.useState)(!1),[eq,eH]=(0,a.useState)(!1),[eK,eJ]=(0,a.useState)([]),[eV,eY]=(0,a.useState)([]),[eQ,eX]=(0,a.useState)("latency"),[eG,eZ]=(0,a.useState)(""),[e0,e5]=(0,a.useState)(!1),[e6,e7]=(0,a.useState)(!1),[e2,e4]=(0,a.useState)(!1),[e3,e1]=(0,a.useState)(null),[e8,e9]=(0,a.useState)([]),[se,ss]=(0,a.useState)("default"),[st,sa]=(0,a.useState)(null),[sr,sl]=(0,a.useState)({id:"new",name:"New Config",provider:"deepseek",model:"deepseek-chat"}),sn=async()=>{e4(!0),e1(null);try{let e=[...e8],s={...sr};"new"===s.id?(s.id=`config_${Date.now()}`,e.push(s)):e=e.map(e=>e.id===s.id?s:e);let t={provider:s.provider,apiKey:s.apiKey,baseUrl:s.baseUrl,model:s.model};e1({type:"success",msg:"Testing connection..."});let a=await (0,u.apiFetch)("/api/settings/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!r.success){e1({type:"error",msg:`Connection Test Failed: ${r.error}`}),e4(!1);return}let l=se;(1===e.length||"default"===se)&&(l=s.id);let n={activeConfigId:l,configs:e},o=await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:n,user:v})});if(o.ok)e9(e),ss(l),sa(null),e1({type:"success",msg:"Saved!"}),setTimeout(()=>e1(null),1500);else{let e=await o.json();e1({type:"error",msg:`Failed to save settings: ${e.error||o.statusText}`})}}catch(e){e1({type:"error",msg:`Error: ${e.message}`})}finally{e4(!1)}},so=async e=>{await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{activeConfigId:e,configs:e8},user:v})}),ss(e)},si=async e=>{if(!confirm("Are you sure?"))return;let s=e8.filter(s=>s.id!==e),t=se;e===se&&(t=s[0]?.id||"");let a={activeConfigId:t,configs:s};await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a,user:v})}),e9(s),ss(t)};(0,a.useEffect)(()=>{sy()},[]),(0,a.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>P(e.org_mode||!1)).catch(()=>{})},[]),(0,a.useEffect)(()=>{e6&&(sy(),e1(null),sa(null))},[e6]),(0,a.useEffect)(()=>{eg&&eg.user_feedback?eZ(eg.user_feedback.comment||""):eZ("")},[eg]);let[sd,sc]=(0,a.useState)(""),[sp,sx]=(0,a.useState)(""),[sm,sf]=(0,a.useState)(""),[su,sh]=(0,a.useState)(""),[sb,sg]=(0,a.useState)(1);(0,a.useEffect)(()=>{sg(1)},[sd,sp,sm,su,eN]);let sj=async()=>{ep(!0);try{let e=v?`/api/data?user=${encodeURIComponent(v)}`:"/api/data",s=await (0,u.apiFetch)(e,{cache:"no-store"}),t=(await s.json()).filter(e=>e.query&&""!==e.query.trim()).map(e=>{let s=Number(e.latency||0);return("opencode"===e.framework||"openhands"===e.framework||"claude"===e.framework)&&(s*=1e3),{...e,tokens:Number(e.tokens||e.Token||0),latency:s,framework:("claude"===e.framework?"claudecode":e.framework)||"Unknown",model:e.model||"Unknown",skill_score:void 0!==e.skill_score?Number(e.skill_score):void 0,answer_score:null===e.answer_score?null:void 0!==e.answer_score?Number(e.answer_score):+!!e.is_answer_correct}});ed(t)}catch(e){console.error("Failed to fetch data",e)}finally{ep(!1)}},sy=(0,a.useCallback)(async()=>{if(v)try{let e=await (0,u.apiFetch)(`/api/settings?user=${encodeURIComponent(v)}`);if(e.ok){let s=await e.json();s.configs&&(e9(s.configs),ss(s.activeConfigId||s.configs[0]?.id||"default"))}}catch(e){console.error("Failed to fetch settings",e)}},[v]);(0,a.useEffect)(()=>{v&&(sj(),v&&(0,u.apiFetch)(`/api/config?user=${encodeURIComponent(v)}`).then(e=>e.json()).then(e=>{Array.isArray(e)?em(e):console.error("Invalid config data received:",e)}).catch(e=>console.error("Failed to fetch configs",e)),v&&(0,u.apiFetch)(`/api/skills?user=${encodeURIComponent(v)}`).then(e=>e.json()).then(e=>{Array.isArray(e)?eu(e):console.error("Invalid skills data received:",e)}).catch(e=>console.error("Failed to fetch skills",e)),sy())},[v,sy]);let sv=async e=>{if(confirm("确定要删除这条记录吗?"))try{(await (0,u.apiFetch)(`/api/data?user=${encodeURIComponent(v||"")}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?sj():alert("删除失败")}catch(e){alert("删除出错")}},sk=async(e,s)=>{if(eg)try{let t={type:e,comment:void 0!==s?s:eG},a={...eg,user_feedback:t};ej(a),ed(e=>e.map(e=>e.task_id===eg.task_id||e.upload_id===eg.upload_id?a:e)),(await (0,u.apiFetch)("/api/data",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({task_id:eg.task_id,upload_id:eg.upload_id,user_feedback:t})})).ok?alert("保存成功"):console.error("Feedback save failed")}catch(e){console.error("Feedback error",e)}},sS=async e=>{let s=e.upload_id||e.task_id||"";if(s&&confirm("确定要重新评估这条记录吗?")){console.log("Rejudging ID:",s),eb(e=>{let t=new Set(e);return t.add(s),t});try{let s=await (0,u.apiFetch)("/api/rejudge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,currentUser:v})});if(s.ok){let t=await s.json();(t.record?.judgment_reason||"").includes("未找到匹配的评测配置")?alert(`重评完成: 未找到匹配的评测配置,Score 已归零。请在「数据集管理」中为该 query 添加完全一致的条目后再重评。`):alert(`重评完成: Score ${t.record.answer_score?.toFixed(2)}`);let a={...t.record,tokens:Number(t.record.tokens||t.record.Token||0),latency:Number(t.record.latency||0),framework:t.record.framework||"Unknown",skill_score:void 0!==t.record.skill_score?Number(t.record.skill_score):void 0,answer_score:null!==t.record.answer_score?Number(t.record.answer_score):+!!t.record.is_answer_correct};ed(s=>s.map(s=>s.upload_id===e.upload_id||s.task_id===e.task_id?a:s)),eg&&(eg.task_id===e.task_id||eg.upload_id===e.upload_id)&&ej(a),sj()}else{let e="重评失败";try{let t=await s.json();t&&t.error&&(e+=`: ${t.error}`)}catch(e){}alert(e)}}catch(e){alert("重评请求出错")}finally{eb(e=>{let t=new Set(e);return t.delete(s),t})}}},sN=async(e,s)=>{try{let t={task_id:e.task_id,upload_id:e.upload_id,label:s};(await (0,u.apiFetch)("/api/data",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(ev(null),sj()):alert("更新标签失败")}catch(e){alert("更新标签出错")}},[sw,s_]=(0,a.useState)({}),[sC,sz]=(0,a.useState)(!1),[sT,s$]=(0,a.useState)(!1),[sR,sF]=(0,a.useState)("manual"),[sI,sA]=(0,a.useState)(null),sW=(0,a.useRef)(new Map);(0,a.useEffect)(()=>()=>{sW.current.forEach(e=>clearTimeout(e))},[]);let sM=(0,a.useCallback)(e=>{let s=async()=>{try{let t=await (0,u.apiFetch)(`/api/config/status?id=${e}`);if(!t.ok)return;let a=await t.json();if("completed"===a.parse_status||"failed"===a.parse_status){em(s=>s.map(s=>s.id===e?{...s,standard_answer:a.standard_answer||s.standard_answer,root_causes:a.root_causes,key_actions:a.key_actions,extractedKeyActions:a.extractedKeyActions,parse_status:a.parse_status}:s));let s=sW.current.get(e);s&&clearTimeout(s),sW.current.delete(e)}else{let t=setTimeout(s,2e3);sW.current.set(e,t)}}catch(a){console.error("Config status poll error:",a);let t=setTimeout(s,5e3);sW.current.set(e,t)}},t=setTimeout(s,2e3);sW.current.set(e,t)},[]);(0,a.useEffect)(()=>{ex.forEach(e=>{"parsing"!==e.parse_status||sW.current.has(e.id)||sM(e.id)})},[ex,sM]);let sB=async()=>{if(!sw.query?.trim())return alert("问题不能为空");if(!sw.id){let e=sw.query.trim();if(ex.some(s=>s.query.trim()===e))return alert("该问题已存在于数据集中,请修改后再保存");sw.query=e}s$(!0);try{if(sw.id){let e=[...ex];e=e.map(e=>e.id===sw.id?{...e,...sw}:e),(await (0,u.apiFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:e,user:v})})).ok?(em(e),sz(!1),s_({})):alert("保存失败")}else{let e;if("manual"===sR&&!sw.standard_answer?.trim())return s$(!1),alert("请填写标准答案");if("document"===sR&&!sI)return s$(!1),alert("请上传案例文档");if("document"===sR&&sI){let s=new FormData;s.append("query",sw.query),s.append("document",sI),v&&s.append("user",v),sw.expectedSkills&&s.append("expectedSkills",JSON.stringify(sw.expectedSkills)),e=await (0,u.apiFetch)("/api/config/create",{method:"POST",body:s})}else e=await (0,u.apiFetch)("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:sw.query,standardAnswer:sw.standard_answer,skill:sw.skill,skillVersion:sw.skillVersion,expectedSkills:sw.expectedSkills,user:v})});if(e.ok){let s=await e.json();s&&s.id&&(em(e=>[s,...e]),"parsing"===s.parse_status&&sM(s.id)),sz(!1),s_({}),sA(null),sF("manual")}else{let s=await e.json();alert(`保存失败: ${s.error||"Unknown error"}`)}}}catch(e){console.error(e),alert("保存出错: "+e.message)}finally{s$(!1)}},sD=async e=>{if(!confirm("确定删除此配置?"))return;let s=ex.filter(s=>s.id!==e);(await (0,u.apiFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:s,user:v})})).ok&&em(s)},sO=(0,a.useMemo)(()=>Array.from(new Set(ei.map(e=>e.framework))).sort(),[ei]),sE=(0,a.useMemo)(()=>Array.from(new Set(ei.map(e=>e.query))).sort(),[ei]),sL=(0,a.useMemo)(()=>{if("all"===eN)return ei;let e=Date.now()-(({"1h":36e5,"3h":108e5,"24h":864e5})[eN]||0);return ei.filter(s=>new Date(s.timestamp).getTime()>e)},[ei,eN]),sP=(0,a.useMemo)(()=>{let e=new Set;return sL.forEach(s=>{s.label&&e.add(s.label)}),Array.from(e).sort()},[sL]),sU=(0,a.useMemo)(()=>{let e=new Set;return sL.forEach(s=>{s.model&&e.add(s.model)}),Array.from(e).sort()},[sL]),sq="framework"===eE?sO:sU,sH=(0,a.useMemo)(()=>{let e=sL;return"single"===e_&&(e=e.filter(e=>e.query===ez)),Array.from(new Set(e.map(e=>e.label||"Other"))).sort()},[sL,e_,ez]),sK=(0,a.useMemo)(()=>{let e=sL;return eF&&(e=e.filter(e=>e.query===eF)),e$&&(e=e.filter(e=>e.framework===e$)),Array.from(new Set(e.map(e=>e.label||"Other"))).sort()},[sL,eF,e$]),sJ=(0,a.useMemo)(()=>{let e=sL;return eF&&(e=e.filter(e=>e.query===eF)),e$&&(e=e.filter(e=>e.framework===e$)),Array.from(new Set(e.map(e=>e.model||"Unknown"))).sort()},[sL,eF,e$]),sV=(0,a.useMemo)(()=>{let e=sL;return e$&&(e=e.filter(e=>e.framework===e$)),Array.from(new Set(e.map(e=>e.query))).sort()},[sL,e$]);(0,a.useEffect)(()=>{e$&&sO.includes(e$)||!(sO.length>0)||eR(sO[0]),!ez&&sE.length>0&&eT(sE[0])},[sO,sE]),(0,a.useEffect)(()=>{eF&&sV.includes(eF)||!(sV.length>0)||eI(sV[0])},[sV]);let sY=(0,a.useMemo)(()=>{let e=sL;if("single"===e_)e=e.filter(e=>e.query===ez);else if("latest_10"===e_){let s=Array.from(new Set(e.map(e=>e.query))).map(s=>({query:s,latestTimestamp:Math.max(...e.filter(e=>e.query===s).map(e=>new Date(e.timestamp).getTime()))})).sort((e,s)=>s.latestTimestamp-e.latestTimestamp).slice(0,10).map(e=>e.query);e=e.filter(e=>s.includes(e.query))}if(eM){let s=[];return Array.from(new Set(e.map(e=>e.label||"Other"))).sort().forEach(t=>{if(eD.length>0&&!eD.includes(t))return;let a=e.filter(e=>(e.label||"Other")===t);if(0===a.length)return;let r={label:t,data:[]};Array.from(new Set(a.map(e=>e.query))).forEach(e=>{let s={shortQuery:e.length>15?e.substring(0,15)+"...":e};sq.forEach(t=>{let r=a.filter(s=>s.query===e&&("framework"===eE?s.framework:s.model||"Unknown")===t);if(r.length>0){let e=r.reduce((e,s)=>e+s.latency,0)/r.length,a=r.reduce((e,s)=>e+s.tokens,0)/r.length,l=r.filter(e=>null!==e.answer_score),n=l.length>0,o=n?l.reduce((e,s)=>e+(s.answer_score||0),0)/l.length:0,i=r.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/r.length*100;s[`${t}_lat`]=parseFloat(e.toFixed(2)),s[`${t}_tok`]=Math.round(a),s[`${t}_score`]=n?parseFloat(o.toFixed(2)):null,s[`${t}_recall`]=parseFloat(i.toFixed(1))}}),Object.keys(s).length>1&&r.data.push(s)}),r.data.length>0&&s.push(r)}),s}{let s={};e.forEach(e=>{s[e.query]||(s[e.query]=[]),s[e.query].push(e)});let t=[];return(Object.keys(s).forEach(e=>{let a=s[e],r=Math.max(...a.map(e=>new Date(e.timestamp).getTime())),l={query:e,shortQuery:e.length>15?e.substring(0,15)+"...":e,latestTimestamp:r},n=!1;sq.forEach(e=>{let s=a.filter(s=>("framework"===eE?s.framework:s.model||"Unknown")===e);if(s.length>0){let t=s.reduce((e,s)=>e+s.latency,0)/s.length,a=s.reduce((e,s)=>e+s.tokens,0)/s.length,r=s.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/s.length*100,o=s.filter(e=>null!==e.answer_score),i=o.length>0,d=i?o.reduce((e,s)=>e+(s.answer_score||0),0)/o.length:0;l[`${e}_lat`]=parseFloat(t.toFixed(2)),l[`${e}_tok`]=Math.round(a),l[`${e}_recall`]=parseFloat(r.toFixed(1)),l[`${e}_score`]=i?parseFloat(d.toFixed(2)):null,n=!0}}),n&&t.push(l)}),t.sort((e,s)=>s.latestTimestamp-e.latestTimestamp),"latest_10"===e_)?t.slice(0,10):t}},[sL,e_,ez,eM,eD,sq,eE]),sQ=(0,a.useMemo)(()=>{if(!eF)return null;let e=sL.filter(e=>e.query===eF);if(e$&&(e=e.filter(e=>e.framework===e$)),0===e.length)return null;let s=e.reduce((e,s)=>e+s.latency,0),t=M(eQ),a=e.filter(e=>I(e,eQ)),r=a.length>0?[...a].sort((e,s)=>{let a=F(e,eQ),r=F(s,eQ);return t?a-r:r-a}):[],l=new Set(ex.filter(e=>e.skill&&""!==e.skill.trim()||e.expectedSkills&&e.expectedSkills.some(e=>e.skill&&""!==e.skill.trim())).map(e=>e.query.trim())),n=sL.filter(e=>e.query&&l.has(e.query.trim())).filter(e=>null!==e.skill_recall_rate&&void 0!==e.skill_recall_rate),o=n.length>0?n.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/n.length*100:0,i=e.filter(e=>null!==e.skill_recall_rate&&void 0!==e.skill_recall_rate),d=i.length>0?i.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/i.length*100:0,c=e.filter(e=>null!=e.cost),p=c.length?c.reduce((e,s)=>e+(s.cost||0),0)/c.length:null,x=D(e);return{count:e.length,avgLatency:s/e.length,avgTokens:Math.round(e.reduce((e,s)=>e+s.tokens,0)/e.length),avgCost:p,globalSkillRecallRate:o,querySkillRecallRate:d,cpsr:x,avgAnsScore:e.filter(e=>null!==e.answer_score).length?e.filter(e=>null!==e.answer_score).reduce((e,s)=>e+(s.answer_score||0),0)/e.filter(e=>null!==e.answer_score).length:0,best:r.length>0?r[0]:null,worst:r.length>0?r[r.length-1]:null,avgSkillScore:e.reduce((e,s)=>e+(s.skill_score||0),0)/e.filter(e=>void 0!==e.skill_score).length||0}},[sL,e$,eF,ex,eQ]),sX=(0,a.useMemo)(()=>sL.filter(e=>(!sd||e.framework===sd)&&(!sp||e.label===sp)&&(!su||e.model===su)&&(!sm||!!e.query.toLowerCase().includes(sm.toLowerCase()))),[sL,sd,sp,su,sm]),sG=Math.ceil(sX.length/10),sZ=sX.slice((sb-1)*10,10*sb),s0=(0,a.useMemo)(()=>{let e=new Map,s=sL.filter(e=>e.skill&&null!=e.skill_version),t=new Map;for(let e of s){let s=`${e.query}|||${e.skill}`;t.has(s)||t.set(s,[]),t.get(s).push(e)}for(let[,s]of Array.from(t.entries())){s.sort((e,s)=>parseInt(e.skill_version||"0")-parseInt(s.skill_version||"0"));let t=new Map;for(let e of s){let s=parseInt(e.skill_version||"0");t.has(s)||t.set(s,{latency:0,tokens:0,accuracy:0,cost:0,count:0});let a=t.get(s);a.latency+=e.latency,a.tokens+=e.tokens,a.accuracy+=e.answer_score??0,a.cost+=e.cost??0,a.count+=1}for(let a of s){let s=parseInt(a.skill_version||"0")-1;if(!t.has(s))continue;let r=t.get(s),l=r.latency/r.count,n=r.tokens/r.count,o=r.accuracy/r.count,i=r.cost/r.count,d=a.upload_id||a.task_id||"";d&&e.set(d,{latencyDiff:0!==l?(a.latency-l)/l*100:null,tokenDiff:0!==n?(a.tokens-n)/n*100:null,accuracyDiff:0!==o?((a.answer_score??0)-o)/o*100:null,costDiff:0!==i?((a.cost??0)-i)/i*100:null})}}return e},[sL]),s5=({title:e,dataKey:t,unit:a="",data:r,frameworks:m,yFormatter:f})=>(0,s.jsxs)("div",{className:"card",style:{height:"350px",display:"flex",flexDirection:"column"},children:[(0,s.jsx)("div",{className:"card-title",style:{marginBottom:"10px"},children:e}),(0,s.jsx)("div",{style:{flex:1,minHeight:0},children:(0,s.jsx)(d.ResponsiveContainer,{width:"100%",height:"100%",children:(0,s.jsxs)(n.BarChart,{data:r,margin:{top:10,right:10,left:0,bottom:20},children:[(0,s.jsx)(o.CartesianGrid,{strokeDasharray:"3 3",stroke:"var(--border)"}),(0,s.jsx)(p.XAxis,{dataKey:"shortQuery",stroke:"var(--foreground-secondary)",fontSize:11,angle:-20,textAnchor:"end",height:60}),(0,s.jsx)(x.YAxis,{stroke:"var(--foreground-secondary)",tickFormatter:f}),(0,s.jsx)(c.Tooltip,{formatter:(e,s)=>[void 0!==e?f?f(e):e+a:"-",s||""],contentStyle:{backgroundColor:"var(--dropdown-bg)",borderColor:"var(--border)",color:"var(--foreground)"}}),(0,s.jsx)(i.Legend,{}),m.map((e,a)=>(0,s.jsx)(l.Bar,{dataKey:`${e}_${t}`,name:e,fill:(H?z:C)[a%(H?z:C).length],radius:[4,4,0,0]},e))]})})})]});return(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 dashboard-container",children:[(0,s.jsxs)("header",{style:{flexDirection:"column",alignItems:"flex-start",gap:"1rem"},className:"jsx-6f5ba7556324d067 header",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h1",{style:{marginBottom:0},className:"jsx-6f5ba7556324d067 title",children:"Skill-insight"}),(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",letterSpacing:"1px"},className:"jsx-6f5ba7556324d067",children:"智能体技能评估、分析与优化"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 tabs",children:[(0,s.jsx)("button",{onClick:()=>el("dashboard"),className:`jsx-6f5ba7556324d067 tab-btn ${"dashboard"===er?"active":""}`,children:"数据概览"}),(0,s.jsx)("button",{onClick:()=>el("config"),className:`jsx-6f5ba7556324d067 tab-btn ${"config"===er?"active":""}`,children:"数据集管理"}),(0,s.jsx)("button",{onClick:()=>el("skill"),className:`jsx-6f5ba7556324d067 tab-btn ${"skill"===er?"active":""}`,children:"技能管理"})]})]}),"dashboard"===er&&(0,s.jsxs)("div",{style:{display:"flex",gap:"8px"},className:"jsx-6f5ba7556324d067 controls",children:[(0,s.jsx)("button",{onClick:q,title:H?"切换到浅色主题":"切换到深色主题",className:"jsx-6f5ba7556324d067 theme-toggle-btn",children:H?"☀️":"🌙"}),(0,s.jsxs)("select",{value:eN,onChange:e=>ew(e.target.value),className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"all",className:"jsx-6f5ba7556324d067",children:"全部时间"}),(0,s.jsx)("option",{value:"24h",className:"jsx-6f5ba7556324d067",children:"24H"}),(0,s.jsx)("option",{value:"3h",className:"jsx-6f5ba7556324d067",children:"3H"}),(0,s.jsx)("option",{value:"1h",className:"jsx-6f5ba7556324d067",children:"1H"})]}),e8.length>0?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px",border:"1px solid var(--border)",borderRadius:"4px",padding:"4px 8px",background:"var(--background-secondary)"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-6f5ba7556324d067",children:"模型:"}),(0,s.jsxs)("select",{value:se||"none",onChange:e=>so(e.target.value),style:{background:"transparent",color:"var(--foreground-secondary)",border:"none",maxWidth:"140px",outline:"none",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"none",className:"jsx-6f5ba7556324d067",children:"未配置模型"}),e8.map(e=>(0,s.jsx)("option",{value:e.id,className:"jsx-6f5ba7556324d067",children:e.name},e.id))]}),(0,s.jsx)("div",{style:{width:"1px",height:"14px",background:"var(--border)",margin:"0 4px"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{onClick:()=>e7(!0),style:{background:"transparent",border:"none",cursor:"pointer",padding:"0",fontSize:"1rem"},title:"Manage Configurations",className:"jsx-6f5ba7556324d067",children:"⚙️"})]}):(0,s.jsx)("button",{style:{padding:"4px 8px",background:"transparent",border:"1px solid var(--border)",color:"var(--foreground-secondary)"},onClick:()=>e7(!0),className:"jsx-6f5ba7556324d067 btn-secondary",children:"⚙️ Eval Config"})]})]}),e6&&(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:K.overlayBg,display:"flex",alignItems:"center",justifyContent:"center",zIndex:2e3},onClick:e=>{e.target===e.currentTarget&&e7(!1)},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("div",{style:{width:"600px",maxHeight:"90vh",overflowY:"auto"},className:"jsx-6f5ba7556324d067 card",children:[!st&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h3",{style:{margin:0,color:K.fg},className:"jsx-6f5ba7556324d067",children:"管理模型配置"}),(0,s.jsx)("button",{onClick:()=>e7(!1),style:{background:"transparent",border:"none",color:K.fgSecondary,fontSize:"1.2rem",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"1.5rem"},className:"jsx-6f5ba7556324d067",children:e8.map(e=>{let t=e.id.startsWith("default_");return(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px",background:se===e.id?"rgba(37, 99, 235, 0.1)":"#f4f4f5",border:se===e.id?"1px solid #2563eb":"1px solid #e4e4e7",borderRadius:"6px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontWeight:"bold",color:se===e.id?"#2563eb":"#1e293b"},className:"jsx-6f5ba7556324d067",children:[e.name," ",se===e.id&&"(Active)",t&&(0,s.jsx)("span",{style:{marginLeft:"8px",fontSize:"0.8rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067",children:"📋 Default (Read-only)"})]}),(0,s.jsxs)("div",{style:{fontSize:"0.8rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067",children:[e.provider," • ",e.model]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"8px"},className:"jsx-6f5ba7556324d067",children:[se!==e.id&&(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem"},onClick:()=>so(e.id),className:"jsx-6f5ba7556324d067 btn-secondary",children:"Activate"}),!t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem"},onClick:()=>{sl({...e}),sa(e.id),e1(null)},className:"jsx-6f5ba7556324d067 btn-secondary",children:"Edit"}),(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem",color:K.error,borderColor:K.error},onClick:()=>si(e.id),className:"jsx-6f5ba7556324d067 btn-secondary",children:"Del"})]})]})]},e.id)})}),(0,s.jsx)("button",{style:{width:"100%",display:"flex",justifyContent:"center",gap:"8px"},onClick:()=>{sl({id:"new",name:"新配置",provider:"deepseek",model:"deepseek-chat",apiKey:"",baseUrl:"https://api.deepseek.com"}),sa("new"),e1(null)},className:"jsx-6f5ba7556324d067 btn-primary",children:"+ 添加新配置"})]}),st&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h3",{style:{margin:0,color:K.fg},className:"jsx-6f5ba7556324d067",children:"new"===st?"新配置":"编辑"}),(0,s.jsx)("button",{onClick:()=>sa(null),style:{background:"transparent",border:"none",color:K.fgSecondary,fontSize:"0.9rem",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"Back to List"})]}),e3&&(0,s.jsx)("div",{style:{padding:"10px",marginBottom:"1rem",borderRadius:"4px",background:"success"===e3.type?"rgba(22, 163, 74, 0.1)":"rgba(220, 38, 38, 0.1)",border:`1px solid ${"success"===e3.type?"#16a34a":"#dc2626"}`,color:"success"===e3.type?"#16a34a":"#dc2626",fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:e3.msg}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{className:"jsx-6f5ba7556324d067",children:"Config Name"}),(0,s.jsx)("input",{placeholder:"e.g. My DeepSeek, Company OpenAI Proxy",value:sr.name||"",onChange:e=>sl({...sr,name:e.target.value}),disabled:st.startsWith("default_"),style:{width:"100%",padding:"10px",background:K.bg,border:`1px solid ${K.borderDark}`,color:K.fg,borderRadius:"4px"},className:"jsx-6f5ba7556324d067"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{className:"jsx-6f5ba7556324d067",children:"Provider"}),(0,s.jsxs)("select",{value:sr.provider,onChange:e=>{let s=e.target.value,t={provider:s};"deepseek"===s?(t.baseUrl="https://api.deepseek.com",t.model="deepseek-chat"):"siliconflow"===s?(t.baseUrl="https://api.siliconflow.cn/v1",t.model="deepseek-ai/DeepSeek-V3"):"openai"===s?(t.baseUrl="https://api.openai.com/v1",t.model="gpt-4o"):"anthropic"===s&&(t.baseUrl="https://api.anthropic.com/v1",t.model="claude-3-5-sonnet-20240620"),sl({...sr,...t})},disabled:st.startsWith("default_"),style:{width:"100%",padding:"10px",background:K.bg,border:`1px solid ${K.borderDark}`,color:K.fg,borderRadius:"4px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"deepseek",className:"jsx-6f5ba7556324d067",children:"DeepSeek (Official)"}),(0,s.jsx)("option",{value:"siliconflow",className:"jsx-6f5ba7556324d067",children:"SiliconFlow (DeepSeek V3 High Speed)"}),(0,s.jsx)("option",{value:"openai",className:"jsx-6f5ba7556324d067",children:"OpenAI"}),(0,s.jsx)("option",{value:"anthropic",className:"jsx-6f5ba7556324d067",children:"Anthropic"}),(0,s.jsx)("option",{value:"custom",className:"jsx-6f5ba7556324d067",children:"Custom (OpenAI Compatible)"})]})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{className:"jsx-6f5ba7556324d067",children:"Base URL (Optional)"}),(0,s.jsx)("input",{placeholder:"e.g. https://api.deepseek.com or https://api.openai.com/v1",value:sr.baseUrl||"",onChange:e=>{let s=e.target.value;s=s.replace(/\/chat\/completions\/?$/,""),sl({...sr,baseUrl:s})},disabled:st.startsWith("default_"),style:{width:"100%",padding:"10px",background:K.bg,border:`1px solid ${K.borderDark}`,color:K.fg,borderRadius:"4px"},className:"jsx-6f5ba7556324d067"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{className:"jsx-6f5ba7556324d067",children:"密钥"}),(0,s.jsx)("input",{type:"password",placeholder:"sk-...",value:sr.apiKey||"",onChange:e=>sl({...sr,apiKey:e.target.value}),disabled:st.startsWith("default_"),style:{width:"100%",padding:"10px",background:K.bg,border:`1px solid ${K.borderDark}`,color:K.fg,borderRadius:"4px"},className:"jsx-6f5ba7556324d067"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{className:"jsx-6f5ba7556324d067",children:"Model Name"}),(0,s.jsx)("input",{placeholder:"e.g. deepseek-chat, gpt-4o",value:sr.model||"",onChange:e=>sl({...sr,model:e.target.value}),disabled:st.startsWith("default_"),style:{width:"100%",padding:"10px",background:K.bg,border:`1px solid ${K.borderDark}`,color:K.fg,borderRadius:"4px"},className:"jsx-6f5ba7556324d067"})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"2rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>sa(null),className:"jsx-6f5ba7556324d067 btn-secondary",children:"Cancel"}),!st.startsWith("default_")&&(0,s.jsxs)("button",{onClick:sn,disabled:e2,style:{opacity:e2?.7:1,display:"flex",alignItems:"center",gap:"6px"},className:"jsx-6f5ba7556324d067 btn-primary",children:[e2&&(0,s.jsx)("span",{style:{width:"12px",height:"12px",border:"2px solid white",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"},className:"jsx-6f5ba7556324d067"}),e2?"Testing & Saving...":"Test Connection & Save"]})]})]})]})}),"dashboard"===er&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"jsx-6f5ba7556324d067 section-title",children:"全景概览"}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 grid",children:sO.map((e,t)=>{let a=sL.filter(s=>s.framework===e),r=new Set(ex.filter(e=>e.skill&&""!==e.skill.trim()||e.expectedSkills&&e.expectedSkills.some(e=>e.skill&&""!==e.skill.trim())).map(e=>e.query.trim())),l=a.filter(e=>e.query&&r.has(e.query.trim())),n=a.length?a.reduce((e,s)=>e+s.latency,0)/a.length:0,o=a.length?a.reduce((e,s)=>e+s.tokens,0)/a.length:0,i=a.filter(e=>null!==e.answer_score),d=i.length>0,c=d?i.reduce((e,s)=>e+(s.answer_score||0),0)/i.length:0,p=l.length?l.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/l.length*100:0;return(0,s.jsxs)("div",{style:{borderLeft:`4px solid ${(H?z:C)[t%(H?z:C).length]}`},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsx)("div",{style:{color:(H?z:C)[t%(H?z:C).length],fontSize:"0.9375rem",fontWeight:600},className:"jsx-6f5ba7556324d067 card-title",children:e}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 stat-value",children:[a.length," ",(0,s.jsx)("small",{style:{fontSize:"1rem",color:"var(--foreground-muted)"},className:"jsx-6f5ba7556324d067",children:"执行数"})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.2rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",textTransform:"uppercase"},className:"jsx-6f5ba7556324d067",children:"时延"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--foreground)"},className:"jsx-6f5ba7556324d067",children:T(n)})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",textTransform:"uppercase"},className:"jsx-6f5ba7556324d067",children:"TOKEN"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--foreground)"},className:"jsx-6f5ba7556324d067",children:$(Math.round(o))})]})]}),(0,s.jsxs)("div",{style:{marginTop:"0.8rem",paddingTop:"0.8rem",borderTop:"1px solid var(--border)",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.2rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-6f5ba7556324d067",children:"准确率"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:d?c>.8?"var(--success)":"var(--warning)":"var(--foreground-muted)"},className:"jsx-6f5ba7556324d067",children:d?`${(100*c).toFixed(1)}%`:"--"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-6f5ba7556324d067",children:"技能召回率"}),(0,s.jsxs)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--warning)"},className:"jsx-6f5ba7556324d067",children:[p.toFixed(1),"%"]})]})]})]},e)})}),(0,s.jsx)("h2",{className:"jsx-6f5ba7556324d067 section-title",children:"对比分析"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 analysis-controls",children:[(0,s.jsx)("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},className:"jsx-6f5ba7556324d067",children:["single","latest_10","all"].map(e=>(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"radio",checked:e_===e,onChange:()=>eC(e),className:"jsx-6f5ba7556324d067"}),"latest_10"===e?"最新10问":"all"===e?"所有":"单问题"]},e))}),"single"===e_&&(0,s.jsx)("select",{value:ez,onChange:e=>eT(e.target.value),style:{maxWidth:"300px"},className:"jsx-6f5ba7556324d067",children:sE.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e.substring(0,40)},e))}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",gap:"8px",borderLeft:"1px solid var(--border)",paddingLeft:"10px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{color:"var(--foreground-secondary)",fontSize:"0.9rem",display:"flex",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:"分类:"}),(0,s.jsx)("button",{onClick:()=>eL("framework"),style:{padding:"2px 8px",fontSize:"0.8rem",background:"framework"===eE?"var(--primary)":"transparent",color:"framework"===eE?"#ffffff":"var(--foreground-secondary)",border:"1px solid var(--primary)"},className:`jsx-6f5ba7556324d067 tab-btn-sm ${"framework"===eE?"active":""}`,children:"框架"}),(0,s.jsx)("button",{onClick:()=>eL("model"),style:{padding:"2px 8px",fontSize:"0.8rem",background:"model"===eE?"var(--primary)":"transparent",color:"model"===eE?"#ffffff":"var(--foreground-secondary)",border:"1px solid var(--primary)"},className:`jsx-6f5ba7556324d067 tab-btn-sm ${"model"===eE?"active":""}`,children:"模型"})]}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center",gap:"10px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eM,onChange:e=>{eB(e.target.checked),e.target.checked&&eD.length},className:"jsx-6f5ba7556324d067"}),"按标签分类"]}),eM&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067 dropdown-trigger",children:[0===eD.length?"所有标签":`已选 ${eD.length} 个`,(0,s.jsx)("span",{style:{float:"right",fontSize:"0.8rem"},className:"jsx-6f5ba7556324d067",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)"},className:"jsx-6f5ba7556324d067 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eD.length,onChange:()=>eO([]),className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:"所有标签"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-6f5ba7556324d067"}),sH.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eD.includes(e),onChange:s=>{s.target.checked?eO([...eD,e]):eO(eD.filter(s=>s!==e))},className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:e})]},e))]})]})]})]}),eM?(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[sY.map(e=>(0,s.jsxs)("div",{style:{marginBottom:"2rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("h3",{style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)",paddingBottom:"0.5rem",marginBottom:"1rem"},className:"jsx-6f5ba7556324d067",children:["Tag: ",(0,s.jsx)("span",{style:{color:K.primary},className:"jsx-6f5ba7556324d067",children:e.label})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 analysis-grid",children:[(0,s.jsx)(s5,{title:"平均时延",unit:"m",dataKey:"lat",data:e.data,frameworks:sq,yFormatter:e=>(e/6e4).toFixed(2)+"m"}),(0,s.jsx)(s5,{title:"平均消耗",dataKey:"tok",data:e.data,frameworks:sq,yFormatter:$}),(0,s.jsx)(s5,{title:"平均准确率",dataKey:"score",unit:"",data:e.data,frameworks:sq}),(0,s.jsx)(s5,{title:"平均技能召回率",dataKey:"recall",unit:"%",data:e.data,frameworks:sq,yFormatter:e=>Number(e).toFixed(1)+"%"})]})]},e.label)),0===sY.length&&(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067 card",children:"无数据"})]}):sY.length>0?(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 analysis-grid",children:[(0,s.jsx)(s5,{title:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["平均时延 ",(0,s.jsx)(L,{content:"基于选中查询的所有执行结果计算出的平均总响应耗时(分钟)"})]}),dataKey:"lat",unit:"m",data:sY,frameworks:sq,yFormatter:e=>(e/6e4).toFixed(2)+"m",className:"jsx-6f5ba7556324d067"}),(0,s.jsx)(s5,{title:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["平均消耗 ",(0,s.jsx)(L,{content:"基于选中查询的所有执行结果计算出的平均令牌消耗总额"})]}),dataKey:"tok",unit:"",data:sY,frameworks:sq,yFormatter:$,className:"jsx-6f5ba7556324d067"}),(0,s.jsx)(s5,{title:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["平均准确率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:["基于LLM评估所有执行结果与期望答案的差异,计算出的0-1分值的平均值,1表示完全正确。",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),'"--"表示评估失败,可能是由于模型未配置(请在首页左上角的设置中配置 LLM)或者数据项未配置。']})})]}),dataKey:"score",unit:"",data:sY,frameworks:sq,className:"jsx-6f5ba7556324d067"}),(0,s.jsx)(s5,{title:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["平均技能召回率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:["基于执行结果是否使用了预期技能计算出的百分比,表示正确调用技能的比例。",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"这是全局指标,反映技能路由的准确性。"]})})]}),dataKey:"recall",unit:"%",data:sY,frameworks:sq,yFormatter:e=>Number(e).toFixed(1)+"%",className:"jsx-6f5ba7556324d067"})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067 card",children:"无数据"}),(0,s.jsx)("h2",{className:"jsx-6f5ba7556324d067 section-title",children:"单问题详情"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 analysis-controls",children:[(0,s.jsxs)("select",{value:e$,onChange:e=>eR(e.target.value),className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"",className:"jsx-6f5ba7556324d067",children:"选择框架"}),sO.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e},e))]}),(0,s.jsxs)("select",{value:eF,onChange:e=>eI(e.target.value),style:{flex:1},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"",className:"jsx-6f5ba7556324d067",children:"选择问题"}),sV.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e.substring(0,80)},e))]}),(0,s.jsxs)("select",{value:eQ,onChange:e=>eX(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"latency",className:"jsx-6f5ba7556324d067",children:"最好/最差指标: 时延"}),(0,s.jsx)("option",{value:"accuracy",className:"jsx-6f5ba7556324d067",children:"最好/最差指标: 准确率"}),(0,s.jsx)("option",{value:"tokens",className:"jsx-6f5ba7556324d067",children:"最好/最差指标: Token"}),(0,s.jsx)("option",{value:"cost",className:"jsx-6f5ba7556324d067",children:"最好/最差指标: 成本"}),(0,s.jsx)("option",{value:"recall",className:"jsx-6f5ba7556324d067",children:"最好/最差指标: 召回率"})]}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center",gap:"20px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eP,onChange:e=>{eU(e.target.checked),e.target.checked&&eH(!1)},className:"jsx-6f5ba7556324d067"}),"按标签分类"]}),(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eq,onChange:e=>{eH(e.target.checked),e.target.checked&&eU(!1)},className:"jsx-6f5ba7556324d067"}),"按模型分类"]}),eP&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-6f5ba7556324d067 dropdown-container",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"space-between",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067 dropdown-trigger",children:[0===eK.length?"所有标签":`已选 ${eK.length} 个`,(0,s.jsx)("span",{style:{fontSize:"0.8rem",marginLeft:"8px"},className:"jsx-6f5ba7556324d067",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eK.length,onChange:()=>eJ([]),className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:"所有标签"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-6f5ba7556324d067"}),sK.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eK.includes(e),onChange:s=>{s.target.checked?eJ([...eK,e]):eJ(eK.filter(s=>s!==e))},className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:e})]},e))]})]}),eq&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-6f5ba7556324d067 dropdown-container",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"space-between",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067 dropdown-trigger",children:[0===eV.length?"所有模型":`已选 ${eV.length} 个`,(0,s.jsx)("span",{style:{fontSize:"0.8rem",marginLeft:"8px"},className:"jsx-6f5ba7556324d067",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eV.length,onChange:()=>eY([]),className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:"所有模型"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-6f5ba7556324d067"}),sJ.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"checkbox",checked:eV.includes(e),onChange:s=>{s.target.checked?eY([...eV,e]):eY(eV.filter(s=>s!==e))},className:"jsx-6f5ba7556324d067"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-6f5ba7556324d067",children:e})]},e))]})]})]})]}),eP||eq?(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067",children:(eP?sK:sJ).filter(e=>eP?0===eK.length||eK.includes(e):0===eV.length||eV.includes(e)).map(e=>{let t=sL;if(t=eP?t.filter(s=>(s.label||"Other")===e):t.filter(s=>(s.model||"Unknown")===e),eF&&(t=t.filter(e=>e.query===eF)),e$&&(t=t.filter(e=>e.framework===e$)),0===t.length)return null;let a=t.length,r=t.reduce((e,s)=>e+s.latency,0)/a,l=Math.round(t.reduce((e,s)=>e+s.tokens,0)/a);t.reduce((e,s)=>e+(s.skill_recall_rate??0),0);let n=t.filter(e=>null!==e.answer_score),o=n.length?n.reduce((e,s)=>e+(s.answer_score||0),0)/n.length:0,i=t.filter(e=>I(e,eQ)),d=i.length>0?[...i].sort((e,s)=>{let t=F(e,eQ),a=F(s,eQ);return M(eQ)?t-a:a-t})[0]:null,c=i.length>0?[...i].sort((e,s)=>{let t=F(e,eQ),a=F(s,eQ);return M(eQ)?a-t:t-a})[0]:null,p=t.filter(e=>null!=e.cost),x=p.length?p.reduce((e,s)=>e+(s.cost||0),0)/p.length:null,m=D(t),f=null;if(eP&&eF&&"without-skill"!==e&&"Other"!==e){let s=sL.filter(e=>e.query===eF);e$&&(s=s.filter(e=>e.framework===e$)),f=((e,s)=>{let t=e.filter(e=>(e.label||"Other")===s),a=e.filter(e=>"without-skill"===e.label),{successRate:r,evaluatedCount:l}=O(t),{successRate:n,evaluatedCount:o}=O(a);return 0===o?{valuePct:null,passSkill:r,passNoSkill:n,evaluatedSkillCount:l,evaluatedBaselineCount:o,reason:"缺少 without-skill 基线或基线数据尚未完成评测,暂无法计算。"}:0===l?{valuePct:null,passSkill:r,passNoSkill:n,evaluatedSkillCount:l,evaluatedBaselineCount:o,reason:"当前标签下暂无可用于计算的已评测数据。"}:null===r||null===n?{valuePct:null,passSkill:r,passNoSkill:n,evaluatedSkillCount:l,evaluatedBaselineCount:o,reason:"当前数据不足以完成 技能提升计算。"}:n>=1?{valuePct:null,passSkill:r,passNoSkill:n,evaluatedSkillCount:l,evaluatedBaselineCount:o,reason:"without-skill 基线成功率为 100%,公式分母为 0,暂无法计算。"}:{valuePct:(r-n)/(1-n)*100,passSkill:r,passNoSkill:n,evaluatedSkillCount:l,evaluatedBaselineCount:o,reason:null}})(s,e)}return(0,s.jsxs)("div",{style:{marginBottom:"2rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{marginBottom:"0.5rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("h3",{style:{margin:0,color:K.primary,fontSize:"1.1rem"},className:"jsx-6f5ba7556324d067",children:[eP?"标签:":"模型:"," ",e]})}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},className:"jsx-6f5ba7556324d067 grid",children:[(0,s.jsxs)("div",{style:{gridColumn:"span 2"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 card-title",children:["平均表现",(0,s.jsxs)("span",{style:{fontSize:"0.85rem",color:K.fgMuted,fontWeight:"normal",marginLeft:"8px"},className:"jsx-6f5ba7556324d067",children:["(基于 ",a," 条记录)"]})]}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"1rem",textAlign:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400",children:"平均时延"}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-xl font-bold",children:T(r)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400",children:"平均 Token"}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-xl font-bold",children:$(l)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400",children:"平均准确率"}),(0,s.jsx)("div",{style:{color:o>.8?"#4ade80":"#fbbf24"},className:"jsx-6f5ba7556324d067 text-xl font-bold",children:o.toFixed(2)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400",children:["平均成本 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出。"})]}),(0,s.jsx)("div",{style:null==x?{color:K.fgSecondary}:{},className:"jsx-6f5ba7556324d067 text-xl font-bold",children:null!=x?R(x):"N/A"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400",children:["CPSR ",(0,s.jsx)(L,{content:"单次成功解决成本:每次任务成功解决的平均开销。\n计算公式:(总成本)÷(成功解决的运行次数)"})]}),(0,s.jsx)("div",{style:{color:null!=m?"#38bdf8":"#64748b"},className:"jsx-6f5ba7556324d067 text-xl font-bold",children:null!=m?R(m):"N/A"})]})]})]}),d&&c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067 card-title text-green-400",children:["最好表现(",M(eQ)?"最小":"最大"," ",A(eQ),")"]}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-xl font-bold",children:W(d,eQ)}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem"},className:"jsx-6f5ba7556324d067 text-sm text-slate-400 mt-2",children:["Token: ",$(d.tokens)," | Score: ",d.answer_score?.toFixed(2)||"-"," ",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"Cost: ",R(d.cost)||"-"," | Latency: ",T(d.latency)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:K.primary,cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=`/details?framework=${encodeURIComponent(d.framework)}&expandTaskId=${d.task_id||d.upload_id}`;window.open(e,"_blank")},className:"jsx-6f5ba7556324d067",children:"查看 >"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067 card-title text-red-400",children:["最差表现(",M(eQ)?"最大":"最小"," ",A(eQ),")"]}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-xl font-bold",children:W(c,eQ)}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem"},className:"jsx-6f5ba7556324d067 text-sm text-slate-400 mt-2",children:["Token: ",$(c.tokens)," | Score: ",c.answer_score?.toFixed(2)||"-"," ",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"Cost: ",R(c.cost)||"-"," | Latency: ",T(c.latency)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:K.primary,cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>window.open(`/details?framework=${encodeURIComponent(c.framework)}&expandTaskId=${c.task_id||c.upload_id}`,"_blank"),className:"jsx-6f5ba7556324d067",children:"查看 >"})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"1rem",color:K.fgMuted,fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067 card",children:"该指标暂无有效数据"}),eP&&null!==f&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067 card-title text-purple-400",children:["技能提升",(0,s.jsx)(L,{content:"表示启用当前 Skill 标签后,相对 without-skill 基线带来的成功率提升。\n计算公式:(skill_success_rate - no_skill_success_rate) / (1 - no_skill_success_rate)\n其中:skill_success_rate 为当前标签下已评测记录的成功率;no_skill_success_rate 为 without-skill 基线下已评测记录的成功率。\n仅在同时存在已评测的当前标签数据和 without-skill 基线数据时才计算。"})]}),(0,s.jsx)("div",{style:{marginTop:"0.5rem",fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsx)("div",{style:{marginBottom:"0.5rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsx)("div",{style:{fontSize:"1.2rem",fontWeight:"bold",color:null==f.valuePct?"#a1a1aa":f.valuePct>0?"#4ade80":f.valuePct<0?"#f87171":"#a1a1aa"},className:"jsx-6f5ba7556324d067",children:null==f.valuePct?"N/A":`${f.valuePct>0?"+":""}${f.valuePct.toFixed(2)}%`})})})]}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067",children:["当前标签成功率:",null==f.passSkill?"N/A":`${(100*f.passSkill).toFixed(1)}%`,(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"基线成功率:",null==f.passNoSkill?"N/A":`${(100*f.passNoSkill).toFixed(1)}%`]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:K.fgSecondary,marginTop:"0.5rem",textAlign:"left",whiteSpace:"pre-wrap"},className:"jsx-6f5ba7556324d067",children:f.reason||"基于 without-skill 基线计算。"})]})]})]},e)})}):sQ?(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 grid",children:[(0,s.jsxs)("div",{style:{gridColumn:"span 2"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 card-title",children:["平均表现",(0,s.jsxs)("span",{style:{fontSize:"0.9rem",color:K.fgMuted,fontWeight:"normal",marginLeft:"8px"},className:"jsx-6f5ba7556324d067",children:["(基于 ",sQ.count," 条记录)"]})]}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"1rem",textAlign:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"平均时延"}),(0,s.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:K.fg},className:"jsx-6f5ba7556324d067",children:T(sQ.avgLatency)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"平均 Token"}),(0,s.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:K.fg},className:"jsx-6f5ba7556324d067",children:$(sQ.avgTokens)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"平均技能召回率"}),(0,s.jsxs)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:K.fg},className:"jsx-6f5ba7556324d067",children:[sQ.querySkillRecallRate?.toFixed(2),"%"]})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"平均准确率"}),(0,s.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:sQ.avgAnsScore>.8?K.success:K.warning},className:"jsx-6f5ba7556324d067",children:sQ.avgAnsScore.toFixed(2)})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:["平均成本 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出。"})]}),(0,s.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:K.fg,...null==sQ.avgCost?{color:K.fgSecondary}:{}},className:"jsx-6f5ba7556324d067",children:null!=sQ.avgCost?R(sQ.avgCost):"N/A"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{fontSize:"0.875rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:["CPSR",(0,s.jsx)(L,{content:"单次成功解决成本:每次任务成功解决的平均开销。\n计算公式:(总成本)÷(成功解决的运行次数)"})]}),(0,s.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:null!=sQ.cpsr?K.primary:K.fgSecondary},className:"jsx-6f5ba7556324d067",children:null!=sQ.cpsr?R(sQ.cpsr):"N/A"})]})]})]}),sQ.best&&sQ.worst?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 card-title text-green-400",children:["最好表现(",M(eQ)?"最小":"最大"," ",A(eQ),")"]}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-2xl font-bold",children:W(sQ.best,eQ)}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400 mt-2",children:["Token: ",$(sQ.best.tokens)," | Cost: ",R(sQ.best.cost)||"-"," | Latency: ",T(sQ.best.latency)," ",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"Time: ",E(sQ.best.timestamp)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.8rem",color:K.primary,cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=sQ.best;e&&window.open(`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${e.task_id||e.upload_id}`,"_blank")},className:"jsx-6f5ba7556324d067",children:"查看 >"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 card-title text-red-400",children:["最差表现(",M(eQ)?"最大":"最小"," ",A(eQ),")"]}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 text-2xl font-bold",children:W(sQ.worst,eQ)}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 text-sm text-slate-400 mt-2",children:["Token: ",$(sQ.worst.tokens)," | Cost: ",R(sQ.worst.cost)||"-"," | Latency: ",T(sQ.worst.latency)," ",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),"Time: ",E(sQ.worst.timestamp)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.8rem",color:K.primary,cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=sQ.worst;if(!e)return;let s=`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${e.task_id||e.upload_id}`;window.open(s,"_blank")},className:"jsx-6f5ba7556324d067",children:"查看 >"})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067 card",children:"该指标暂无有效数据"})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067 card",children:eF?"该组合下暂无数据":"请选择一个问题进行分析"}),(0,s.jsx)("h2",{className:"jsx-6f5ba7556324d067 section-title",children:"执行记录"}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},className:"jsx-6f5ba7556324d067 analysis-controls",children:[(0,s.jsxs)("select",{value:sd,onChange:e=>sc(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"",className:"jsx-6f5ba7556324d067",children:"所有框架"}),sO.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e},e))]}),(0,s.jsxs)("select",{value:sp,onChange:e=>sx(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"",className:"jsx-6f5ba7556324d067",children:"所有标签"}),sP.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e},e))]}),(0,s.jsxs)("select",{value:su,onChange:e=>sh(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("option",{value:"",className:"jsx-6f5ba7556324d067",children:"所有模型"}),sU.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-6f5ba7556324d067",children:e},e))]}),(0,s.jsx)("input",{type:"text",placeholder:"搜索问题...",value:sm,onChange:e=>sf(e.target.value),style:{padding:"0.5rem",background:"var(--input-bg)",border:"1px solid var(--input-border)",borderRadius:"4px",color:"var(--foreground)",minWidth:"250px"},className:"jsx-6f5ba7556324d067"}),(0,s.jsxs)("span",{style:{marginLeft:"auto",color:"var(--foreground-secondary)",fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067",children:["共有 ",sX.length," 条数据"]})]}),(0,s.jsx)("div",{style:{overflowX:"auto"},className:"jsx-6f5ba7556324d067 card table-container",children:(0,s.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("thead",{style:{textAlign:"left",color:"var(--foreground-secondary)",borderBottom:"1px solid var(--border)"},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("tr",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"130px"},className:"jsx-6f5ba7556324d067 p-2",children:"时间"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"90px"},className:"jsx-6f5ba7556324d067 p-2",children:"框架"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",maxWidth:"200px"},className:"jsx-6f5ba7556324d067 p-2",children:"用户输入"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"100px"},className:"jsx-6f5ba7556324d067 p-2",children:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["时延 ",(0,s.jsx)(L,{content:"从请求发出到收到最终完整回复的总耗时"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"80px"},className:"jsx-6f5ba7556324d067 p-2",children:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["Token ",(0,s.jsx)(L,{content:"输入 Prompt 与输出 Completion 的 Token 总和"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"80px"},className:"jsx-6f5ba7556324d067 p-2",children:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["准确率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:["基于LLM评估Agent真实运行结果与期望答案的差异,给出0-1分值,1表示完全正确。",(0,s.jsx)("br",{className:"jsx-6f5ba7556324d067"}),'"--"表示评估失败,可能是由于模型未配置(请在首页左上角的设置中配置 LLM)或者数据项未配置。']})})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"90px"},className:"jsx-6f5ba7556324d067 p-2",children:(0,s.jsxs)("span",{className:"jsx-6f5ba7556324d067",children:["预估花费 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"100px"},className:"jsx-6f5ba7556324d067 p-2",children:"模型"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"90px"},className:"jsx-6f5ba7556324d067 p-2",children:"标签"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap",width:"120px"},className:"jsx-6f5ba7556324d067 p-2",children:"操作"})]})}),(0,s.jsx)("tbody",{className:"jsx-6f5ba7556324d067",children:sZ.map((e,t)=>{let a=e.upload_id||e.task_id||"",r=s0.get(a);return(0,s.jsxs)("tr",{style:{borderBottom:"1px solid var(--table-row-border)"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:E(e.timestamp)}),(0,s.jsx)("td",{style:{whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:e.framework}),(0,s.jsx)("td",{title:e.query,style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:e.query.length>40?e.query.substring(0,40)+"...":e.query}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:[T(e.latency),r&&B(r.latencyDiff,!0,H)]}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},title:e.reasoning_tokens?`Output: ${$(e.output_tokens||0)} (Reasoning: ${$(e.reasoning_tokens)}, Response: ${$((e.output_tokens||0)-e.reasoning_tokens)})`+(e.input_tokens?`
2
+ Input: ${$(e.input_tokens)}`:""):e.input_tokens||e.output_tokens?`Input: ${$(e.input_tokens||0)}, Output: ${$(e.output_tokens||0)}`:void 0,className:"jsx-6f5ba7556324d067 p-2",children:[$(e.tokens),r&&B(r.tokenDiff,!0,H)]}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:[(0,s.jsx)("span",{style:{color:null===e.answer_score?"var(--foreground-muted)":(e.answer_score||0)>.8?"var(--success)":"var(--error)",fontWeight:"bold"},className:"jsx-6f5ba7556324d067",children:null===e.answer_score?"--":(e.answer_score||0).toFixed(2)}),r&&B(r.accuracyDiff,!1,H)]}),(0,s.jsxs)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},title:null!=e.cost&&e.cost_pricing?(e.cache_read_input_tokens||e.cache_creation_input_tokens?`Cost = base_input \xd7 $${e.cost_pricing.inputTokenPrice}/M + cache_read \xd7 $${e.cost_pricing.cacheReadInputTokenPrice}/M + cache_create \xd7 $${e.cost_pricing.cacheCreationInputTokenPrice}/M + output \xd7 $${e.cost_pricing.outputTokenPrice}/M`:`Cost = input_tokens \xd7 $${e.cost_pricing.inputTokenPrice}/M + output_tokens \xd7 $${e.cost_pricing.outputTokenPrice}/M`)+(e.model?` (${e.model})`:"")+`. Estimated from ${"custom"===e.cost_pricing.source?"custom":"default"} pricing.`:void 0,className:"jsx-6f5ba7556324d067 p-2",children:[null!=e.cost?R(e.cost):e.tokens?(0,s.jsx)("span",{style:{color:"var(--foreground-muted)"},className:"jsx-6f5ba7556324d067",children:"N/A"}):"-",r&&B(r.costDiff,!0,H)]}),(0,s.jsx)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 p-2",children:e.model||"-"}),(0,s.jsx)("td",{className:"jsx-6f5ba7556324d067 p-2",children:ey===a?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{value:ek,onChange:e=>eS(e.target.value),style:{width:"80px",padding:"2px 4px",fontSize:"0.8rem",background:"var(--input-bg)",border:"1px solid var(--input-border)",color:"var(--foreground)"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{onClick:()=>sN(e,ek),style:{color:"var(--success)",background:"none",border:"none",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✓"}),(0,s.jsx)("button",{onClick:()=>ev(null),style:{color:"var(--error)",background:"none",border:"none",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]}):(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:()=>{a&&(ev(a),eS(e.label||""))},className:"jsx-6f5ba7556324d067",children:[e.label?(0,s.jsx)("span",{style:{padding:"2px 6px",background:"var(--background-secondary)",borderRadius:"4px",fontSize:"0.8rem",border:"1px solid var(--border)"},className:"jsx-6f5ba7556324d067",children:e.label}):(0,s.jsx)("span",{style:{color:"var(--foreground-muted)"},className:"jsx-6f5ba7556324d067",children:"-"}),(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--foreground-muted)",opacity:.5},className:"jsx-6f5ba7556324d067",children:"✎"})]})}),(0,s.jsx)("td",{className:"jsx-6f5ba7556324d067 p-2",children:(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>{let s=`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${a}`;window.open(s,"_blank")},style:{background:"var(--primary)"},className:"jsx-6f5ba7556324d067 btn-sm",children:"详情"}),(0,s.jsx)("button",{onClick:()=>sS(e),disabled:eh.has(a),style:{background:eh.has(a)?"var(--foreground-muted)":"var(--warning)",color:"#ffffff",cursor:eh.has(a)?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:"4px",opacity:eh.has(a)?.7:1},className:"jsx-6f5ba7556324d067 btn-sm",children:eh.has(a)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{style:{width:"12px",height:"12px",border:"2px solid #18181b",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite",display:"inline-block"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("span",{className:"jsx-6f5ba7556324d067",children:"评估中..."})]}):"重评"}),(0,s.jsx)("button",{onClick:()=>sv(e),style:{background:K.error},className:"jsx-6f5ba7556324d067 btn-sm",children:"删"})]})})]},t)})})]})}),sG>1&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"1rem",gap:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{disabled:1===sb,onClick:()=>sg(e=>Math.max(1,e-1)),style:{background:1===sb?"#334155":"#38bdf8",color:1===sb?"#a1a1aa":"#18181b",cursor:1===sb?"not-allowed":"pointer"},className:"jsx-6f5ba7556324d067 btn-sm",children:"< Prev"}),(0,s.jsxs)("span",{style:{color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:["Page ",sb," of ",sG]}),(0,s.jsx)("button",{disabled:sb===sG,onClick:()=>sg(e=>Math.min(sG,e+1)),style:{background:sb===sG?"#334155":"#38bdf8",color:sb===sG?"#a1a1aa":"#18181b",cursor:sb===sG?"not-allowed":"pointer"},className:"jsx-6f5ba7556324d067 btn-sm",children:"Next >"})]}),(0,s.jsx)("div",{style:{marginTop:"2rem",marginBottom:"0.5rem",height:"1px",background:"linear-gradient(to right, transparent, rgba(56, 189, 248, 0.5), transparent)"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("div",{style:{marginTop:"0.5rem",padding:"0.5rem",textAlign:"center"},className:"jsx-6f5ba7556324d067",children:(0,s.jsx)("p",{style:{margin:0,fontSize:"0.9rem",color:K.fgMuted,lineHeight:1.6},className:"jsx-6f5ba7556324d067",children:(0,s.jsx)("a",{href:"https://atomgit.com/openeuler/witty-skill-insight",target:"_blank",rel:"noopener noreferrer",style:{color:K.fgMuted,textDecoration:"underline",textUnderlineOffset:"3px"},className:"jsx-6f5ba7556324d067",children:"你的 ⭐ Star 是前进动力,📢 Issue 使产品更稳,🚀 PR 让功能更强。"})})})]}),"config"===er&&(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 config-container",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h2",{style:{marginBottom:0},className:"jsx-6f5ba7556324d067 section-title",children:"数据集管理"}),(0,s.jsx)("button",{onClick:()=>{s_({}),sF("manual"),sA(null),sz(!0)},style:{padding:"8px 20px",fontSize:"0.9rem",borderRadius:"6px"},className:"jsx-6f5ba7556324d067 btn-primary",children:"+ 新增数据项"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-6f5ba7556324d067",children:[Array.isArray(ex)&&0===ex.length&&(0,s.jsx)("div",{style:{textAlign:"center",padding:"3rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067 card",children:'暂无数据项,点击上方"+ 新增数据项"开始添加'}),Array.isArray(ex)&&ex.map(e=>(0,s.jsxs)("div",{style:{padding:"14px 18px",display:"flex",flexDirection:"row",alignItems:"center",gap:"16px",transition:"border-color 0.2s",borderColor:K.border},className:"jsx-6f5ba7556324d067 card",children:[(0,s.jsx)("div",{style:{flexShrink:0,width:"8px",height:"8px",borderRadius:"50%",background:"parsing"===e.parse_status?"#fbbf24":"failed"===e.parse_status?"#ef4444":"#4ade80",boxShadow:`0 0 6px ${"parsing"===e.parse_status?"#fbbf2444":"failed"===e.parse_status?"#ef444444":"#4ade8044"}`,..."parsing"===e.parse_status?{animation:"pulse-dot 1.5s ease-in-out infinite"}:{}},className:"jsx-6f5ba7556324d067"}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontWeight:500,color:K.fg,fontSize:"0.9rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginBottom:"4px"},className:"jsx-6f5ba7556324d067",children:e.query}),(0,s.jsx)("div",{style:{color:K.fgSecondary,fontSize:"0.8rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},className:"jsx-6f5ba7556324d067",children:(e.standard_answer||"").length>100?(e.standard_answer||"").substring(0,100)+"...":e.standard_answer||"暂无标准答案"}),e.expectedSkills&&e.expectedSkills.length>0?(0,s.jsxs)("div",{style:{color:K.fgMuted,fontSize:"0.75rem",marginTop:"2px"},className:"jsx-6f5ba7556324d067",children:["预期技能: ",e.expectedSkills.map(e=>`${e.skill}${null!==e.version&&void 0!==e.version?` (v${e.version})`:""}`).join(", ")]}):e.skill&&(0,s.jsxs)("div",{style:{color:K.fgMuted,fontSize:"0.75rem",marginTop:"2px"},className:"jsx-6f5ba7556324d067",children:["预期技能: ",e.skill,null!==e.skillVersion&&void 0!==e.skillVersion?` (v${e.skillVersion})`:""]})]}),(0,s.jsx)("div",{style:{flexShrink:0},className:"jsx-6f5ba7556324d067",children:"parsing"===e.parse_status?(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:K.warningSubtle,color:K.warning,border:"1px solid rgba(251, 191, 36, 0.25)"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{width:"10px",height:"10px",border:"1.5px solid #fbbf24",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite",display:"inline-block"},className:"jsx-6f5ba7556324d067"}),"解析中"]}):"failed"===e.parse_status?(0,s.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:K.errorSubtle,color:K.error,border:"1px solid rgba(239, 68, 68, 0.25)"},className:"jsx-6f5ba7556324d067",children:"✕ 失败"}):(0,s.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:K.successSubtle,color:K.success,border:"1px solid rgba(74, 222, 128, 0.25)"},className:"jsx-6f5ba7556324d067",children:"✓ 完成"})}),(0,s.jsxs)("div",{style:{display:"flex",gap:"6px",flexShrink:0},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>{let s={...e};!s.expectedSkills&&s.skill&&(s.expectedSkills=[{skill:s.skill,version:s.skillVersion??null}]),s_(s),sz(!0)},style:{padding:"5px 12px",background:K.primarySubtle,color:K.primary,border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-6f5ba7556324d067",children:"详情"}),(0,s.jsx)("button",{onClick:()=>{s_({query:e.query,skill:"",expectedSkills:e.expectedSkills?[...e.expectedSkills]:e.skill?[{skill:e.skill,version:e.skillVersion??null}]:void 0,standard_answer:e.standard_answer}),sF("manual"),sA(null),sz(!0)},style:{padding:"5px 12px",background:K.primarySubtle,color:K.secondary,border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-6f5ba7556324d067",children:"复制"}),(0,s.jsx)("button",{onClick:()=>sD(e.id),style:{padding:"5px 12px",background:K.errorSubtle,color:K.error,border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-6f5ba7556324d067",children:"删除"})]})]},e.id))]})]}),"skill"===er&&(0,s.jsx)(S,{}),sC&&(0,s.jsx)("div",{onClick:()=>sz(!1),className:"jsx-6f5ba7556324d067 modal-overlay",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{maxHeight:"90vh",overflowY:"auto",maxWidth:"900px",width:"66vw",minWidth:"500px",flexDirection:"column"},className:"jsx-6f5ba7556324d067 modal-content card",children:[(0,s.jsx)("h3",{className:"jsx-6f5ba7556324d067",children:sw.id?"数据项详情":"新增数据项"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:K.fg},className:"jsx-6f5ba7556324d067",children:["问题",(0,s.jsx)("span",{style:{color:K.error},className:"jsx-6f5ba7556324d067",children:"*"})]}),(0,s.jsx)("textarea",{value:sw.query||"",onChange:e=>s_({...sw,query:e.target.value}),disabled:!!sw.id,placeholder:"请输入需要评估的问题...",style:{width:"100%",padding:"10px",minHeight:"60px",opacity:sw.id?.7:1,cursor:sw.id?"not-allowed":"text",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067"})]}),sw.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:K.fg},className:"jsx-6f5ba7556324d067",children:"标准答案"}),(0,s.jsx)("textarea",{value:sw.standard_answer||"",onChange:e=>s_({...sw,standard_answer:e.target.value}),style:{width:"100%",padding:"10px",minHeight:"120px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067"})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:K.fg},className:"jsx-6f5ba7556324d067",children:["预期技能 ",(0,s.jsx)("span",{style:{color:K.fgSecondary,fontWeight:400},className:"jsx-6f5ba7556324d067",children:"(可选)"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-6f5ba7556324d067",children:[(sw.expectedSkills||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"text",value:e.skill,onChange:e=>{let s=[...sw.expectedSkills||[]];s[t]={...s[t],skill:e.target.value},s_({...sw,expectedSkills:s})},placeholder:"技能名称",style:{flex:2,padding:"10px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("input",{type:"number",value:e.version??0,onChange:e=>{let s=e.target.value,a=[...sw.expectedSkills||[]];a[t]={...a[t],version:""===s?0:Math.max(0,parseInt(s,10)||0)},s_({...sw,expectedSkills:a})},placeholder:"版本 (默认: 0)",style:{flex:1,padding:"10px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=(sw.expectedSkills||[]).filter((e,s)=>s!==t);s_({...sw,expectedSkills:e})},style:{padding:"10px",background:K.errorSubtle,color:K.error,border:"none",borderRadius:"6px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=[...sw.expectedSkills||[],{skill:"",version:0}];s_({...sw,expectedSkills:e})},style:{padding:"8px",background:K.primarySubtle,color:K.primary,border:`1px dashed ${K.primary}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067",children:"+ 添加预期技能"})]})]}),(0,s.jsxs)("details",{style:{marginBottom:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("summary",{style:{cursor:"pointer",color:K.fgMuted,fontSize:"0.9rem",padding:"10px 12px",userSelect:"none",display:"flex",alignItems:"center",gap:"8px",background:K.bgTertiary,borderRadius:"6px",border:`1px solid ${K.border}`,listStyle:"none",transition:"background 0.2s"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:K.fgSecondary,transition:"transform 0.2s",display:"inline-block"},className:"jsx-6f5ba7556324d067 details-arrow",children:"▶"}),(0,s.jsx)("span",{style:{fontWeight:500},className:"jsx-6f5ba7556324d067",children:"关键观点"}),(0,s.jsxs)("span",{style:{fontSize:"0.8rem",color:K.fgSecondary,marginLeft:"auto"},className:"jsx-6f5ba7556324d067",children:[(sw.root_causes||[]).length," 项 · 点击展开"]})]}),(0,s.jsxs)("div",{style:{background:K.bg,padding:"10px",borderRadius:"4px",border:`1px solid ${K.border}`,marginTop:"8px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{color:K.fgSecondary,fontSize:"0.8rem",marginBottom:"10px",padding:"6px 8px",background:K.bgTertiary,borderRadius:"4px"},className:"jsx-6f5ba7556324d067",children:"来源:从标准答案中自动提取 · 作用:评估 Agent 回答是否包含了所有关键信息"}),(sw.root_causes||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"8px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{placeholder:"内容",value:e.content,onChange:e=>{let s=[...sw.root_causes||[]];s[t].content=e.target.value,s_({...sw,root_causes:s})},style:{flex:1,padding:"6px",color:K.fg,background:K.inputBg,border:`1px solid ${K.inputBorder}`},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("input",{type:"number",placeholder:"权重",value:e.weight,onChange:e=>{let s=[...sw.root_causes||[]];s[t].weight=Number(e.target.value),s_({...sw,root_causes:s})},style:{width:"80px",padding:"6px",color:K.fg,background:K.inputBg,border:`1px solid ${K.inputBorder}`},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{onClick:()=>{let e=(sw.root_causes||[]).filter((e,s)=>s!==t);s_({...sw,root_causes:e})},style:{color:K.error,padding:"0 8px",background:"none",border:"none",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]},t)),(0,s.jsx)("button",{style:{background:K.bgTertiary,color:K.fgSecondary,marginTop:"5px",border:`1px solid ${K.border}`},onClick:()=>s_({...sw,root_causes:[...sw.root_causes||[],{content:"",weight:1}]}),className:"jsx-6f5ba7556324d067 btn-sm",children:"+ 添加关键观点"})]})]}),(0,s.jsxs)("details",{style:{marginBottom:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("summary",{style:{cursor:"pointer",color:K.fgMuted,fontSize:"0.9rem",padding:"10px 12px",userSelect:"none",display:"flex",alignItems:"center",gap:"8px",background:K.bgTertiary,borderRadius:"6px",border:`1px solid ${K.border}`,listStyle:"none",transition:"background 0.2s"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:K.fgSecondary,transition:"transform 0.2s",display:"inline-block"},className:"jsx-6f5ba7556324d067 details-arrow",children:"▶"}),(0,s.jsx)("span",{style:{fontWeight:500},className:"jsx-6f5ba7556324d067",children:"关键动作"}),(0,s.jsxs)("span",{style:{fontSize:"0.8rem",color:K.fgSecondary,marginLeft:"auto"},className:"jsx-6f5ba7556324d067",children:[(sw.key_actions||[]).length," 项 · 点击展开"]})]}),(0,s.jsxs)("div",{style:{background:K.bg,padding:"10px",borderRadius:"4px",border:`1px solid ${K.border}`,marginTop:"8px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{color:K.fgSecondary,fontSize:"0.8rem",marginBottom:"10px",padding:"6px 8px",background:K.bgTertiary,borderRadius:"4px"},className:"jsx-6f5ba7556324d067",children:sw.extractedKeyActions&&sw.extractedKeyActions.length>0?"来源:从 Skill 流程中自动抽取 · 作用:评估 Agent 是否执行了所有必要的操作步骤":"来源:从标准答案中自动提取 · 作用:评估 Agent 是否执行了所有必要的操作步骤"}),(()=>{let e,t={required:{text:"必选",color:"#38bdf8"},conditional:{text:"条件分支",color:"#fbbf24"},loop:{text:"循环",color:"#a78bfa"},optional:{text:"可选",color:"#94a3b8"},handoff:{text:"衔接",color:"#4ade80"}},a=sw.key_actions||[],r=[];for(let l=0;l<a.length;l++){let n=a[l],o=n.controlFlowType||"required",i=n.groupId,d=t[o]||t.required,c="conditional"===o||"loop"===o,p=c&&i&&i!==e,x=c&&!!i;if(p){let t="conditional"===o?n.condition||"条件分支":n.loopCondition||"循环";r.push((0,s.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px",marginTop:e?"8px":"0",padding:"4px 8px",background:`${d.color}10`,borderRadius:"4px",borderLeft:`3px solid ${d.color}`},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("span",{style:{color:d.color,fontSize:"0.8rem",fontWeight:500},className:"jsx-6f5ba7556324d067",children:["conditional"===o?"⎇":"↻"," ",t]})},`group-${i}`))}e=i,r.push((0,s.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"8px",alignItems:"center",paddingLeft:x?"20px":"0"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",background:`${d.color}20`,color:d.color,fontSize:"0.75rem",whiteSpace:"nowrap",minWidth:"56px",textAlign:"center"},className:"jsx-6f5ba7556324d067",children:d.text}),(0,s.jsx)("input",{placeholder:"内容",value:n.content,onChange:e=>{let s=[...sw.key_actions||[]];s[l].content=e.target.value,s_({...sw,key_actions:s})},style:{flex:1,padding:"6px",color:K.fg,background:K.inputBg,border:`1px solid ${K.inputBorder}`},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("input",{type:"number",placeholder:"权重",value:n.weight,onChange:e=>{let s=[...sw.key_actions||[]];s[l].weight=Number(e.target.value),s_({...sw,key_actions:s})},style:{width:"80px",padding:"6px",color:K.fg,background:K.inputBg,border:`1px solid ${K.inputBorder}`},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{onClick:()=>{let e=(sw.key_actions||[]).filter((e,s)=>s!==l);s_({...sw,key_actions:e})},style:{color:K.error,padding:"0 8px",background:"none",border:"none",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]},l))}return r})(),(0,s.jsx)("button",{style:{background:K.bgTertiary,color:K.fgSecondary,marginTop:"5px",border:`1px solid ${K.border}`},onClick:()=>s_({...sw,key_actions:[...sw.key_actions||[],{content:"",weight:1}]}),className:"jsx-6f5ba7556324d067 btn-sm",children:"+ 添加关键动作"})]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:K.fg},className:"jsx-6f5ba7556324d067",children:["标准答案 ",(0,s.jsx)("span",{style:{color:K.error},className:"jsx-6f5ba7556324d067",children:"*"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"12px",marginBottom:"10px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>{sF("manual"),sA(null)},style:{padding:"6px 16px",background:"manual"===sR?K.primary:K.bgSecondary,color:"manual"===sR?K.bg:K.fgMuted,border:`1px solid ${"manual"===sR?K.primary:K.border}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"manual"===sR?600:400,transition:"all 0.2s"},className:"jsx-6f5ba7556324d067",children:"✏️ 手动填写"}),(0,s.jsx)("button",{onClick:()=>sF("document"),style:{padding:"6px 16px",background:"document"===sR?K.primary:K.bgSecondary,color:"document"===sR?K.bg:K.fgMuted,border:`1px solid ${"document"===sR?K.primary:K.border}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"document"===sR?600:400,transition:"all 0.2s"},className:"jsx-6f5ba7556324d067",children:"📄 上传案例文档"})]}),"manual"===sR?(0,s.jsx)("textarea",{value:sw.standard_answer||"",onChange:e=>s_({...sw,standard_answer:e.target.value}),placeholder:"请填写该问题的标准答案...",style:{width:"100%",padding:"10px",minHeight:"150px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067"}):(0,s.jsx)("div",{style:{border:`2px dashed ${K.border}`,borderRadius:"8px",padding:"2rem",textAlign:"center",background:K.bg,cursor:"pointer",transition:"border-color 0.2s"},onDragOver:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#38bdf8"},onDragLeave:e=>{e.currentTarget.style.borderColor="#334155"},onDrop:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#334155";let s=e.dataTransfer.files[0];s&&sA(s)},onClick:()=>{let e=document.createElement("input");e.type="file",e.accept=".txt,.md,.markdown,.pdf",e.onchange=e=>{let s=e.target.files[0];s&&sA(s)},e.click()},className:"jsx-6f5ba7556324d067",children:sI?(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"},className:"jsx-6f5ba7556324d067",children:"📄"}),(0,s.jsx)("div",{style:{color:K.success,fontWeight:500},className:"jsx-6f5ba7556324d067",children:sI.name}),(0,s.jsxs)("div",{style:{color:K.fgMuted,fontSize:"0.8rem",marginTop:"4px"},className:"jsx-6f5ba7556324d067",children:[(sI.size/1024).toFixed(1)," KB · 点击更换文件"]})]}):(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"},className:"jsx-6f5ba7556324d067",children:"📁"}),(0,s.jsx)("div",{style:{color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"点击或拖拽上传案例文档"}),(0,s.jsx)("div",{style:{color:K.fgSecondary,fontSize:"0.8rem",marginTop:"4px"},className:"jsx-6f5ba7556324d067",children:"支持 .txt, .md, .pdf 格式"})]})})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:K.fg},className:"jsx-6f5ba7556324d067",children:["预期技能 ",(0,s.jsx)("span",{style:{color:K.fgSecondary,fontWeight:400},className:"jsx-6f5ba7556324d067",children:"(可选)"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-6f5ba7556324d067",children:[(sw.expectedSkills||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("input",{type:"text",value:e.skill,onChange:e=>{let s=[...sw.expectedSkills||[]];s[t]={...s[t],skill:e.target.value},s_({...sw,expectedSkills:s})},placeholder:"技能名称",style:{flex:2,padding:"10px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("input",{type:"number",value:e.version??0,onChange:e=>{let s=e.target.value,a=[...sw.expectedSkills||[]];a[t]={...a[t],version:""===s?0:Math.max(0,parseInt(s,10)||0)},s_({...sw,expectedSkills:a})},placeholder:"版本 (默认: 0)",style:{flex:1,padding:"10px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=(sw.expectedSkills||[]).filter((e,s)=>s!==t);s_({...sw,expectedSkills:e})},style:{padding:"10px",background:K.errorSubtle,color:K.error,border:"none",borderRadius:"6px",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"✕"})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=[...sw.expectedSkills||[],{skill:"",version:0}];s_({...sw,expectedSkills:e})},style:{padding:"8px",background:K.primarySubtle,color:K.primary,border:`1px dashed ${K.primary}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067",children:"+ 添加预期技能"})]})]}),(0,s.jsx)("div",{style:{marginTop:"1rem",padding:"12px 16px",background:K.primarySubtle,border:"1px solid rgba(56, 189, 248, 0.2)",borderRadius:"8px",color:K.fgMuted,fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("p",{style:{margin:0},className:"jsx-6f5ba7556324d067",children:["💡 保存后,系统将基于标准答案自动提取",(0,s.jsx)("strong",{style:{color:K.linkHover},className:"jsx-6f5ba7556324d067",children:"关键观点"}),"(回答中必须包含的核心信息)和",(0,s.jsx)("strong",{style:{color:K.linkHover},className:"jsx-6f5ba7556324d067",children:"关键动作"}),"(Agent 必须执行的操作步骤),用于后续的细致评估打分。此过程在后台执行,无需等待。"]})})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"1.5rem",paddingTop:"1rem",borderTop:`1px solid ${K.border}`},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>{sz(!1),s$(!1)},style:{padding:"8px 24px",background:K.bgSecondary,color:K.fgMuted,border:`1px solid ${K.border}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.9rem",fontWeight:500,transition:"all 0.2s"},className:"jsx-6f5ba7556324d067",children:"取消"}),(0,s.jsx)("button",{onClick:sB,disabled:sT,style:{padding:"8px 28px",background:sT?"#1e3a5f":"#38bdf8",color:sT?"#64748b":"#18181b",border:"none",borderRadius:"6px",cursor:sT?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:600,transition:"all 0.2s",boxShadow:sT?"none":"0 2px 8px rgba(56, 189, 248, 0.25)"},className:"jsx-6f5ba7556324d067",children:sT?"保存中...":"保存"})]})]})}),eg&&(0,s.jsx)("div",{onClick:()=>ej(null),className:"jsx-6f5ba7556324d067 modal-overlay",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"800px",maxWidth:"95%",maxHeight:"90vh",overflowY:"auto",overflowX:"hidden"},className:"jsx-6f5ba7556324d067 modal-content card",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h3",{className:"jsx-6f5ba7556324d067",children:"记录详情"}),(0,s.jsx)("button",{onClick:()=>ej(null),style:{background:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"×"})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-6f5ba7556324d067",children:"基本信息"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-grid",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"Time:"})," ",E(eg.timestamp)]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"Framework:"})," ",eg.framework]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"Latency:"})," ",T(eg.latency),(e=eg.upload_id||eg.task_id||"",(r=s0.get(e))?B(r.latencyDiff,!0,H):null)]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"Token:"})," ",eg.tokens,(b=eg.upload_id||eg.task_id||"",(g=s0.get(b))?B(g.tokenDiff,!0,H):null)]}),(j=eg.upload_id||eg.task_id||"",(y=s0.get(j))?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"准确率变化:"})," ",B(y.accuracyDiff,!1,H)]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"成本变化:"})," ",B(y.costDiff,!0,H)]})]}):null)]})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-6f5ba7556324d067",children:"Input / Output"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"Query:"}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 code-block",children:eg.query})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"Skills Used:"}),(0,s.jsx)("div",{className:"jsx-6f5ba7556324d067 code-block",children:(0,s.jsx)(m.SkillLinks,{skills:eg.skills,skill:eg.skill,skillVersion:eg.skill_version?parseInt(eg.skill_version):null,user:eg.user})})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"Final Result:"}),(0,s.jsx)("div",{style:{maxHeight:"200px",overflowY:"auto"},className:"jsx-6f5ba7556324d067 code-block",children:eg.final_result||"(None)"})]})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-6f5ba7556324d067",children:"评估结果"}),(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:"1rem",marginBottom:"1.5rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("div",{style:null===eg.answer_score?{borderLeft:`4px solid ${K.fgMuted}`,background:K.bgTertiary,color:K.fgMuted}:{},className:`jsx-6f5ba7556324d067 status-box ${null===eg.answer_score?"warning":(eg.answer_score||0)>.8?"good":"bad"}`,children:[(0,s.jsx)("strong",{className:"jsx-6f5ba7556324d067",children:"回答评分:"})," ",null===eg.answer_score?"--":(eg.answer_score||0).toFixed(2)]})}),eg.failures&&eg.failures.length>0&&(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-section",children:[(0,s.jsx)("h4",{style:{color:K.error},className:"jsx-6f5ba7556324d067",children:"中间故障 / 异常分析"}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},className:"jsx-6f5ba7556324d067",children:eg.failures.map((e,t)=>(0,s.jsxs)("div",{style:{background:K.errorSubtle,border:`1px solid ${K.errorSubtleBorder}`,borderRadius:"6px",padding:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.5rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("span",{style:{background:K.error,color:K.bg,padding:"2px 8px",borderRadius:"4px",fontSize:"0.8rem",fontWeight:"bold"},className:"jsx-6f5ba7556324d067",children:e.failure_type}),(0,s.jsx)("span",{style:{color:K.error,fontWeight:"bold"},className:"jsx-6f5ba7556324d067",children:e.description})]}),e.context&&(0,s.jsx)("div",{style:{marginBottom:"0.5rem",fontSize:"0.9rem",color:"#d4d4d8",fontFamily:"monospace",background:"rgba(0,0,0,0.3)",padding:"0.5rem",borderRadius:"4px"},className:"jsx-6f5ba7556324d067",children:e.context}),e.recovery&&(0,s.jsxs)("div",{style:{fontSize:"0.9rem",color:K.success},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{style:{color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"修复建议:"})," ",e.recovery]}),(e.attribution||e.attribution_reason)&&(0,s.jsxs)("div",{style:{marginTop:"0.8rem",paddingTop:"0.8rem",borderTop:`1px dashed ${K.errorSubtleBorder}`},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.3rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("strong",{style:{color:K.warning},className:"jsx-6f5ba7556324d067",children:"归因分析:"}),e.attribution&&(0,s.jsx)("span",{style:{background:K.warning,color:K.bg,padding:"1px 6px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:"bold",border:`1px solid ${K.warning}`},className:"jsx-6f5ba7556324d067",children:e.attribution})]}),e.attribution_reason&&(0,s.jsx)("div",{style:{fontSize:"0.9rem",color:K.warning,fontStyle:"italic"},className:"jsx-6f5ba7556324d067",children:e.attribution_reason})]})]},t))})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-6f5ba7556324d067 detail-row",children:[(0,s.jsx)("strong",{style:{color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"Reason:"}),(0,s.jsx)("div",{style:{marginTop:"0.2rem",fontSize:"0.9rem",color:K.fg,whiteSpace:"pre-wrap"},className:"jsx-6f5ba7556324d067",children:eg.judgment_reason||"-"})]})]}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-6f5ba7556324d067",children:"用户反馈"}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",gap:"1rem",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>sk("like"),style:{display:"flex",alignItems:"center",gap:"0.5rem",background:eg.user_feedback?.type==="like"?"#38bdf8":"#334155",color:eg.user_feedback?.type==="like"?"#18181b":"#a1a1aa",border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontWeight:eg.user_feedback?.type==="like"?"bold":"normal",transition:"all 0.2s"},className:"jsx-6f5ba7556324d067",children:"👍 Like"}),(0,s.jsx)("button",{onClick:()=>sk("dislike"),style:{display:"flex",alignItems:"center",gap:"0.5rem",background:eg.user_feedback?.type==="dislike"?"#f87171":"#334155",color:eg.user_feedback?.type==="dislike"?"#18181b":"#a1a1aa",border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontWeight:eg.user_feedback?.type==="dislike"?"bold":"normal",transition:"all 0.2s"},className:"jsx-6f5ba7556324d067",children:"👎 Dislike"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"flex-start"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("textarea",{value:eG,onChange:e=>eZ(e.target.value),placeholder:"添加评论 (可选)...",style:{flex:1,minHeight:"60px",padding:"8px",background:K.bg,border:`1px solid ${K.border}`,color:K.fg,borderRadius:"4px",fontSize:"0.9rem"},className:"jsx-6f5ba7556324d067"}),(0,s.jsx)("button",{onClick:()=>sk(eg.user_feedback?.type||null),style:{padding:"8px 16px",fontSize:"0.9rem",height:"fit-content",whiteSpace:"nowrap"},className:"jsx-6f5ba7556324d067 btn-primary",children:"保存评论"})]})]})]})]})}),(0,s.jsx)("button",{onClick:()=>eo(!0),style:{position:"fixed",top:"1.5rem",right:"2rem",width:"3rem",height:"3rem",borderRadius:"50%",background:K.primary,color:K.bg,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.5rem",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",zIndex:900,transition:"transform 0.2s"},onMouseOver:e=>e.currentTarget.style.transform="scale(1.1)",onMouseOut:e=>e.currentTarget.style.transform="scale(1)",title:"User Settings",className:"jsx-6f5ba7556324d067",children:"👤"}),en&&(0,s.jsx)("div",{onClick:()=>eo(!1),style:{alignItems:"flex-start",paddingTop:"10vh"},className:"jsx-6f5ba7556324d067 modal-overlay",children:(0,s.jsxs)("div",{style:{width:"500px",maxWidth:"90vw",background:K.bg,border:`1px solid ${K.border}`,borderRadius:"12px",padding:"0",overflow:"hidden"},onClick:e=>e.stopPropagation(),className:"jsx-6f5ba7556324d067 modal-content",children:[(0,s.jsxs)("div",{style:{padding:"1.5rem",background:K.bgSecondary,borderBottom:`1px solid ${K.border}`,display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:K.primary,color:K.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",fontWeight:"bold"},className:"jsx-6f5ba7556324d067",children:v?v.substring(0,1).toUpperCase():"?"}),(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h3",{style:{margin:0,color:K.fg,fontSize:"1.1rem"},className:"jsx-6f5ba7556324d067",children:v}),(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:"User Profile"})]})]}),(0,s.jsx)("button",{onClick:()=>eo(!1),style:{background:"transparent",border:"none",color:K.fgSecondary,fontSize:"1.5rem",cursor:"pointer",lineHeight:1},className:"jsx-6f5ba7556324d067",children:"×"})]}),(0,s.jsx)("div",{style:{padding:"1.5rem"},className:"jsx-6f5ba7556324d067",children:J?(0,s.jsxs)("div",{style:{background:K.bgSecondary,padding:"1.25rem",borderRadius:"8px",border:`1px solid ${K.border}`},className:"jsx-6f5ba7556324d067 form-group",children:[(0,s.jsx)("label",{style:{color:K.fgMuted,fontSize:"0.8rem",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"0.75rem",display:"block"},className:"jsx-6f5ba7556324d067",children:"密钥"}),(0,s.jsxs)("div",{style:{display:"flex",gap:"10px"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("div",{style:{flex:1,padding:"0.75rem 1rem",background:K.bg,borderRadius:"6px",border:`1px solid ${K.border}`,color:K.fg,fontFamily:"monospace",fontSize:"0.9rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},className:"jsx-6f5ba7556324d067",children:J}),(0,s.jsx)("button",{onClick:()=>{let e=()=>{e5(!0),setTimeout(()=>e5(!1),2e3)};if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(J).then(e);else{let s=document.createElement("textarea");s.value=J,s.style.position="fixed",s.style.left="-9999px",s.style.top="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),e()}catch(e){console.error("Fallback: Oops, unable to copy",e),alert("复制失败,请手动复制")}document.body.removeChild(s)}},style:{padding:"0 1.25rem",display:"flex",alignItems:"center",gap:"6px",background:e0?"#4ade80":void 0},className:"jsx-6f5ba7556324d067 btn-primary",children:e0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"jsx-6f5ba7556324d067",children:"✅"})," Copied"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"jsx-6f5ba7556324d067",children:"📋"})," Copy"]})})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:K.fgSecondary},className:"jsx-6f5ba7556324d067",children:"未找到密钥。"})}),(0,s.jsx)("div",{style:{padding:"0 1.5rem 1.5rem"},className:"jsx-6f5ba7556324d067",children:(0,s.jsx)("div",{style:{background:K.bgSecondary,padding:"1.25rem",borderRadius:"8px",border:`1px solid ${K.border}`},className:"jsx-6f5ba7556324d067",children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsxs)("div",{className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("h4",{style:{margin:"0 0 0.25rem 0",color:K.fg,fontSize:"0.95rem"},className:"jsx-6f5ba7556324d067",children:"新手引导"}),(0,s.jsx)("p",{style:{margin:0,fontSize:"0.8rem",color:K.fgMuted},className:"jsx-6f5ba7556324d067",children:Y?.guideDisabled?"引导已关闭":"引导已开启"})]}),(0,s.jsx)("button",{onClick:async()=>{Y?.guideDisabled?(await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":v},body:JSON.stringify({guideDisabled:!1,dismissedAt:null})})).ok&&window.location.reload():(await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":v},body:JSON.stringify({currentStep:0,completedSteps:[],skippedSteps:[],dismissedAt:null})})).ok&&(eo(!1),G(!0))},style:{background:Y?.guideDisabled?"#4ade80":"#38bdf8",border:"none",color:K.bg,padding:"0.5rem 1rem",borderRadius:"6px",fontWeight:"600",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-6f5ba7556324d067",children:Y?.guideDisabled?"启用引导":"重新开始引导"})]})})}),(0,s.jsxs)("div",{style:{padding:"1.25rem 1.5rem",background:K.bg,borderTop:`1px solid ${K.border}`,display:"flex",justifyContent:"flex-end",gap:"1rem"},className:"jsx-6f5ba7556324d067",children:[(0,s.jsx)("button",{onClick:()=>eo(!1),style:{background:"transparent",border:`1px solid ${K.border}`,color:K.fgMuted,padding:"0.6rem 1.25rem",borderRadius:"6px",fontWeight:"500",cursor:"pointer"},className:"jsx-6f5ba7556324d067",children:"Close"}),!N&&(0,s.jsx)("button",{onClick:()=>{localStorage.removeItem("user_id"),localStorage.removeItem("api_key"),window.location.reload()},style:{background:K.error,border:"none",color:"white",padding:"0.6rem 1.25rem",borderRadius:"6px",fontWeight:"600",cursor:"pointer",boxShadow:"0 2px 4px rgba(239, 68, 68, 0.2)"},className:"jsx-6f5ba7556324d067",children:"Sign Out"})]})]})}),(0,s.jsx)(t.default,{id:"6f5ba7556324d067",children:'.tab-btn.jsx-6f5ba7556324d067{color:var(--foreground-muted);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;padding:.5rem 1rem;font-size:1rem}.tab-btn.active.jsx-6f5ba7556324d067{color:var(--primary);border-bottom-color:var(--primary)}.p-2.jsx-6f5ba7556324d067{padding:.75rem}.btn-primary.jsx-6f5ba7556324d067{background:var(--primary);color:var(--background);cursor:pointer;border:none;border-radius:4px;padding:.5rem 1rem;font-weight:700}.btn-sm.jsx-6f5ba7556324d067{color:var(--background);cursor:pointer;border:none;border-radius:4px;padding:4px 8px;font-size:.8rem}.modal-overlay.jsx-6f5ba7556324d067{alignItems:center;z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0009;justify-content:center;display:flex;position:fixed;inset:0}.modal-content.jsx-6f5ba7556324d067{background:var(--background-secondary);border:1px solid var(--border);width:66vw;max-width:1200px;padding:2rem}.form-group.jsx-6f5ba7556324d067{margin-bottom:1rem}.form-group.jsx-6f5ba7556324d067 label.jsx-6f5ba7556324d067{marginBottom:.5rem;color:var(--foreground-secondary);display:block}input.jsx-6f5ba7556324d067,textarea.jsx-6f5ba7556324d067{background:var(--input-bg);border:1px solid var(--border);color:#fff;borderRadius:4px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}details[open].jsx-6f5ba7556324d067>summary.jsx-6f5ba7556324d067 .details-arrow.jsx-6f5ba7556324d067{transform:rotate(90deg)}details.jsx-6f5ba7556324d067>summary.jsx-6f5ba7556324d067:hover{background:#1e293bcc!important}details.jsx-6f5ba7556324d067>summary.jsx-6f5ba7556324d067::-webkit-details-marker{display:none}details.jsx-6f5ba7556324d067>summary.jsx-6f5ba7556324d067::marker{content:"";display:none}@keyframes pulse-dot{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.3)}}.detail-section.jsx-6f5ba7556324d067{border-bottom:1px solid #334155;margin-bottom:1.5rem;padding-bottom:1.5rem}.detail-section.jsx-6f5ba7556324d067:last-child{border-bottom:none}.detail-grid.jsx-6f5ba7556324d067{grid-template-columns:1fr 1fr;gap:1rem;display:grid}.detail-row.jsx-6f5ba7556324d067{margin-bottom:1rem}.code-block.jsx-6f5ba7556324d067{background:var(--input-bg);white-space:pre-wrap;word-break:break-word;overflow-wrap:break-word;color:var(--foreground);border-radius:6px;max-width:100%;padding:.8rem;font-family:monospace;font-size:.9rem;overflow-x:auto}.status-box.jsx-6f5ba7556324d067{text-align:center;border-radius:6px;padding:1rem}.status-box.good.jsx-6f5ba7556324d067{background:var(--success-subtle);border:1px solid var(--success);color:var(--success)}.status-box.bad.jsx-6f5ba7556324d067{background:var(--error-subtle);border:1px solid var(--error);color:var(--error)}h4.jsx-6f5ba7556324d067{color:var(--primary);margin-top:0;margin-bottom:1rem}.text-sm.jsx-6f5ba7556324d067{font-size:.875rem}.text-xl.jsx-6f5ba7556324d067{font-size:1.25rem}.text-2xl.jsx-6f5ba7556324d067{font-size:1.5rem}.font-bold.jsx-6f5ba7556324d067{font-weight:700}.text-slate-400.jsx-6f5ba7556324d067{color:var(--foreground-muted)}.text-green-400.jsx-6f5ba7556324d067{color:var(--success)}.text-red-400.jsx-6f5ba7556324d067{color:var(--error)}.dropdown-content.jsx-6f5ba7556324d067{display:none}.dropdown-trigger.jsx-6f5ba7556324d067:hover+.dropdown-content.jsx-6f5ba7556324d067,.dropdown-content.jsx-6f5ba7556324d067:hover{display:block}'}),X&&et.length>0&&!Q&&(0,s.jsx)(w,{steps:et,onComplete:async()=>{G(!1),await es()},onSkip:async e=>{await Z(e)},onDontShowAgain:async()=>{await ee()}})]})}e.s(["default",()=>P],58116)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94542,e=>{"use strict";var r=e.i(43476),t=e.i(94690),a=e.i(18566),i=e.i(71645),o=e.i(97703),n=e.i(9165);function l(){let[e,l]=(0,i.useState)(""),[s,c]=(0,i.useState)(""),[d,m]=(0,i.useState)(!1),[u,g]=(0,i.useState)(""),{login:p}=(0,t.useAuth)(),h=(0,a.useRouter)(),{isDark:f}=(0,o.useTheme)();(0,i.useEffect)(()=>{(0,n.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{m(e.org_mode||!1),g(e.org_login_redirect_url||"")}).catch(()=>{})},[]),(0,i.useEffect)(()=>{if(!d||!u)return;let e=!1;return(async()=>{try{let r=await (0,n.apiFetch)("/api/auth/organization",{cache:"no-store"});if(!r.ok){e||401!==r.status&&403!==r.status||(window.location.href=u);return}let t=await r.json();!e&&t?.username&&(p(t.username,t.apiKey),h.replace("/"))}catch(r){e||(window.location.href=u)}})(),()=>{e=!0}},[d,u,p,h]);let y=async r=>{if(r.preventDefault(),c(""),!e.trim())return void c("请输入邮箱地址");try{let r=await (0,n.apiFetch)("/api/auth/apikey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e.trim()})}),t=await r.json();r.ok?p(t.username,t.apiKey):c(t.error||"登录失败,请重试")}catch(e){console.error(e),c("网络错误,请检查连接")}},b=f?{fg:"#fafafa",fgSecondary:"#a1a1aa",fgMuted:"#71717a",primary:"#3b82f6",primaryGlow:"rgba(59, 130, 246, 0.3)",error:"#ef4444",errorSubtle:"rgba(239, 68, 68, 0.1)",errorBorder:"rgba(239, 68, 68, 0.2)"}:{fg:"#18181b",fgSecondary:"#52525b",fgMuted:"#a1a1aa",primary:"#2563eb",primaryGlow:"rgba(29, 78, 216, 0.3)",error:"#dc2626",errorSubtle:"rgba(185, 28, 28, 0.08)",errorBorder:"rgba(185, 28, 28, 0.18)"};return d?(0,r.jsx)("div",{className:"login-container",children:(0,r.jsx)("div",{className:"login-box",children:(0,r.jsx)("p",{style:{color:b.fgMuted,textAlign:"center"},children:"正在跳转到企业登录页..."})})}):(0,r.jsx)("div",{className:"login-container",children:(0,r.jsxs)("div",{className:"login-box",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"1.25rem",marginBottom:"2rem"},children:[(0,r.jsx)("div",{style:{background:`linear-gradient(135deg, ${b.primary}, #7c3aed)`,color:"white",fontWeight:600,fontSize:"1.5rem",padding:"0.625rem 1rem",borderRadius:"0.75rem",whiteSpace:"nowrap",boxShadow:`0 8px 16px -4px ${b.primaryGlow}`},children:"Skill"}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)("h1",{style:{fontSize:"2.25rem",fontWeight:700,color:b.fg,margin:0,lineHeight:1,letterSpacing:"-0.025em"},children:"Insight"}),(0,r.jsx)("span",{style:{fontSize:"0.8125rem",color:b.fgMuted,letterSpacing:"0.04em",textTransform:"uppercase",marginTop:"0.25rem"},children:"智能体技能评估、分析与优化"})]})]}),(0,r.jsxs)("form",{className:"login-form",children:[(0,r.jsxs)("div",{style:{marginBottom:"0.875rem"},children:[(0,r.jsx)("label",{className:"login-label",htmlFor:"username",children:"邮箱地址"}),(0,r.jsx)("input",{className:"login-input",id:"username",type:"email",placeholder:"your.email@example.com",value:e,onChange:e=>{l(e.target.value),c("")},style:s?{borderColor:b.error}:{}}),s&&(0,r.jsxs)("div",{style:{color:b.error,fontSize:"0.8125rem",marginTop:"0.375rem",padding:"0.375rem 0.625rem",background:b.errorSubtle,borderRadius:"0.375rem",border:`1px solid ${b.errorBorder}`},children:["⚠️ ",s]})]}),(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:(0,r.jsx)("button",{className:"login-btn",type:"button",onClick:y,children:"Sign In"})})]})]})})}e.s(["default",()=>l])}]);