chatlab-cli 0.37.1 → 0.37.3

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 (153) hide show
  1. package/dist/{chat-command-YAFRLHMQ.mjs → chat-command-RQC44FPF.mjs} +53 -13
  2. package/dist/chat-command-RQC44FPF.mjs.map +1 -0
  3. package/dist/{chunk-FPVRSXQ4.mjs → chunk-4FAEB4C2.mjs} +12 -12
  4. package/dist/{chunk-MMTEGUQA.mjs → chunk-5OA4QI3Q.mjs} +3 -3
  5. package/dist/{chunk-UP6JIV3S.mjs → chunk-E2ZFGNZQ.mjs} +16 -12
  6. package/dist/chunk-E2ZFGNZQ.mjs.map +1 -0
  7. package/dist/{chunk-JWJREWVN.mjs → chunk-E6IRRNBQ.mjs} +27 -3
  8. package/dist/chunk-E6IRRNBQ.mjs.map +1 -0
  9. package/dist/{chunk-PDQV4RUA.mjs → chunk-GDKQKHJT.mjs} +2 -2
  10. package/dist/{chunk-GKCIRKOH.mjs → chunk-HJWBFHNR.mjs} +4 -4
  11. package/dist/{chunk-73TJ2S7W.mjs → chunk-IDDTW5JN.mjs} +313 -24
  12. package/dist/chunk-IDDTW5JN.mjs.map +1 -0
  13. package/dist/{chunk-2PY4XCH3.mjs → chunk-IMJVOODY.mjs} +2 -2
  14. package/dist/{chunk-ARIBCH47.mjs → chunk-LUENE6L7.mjs} +25 -15
  15. package/dist/chunk-LUENE6L7.mjs.map +1 -0
  16. package/dist/{chunk-WDLO7OLX.mjs → chunk-O57SQSCO.mjs} +2 -2
  17. package/dist/{chunk-N4SB6QZV.mjs → chunk-ZGXXAPLX.mjs} +2 -2
  18. package/dist/{chunk-OTYNMDDL.mjs → chunk-ZOHSWBD2.mjs} +2237 -1977
  19. package/dist/chunk-ZOHSWBD2.mjs.map +1 -0
  20. package/dist/cli.mjs +9 -9
  21. package/dist/contacts-worker.mjs +2 -2
  22. package/dist/global-insight-worker.mjs +1 -1
  23. package/dist/{http-LPFPVTBC.mjs → http-QJDZKDNJ.mjs} +12 -12
  24. package/dist/{import-T4WX2ZJL.mjs → import-XK6YM26A.mjs} +7 -7
  25. package/dist/index.mjs +12 -12
  26. package/dist/{mcp-SMF3NWIN.mjs → mcp-DMGZFSYN.mjs} +24 -17
  27. package/dist/mcp-DMGZFSYN.mjs.map +1 -0
  28. package/dist/people-relationships-worker.mjs +2 -2
  29. package/dist/semantic-index-worker.mjs +1 -1
  30. package/dist/{src-EGLLMTAU.mjs → src-4AHJUFCW.mjs} +6 -6
  31. package/dist/{stream-import-2BXJTTCE.mjs → stream-import-7VQVT5ST.mjs} +7 -7
  32. package/dist/{worker-runtime-RDLSPXFT.mjs → worker-runtime-PQBAV75N.mjs} +5 -5
  33. package/dist-cli-web/assets/{AISettingsTab-CEhrXlYR.js → AISettingsTab-qS3XKnvh.js} +1 -1
  34. package/dist-cli-web/assets/{AboutTab-Bbu0SsMM.js → AboutTab-K-i40dPv.js} +1 -1
  35. package/dist-cli-web/assets/{Alert-510jTN3l.js → Alert-GSvA5B7J.js} +1 -1
  36. package/dist-cli-web/assets/{ApiSettingsTab-Bi1GRMN4.js → ApiSettingsTab-DIVGTR3g.js} +1 -1
  37. package/dist-cli-web/assets/{BatchManageTab-DhnqMCSM.js → BatchManageTab-CJhwvYWV.js} +1 -1
  38. package/dist-cli-web/assets/{BufferResource-CKZxnACp.js → BufferResource-Cjm0m7sF.js} +1 -1
  39. package/dist-cli-web/assets/{CanvasRenderer-BeK5POBy.js → CanvasRenderer-C-fmrahh.js} +1 -1
  40. package/dist-cli-web/assets/{CardDecoration-RuBA3N2j.js → CardDecoration-Cz54ZPyh.js} +1 -1
  41. package/dist-cli-web/assets/{ChatRecordDrawer-BY_-lIEj.js → ChatRecordDrawer-Cst8zTUv.js} +1 -1
  42. package/dist-cli-web/assets/{ChatRecordWorkspace-7prKd-Tq.js → ChatRecordWorkspace-DKVKaimw.js} +1 -1
  43. package/dist-cli-web/assets/{Checkbox-_eH64bb0.js → Checkbox-CrlY3jiJ.js} +1 -1
  44. package/dist-cli-web/assets/{DataDirCleanupNotice-BHaXwlfr.js → DataDirCleanupNotice-Cjqiub4e.js} +1 -1
  45. package/dist-cli-web/assets/{DatePicker.vue_vue_type_script_setup_true_lang-D9Ul_GYz.js → DatePicker.vue_vue_type_script_setup_true_lang-BYY2UmPA.js} +1 -1
  46. package/dist-cli-web/assets/{DebugToolsPanel-ByKItGrS.js → DebugToolsPanel-I00RV_Lr.js} +1 -1
  47. package/dist-cli-web/assets/{EChart.vue_vue_type_script_setup_true_lang-DubnuUXI.js → EChart.vue_vue_type_script_setup_true_lang-CRTZh9kh.js} +1 -1
  48. package/dist-cli-web/assets/{EChartBar.vue_vue_type_script_setup_true_lang-DKNCZuFm.js → EChartBar.vue_vue_type_script_setup_true_lang-DjDFhnN9.js} +1 -1
  49. package/dist-cli-web/assets/{EChartLine.vue_vue_type_script_setup_true_lang-Fl7xAOSR.js → EChartLine.vue_vue_type_script_setup_true_lang-BLqlW9E4.js} +1 -1
  50. package/dist-cli-web/assets/{EChartWordcloud-C6XM4KOX.js → EChartWordcloud-ChKJM8bU.js} +1 -1
  51. package/dist-cli-web/assets/{FileDropZone.vue_vue_type_script_setup_true_lang-DYDdRSNE.js → FileDropZone.vue_vue_type_script_setup_true_lang-CsRmQhVQ.js} +1 -1
  52. package/dist-cli-web/assets/{Filter-CByj_rCR.js → Filter-Duzxgudo.js} +1 -1
  53. package/dist-cli-web/assets/{GlobalTaskBar-BdELjzrs.js → GlobalTaskBar-DL0IJxlt.js} +1 -1
  54. package/dist-cli-web/assets/{GroupRelationshipGalaxyView-CnzPEgUS.js → GroupRelationshipGalaxyView-BZrB2o2g.js} +1 -1
  55. package/dist-cli-web/assets/{Label-DCIcxkhU.js → Label-CaVKlQnJ.js} +1 -1
  56. package/dist-cli-web/assets/{LoadingState.vue_vue_type_script_setup_true_lang-BBcCt_Qm.js → LoadingState.vue_vue_type_script_setup_true_lang-uF54r-dT.js} +1 -1
  57. package/dist-cli-web/assets/{MessageExportModal-DNU16Bs8.js → MessageExportModal-JpurBsUW.js} +1 -1
  58. package/dist-cli-web/assets/{PageHeader-CKeZjNNR.js → PageHeader-BciykZ_-.js} +1 -1
  59. package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-C8M3wNNH.js → PageTabs.vue_vue_type_script_setup_true_lang-2Xe2iUFO.js} +1 -1
  60. package/dist-cli-web/assets/{RelationshipGalaxyCanvas-CDhljGyJ.js → RelationshipGalaxyCanvas-BO5-MowG.js} +3 -3
  61. package/dist-cli-web/assets/{RelationshipGalaxyThreeCanvas-BP8fsvvf.js → RelationshipGalaxyThreeCanvas-Dp4CcWU5.js} +1 -1
  62. package/dist-cli-web/assets/{RenderTargetSystem-D76QrDT_.js → RenderTargetSystem-CfuoUG_y.js} +1 -1
  63. package/dist-cli-web/assets/{RovingFocusItem-BJMUQ5DJ.js → RovingFocusItem-FpYwYEP_.js} +1 -1
  64. package/dist-cli-web/assets/{ScreenCaptureModal-DkX4z-M1.js → ScreenCaptureModal-cElYPaSj.js} +1 -1
  65. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-pVQMbTsj.js +1 -0
  66. package/dist-cli-web/assets/{Select-B5oJc5y1.js → Select-H8Fz6RkU.js} +1 -1
  67. package/dist-cli-web/assets/{SettingsModal-BO-QKQ2h.js → SettingsModal-52Fw4fVW.js} +2 -2
  68. package/dist-cli-web/assets/{StorageTab-CPPXXaRm.js → StorageTab-BnugE5BO.js} +1 -1
  69. package/dist-cli-web/assets/{Switch-CDk3LZ4_.js → Switch-K4aqYC4Y.js} +1 -1
  70. package/dist-cli-web/assets/{Tabs-DqWTBV8x.js → Tabs-BXjD45rO.js} +1 -1
  71. package/dist-cli-web/assets/{Tabs-BMq9wODW.js → Tabs-DJ5p8gb6.js} +1 -1
  72. package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-D2outEOV.js → ThemeCard.vue_vue_type_script_setup_true_lang-BLmTpx4f.js} +1 -1
  73. package/dist-cli-web/assets/{TimeSelect.vue_vue_type_script_setup_true_lang-BcflxP_U.js → TimeSelect.vue_vue_type_script_setup_true_lang-geQAlopO.js} +1 -1
  74. package/dist-cli-web/assets/{VisuallyHiddenInput-BAFpkxMI.js → VisuallyHiddenInput-J2KEIQBX.js} +1 -1
  75. package/dist-cli-web/assets/{WebGLRenderer-DjCPvR_O.js → WebGLRenderer-BDFzRniS.js} +1 -1
  76. package/dist-cli-web/assets/{WebGPURenderer-C2B_u03z.js → WebGPURenderer-BKYZyUCZ.js} +1 -1
  77. package/dist-cli-web/assets/aiChat-CdJzpNYW.js +8 -0
  78. package/dist-cli-web/assets/{base-F6s0vTrr.js → base-129JztT1.js} +1 -1
  79. package/dist-cli-web/assets/{browserAll-DiUAZg4L.js → browserAll-CZNZDK1i.js} +1 -1
  80. package/dist-cli-web/assets/{chatMessages-Bd33SSXI.js → chatMessages-zmzHCUCy.js} +3 -3
  81. package/dist-cli-web/assets/{cli-web-DoibEdj2.js → cli-web-_WGCg-ZY.js} +1 -1
  82. package/dist-cli-web/assets/{fetch-CXM-cjDS.js → fetch-B7Tdp7Uo.js} +1 -1
  83. package/dist-cli-web/assets/{fetch-DBpDMy29.js → fetch-BBdyPNj3.js} +1 -1
  84. package/dist-cli-web/assets/{fetch-B_YFABxI.js → fetch-Bafz8jLM.js} +1 -1
  85. package/dist-cli-web/assets/{fetch-CxVcHNid.js → fetch-C4W6tD-D.js} +1 -1
  86. package/dist-cli-web/assets/{fetch-BeX69kpS.js → fetch-DOsmgros.js} +1 -1
  87. package/dist-cli-web/assets/{fetch-CRocA-4C.js → fetch-DTPDtL38.js} +1 -1
  88. package/dist-cli-web/assets/{fetch-CXqeAbnY.js → fetch-DaeoNUip.js} +1 -1
  89. package/dist-cli-web/assets/{fetch-7lUvXbhU.js → fetch-DgHdAlO7.js} +1 -1
  90. package/dist-cli-web/assets/{fetch-DKBBS9Op.js → fetch-Di4QpfqL.js} +1 -1
  91. package/dist-cli-web/assets/{fetch-4nh1LaVF.js → fetch-Dw33HaVP.js} +11 -13
  92. package/dist-cli-web/assets/{fetch-BEaW1j5H.js → fetch-IP6i-mtr.js} +1 -1
  93. package/dist-cli-web/assets/{fetch-epFXmPIQ.js → fetch-sbr95ipd.js} +1 -1
  94. package/dist-cli-web/assets/{host-CtSqR_Zm.js → host-CMnAiJSx.js} +1 -1
  95. package/dist-cli-web/assets/{host-C4rU8pKA.js → host-CuuNLUWx.js} +1 -1
  96. package/dist-cli-web/assets/{index-ekvsNmfe.js → index-BBYtZa7g.js} +1 -1
  97. package/dist-cli-web/assets/{index-mXe1LssU.js → index-BOXh7X5Y.js} +1 -1
  98. package/dist-cli-web/assets/index-BepItDCQ.js +64 -0
  99. package/dist-cli-web/assets/{index-4DVZ2g0M.js → index-BmGA3geF.js} +1 -1
  100. package/dist-cli-web/assets/{index-BvMAw3Zd.js → index-C-u3l4Uh.js} +1 -1
  101. package/dist-cli-web/assets/{index-D8cHMqV-.js → index-CN9WMxb3.js} +2 -2
  102. package/dist-cli-web/assets/{index-BFH1j_R9.js → index-Chh0gCp7.js} +1 -1
  103. package/dist-cli-web/assets/index-DRFMz0cs.css +1 -0
  104. package/dist-cli-web/assets/{index-BgelKQTW.css → index-DbP9vQhR.css} +1 -1
  105. package/dist-cli-web/assets/index-DgCXdbsG.js +2 -0
  106. package/dist-cli-web/assets/{index-CuCQ1d9f.js → index-DhRaZS6z.js} +1 -1
  107. package/dist-cli-web/assets/{index-_m1mf1jm.js → index-Dz4yfeg6.js} +1 -1
  108. package/dist-cli-web/assets/{index-mbLXPIyC.js → index-EtteazuD.js} +1 -1
  109. package/dist-cli-web/assets/index-GNMlsoVH.js +137 -0
  110. package/dist-cli-web/assets/{index-B1oj9KDv.js → index-bQ9oj54q.js} +4 -4
  111. package/dist-cli-web/assets/{index-DlHuILT_.js → index-fsLAooCi.js} +1 -1
  112. package/dist-cli-web/assets/{people-page-header-BbYSSpsO.js → people-page-header-CKXRSnpl.js} +1 -1
  113. package/dist-cli-web/assets/{prompt-C-ofJ7t_.js → prompt-DNxAd1Bj.js} +1 -1
  114. package/dist-cli-web/assets/{semantic-index-config-builder-D3TYVYC-.js → semantic-index-config-builder-CQ27G4TK.js} +1 -1
  115. package/dist-cli-web/assets/{service-CppETV4a.js → service-BwbGKwDn.js} +1 -1
  116. package/dist-cli-web/assets/service-DQjyjQZx.js +1 -0
  117. package/dist-cli-web/assets/service-Dtve_40X.js +1 -0
  118. package/dist-cli-web/assets/useFormControl-CNmp_2bd.js +1 -0
  119. package/dist-cli-web/assets/{ActionToolsPanel.vue_vue_type_script_setup_true_lang-IB1yZxCE.js → useInsightTabAnalytics-DaU_ADbQ.js} +8 -8
  120. package/dist-cli-web/assets/{useTable-Clk7ecq-.js → useTable-BYXxnZMd.js} +1 -1
  121. package/dist-cli-web/assets/{useToast-B5LaA6c-.js → useToast-DPkgv34s.js} +1 -1
  122. package/dist-cli-web/assets/{webworkerAll-CyA4b4LT.js → webworkerAll-Um4PrCaA.js} +1 -1
  123. package/dist-cli-web/index.html +1 -1
  124. package/package.json +1 -1
  125. package/dist/chat-command-YAFRLHMQ.mjs.map +0 -1
  126. package/dist/chunk-73TJ2S7W.mjs.map +0 -1
  127. package/dist/chunk-ARIBCH47.mjs.map +0 -1
  128. package/dist/chunk-JWJREWVN.mjs.map +0 -1
  129. package/dist/chunk-OTYNMDDL.mjs.map +0 -1
  130. package/dist/chunk-UP6JIV3S.mjs.map +0 -1
  131. package/dist/mcp-SMF3NWIN.mjs.map +0 -1
  132. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-qFhJO5B0.js +0 -1
  133. package/dist-cli-web/assets/aiChat--CR4g2M7.js +0 -8
  134. package/dist-cli-web/assets/index-CIIyg_o9.css +0 -1
  135. package/dist-cli-web/assets/index-CaYtkONV.js +0 -64
  136. package/dist-cli-web/assets/index-D3Hyjv4e.js +0 -137
  137. package/dist-cli-web/assets/index-R4LqAnx9.js +0 -2
  138. package/dist-cli-web/assets/service-BYOUkk7V.js +0 -1
  139. package/dist-cli-web/assets/service-tEx-5LUL.js +0 -1
  140. package/dist-cli-web/assets/useFormControl-CrWi_6Hn.js +0 -1
  141. /package/dist/{chunk-FPVRSXQ4.mjs.map → chunk-4FAEB4C2.mjs.map} +0 -0
  142. /package/dist/{chunk-MMTEGUQA.mjs.map → chunk-5OA4QI3Q.mjs.map} +0 -0
  143. /package/dist/{chunk-PDQV4RUA.mjs.map → chunk-GDKQKHJT.mjs.map} +0 -0
  144. /package/dist/{chunk-GKCIRKOH.mjs.map → chunk-HJWBFHNR.mjs.map} +0 -0
  145. /package/dist/{chunk-2PY4XCH3.mjs.map → chunk-IMJVOODY.mjs.map} +0 -0
  146. /package/dist/{chunk-WDLO7OLX.mjs.map → chunk-O57SQSCO.mjs.map} +0 -0
  147. /package/dist/{chunk-N4SB6QZV.mjs.map → chunk-ZGXXAPLX.mjs.map} +0 -0
  148. /package/dist/{http-LPFPVTBC.mjs.map → http-QJDZKDNJ.mjs.map} +0 -0
  149. /package/dist/{import-T4WX2ZJL.mjs.map → import-XK6YM26A.mjs.map} +0 -0
  150. /package/dist/{src-EGLLMTAU.mjs.map → src-4AHJUFCW.mjs.map} +0 -0
  151. /package/dist/{stream-import-2BXJTTCE.mjs.map → stream-import-7VQVT5ST.mjs.map} +0 -0
  152. /package/dist/{worker-runtime-RDLSPXFT.mjs.map → worker-runtime-PQBAV75N.mjs.map} +0 -0
  153. /package/dist-cli-web/assets/{ActionToolsPanel-DDNXXH8v.css → useInsightTabAnalytics-DDNXXH8v.css} +0 -0
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/service-CppETV4a.js","assets/index-B1oj9KDv.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-BZpR015e.css"])))=>i.map(i=>d[i]);
2
- import{e as S,g as k,bD as Qs,x as wt,al as _t,d as be,cI as ze,c0 as ti,C as Oe,b as J,cB as ni,cJ as ri,cK as Js,G as si,cL as ai,cM as ii,cN as ls,cO as oi,cP as li,cQ as ci,cR as ui,cS as di,cT as pi,cU as hi,cV as Be,ce as Lt,K as Te,cW as fi,cX as gi,cg as cs,aI as Je,bt as mi,o as m,f as ae,a6 as qe,J as Xn,aA as er,c as x,n as Y,a as h,z as F,a7 as Ne,p as w,a8 as tr,w as de,a9 as He,F as me,j as _e,aK as Zs,aL as Xs,aR as mt,aQ as yn,bO as ea,cY as yi,l as q,aF as It,a0 as vi,aa as ta,a3 as ki,O as xi,r as Rt,ah as nr,bh as na,cZ as Nt,c_ as xt,c$ as Pt,d0 as fe,d1 as Ee,d2 as ra,d3 as bi,d4 as sa,d5 as vt,d6 as Or,d7 as wi,d8 as _i,d9 as Ti,da as Ci,db as Ue,dc as Si,dd as us,de as aa,df as Mi,dg as en,dh as rr,di as tn,dj as Ai,dk as Ke,dl as Li,dm as $t,dn as $i,dp as tt,dq as Ei,dr as Ii,ds as Ht,dt as wr,du as Ri,dv as Pi,dw as Hi,dx as Ni,dy as zi,dz as ia,dA as Oi,dB as ds,dC as _r,dD as Bi,dE as Di,dF as oa,dG as ji,as as la,aX as Fi,aT as qi,bG as Ui,P as ca,aw as xn,av as ua,H as Ki,aN as Wi,aH as Vi,aE as Gi,ap as Yi,L as lr,bS as Qi,ar as Ji,aP as Zi,aV as Xi,cb as eo,m as ps,au as to,bC as no,cf as ro}from"./index-B1oj9KDv.js";import{M as da,_ as so}from"./index-4DVZ2g0M.js";import{u as Br}from"./useToast-B5LaA6c-.js";import{_ as hs}from"./EChartBar.vue_vue_type_script_setup_true_lang-DKNCZuFm.js";import{_ as pa}from"./EChart.vue_vue_type_script_setup_true_lang-DubnuUXI.js";import{_ as fs}from"./EChartLine.vue_vue_type_script_setup_true_lang-Fl7xAOSR.js";import{s as ao,a as ha}from"./aiChat--CR4g2M7.js";import{u as fa}from"./prompt-C-ofJ7t_.js";import{useCacheService as io}from"./service-CppETV4a.js";function oo(e){const t=S(()=>k(e)),n=S(()=>new Intl.Collator("en",{usage:"search",...t.value}));return{startsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(0,o.length),o)===0),endsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(-o.length),o)===0),contains:(a,o)=>{if(o.length===0)return!0;a=a.normalize("NFC"),o=o.normalize("NFC");let l=0;const c=o.length;for(;l+c<=a.length;l++){const u=a.slice(l,l+c);if(n.value.compare(o,u)===0)return!0}return!1}}}const lo={none:[],qwen:["default","off","high"],deepseek_v4:["default","off","high","xhigh"],deepseek_hybrid:["default","off","auto"],o_series:["default","low","medium","high"],gpt5:["default","minimal","low","medium","high"],gpt5_1:["default","off","low","medium","high"],gpt5_2plus:["default","off","minimal","low","medium","high","xhigh"],grok:["default","low","high"],kimi:["default","off","auto","low","medium","high"],doubao:["default","off","auto","high"],hunyuan:["default","off","high"],gemini:["default","off","low","medium","high"],default:["default","off","low","medium","high"]},gs=/^(?!.*-non-reasoning\b)(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking|think)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bgrok-(?:3-mini|4|4-fast|build)(?:-[\w-]+)?\b.*)$/i;function co(e,t){const n=t.toLowerCase(),s=e.toLowerCase();if(n.includes("-non-reasoning")||s==="anthropic")return"none";if(s==="gemini")return/gemini-(?:2\.5|3(?:\.\d+)?-(?:flash|pro)|flash-latest|pro-latest)/i.test(n)?"gemini":"none";if(s==="qwen"||/\bqwen|qwq/i.test(n))return"qwen";if(/deepseek[_-]v([4-9]|\d{2,})/i.test(n)||/deepseek-ai\/deepseek-r1/i.test(n))return"deepseek_v4";if(/deepseek[_-]chat|deepseek[_-]v3/i.test(n))return"deepseek_hybrid";if(s==="openai"||s==="openai-compatible"){if(/gpt-5\.[2-9]|gpt-5\.[1-9]\d/.test(n))return"gpt5_2plus";if(/gpt-5\.1/.test(n))return"gpt5_1";if(/gpt-5/.test(n))return"gpt5";if(/^o\d/.test(n))return"o_series"}return/^o\d/.test(n)?"o_series":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)||s==="kimi"&&/thinking/i.test(n)?"kimi":/\bdoubao-.*seed/i.test(n)||s==="doubao"&&/seed/i.test(n)?"doubao":/\bhunyuan-(?:t1|a13b)/i.test(n)?"hunyuan":s==="glm"||/\bglm-?(?:5|4\.[5-7]|z1|zero)/i.test(n)?"qwen":s==="siliconflow"&&/r[1-9]/i.test(n)?"deepseek_v4":s==="openrouter"?/deepseek.*(v[4-9]|r\d)/i.test(n)?"deepseek_v4":/deepseek[_-]?(chat|v3)/i.test(n)?"deepseek_hybrid":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)?"kimi":gs.test(n)?"default":"none":/\bmimo-v2/i.test(n)||/\bminimax-m[123]/i.test(n)||/\bseed-oss/i.test(n)?"deepseek_hybrid":/\bbaichuan-m[23]/i.test(n)||/\bmagistral/i.test(n)||/\bmistral-small-2603/i.test(n)||/\bstep-(?:3|r1-v-mini)/i.test(n)||/\bgemma-?4/i.test(n)||/\bpangu-pro-moe/i.test(n)||/\bsonar-deep-research/i.test(n)||/\bring-(?:1t|mini|flash)/i.test(n)?"default":/\bqwen|qwq/i.test(n)?"qwen":/deepseek[_-]?r\d|deepseek[_-]?v[4-9]/i.test(n)?"deepseek_v4":/^o\d/i.test(n)?"o_series":gs.test(n)?"default":"none"}function uo(e,t){const n=co(e,t);return lo[n]}function po(){const{contains:e,startsWith:t}=oo({sensitivity:"base"});function n(a,o){return e(a,o)?e(o,a)?0:t(a,o)?1:2:null}function s(a,o,l){if(typeof a!="object"||a===null)return n(String(a),o);let c=null;for(const u of l){const d=Qs(a,u);if(d==null)continue;const p=Array.isArray(d)?d.map(String):[String(d)];for(const f of p){const y=n(f,o);if(y!==null&&(c===null||y<c)&&(c=y),c===0)return 0}}return c}function r(a,o,l){if(!o)return a;const c=[];for(const u of a){const d=s(u,o,l);d!==null&&c.push({item:u,score:d})}return c.sort((u,d)=>u.score-d.score),c.map(({item:u})=>u)}function i(a,o,l){return o?a.map(c=>{const u=[];for(const d of c){if(d==null)continue;if(l.isStructural?.(d)){u.push({item:d,score:-1});continue}const p=s(d,o,l.fields);p!==null&&u.push({item:d,score:p})}return u.sort((d,p)=>d.score-p.score),u.map(({item:d})=>d)}).filter(c=>c.some(u=>!l.isStructural?.(u))):a}return{score:n,scoreItem:s,filter:r,filterGroups:i}}function ms(e){return ai((t,n)=>({get(){return t(),e},set(s){e=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var ho=class extends ri{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ms(this.view.state),this.reactiveExtensionStorage=ms(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Js(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},fo=be({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=J(),n=ni();return ti(()=>{const s=e.editor;s&&s.options.element&&t.value&&Oe(()=>{var r;if(!t.value||!((r=s.view.dom)!=null&&r.parentNode))return;const i=k(t.value);t.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=n.ctx._,n&&(s.appContext={...n.appContext,provides:n.provides}),s.setOptions({element:i}),s.createNodeViews()})}),_t(()=>{const s=e.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:t}},render(){return ze("div",{ref:e=>{this.rootEl=e}})}}),go=(e={})=>{const t=si();return wt(()=>{t.value=new ho(e)}),_t(()=>{var n,s,r,i;const a=(s=(n=t.value)==null?void 0:n.view.dom)==null?void 0:s.parentNode,o=a?.cloneNode(!0);(r=a?.parentNode)==null||r.replaceChild(o,a),(i=t.value)==null||i.destroy()}),t},mo=class{constructor(e,{props:t={},editor:n}){this.destroyed=!1,this.editor=n,this.component=Js(e),this.el=document.createElement("div"),this.props=ii(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,s;return(t=(e=this.renderedComponent.vNode)==null?void 0:e.component)!=null&&t.exposed?this.renderedComponent.vNode.component.exposed:(s=(n=this.renderedComponent.vNode)==null?void 0:n.component)==null?void 0:s.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=ze(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&ls(e,this.el),{vNode:e,destroy:()=>{this.el&&ls(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([t,n])=>{this.props[t]=n}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}};function yo(e,t){if(!t?.schema)return!1;const n=typeof e=="string"?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function Tt(e,t){if(!e)return!1;const{selection:n}=e.state,{$from:s,to:r}=n;return t.some(i=>e.state.doc.nodesBetween(s.pos,r,a=>a.type.name===i))}function ut(e,t){return e?e.extensionManager.extensions.some(n=>n.name===t):!1}function ys(e){const t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function vs(e){const t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function ks(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function vo(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!yo(t.mark,e)||Tt(e,["image"])}}function ko(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!ut(e,"textAlign")||Tt(e,["image","horizontalRule"])}}function xo(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive("heading",{level:t.level}),isDisabled:e=>Tt(e,["image"])||e.isActive("code")}}function bo(){return{canExecute:e=>e.can().setLink({href:""})||e.can().unsetLink(),execute:(e,t)=>{const n=e.chain(),s=e.getAttributes("link").href,r=e.isActive("code");if(s)return n.focus().unsetLink();const i=t?.href||prompt("Enter the URL:");return i?r?n.focus().extendMarkRange("code").setLink({href:i}):n.focus().setLink({href:i}):n},isActive:e=>e.isActive("link"),isDisabled:e=>{if(!ut(e,"link")||Tt(e,["image"]))return!0;const{selection:t}=e.state;return t.empty&&!e.isActive("link")}}}function wo(){return{canExecute:e=>e.can().setImage({src:""}),execute:(e,t)=>{const n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});const s=prompt("Enter the image URL:");return s?n.setImage({src:s}):n},isActive:e=>e.isActive("image"),isDisabled:e=>!ut(e,"image")}}function cr(e){const n={bulletList:"toggleBulletList",orderedList:"toggleOrderedList",taskList:"toggleTaskList"}[e],s=e==="taskList"?"taskItem":"listItem",r=["bulletList","orderedList","taskList"];return{canExecute:i=>i.can()[n]()||i.isActive("listItem")||r.some(a=>ut(i,a)&&i.isActive(a)),execute:i=>{const{state:a}=i,{selection:o}=a;let l=i.chain().focus();if(o.node){const c=o.node,u=c.firstChild?.firstChild,d=c.lastChild?.lastChild,p=u?o.from+u.nodeSize:o.from+1,f=d?o.to-d.nodeSize:o.to-1;l=l.setTextSelection({from:p,to:f}).clearNodes()}if(i.isActive(e)){let c=l.liftListItem(s);for(const u of r)ut(i,u)&&(c=c.lift(u));return c.selectTextblockEnd()}if(r.some(c=>ut(i,c)&&i.isActive(c))){const c=i.isActive("taskList")?"taskItem":"listItem";let u=l.liftListItem(c);for(const d of r)ut(i,d)&&(u=u.lift(d));return u[n]().selectTextblockEnd()}return l[n]().selectTextblockEnd()},isActive:i=>i.isActive(e),isDisabled:i=>ut(i,e)?Tt(i,["image"])||i.isActive("code"):!0}}function xs(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e==="up"?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();const s=t.state.doc.nodeAt(n.pos);if(!s)return t.chain();const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();if(e==="up"&&a>0){const o=i.child(a-1),l=n.pos-o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}if(e==="down"&&a<i.childCount-1){const o=i.child(a+1),l=n.pos+o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function _o(){return{mark:vo(),textAlign:ko(),heading:xo(),link:bo(),image:wo(),blockquote:ys("blockquote"),bulletList:cr("bulletList"),orderedList:cr("orderedList"),taskList:cr("taskList"),codeBlock:ys("codeBlock"),horizontalRule:vs("horizontalRule"),paragraph:vs("paragraph"),undo:ks("undo"),redo:ks("redo"),clearFormatting:{canExecute:(e,t)=>t?.pos!=null?!!e.state.doc.nodeAt(t.pos):e.can().clearNodes()||e.can().unsetAllMarks(),execute:(e,t)=>{if(t?.pos!=null){const n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();const s=t.pos+1,r=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:s,to:r}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:xs("up"),moveDown:xs("down"),suggestion:{canExecute:()=>!0,execute:(e,t)=>{const{state:n}=e,{selection:s}=n,{$from:r}=s;if(t?.pos!==void 0){const l=n.doc.nodeAt(t.pos);if(l){const c=t.pos+l.nodeSize;return e.chain().focus().insertContentAt(c,{type:"paragraph",content:[{type:"text",text:"/"}]})}}const i=r.node(r.depth),o=r.before(r.depth)+i.nodeSize;return e.chain().focus().insertContentAt(o,{type:"paragraph",content:[{type:"text",text:"/"}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" @":"@")},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" :":":")},isActive:()=>!1,isDisabled:void 0}}}function To(e){const t=[];return e.offset&&t.push(oi(typeof e.offset!="boolean"?e.offset:void 0)),e.flip&&t.push(li(typeof e.flip!="boolean"?e.flip:void 0)),e.shift&&t.push(ci(typeof e.shift!="boolean"?e.shift:void 0)),e.size&&t.push(ui(typeof e.size!="boolean"?e.size:void 0)),e.autoPlacement&&t.push(di(typeof e.autoPlacement!="boolean"?e.autoPlacement:void 0)),e.hide&&t.push(pi(typeof e.hide!="boolean"?e.hide:void 0)),e.inline&&t.push(hi(typeof e.inline!="boolean"?e.inline:void 0)),t}function Co(e){const t=J([]),n=J(0),s=J("closed"),r=e.searchTerm??J("");let i=null,a=null,o=null,l=null,c=null,u=null,d=null,p=null,f=null,y=null,_=null;const{score:M}=po(),v=()=>{s.value!=="closed"&&(s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null))},C=e.filterFields??["label"],z=(H,W)=>{if(!W)return H;const j=[];for(const se of H){let oe=null;for(const Se of C){const Ae=Qs(se,Se);if(Ae==null)continue;const we=Array.isArray(Ae)?Ae.map(String):[String(Ae)];for(const he of we){const De=he.replace(/[\s_-]/g,""),Me=Math.min(M(he,W)??3,M(De,W)??3);if((oe===null||Me<oe)&&(oe=Me),oe===0)break}if(oe===0)break}oe!==null&&oe<3&&j.push({item:se,score:oe})}return j.sort((se,oe)=>se.score-oe.score),j.map(({item:se})=>se)},L=e.filter||z,E=e.limit??42,G=typeof e.pluginKey=="string"?new Be(e.pluginKey):e.pluginKey,ue=S(()=>{const H=k(e.items);return H?.length?cs(H)?H:[H]:[]}),te=S(()=>ue.value.flatMap(H=>H)),V=S(()=>t.value.length?e.ignoreFilter?[t.value]:ue.value.map(H=>{const W=H.filter(j=>t.value.includes(j));return W.sort((j,se)=>t.value.indexOf(j)-t.value.indexOf(se)),W}).filter(H=>H.length>0):[]),I=S(()=>t.value.filter(H=>H.type!=="label"&&H.type!=="separator")),U=Lt(e.options,{strategy:"absolute",placement:"bottom-start",offset:8,flip:{},shift:{padding:8},size:!1,autoPlacement:!1,hide:!1,inline:!1}),O=To(U),Z=H=>{if(!p)return;const W=p();if(!W)return;gi({getBoundingClientRect:()=>W},H,{placement:U.placement,strategy:U.strategy,middleware:O}).then(({x:se,y:oe,strategy:Se})=>{H.style.width="max-content",H.style.position=Se,H.style.top="0",H.style.left="0",H.style.transform=`translate(${Math.round(se)}px, ${Math.round(oe)}px)`})},ie=()=>{s.value="open",u||(u=j=>{c&&c({event:j})&&(j.preventDefault(),j.stopPropagation())},document.addEventListener("keydown",u,!0)),d||(d=()=>{setTimeout(()=>{if(s.value==="open"){const j=e.editor.view.state.tr.setMeta(G,{exit:!0});e.editor.view.dispatch(j)}},0)},e.editor.view.dom.addEventListener("blur",d)),y||(y=()=>{a&&Z(a)},window.addEventListener("scroll",y,!0)),f=j=>{n.value=j,i&&i.updateProps({groups:V.value,selectedIndex:j,onSelect:l,onHover:f,state:s.value})},i=new mo(K,{props:{groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value},editor:e.editor}),a=document.createElement("div"),a.style.position=U.strategy,a.style.zIndex="50",o=j=>{j.preventDefault()},a.addEventListener("mousedown",o),((typeof e.appendTo=="function"?e.appendTo():e.appendTo)??e.editor.view.dom.parentElement)?.appendChild(a),i.element&&a.appendChild(i.element),Z(a)};e.ignoreFilter&&(_=Te(()=>k(e.items),H=>{if(!p)return;const W=H?.length?cs(H)?H.flat():H:[];if(t.value=W.slice(0,E),!t.value.length){v();return}if(n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),s.value==="closed"&&t.value.length){ie();return}i&&i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),a&&Z(a)},{deep:!0,flush:"sync"}));const K={props:{groups:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},onSelect:{type:Function,required:!0},onHover:{type:Function,required:!0},state:{type:String,required:!0}},setup(H){function W(se,oe,Se){se.preventDefault(),H.onSelect(oe,Se)}function j(se){H.onHover(se)}return()=>{const se=H.groups,oe=new Map;let Se=0;for(const Ae of se)for(const we of Ae){const he=we;he.type!=="label"&&he.type!=="separator"&&oe.set(we,Se++)}return ze("div",{class:e.ui.value.content(),role:"listbox","data-state":H.state},[ze("div",{class:e.ui.value.viewport(),role:"presentation"},se.map((Ae,we)=>ze("div",{key:`group-${we}`,class:e.ui.value.group(),role:"group"},Ae.map((he,De)=>{const Me=he;if(Me.type==="label")return ze("div",{key:`label-${we}-${De}`,class:e.ui.value.label({class:Me.class})},e.renderItem(he,e.ui));if(Me.type==="separator")return ze("div",{key:`separator-${we}-${De}`,class:e.ui.value.separator({class:Me.class}),role:"separator"});const Ie=oe.get(he),pt=Ie===H.selectedIndex;return ze("div",{key:`item-${Ie}`,class:e.ui.value.item({class:Me.class,active:!1}),role:"option","aria-selected":pt,"data-highlighted":pt?"":void 0,"data-disabled":Me.disabled?"":void 0,onMousedown:it=>W(it,he,Ie),onMouseenter:()=>j(Ie),ref:it=>{it&&pt&&it.scrollIntoView({block:"nearest",inline:"nearest"})}},e.renderItem(he,e.ui))}))))])}}};return{plugin:fi({...e.suggestion||{},pluginKey:G,editor:e.editor,char:e.char,items:({query:H})=>(r.value=H,e.ignoreFilter?te.value.slice(0,E):L(te.value,H).slice(0,E)),command:({editor:H,range:W,props:j})=>{e.onSelect(H,W,j)},render:()=>(c=W=>{const{event:j}=W;if(!i||!I.value.length)return!1;if(j.key==="Escape")return v(),!0;if(j.key==="ArrowUp")return n.value=(n.value+I.value.length-1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="ArrowDown")return n.value=(n.value+1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="Enter"||j.key==="Tab"){const se=I.value[n.value];return se&&l&&l(se),!0}return!1},{onStart:W=>{t.value=e.ignoreFilter?te.value.slice(0,E):W.items,n.value=0,l=j=>W.command(j),p=W.clientRect,t.value.length&&ie()},onUpdate:W=>{if(t.value=e.ignoreFilter?te.value.slice(0,E):W.items,l=j=>W.command(j),n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),!t.value.length){v();return}i?i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}):ie(),a&&Z(a)},onKeyDown:c,onExit:()=>{v(),p=null,r.value=""}})}),destroy:()=>{s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null),_&&(_(),_=null)},filteredItems:t,searchTerm:r}}function So(e){return e.content.trim()?e.content:e.contentBlocks?.filter(n=>n.type==="text"&&!!n.text).map(n=>n.text).join("")??""}function Tr(e){return e.flatMap(t=>{if(t.role!=="user"&&t.role!=="assistant")return[];const n=So(t);return n.trim()?[{role:t.role,content:n,timestamp:t.timestamp}]:[]})}function Mo(e){return Tr(e).length>0}function Ao(e,t,n,s){const r=[];r.push(`# ${e}`),r.push(""),r.push(`> ${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("---"),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`### ${o}`),r.push(`*${a}*`),r.push(""),r.push(i.content),r.push(""),r.push("---"),r.push("")}return r.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/service-BwbGKwDn.js","assets/index-bQ9oj54q.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-BZpR015e.css"])))=>i.map(i=>d[i]);
2
+ import{e as S,g as k,bD as Qs,x as wt,al as _t,d as be,cI as ze,c0 as ti,C as Oe,b as J,cB as ni,cJ as ri,cK as Js,G as si,cL as ai,cM as ii,cN as ls,cO as oi,cP as li,cQ as ci,cR as ui,cS as di,cT as pi,cU as hi,cV as Be,ce as Lt,K as Te,cW as fi,cX as gi,cg as cs,aI as Je,bt as mi,o as m,f as ae,a6 as qe,J as Xn,aA as er,c as x,n as Y,a as h,z as F,a7 as Ne,p as w,a8 as tr,w as de,a9 as He,F as me,j as _e,aK as Zs,aL as Xs,aR as mt,aQ as yn,bO as ea,cY as yi,l as q,aF as It,a0 as vi,aa as ta,a3 as ki,O as xi,r as Rt,ah as nr,bh as na,cZ as Nt,c_ as xt,c$ as Pt,d0 as fe,d1 as Ee,d2 as ra,d3 as bi,d4 as sa,d5 as vt,d6 as Or,d7 as wi,d8 as _i,d9 as Ti,da as Ci,db as Ue,dc as Si,dd as us,de as aa,df as Mi,dg as en,dh as rr,di as tn,dj as Ai,dk as Ke,dl as Li,dm as $t,dn as $i,dp as tt,dq as Ei,dr as Ii,ds as Ht,dt as wr,du as Ri,dv as Pi,dw as Hi,dx as Ni,dy as zi,dz as ia,dA as Oi,dB as ds,dC as _r,dD as Bi,dE as Di,dF as oa,dG as ji,as as la,aX as Fi,aT as qi,bG as Ui,P as ca,aw as xn,av as ua,H as Ki,aN as Wi,aH as Vi,aE as Gi,ap as Yi,L as lr,bS as Qi,ar as Ji,aP as Zi,aV as Xi,cb as eo,m as ps,au as to,bC as no,cf as ro}from"./index-bQ9oj54q.js";import{M as da,_ as so}from"./index-BmGA3geF.js";import{u as Br}from"./useToast-DPkgv34s.js";import{_ as hs}from"./EChartBar.vue_vue_type_script_setup_true_lang-DjDFhnN9.js";import{_ as pa}from"./EChart.vue_vue_type_script_setup_true_lang-CRTZh9kh.js";import{_ as fs}from"./EChartLine.vue_vue_type_script_setup_true_lang-BLqlW9E4.js";import{s as ao,a as ha}from"./aiChat-CdJzpNYW.js";import{u as fa}from"./prompt-DNxAd1Bj.js";import{useCacheService as io}from"./service-BwbGKwDn.js";function oo(e){const t=S(()=>k(e)),n=S(()=>new Intl.Collator("en",{usage:"search",...t.value}));return{startsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(0,o.length),o)===0),endsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(-o.length),o)===0),contains:(a,o)=>{if(o.length===0)return!0;a=a.normalize("NFC"),o=o.normalize("NFC");let l=0;const c=o.length;for(;l+c<=a.length;l++){const u=a.slice(l,l+c);if(n.value.compare(o,u)===0)return!0}return!1}}}const lo={none:[],qwen:["default","off","high"],deepseek_v4:["default","off","high","xhigh"],deepseek_hybrid:["default","off","auto"],o_series:["default","low","medium","high"],gpt5:["default","minimal","low","medium","high"],gpt5_1:["default","off","low","medium","high"],gpt5_2plus:["default","off","minimal","low","medium","high","xhigh"],grok:["default","low","high"],kimi:["default","off","auto","low","medium","high"],doubao:["default","off","auto","high"],hunyuan:["default","off","high"],gemini:["default","off","low","medium","high"],default:["default","off","low","medium","high"]},gs=/^(?!.*-non-reasoning\b)(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking|think)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bgrok-(?:3-mini|4|4-fast|build)(?:-[\w-]+)?\b.*)$/i;function co(e,t){const n=t.toLowerCase(),s=e.toLowerCase();if(n.includes("-non-reasoning")||s==="anthropic")return"none";if(s==="gemini")return/gemini-(?:2\.5|3(?:\.\d+)?-(?:flash|pro)|flash-latest|pro-latest)/i.test(n)?"gemini":"none";if(s==="qwen"||/\bqwen|qwq/i.test(n))return"qwen";if(/deepseek[_-]v([4-9]|\d{2,})/i.test(n)||/deepseek-ai\/deepseek-r1/i.test(n))return"deepseek_v4";if(/deepseek[_-]chat|deepseek[_-]v3/i.test(n))return"deepseek_hybrid";if(s==="openai"||s==="openai-compatible"){if(/gpt-5\.[2-9]|gpt-5\.[1-9]\d/.test(n))return"gpt5_2plus";if(/gpt-5\.1/.test(n))return"gpt5_1";if(/gpt-5/.test(n))return"gpt5";if(/^o\d/.test(n))return"o_series"}return/^o\d/.test(n)?"o_series":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)||s==="kimi"&&/thinking/i.test(n)?"kimi":/\bdoubao-.*seed/i.test(n)||s==="doubao"&&/seed/i.test(n)?"doubao":/\bhunyuan-(?:t1|a13b)/i.test(n)?"hunyuan":s==="glm"||/\bglm-?(?:5|4\.[5-7]|z1|zero)/i.test(n)?"qwen":s==="siliconflow"&&/r[1-9]/i.test(n)?"deepseek_v4":s==="openrouter"?/deepseek.*(v[4-9]|r\d)/i.test(n)?"deepseek_v4":/deepseek[_-]?(chat|v3)/i.test(n)?"deepseek_hybrid":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)?"kimi":gs.test(n)?"default":"none":/\bmimo-v2/i.test(n)||/\bminimax-m[123]/i.test(n)||/\bseed-oss/i.test(n)?"deepseek_hybrid":/\bbaichuan-m[23]/i.test(n)||/\bmagistral/i.test(n)||/\bmistral-small-2603/i.test(n)||/\bstep-(?:3|r1-v-mini)/i.test(n)||/\bgemma-?4/i.test(n)||/\bpangu-pro-moe/i.test(n)||/\bsonar-deep-research/i.test(n)||/\bring-(?:1t|mini|flash)/i.test(n)?"default":/\bqwen|qwq/i.test(n)?"qwen":/deepseek[_-]?r\d|deepseek[_-]?v[4-9]/i.test(n)?"deepseek_v4":/^o\d/i.test(n)?"o_series":gs.test(n)?"default":"none"}function uo(e,t){const n=co(e,t);return lo[n]}function po(){const{contains:e,startsWith:t}=oo({sensitivity:"base"});function n(a,o){return e(a,o)?e(o,a)?0:t(a,o)?1:2:null}function s(a,o,l){if(typeof a!="object"||a===null)return n(String(a),o);let c=null;for(const u of l){const d=Qs(a,u);if(d==null)continue;const p=Array.isArray(d)?d.map(String):[String(d)];for(const f of p){const y=n(f,o);if(y!==null&&(c===null||y<c)&&(c=y),c===0)return 0}}return c}function r(a,o,l){if(!o)return a;const c=[];for(const u of a){const d=s(u,o,l);d!==null&&c.push({item:u,score:d})}return c.sort((u,d)=>u.score-d.score),c.map(({item:u})=>u)}function i(a,o,l){return o?a.map(c=>{const u=[];for(const d of c){if(d==null)continue;if(l.isStructural?.(d)){u.push({item:d,score:-1});continue}const p=s(d,o,l.fields);p!==null&&u.push({item:d,score:p})}return u.sort((d,p)=>d.score-p.score),u.map(({item:d})=>d)}).filter(c=>c.some(u=>!l.isStructural?.(u))):a}return{score:n,scoreItem:s,filter:r,filterGroups:i}}function ms(e){return ai((t,n)=>({get(){return t(),e},set(s){e=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var ho=class extends ri{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ms(this.view.state),this.reactiveExtensionStorage=ms(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Js(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},fo=be({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=J(),n=ni();return ti(()=>{const s=e.editor;s&&s.options.element&&t.value&&Oe(()=>{var r;if(!t.value||!((r=s.view.dom)!=null&&r.parentNode))return;const i=k(t.value);t.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=n.ctx._,n&&(s.appContext={...n.appContext,provides:n.provides}),s.setOptions({element:i}),s.createNodeViews()})}),_t(()=>{const s=e.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:t}},render(){return ze("div",{ref:e=>{this.rootEl=e}})}}),go=(e={})=>{const t=si();return wt(()=>{t.value=new ho(e)}),_t(()=>{var n,s,r,i;const a=(s=(n=t.value)==null?void 0:n.view.dom)==null?void 0:s.parentNode,o=a?.cloneNode(!0);(r=a?.parentNode)==null||r.replaceChild(o,a),(i=t.value)==null||i.destroy()}),t},mo=class{constructor(e,{props:t={},editor:n}){this.destroyed=!1,this.editor=n,this.component=Js(e),this.el=document.createElement("div"),this.props=ii(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,s;return(t=(e=this.renderedComponent.vNode)==null?void 0:e.component)!=null&&t.exposed?this.renderedComponent.vNode.component.exposed:(s=(n=this.renderedComponent.vNode)==null?void 0:n.component)==null?void 0:s.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=ze(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&ls(e,this.el),{vNode:e,destroy:()=>{this.el&&ls(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([t,n])=>{this.props[t]=n}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}};function yo(e,t){if(!t?.schema)return!1;const n=typeof e=="string"?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function Tt(e,t){if(!e)return!1;const{selection:n}=e.state,{$from:s,to:r}=n;return t.some(i=>e.state.doc.nodesBetween(s.pos,r,a=>a.type.name===i))}function ut(e,t){return e?e.extensionManager.extensions.some(n=>n.name===t):!1}function ys(e){const t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function vs(e){const t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function ks(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function vo(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!yo(t.mark,e)||Tt(e,["image"])}}function ko(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!ut(e,"textAlign")||Tt(e,["image","horizontalRule"])}}function xo(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive("heading",{level:t.level}),isDisabled:e=>Tt(e,["image"])||e.isActive("code")}}function bo(){return{canExecute:e=>e.can().setLink({href:""})||e.can().unsetLink(),execute:(e,t)=>{const n=e.chain(),s=e.getAttributes("link").href,r=e.isActive("code");if(s)return n.focus().unsetLink();const i=t?.href||prompt("Enter the URL:");return i?r?n.focus().extendMarkRange("code").setLink({href:i}):n.focus().setLink({href:i}):n},isActive:e=>e.isActive("link"),isDisabled:e=>{if(!ut(e,"link")||Tt(e,["image"]))return!0;const{selection:t}=e.state;return t.empty&&!e.isActive("link")}}}function wo(){return{canExecute:e=>e.can().setImage({src:""}),execute:(e,t)=>{const n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});const s=prompt("Enter the image URL:");return s?n.setImage({src:s}):n},isActive:e=>e.isActive("image"),isDisabled:e=>!ut(e,"image")}}function cr(e){const n={bulletList:"toggleBulletList",orderedList:"toggleOrderedList",taskList:"toggleTaskList"}[e],s=e==="taskList"?"taskItem":"listItem",r=["bulletList","orderedList","taskList"];return{canExecute:i=>i.can()[n]()||i.isActive("listItem")||r.some(a=>ut(i,a)&&i.isActive(a)),execute:i=>{const{state:a}=i,{selection:o}=a;let l=i.chain().focus();if(o.node){const c=o.node,u=c.firstChild?.firstChild,d=c.lastChild?.lastChild,p=u?o.from+u.nodeSize:o.from+1,f=d?o.to-d.nodeSize:o.to-1;l=l.setTextSelection({from:p,to:f}).clearNodes()}if(i.isActive(e)){let c=l.liftListItem(s);for(const u of r)ut(i,u)&&(c=c.lift(u));return c.selectTextblockEnd()}if(r.some(c=>ut(i,c)&&i.isActive(c))){const c=i.isActive("taskList")?"taskItem":"listItem";let u=l.liftListItem(c);for(const d of r)ut(i,d)&&(u=u.lift(d));return u[n]().selectTextblockEnd()}return l[n]().selectTextblockEnd()},isActive:i=>i.isActive(e),isDisabled:i=>ut(i,e)?Tt(i,["image"])||i.isActive("code"):!0}}function xs(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e==="up"?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();const s=t.state.doc.nodeAt(n.pos);if(!s)return t.chain();const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();if(e==="up"&&a>0){const o=i.child(a-1),l=n.pos-o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}if(e==="down"&&a<i.childCount-1){const o=i.child(a+1),l=n.pos+o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function _o(){return{mark:vo(),textAlign:ko(),heading:xo(),link:bo(),image:wo(),blockquote:ys("blockquote"),bulletList:cr("bulletList"),orderedList:cr("orderedList"),taskList:cr("taskList"),codeBlock:ys("codeBlock"),horizontalRule:vs("horizontalRule"),paragraph:vs("paragraph"),undo:ks("undo"),redo:ks("redo"),clearFormatting:{canExecute:(e,t)=>t?.pos!=null?!!e.state.doc.nodeAt(t.pos):e.can().clearNodes()||e.can().unsetAllMarks(),execute:(e,t)=>{if(t?.pos!=null){const n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();const s=t.pos+1,r=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:s,to:r}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:xs("up"),moveDown:xs("down"),suggestion:{canExecute:()=>!0,execute:(e,t)=>{const{state:n}=e,{selection:s}=n,{$from:r}=s;if(t?.pos!==void 0){const l=n.doc.nodeAt(t.pos);if(l){const c=t.pos+l.nodeSize;return e.chain().focus().insertContentAt(c,{type:"paragraph",content:[{type:"text",text:"/"}]})}}const i=r.node(r.depth),o=r.before(r.depth)+i.nodeSize;return e.chain().focus().insertContentAt(o,{type:"paragraph",content:[{type:"text",text:"/"}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" @":"@")},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" :":":")},isActive:()=>!1,isDisabled:void 0}}}function To(e){const t=[];return e.offset&&t.push(oi(typeof e.offset!="boolean"?e.offset:void 0)),e.flip&&t.push(li(typeof e.flip!="boolean"?e.flip:void 0)),e.shift&&t.push(ci(typeof e.shift!="boolean"?e.shift:void 0)),e.size&&t.push(ui(typeof e.size!="boolean"?e.size:void 0)),e.autoPlacement&&t.push(di(typeof e.autoPlacement!="boolean"?e.autoPlacement:void 0)),e.hide&&t.push(pi(typeof e.hide!="boolean"?e.hide:void 0)),e.inline&&t.push(hi(typeof e.inline!="boolean"?e.inline:void 0)),t}function Co(e){const t=J([]),n=J(0),s=J("closed"),r=e.searchTerm??J("");let i=null,a=null,o=null,l=null,c=null,u=null,d=null,p=null,f=null,y=null,_=null;const{score:M}=po(),v=()=>{s.value!=="closed"&&(s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null))},C=e.filterFields??["label"],z=(H,W)=>{if(!W)return H;const j=[];for(const se of H){let oe=null;for(const Se of C){const Ae=Qs(se,Se);if(Ae==null)continue;const we=Array.isArray(Ae)?Ae.map(String):[String(Ae)];for(const he of we){const De=he.replace(/[\s_-]/g,""),Me=Math.min(M(he,W)??3,M(De,W)??3);if((oe===null||Me<oe)&&(oe=Me),oe===0)break}if(oe===0)break}oe!==null&&oe<3&&j.push({item:se,score:oe})}return j.sort((se,oe)=>se.score-oe.score),j.map(({item:se})=>se)},L=e.filter||z,E=e.limit??42,G=typeof e.pluginKey=="string"?new Be(e.pluginKey):e.pluginKey,ue=S(()=>{const H=k(e.items);return H?.length?cs(H)?H:[H]:[]}),te=S(()=>ue.value.flatMap(H=>H)),V=S(()=>t.value.length?e.ignoreFilter?[t.value]:ue.value.map(H=>{const W=H.filter(j=>t.value.includes(j));return W.sort((j,se)=>t.value.indexOf(j)-t.value.indexOf(se)),W}).filter(H=>H.length>0):[]),I=S(()=>t.value.filter(H=>H.type!=="label"&&H.type!=="separator")),U=Lt(e.options,{strategy:"absolute",placement:"bottom-start",offset:8,flip:{},shift:{padding:8},size:!1,autoPlacement:!1,hide:!1,inline:!1}),O=To(U),Z=H=>{if(!p)return;const W=p();if(!W)return;gi({getBoundingClientRect:()=>W},H,{placement:U.placement,strategy:U.strategy,middleware:O}).then(({x:se,y:oe,strategy:Se})=>{H.style.width="max-content",H.style.position=Se,H.style.top="0",H.style.left="0",H.style.transform=`translate(${Math.round(se)}px, ${Math.round(oe)}px)`})},ie=()=>{s.value="open",u||(u=j=>{c&&c({event:j})&&(j.preventDefault(),j.stopPropagation())},document.addEventListener("keydown",u,!0)),d||(d=()=>{setTimeout(()=>{if(s.value==="open"){const j=e.editor.view.state.tr.setMeta(G,{exit:!0});e.editor.view.dispatch(j)}},0)},e.editor.view.dom.addEventListener("blur",d)),y||(y=()=>{a&&Z(a)},window.addEventListener("scroll",y,!0)),f=j=>{n.value=j,i&&i.updateProps({groups:V.value,selectedIndex:j,onSelect:l,onHover:f,state:s.value})},i=new mo(K,{props:{groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value},editor:e.editor}),a=document.createElement("div"),a.style.position=U.strategy,a.style.zIndex="50",o=j=>{j.preventDefault()},a.addEventListener("mousedown",o),((typeof e.appendTo=="function"?e.appendTo():e.appendTo)??e.editor.view.dom.parentElement)?.appendChild(a),i.element&&a.appendChild(i.element),Z(a)};e.ignoreFilter&&(_=Te(()=>k(e.items),H=>{if(!p)return;const W=H?.length?cs(H)?H.flat():H:[];if(t.value=W.slice(0,E),!t.value.length){v();return}if(n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),s.value==="closed"&&t.value.length){ie();return}i&&i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),a&&Z(a)},{deep:!0,flush:"sync"}));const K={props:{groups:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},onSelect:{type:Function,required:!0},onHover:{type:Function,required:!0},state:{type:String,required:!0}},setup(H){function W(se,oe,Se){se.preventDefault(),H.onSelect(oe,Se)}function j(se){H.onHover(se)}return()=>{const se=H.groups,oe=new Map;let Se=0;for(const Ae of se)for(const we of Ae){const he=we;he.type!=="label"&&he.type!=="separator"&&oe.set(we,Se++)}return ze("div",{class:e.ui.value.content(),role:"listbox","data-state":H.state},[ze("div",{class:e.ui.value.viewport(),role:"presentation"},se.map((Ae,we)=>ze("div",{key:`group-${we}`,class:e.ui.value.group(),role:"group"},Ae.map((he,De)=>{const Me=he;if(Me.type==="label")return ze("div",{key:`label-${we}-${De}`,class:e.ui.value.label({class:Me.class})},e.renderItem(he,e.ui));if(Me.type==="separator")return ze("div",{key:`separator-${we}-${De}`,class:e.ui.value.separator({class:Me.class}),role:"separator"});const Ie=oe.get(he),pt=Ie===H.selectedIndex;return ze("div",{key:`item-${Ie}`,class:e.ui.value.item({class:Me.class,active:!1}),role:"option","aria-selected":pt,"data-highlighted":pt?"":void 0,"data-disabled":Me.disabled?"":void 0,onMousedown:it=>W(it,he,Ie),onMouseenter:()=>j(Ie),ref:it=>{it&&pt&&it.scrollIntoView({block:"nearest",inline:"nearest"})}},e.renderItem(he,e.ui))}))))])}}};return{plugin:fi({...e.suggestion||{},pluginKey:G,editor:e.editor,char:e.char,items:({query:H})=>(r.value=H,e.ignoreFilter?te.value.slice(0,E):L(te.value,H).slice(0,E)),command:({editor:H,range:W,props:j})=>{e.onSelect(H,W,j)},render:()=>(c=W=>{const{event:j}=W;if(!i||!I.value.length)return!1;if(j.key==="Escape")return v(),!0;if(j.key==="ArrowUp")return n.value=(n.value+I.value.length-1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="ArrowDown")return n.value=(n.value+1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="Enter"||j.key==="Tab"){const se=I.value[n.value];return se&&l&&l(se),!0}return!1},{onStart:W=>{t.value=e.ignoreFilter?te.value.slice(0,E):W.items,n.value=0,l=j=>W.command(j),p=W.clientRect,t.value.length&&ie()},onUpdate:W=>{if(t.value=e.ignoreFilter?te.value.slice(0,E):W.items,l=j=>W.command(j),n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),!t.value.length){v();return}i?i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}):ie(),a&&Z(a)},onKeyDown:c,onExit:()=>{v(),p=null,r.value=""}})}),destroy:()=>{s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null),_&&(_(),_=null)},filteredItems:t,searchTerm:r}}function So(e){return e.content.trim()?e.content:e.contentBlocks?.filter(n=>n.type==="text"&&!!n.text).map(n=>n.text).join("")??""}function Tr(e){return e.flatMap(t=>{if(t.role!=="user"&&t.role!=="assistant")return[];const n=So(t);return n.trim()?[{role:t.role,content:n,timestamp:t.timestamp}]:[]})}function Mo(e){return Tr(e).length>0}function Ao(e,t,n,s){const r=[];r.push(`# ${e}`),r.push(""),r.push(`> ${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("---"),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`### ${o}`),r.push(`*${a}*`),r.push(""),r.push(i.content),r.push(""),r.push("---"),r.push("")}return r.join(`
3
3
  `)}function Lo(e,t,n,s){const r=[];r.push(`${e}`),r.push(`${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("=".repeat(50)),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`[${o}] ${a}`),r.push(""),r.push(i.content),r.push(""),r.push("-".repeat(50)),r.push("")}return r.join(`
4
- `)}function $o(e){return e.replace(/[/\\?%*:|"<>]/g,"_")}async function Eo(e,t,n,s,r){if(t.length===0)return{success:!1,error:"No messages to export"};let i,a;const o=Je(n).format("YYYYMMDD_HHmmss"),l=$o(e);s==="markdown"?(i=Ao(e,t,n,r),a=`${l}_${o}.md`):(i=Lo(e,t,n,r),a=`${l}_${o}.txt`);const c=`data:text/plain;charset=utf-8,${encodeURIComponent(i)}`,{useCacheService:u}=await mi(async()=>{const{useCacheService:p}=await import("./service-CppETV4a.js");return{useCacheService:p}},__vite__mapDeps([0,1,2,3]));return await u().saveToDownloads(a,c)}const bs=be({__name:"EChartPie",props:{data:{},height:{default:280},mode:{default:"expanded"},doughnut:{type:Boolean,default:!0},innerRadius:{default:"50%"},showLegend:{type:Boolean,default:!0}},setup(e){const t=e,n=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6"],s=S(()=>{const r=t.data.labels.map((p,f)=>({name:p,value:t.data.values[f]})),i=t.data.labels.length,a=t.mode==="compact",o=i>(a?8:14),l=i>(a?6:12),c=a?{type:l?"scroll":"plain",orient:"horizontal",left:8,right:8,bottom:0,height:28,textStyle:{fontSize:11,overflow:"truncate",width:72}}:{type:l?"scroll":"plain",orient:"vertical",right:10,top:24,bottom:24,textStyle:{fontSize:12,overflow:"truncate",width:120}},u=!a&&!o,d=t.showLegend&&!u;return{color:n,tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},legend:d?c:void 0,series:[{type:"pie",radius:t.doughnut?[t.innerRadius,a?"58%":"68%"]:a?"58%":"68%",center:d?a?["50%","42%"]:["38%","50%"]:["50%",a?"46%":"50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:4,borderColor:"#fff",borderWidth:2},label:{show:u,formatter:"{b}",overflow:"truncate",width:110,alignTo:"edge",edgeDistance:12},emphasis:{label:{show:u,fontSize:14,fontWeight:"bold",overflow:"truncate",width:140},itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:r}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),ws=be({__name:"EChartHeatmap",props:{data:{},height:{default:280},mode:{default:"expanded"},minColor:{default:"#fee5e8"},maxColor:{default:"#ee4567"}},setup(e){const t=e,n=S(()=>{let r=0;for(const[,,i]of t.data.data)i>r&&(r=i);return r||1}),s=S(()=>{const r=t.mode==="compact",i=t.data.xLabels.length,a=t.data.yLabels.length;return{tooltip:{position:"top",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",formatter:o=>{const l=t.data.xLabels[o.data[0]],c=t.data.yLabels[o.data[1]],u=o.data[2];return`${c} ${l}<br/>消息数: <strong>${u}</strong>`},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},grid:{left:r?52:72,right:20,top:r?12:24,bottom:r?52:70,outerBoundsMode:"same"},xAxis:{type:"category",data:t.data.xLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&i>16?"auto":0,hideOverlap:!0}},yAxis:{type:"category",data:t.data.yLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&a>14?"auto":0,hideOverlap:!0}},visualMap:{min:0,max:n.value,calculable:!0,orient:"horizontal",left:"center",bottom:0,itemWidth:r?8:10,itemHeight:r?84:120,inRange:{color:[t.minColor,t.maxColor]},textStyle:{color:"#6b7280",fontSize:11}},series:[{type:"heatmap",data:t.data.data,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),Io=["inert","aria-hidden"],Ro={class:"flex h-full w-64 flex-col"},Po={class:"flex-1 overflow-y-auto p-2"},Ho={key:0,class:"flex items-center justify-center py-8"},No={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},zo={class:"flex h-12 w-12 items-center justify-center rounded-full bg-gray-50 dark:bg-gray-800"},Oo={class:"mt-3 text-xs text-gray-400"},Bo={key:2,class:"space-y-3"},Do={class:"px-2 pb-1 pt-1.5 text-[10px] font-medium tracking-wide text-gray-400 dark:text-gray-500"},jo={class:"space-y-0.5"},Fo=["onClick"],qo=["placeholder","onBlur","onKeyup"],Uo={key:1,class:"flex items-center"},Ko={class:"line-clamp-1 min-w-0 flex-1 text-sm leading-snug"},Wo={class:"rounded p-0.5 text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300"},Vo={class:"w-28 p-1"},Go=["disabled","onClick"],Yo=["onClick"],Qo=["disabled","onClick"],Jo={class:"pointer-events-none absolute left-0 top-0 z-10 h-[52px] w-[92px]"},Zo={key:0,class:"pointer-events-auto absolute left-2 top-2"},Xo=["title","disabled"],fg=be({__name:"ConversationList",props:{sessionId:{},activeId:{},disabled:{type:Boolean},conversations:{},loading:{type:Boolean},embedded:{type:Boolean},collapsible:{type:Boolean,default:!0}},emits:["select","create","delete","rename"],setup(e,{expose:t,emit:n}){const{t:s}=qe(),r=Xn(),{isAIChatSidebarCollapsed:i}=er(r),{toggleAIChatSidebar:a}=r,o=e,l=n,c=J([]),u=J(!1),d=J(null),p=J(""),f=J(null),y=S(()=>o.conversations!==void 0),_=S(()=>o.conversations??c.value),M=S(()=>y.value?o.loading??!1:u.value),v=S(()=>o.collapsible!==!1),C=S(()=>v.value&&i.value);async function z(){if(!y.value){u.value=!0;try{c.value=await It().getAIChats(o.sessionId)}catch(O){console.error("加载对话列表失败:",O)}finally{u.value=!1}}}const L=S(()=>{if(_.value.length===0)return[];const O=Je(),Z=O.subtract(7,"day").startOf("day"),ie=O.subtract(30,"day").startOf("day"),K=[],B=[],re=new Map;for(const j of _.value){const se=Je(j.updatedAt*1e3);if(se.isAfter(Z))K.push(j);else if(se.isAfter(ie))B.push(j);else{const oe=se.format("YYYY-MM");re.has(oe)||re.set(oe,[]),re.get(oe).push(j)}}const H=[];K.length>0&&H.push({label:s("ai.chat.conversation.group.last7Days"),conversations:K}),B.length>0&&H.push({label:s("ai.chat.conversation.group.last30Days"),conversations:B});const W=[...re.keys()].sort((j,se)=>se.localeCompare(j));for(const j of W){const se=Je(j+"-01");H.push({label:se.format(se.year()===O.year()?"M月":"YYYY年M月"),conversations:re.get(j)})}return H});function E(O){return O.title||s("ai.chat.conversation.newChat")}function G(O){o.disabled||(d.value=O.id,p.value=O.title||"")}async function ue(O){if(!o.disabled){if(p.value.trim()){if(y.value){l("rename",{id:O,title:p.value.trim()}),d.value=null;return}try{await It().updateAIChatTitle(O,p.value.trim());const Z=c.value.find(ie=>ie.id===O);Z&&(Z.title=p.value.trim())}catch(Z){console.error("更新标题失败:",Z)}}d.value=null}}function te(O){f.value=null,G(O)}function V(O){f.value=null,navigator.clipboard.writeText(O)}function I(O){f.value=null,U(O)}async function U(O){if(!o.disabled){if(y.value){l("delete",O);return}try{await It().deleteAIChat(O),c.value=c.value.filter(Z=>Z.id!==O),l("delete",O)}catch(Z){console.error("删除对话失败:",Z)}}}return wt(()=>{z()}),Te(()=>o.sessionId,()=>{z()}),t({refresh:z}),(O,Z)=>{const ie=Ne,K=tr,B=ea;return m(),x("div",{class:Y(["relative shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none",[o.embedded?"h-full":"m-3 h-[calc(100%-1.5rem)]",C.value?"w-[92px]":"w-64"]])},[h("div",{class:Y(["absolute inset-y-0 left-0 overflow-hidden rounded-lg bg-white transition-[width] duration-300 ease-in-out motion-reduce:transition-none dark:bg-sidebar-dark",C.value?"pointer-events-none w-0":"w-64"]),inert:C.value,"aria-hidden":C.value?"true":void 0},[h("div",Ro,[Z[5]||(Z[5]=h("div",{class:"h-[52px] shrink-0 border-b border-gray-200 dark:border-gray-800"},null,-1)),h("div",Po,[M.value?(m(),x("div",Ho,[F(ie,{name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-gray-400"})])):_.value.length===0?(m(),x("div",No,[h("div",zo,[F(ie,{name:"i-heroicons-chat-bubble-left",class:"h-6 w-6 text-gray-300 dark:text-gray-600"})]),h("p",Oo,w(k(s)("ai.chat.conversation.empty")),1),F(K,{class:"mt-2",size:"xs",variant:"link",color:"primary",disabled:e.disabled,onClick:Z[0]||(Z[0]=re=>!e.disabled&&l("create"))},{default:de(()=>[He(w(k(s)("ai.chat.conversation.startNew")),1)]),_:1},8,["disabled"])])):(m(),x("div",Bo,[(m(!0),x(me,null,_e(L.value,re=>(m(),x("div",{key:re.label},[h("div",Do,w(re.label),1),h("div",jo,[(m(!0),x(me,null,_e(re.conversations,H=>(m(),x("div",{key:H.id,class:Y(["group relative rounded-lg px-3 py-2 transition-all",["cursor-pointer",e.activeId===H.id?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50"]]),onClick:W=>l("select",H.id)},[d.value===H.id?Zs((m(),x("input",{key:0,"onUpdate:modelValue":Z[1]||(Z[1]=W=>p.value=W),class:"w-full rounded border-none bg-white px-2 py-1 text-sm shadow-sm outline-none ring-1 ring-gray-200 focus:ring-2 focus:ring-primary-500 dark:bg-page-dark dark:ring-gray-700",placeholder:k(s)("ai.chat.conversation.titlePlaceholder"),autoFocus:"",onBlur:W=>ue(H.id),onKeyup:yn(W=>ue(H.id),["enter"]),onClick:Z[2]||(Z[2]=mt(()=>{},["stop"]))},null,40,qo)),[[Xs,p.value]]):(m(),x("div",Uo,[h("p",Ko,w(E(H)),1),h("div",{class:Y(["ml-1 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",{"opacity-100":e.activeId===H.id||f.value===H.id}]),onClick:Z[3]||(Z[3]=mt(()=>{},["stop"]))},[F(B,{open:f.value===H.id,ui:{content:"z-50 p-0"},"onUpdate:open":W=>f.value=W?H.id:null},{content:de(()=>[h("div",Vo,[h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",disabled:e.disabled,onClick:W=>te(H)},[F(ie,{name:"i-heroicons-pencil",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.rename")),1)],8,Go),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",onClick:W=>V(H.id)},[F(ie,{name:"i-heroicons-clipboard-document",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.copyId")),1)],8,Yo),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-red-500 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/30",disabled:e.disabled,onClick:W=>I(H.id)},[F(ie,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.delete")),1)],8,Qo)])]),default:de(()=>[h("button",Wo,[F(ie,{name:"i-heroicons-ellipsis-horizontal",class:"h-4 w-4"})])]),_:2},1032,["open","onUpdate:open"])],2)]))],10,Fo))),128))])]))),128))]))])])],10,Io),h("div",Jo,[v.value?(m(),x("div",Zo,[F(yi,{collapsed:C.value,"accessible-label":k(s)(C.value?"common.expandSidebar":"common.collapseSidebar"),onClick:k(a)},null,8,["collapsed","accessible-label","onClick"])])):q("",!0),h("button",{type:"button",class:Y(["pointer-events-auto absolute left-12 top-2 flex h-9 w-9 items-center justify-center rounded-full text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",{"cursor-not-allowed opacity-50":e.disabled}]),title:k(s)("ai.chat.conversation.newConversation"),disabled:e.disabled,onClick:Z[4]||(Z[4]=re=>!e.disabled&&l("create"))},[F(ie,{name:"i-lucide-square-pen",class:"h-4 w-4"})],10,Xo)])],2)}}}),el={class:"flex max-h-[80vh] flex-col overflow-hidden"},tl={class:"shrink-0 border-b border-gray-200 px-6 py-4 dark:border-gray-800"},nl={class:"flex items-center justify-between"},rl={class:"flex items-center gap-3"},sl={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-red-100 dark:bg-red-900/40"},al={class:"text-lg font-semibold text-gray-900 dark:text-white"},il={class:"flex-1 overflow-y-auto px-6 py-4"},ol={class:"flex flex-col gap-4"},ll={class:"text-sm font-semibold text-gray-700 dark:text-gray-300"},cl={key:0,class:"rounded-md border border-red-200 bg-red-50/50 p-3 dark:border-red-900/40 dark:bg-red-950/20"},ul={class:"m-0 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-red-600 dark:text-red-400"},dl={key:1,class:"rounded-md border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-page-dark"},pl={class:"m-0 max-h-[300px] overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-gray-700 dark:text-gray-300"},hl={key:2,class:"select-text break-words rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-700 dark:border-gray-700 dark:bg-page-dark dark:text-gray-300"},fl={key:0,class:"py-8 text-center text-sm text-gray-400 dark:text-gray-500"},gl={class:"shrink-0 border-t border-gray-200 px-6 py-3 dark:border-gray-800"},ml={class:"flex justify-end"},yl=be({__name:"ErrorDetailModal",props:ki({error:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const{t}=qe(),n=Br(),s=vi(e,"open"),r=e,i=S(()=>{const l=r.error,c=[];return l.url&&c.push({label:t("ai.chat.error.requestUrl"),value:l.url}),l.statusCode!=null&&c.push({label:t("ai.chat.error.statusCode"),value:String(l.statusCode)}),l.responseBody&&c.push({label:t("ai.chat.error.responseBody"),value:a(l.responseBody),isCode:!0}),l.responseHeaders&&c.push({label:t("ai.chat.error.responseHeaders"),value:JSON.stringify(l.responseHeaders,null,2),isCode:!0}),l.name&&c.push({label:t("ai.chat.error.name"),value:l.name}),l.message&&c.push({label:t("ai.chat.error.message"),value:l.message}),l.stack&&c.push({label:t("ai.chat.error.stack"),value:l.stack,isStack:!0}),l.cause&&c.push({label:t("ai.chat.error.cause"),value:a(l.cause),isCode:!0}),l.provider&&c.push({label:t("ai.chat.error.provider"),value:l.provider}),l.requestBody&&c.push({label:t("ai.chat.error.requestBody"),value:a(l.requestBody),isCode:!0}),c});function a(l){try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}function o(){const l=i.value.map(c=>`${c.label}: ${c.value}`).join(`
4
+ `)}function $o(e){return e.replace(/[/\\?%*:|"<>]/g,"_")}async function Eo(e,t,n,s,r){if(t.length===0)return{success:!1,error:"No messages to export"};let i,a;const o=Je(n).format("YYYYMMDD_HHmmss"),l=$o(e);s==="markdown"?(i=Ao(e,t,n,r),a=`${l}_${o}.md`):(i=Lo(e,t,n,r),a=`${l}_${o}.txt`);const c=`data:text/plain;charset=utf-8,${encodeURIComponent(i)}`,{useCacheService:u}=await mi(async()=>{const{useCacheService:p}=await import("./service-BwbGKwDn.js");return{useCacheService:p}},__vite__mapDeps([0,1,2,3]));return await u().saveToDownloads(a,c)}const bs=be({__name:"EChartPie",props:{data:{},height:{default:280},mode:{default:"expanded"},doughnut:{type:Boolean,default:!0},innerRadius:{default:"50%"},showLegend:{type:Boolean,default:!0}},setup(e){const t=e,n=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6"],s=S(()=>{const r=t.data.labels.map((p,f)=>({name:p,value:t.data.values[f]})),i=t.data.labels.length,a=t.mode==="compact",o=i>(a?8:14),l=i>(a?6:12),c=a?{type:l?"scroll":"plain",orient:"horizontal",left:8,right:8,bottom:0,height:28,textStyle:{fontSize:11,overflow:"truncate",width:72}}:{type:l?"scroll":"plain",orient:"vertical",right:10,top:24,bottom:24,textStyle:{fontSize:12,overflow:"truncate",width:120}},u=!a&&!o,d=t.showLegend&&!u;return{color:n,tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},legend:d?c:void 0,series:[{type:"pie",radius:t.doughnut?[t.innerRadius,a?"58%":"68%"]:a?"58%":"68%",center:d?a?["50%","42%"]:["38%","50%"]:["50%",a?"46%":"50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:4,borderColor:"#fff",borderWidth:2},label:{show:u,formatter:"{b}",overflow:"truncate",width:110,alignTo:"edge",edgeDistance:12},emphasis:{label:{show:u,fontSize:14,fontWeight:"bold",overflow:"truncate",width:140},itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:r}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),ws=be({__name:"EChartHeatmap",props:{data:{},height:{default:280},mode:{default:"expanded"},minColor:{default:"#fee5e8"},maxColor:{default:"#ee4567"}},setup(e){const t=e,n=S(()=>{let r=0;for(const[,,i]of t.data.data)i>r&&(r=i);return r||1}),s=S(()=>{const r=t.mode==="compact",i=t.data.xLabels.length,a=t.data.yLabels.length;return{tooltip:{position:"top",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",formatter:o=>{const l=t.data.xLabels[o.data[0]],c=t.data.yLabels[o.data[1]],u=o.data[2];return`${c} ${l}<br/>消息数: <strong>${u}</strong>`},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},grid:{left:r?52:72,right:20,top:r?12:24,bottom:r?52:70,outerBoundsMode:"same"},xAxis:{type:"category",data:t.data.xLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&i>16?"auto":0,hideOverlap:!0}},yAxis:{type:"category",data:t.data.yLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&a>14?"auto":0,hideOverlap:!0}},visualMap:{min:0,max:n.value,calculable:!0,orient:"horizontal",left:"center",bottom:0,itemWidth:r?8:10,itemHeight:r?84:120,inRange:{color:[t.minColor,t.maxColor]},textStyle:{color:"#6b7280",fontSize:11}},series:[{type:"heatmap",data:t.data.data,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),Io=["inert","aria-hidden"],Ro={class:"flex h-full w-64 flex-col"},Po={class:"flex-1 overflow-y-auto p-2"},Ho={key:0,class:"flex items-center justify-center py-8"},No={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},zo={class:"flex h-12 w-12 items-center justify-center rounded-full bg-gray-50 dark:bg-gray-800"},Oo={class:"mt-3 text-xs text-gray-400"},Bo={key:2,class:"space-y-3"},Do={class:"px-2 pb-1 pt-1.5 text-[10px] font-medium tracking-wide text-gray-400 dark:text-gray-500"},jo={class:"space-y-0.5"},Fo=["onClick"],qo=["placeholder","onBlur","onKeyup"],Uo={key:1,class:"flex items-center"},Ko={class:"line-clamp-1 min-w-0 flex-1 text-sm leading-snug"},Wo={class:"rounded p-0.5 text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300"},Vo={class:"w-28 p-1"},Go=["disabled","onClick"],Yo=["onClick"],Qo=["disabled","onClick"],Jo={class:"pointer-events-none absolute left-0 top-0 z-10 h-[52px] w-[92px]"},Zo={key:0,class:"pointer-events-auto absolute left-2 top-2"},Xo=["title","disabled"],fg=be({__name:"ConversationList",props:{sessionId:{},activeId:{},disabled:{type:Boolean},conversations:{},loading:{type:Boolean},embedded:{type:Boolean},collapsible:{type:Boolean,default:!0}},emits:["select","create","delete","rename"],setup(e,{expose:t,emit:n}){const{t:s}=qe(),r=Xn(),{isAIChatSidebarCollapsed:i}=er(r),{toggleAIChatSidebar:a}=r,o=e,l=n,c=J([]),u=J(!1),d=J(null),p=J(""),f=J(null),y=S(()=>o.conversations!==void 0),_=S(()=>o.conversations??c.value),M=S(()=>y.value?o.loading??!1:u.value),v=S(()=>o.collapsible!==!1),C=S(()=>v.value&&i.value);async function z(){if(!y.value){u.value=!0;try{c.value=await It().getAIChats(o.sessionId)}catch(O){console.error("加载对话列表失败:",O)}finally{u.value=!1}}}const L=S(()=>{if(_.value.length===0)return[];const O=Je(),Z=O.subtract(7,"day").startOf("day"),ie=O.subtract(30,"day").startOf("day"),K=[],B=[],re=new Map;for(const j of _.value){const se=Je(j.updatedAt*1e3);if(se.isAfter(Z))K.push(j);else if(se.isAfter(ie))B.push(j);else{const oe=se.format("YYYY-MM");re.has(oe)||re.set(oe,[]),re.get(oe).push(j)}}const H=[];K.length>0&&H.push({label:s("ai.chat.conversation.group.last7Days"),conversations:K}),B.length>0&&H.push({label:s("ai.chat.conversation.group.last30Days"),conversations:B});const W=[...re.keys()].sort((j,se)=>se.localeCompare(j));for(const j of W){const se=Je(j+"-01");H.push({label:se.format(se.year()===O.year()?"M月":"YYYY年M月"),conversations:re.get(j)})}return H});function E(O){return O.title||s("ai.chat.conversation.newChat")}function G(O){o.disabled||(d.value=O.id,p.value=O.title||"")}async function ue(O){if(!o.disabled){if(p.value.trim()){if(y.value){l("rename",{id:O,title:p.value.trim()}),d.value=null;return}try{await It().updateAIChatTitle(O,p.value.trim());const Z=c.value.find(ie=>ie.id===O);Z&&(Z.title=p.value.trim())}catch(Z){console.error("更新标题失败:",Z)}}d.value=null}}function te(O){f.value=null,G(O)}function V(O){f.value=null,navigator.clipboard.writeText(O)}function I(O){f.value=null,U(O)}async function U(O){if(!o.disabled){if(y.value){l("delete",O);return}try{await It().deleteAIChat(O),c.value=c.value.filter(Z=>Z.id!==O),l("delete",O)}catch(Z){console.error("删除对话失败:",Z)}}}return wt(()=>{z()}),Te(()=>o.sessionId,()=>{z()}),t({refresh:z}),(O,Z)=>{const ie=Ne,K=tr,B=ea;return m(),x("div",{class:Y(["relative shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none",[o.embedded?"h-full":"m-3 h-[calc(100%-1.5rem)]",C.value?"w-[92px]":"w-64"]])},[h("div",{class:Y(["absolute inset-y-0 left-0 overflow-hidden rounded-lg bg-white transition-[width] duration-300 ease-in-out motion-reduce:transition-none dark:bg-sidebar-dark",C.value?"pointer-events-none w-0":"w-64"]),inert:C.value,"aria-hidden":C.value?"true":void 0},[h("div",Ro,[Z[5]||(Z[5]=h("div",{class:"h-[52px] shrink-0 border-b border-gray-200 dark:border-gray-800"},null,-1)),h("div",Po,[M.value?(m(),x("div",Ho,[F(ie,{name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-gray-400"})])):_.value.length===0?(m(),x("div",No,[h("div",zo,[F(ie,{name:"i-heroicons-chat-bubble-left",class:"h-6 w-6 text-gray-300 dark:text-gray-600"})]),h("p",Oo,w(k(s)("ai.chat.conversation.empty")),1),F(K,{class:"mt-2",size:"xs",variant:"link",color:"primary",disabled:e.disabled,onClick:Z[0]||(Z[0]=re=>!e.disabled&&l("create"))},{default:de(()=>[He(w(k(s)("ai.chat.conversation.startNew")),1)]),_:1},8,["disabled"])])):(m(),x("div",Bo,[(m(!0),x(me,null,_e(L.value,re=>(m(),x("div",{key:re.label},[h("div",Do,w(re.label),1),h("div",jo,[(m(!0),x(me,null,_e(re.conversations,H=>(m(),x("div",{key:H.id,class:Y(["group relative rounded-lg px-3 py-2 transition-all",["cursor-pointer",e.activeId===H.id?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50"]]),onClick:W=>l("select",H.id)},[d.value===H.id?Zs((m(),x("input",{key:0,"onUpdate:modelValue":Z[1]||(Z[1]=W=>p.value=W),class:"w-full rounded border-none bg-white px-2 py-1 text-sm shadow-sm outline-none ring-1 ring-gray-200 focus:ring-2 focus:ring-primary-500 dark:bg-page-dark dark:ring-gray-700",placeholder:k(s)("ai.chat.conversation.titlePlaceholder"),autoFocus:"",onBlur:W=>ue(H.id),onKeyup:yn(W=>ue(H.id),["enter"]),onClick:Z[2]||(Z[2]=mt(()=>{},["stop"]))},null,40,qo)),[[Xs,p.value]]):(m(),x("div",Uo,[h("p",Ko,w(E(H)),1),h("div",{class:Y(["ml-1 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",{"opacity-100":e.activeId===H.id||f.value===H.id}]),onClick:Z[3]||(Z[3]=mt(()=>{},["stop"]))},[F(B,{open:f.value===H.id,ui:{content:"z-50 p-0"},"onUpdate:open":W=>f.value=W?H.id:null},{content:de(()=>[h("div",Vo,[h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",disabled:e.disabled,onClick:W=>te(H)},[F(ie,{name:"i-heroicons-pencil",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.rename")),1)],8,Go),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",onClick:W=>V(H.id)},[F(ie,{name:"i-heroicons-clipboard-document",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.copyId")),1)],8,Yo),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-red-500 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/30",disabled:e.disabled,onClick:W=>I(H.id)},[F(ie,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.delete")),1)],8,Qo)])]),default:de(()=>[h("button",Wo,[F(ie,{name:"i-heroicons-ellipsis-horizontal",class:"h-4 w-4"})])]),_:2},1032,["open","onUpdate:open"])],2)]))],10,Fo))),128))])]))),128))]))])])],10,Io),h("div",Jo,[v.value?(m(),x("div",Zo,[F(yi,{collapsed:C.value,"accessible-label":k(s)(C.value?"common.expandSidebar":"common.collapseSidebar"),onClick:k(a)},null,8,["collapsed","accessible-label","onClick"])])):q("",!0),h("button",{type:"button",class:Y(["pointer-events-auto absolute left-12 top-2 flex h-9 w-9 items-center justify-center rounded-full text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",{"cursor-not-allowed opacity-50":e.disabled}]),title:k(s)("ai.chat.conversation.newConversation"),disabled:e.disabled,onClick:Z[4]||(Z[4]=re=>!e.disabled&&l("create"))},[F(ie,{name:"i-lucide-square-pen",class:"h-4 w-4"})],10,Xo)])],2)}}}),el={class:"flex max-h-[80vh] flex-col overflow-hidden"},tl={class:"shrink-0 border-b border-gray-200 px-6 py-4 dark:border-gray-800"},nl={class:"flex items-center justify-between"},rl={class:"flex items-center gap-3"},sl={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-red-100 dark:bg-red-900/40"},al={class:"text-lg font-semibold text-gray-900 dark:text-white"},il={class:"flex-1 overflow-y-auto px-6 py-4"},ol={class:"flex flex-col gap-4"},ll={class:"text-sm font-semibold text-gray-700 dark:text-gray-300"},cl={key:0,class:"rounded-md border border-red-200 bg-red-50/50 p-3 dark:border-red-900/40 dark:bg-red-950/20"},ul={class:"m-0 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-red-600 dark:text-red-400"},dl={key:1,class:"rounded-md border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-page-dark"},pl={class:"m-0 max-h-[300px] overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-gray-700 dark:text-gray-300"},hl={key:2,class:"select-text break-words rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-700 dark:border-gray-700 dark:bg-page-dark dark:text-gray-300"},fl={key:0,class:"py-8 text-center text-sm text-gray-400 dark:text-gray-500"},gl={class:"shrink-0 border-t border-gray-200 px-6 py-3 dark:border-gray-800"},ml={class:"flex justify-end"},yl=be({__name:"ErrorDetailModal",props:ki({error:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const{t}=qe(),n=Br(),s=vi(e,"open"),r=e,i=S(()=>{const l=r.error,c=[];return l.url&&c.push({label:t("ai.chat.error.requestUrl"),value:l.url}),l.statusCode!=null&&c.push({label:t("ai.chat.error.statusCode"),value:String(l.statusCode)}),l.responseBody&&c.push({label:t("ai.chat.error.responseBody"),value:a(l.responseBody),isCode:!0}),l.responseHeaders&&c.push({label:t("ai.chat.error.responseHeaders"),value:JSON.stringify(l.responseHeaders,null,2),isCode:!0}),l.name&&c.push({label:t("ai.chat.error.name"),value:l.name}),l.message&&c.push({label:t("ai.chat.error.message"),value:l.message}),l.stack&&c.push({label:t("ai.chat.error.stack"),value:l.stack,isStack:!0}),l.cause&&c.push({label:t("ai.chat.error.cause"),value:a(l.cause),isCode:!0}),l.provider&&c.push({label:t("ai.chat.error.provider"),value:l.provider}),l.requestBody&&c.push({label:t("ai.chat.error.requestBody"),value:a(l.requestBody),isCode:!0}),c});function a(l){try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}function o(){const l=i.value.map(c=>`${c.label}: ${c.value}`).join(`
5
5
 
6
6
  `);navigator.clipboard.writeText(l).then(()=>{n.success(t("ai.chat.error.copied"))})}return(l,c)=>{const u=Ne,d=tr,p=ta;return m(),ae(p,{open:s.value,"onUpdate:open":c[1]||(c[1]=f=>s.value=f),ui:{content:"sm:max-w-[700px] z-[100]",overlay:"backdrop-blur-sm z-[99]"}},{content:de(()=>[h("div",el,[h("div",tl,[h("div",nl,[h("div",rl,[h("div",sl,[F(u,{name:"i-heroicons-exclamation-triangle",class:"h-4 w-4 text-red-600 dark:text-red-400"})]),h("h2",al,w(k(t)("ai.chat.error.detail")),1)]),F(d,{icon:"i-heroicons-x-mark",variant:"ghost",color:"neutral",size:"sm",onClick:c[0]||(c[0]=f=>s.value=!1)})])]),h("div",il,[h("div",ol,[(m(!0),x(me,null,_e(i.value,(f,y)=>(m(),x("div",{key:y,class:"flex flex-col gap-1.5"},[h("div",ll,w(f.label),1),f.isStack?(m(),x("div",cl,[h("pre",ul,w(f.value),1)])):f.isCode?(m(),x("div",dl,[h("pre",pl,w(f.value),1)])):(m(),x("div",hl,w(f.value),1))]))),128)),i.value.length===0?(m(),x("div",fl,w(k(t)("ai.chat.error.unknown")),1)):q("",!0)])]),h("div",gl,[h("div",ml,[F(d,{icon:"i-heroicons-document-duplicate",variant:"soft",color:"neutral",size:"sm",onClick:o},{default:de(()=>[He(w(k(t)("ai.chat.error.copyAll")),1)]),_:1})])])])]),_:1},8,["open"])}}}),vl={class:"min-w-0 flex-1 truncate"},kl={class:"shrink-0 text-[11px] text-amber-600/80 dark:text-amber-400/80"},xl={class:"mb-1.5 flex items-center gap-2"},bl={class:"flex shrink-0 items-center justify-center text-red-500 dark:text-red-400"},wl={class:"pr-5 text-[13px] font-semibold leading-[1.4] text-red-600 dark:text-red-400"},_l={class:"ml-6 line-clamp-3 break-words text-xs leading-normal text-gray-600 dark:text-gray-400"},Tl={class:"mt-2.5 ml-6 flex items-center"},Cl={class:"ml-auto inline-flex items-center gap-0.5 text-xs text-gray-400 transition-colors duration-150 group-hover:text-red-500 dark:text-gray-500 dark:group-hover:text-red-400"},Sl=be({__name:"ErrorBlock",props:{error:{},compact:{type:Boolean}},setup(e){const{t}=qe(),n=e,s=J(!1);function r(i){return i.friendlyMessage||i.message||t("ai.chat.error.unknown")}return(i,a)=>{const o=Ne;return m(),x(me,null,[n.compact?(m(),x("button",{key:0,type:"button",class:"flex w-full min-w-0 items-start gap-2 rounded-md py-1 text-left text-xs text-amber-700 transition-colors hover:bg-amber-50/70 dark:text-amber-300 dark:hover:bg-amber-950/20",onClick:a[0]||(a[0]=l=>s.value=!0)},[F(o,{name:"i-heroicons-exclamation-circle",class:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500"}),h("span",vl,w(r(e.error)),1),h("span",kl,w(k(t)("ai.chat.error.viewDetail")),1)])):(m(),x("div",{key:1,class:"group relative my-2 w-full min-w-[320px] cursor-pointer rounded-lg border border-red-200 bg-red-50/60 px-3.5 py-3 text-[13px] transition-all duration-200 hover:border-red-300 hover:bg-red-50 dark:border-red-900/30 dark:bg-red-950/20 dark:hover:border-red-800/50 dark:hover:bg-red-950/30",onClick:a[1]||(a[1]=l=>s.value=!0)},[h("div",xl,[h("div",bl,[F(o,{name:"i-heroicons-exclamation-triangle",class:"h-4 w-4"})]),h("div",wl,w(k(t)("ai.chat.error.title")),1)]),h("div",_l,w(r(e.error)),1),h("div",Tl,[h("div",Cl,[He(w(k(t)("ai.chat.error.viewDetail"))+" ",1),F(o,{name:"i-heroicons-chevron-right",class:"h-3.5 w-3.5"})])])])),F(yl,{open:s.value,"onUpdate:open":a[2]||(a[2]=l=>s.value=l),error:e.error},null,8,["open","error"])],64)}}}),Ml={class:"my-2 w-full overflow-hidden rounded-lg border border-gray-200 bg-white/80 dark:border-gray-700/70 dark:bg-page-dark/70"},Al={class:"border-b border-gray-100 px-3 py-2 dark:border-gray-800"},Ll={class:"flex min-w-0 items-start justify-between gap-3"},$l={class:"min-w-0"},El={class:"truncate text-sm font-semibold text-gray-900 dark:text-gray-100"},Il={key:0,class:"mt-0.5 line-clamp-2 text-xs text-gray-500 dark:text-gray-400"},Rl={class:"flex shrink-0 items-center gap-1.5"},Pl={class:"rounded-md bg-gray-100 px-1.5 py-0.5 text-[10px] uppercase text-gray-500 dark:bg-gray-800"},Hl={class:"flex max-h-[92vh] flex-col overflow-hidden bg-white dark:bg-page-dark"},Nl={class:"flex items-start justify-between gap-4 border-b border-gray-200 px-5 py-4 dark:border-gray-800"},zl={class:"min-w-0"},Ol={class:"truncate text-base font-semibold text-gray-900 dark:text-gray-100"},Bl={key:0,class:"mt-1 line-clamp-2 text-xs text-gray-500 dark:text-gray-400"},Dl={class:"mt-1 text-[11px] text-gray-400 dark:text-gray-500"},jl={class:"min-h-0 flex-1 overflow-auto p-4"},Fl={key:0,class:"flex h-64 items-center justify-center text-xs text-gray-400 dark:text-gray-500"},ql={class:"mt-1 text-[11px] text-gray-400 dark:text-gray-500"},Ul={class:"px-2 py-3"},Kl={key:0,class:"flex h-32 items-center justify-center text-xs text-gray-400 dark:text-gray-500"},Wl=be({__name:"ChartBlockRenderer",props:{chart:{}},setup(e){const{t}=qe(),n=e,s=J(!1),r=S(()=>n.chart.spec.title),i=S(()=>n.chart.spec.subtitle||n.chart.spec.description||""),a=S(()=>n.chart.spec.display?.height??(n.chart.spec.type==="heatmap"?300:260)),o=S(()=>n.chart.rowCount===0),l=S(()=>{const v=[];return n.chart.spec.unit&&v.push(n.chart.spec.unit),n.chart.truncated&&v.push(t("ai.chat.message.chart.truncated")),v.push(t("ai.chat.message.chart.rows",{count:n.chart.rowCount})),v.join(" · ")}),c=S(()=>n.chart.data),u=S(()=>n.chart.data),d=S(()=>n.chart.data),p=S(()=>n.chart.data),f=S(()=>n.chart.spec.type==="pie"?d.value.labels.length>8:n.chart.spec.type==="line"?u.value.labels.length>28||(u.value.series?.length??0)>4:n.chart.spec.type==="bar"?c.value.labels.length>12:n.chart.spec.type==="heatmap"?p.value.xLabels.length*p.value.yLabels.length>180:!1),y=S(()=>{const v=f.value?320:380;return Math.min(a.value,v)}),_=S(()=>{const v=a.value;if(n.chart.spec.type==="pie")return Math.max(v,560);if(n.chart.spec.type==="line")return Math.max(v,u.value.labels.length>40?620:540);if(n.chart.spec.type==="bar"){const C=n.chart.spec.display?.horizontal?c.value.labels.length*28+120:520;return Math.min(Math.max(v,C),820)}return n.chart.spec.type==="heatmap"?Math.min(Math.max(v,p.value.yLabels.length*22+150,560),860):Math.max(v,520)}),M=S(()=>n.chart.spec.type==="pie"?"640px":n.chart.spec.type==="bar"?"720px":"780px");return(v,C)=>{const z=tr,L=ta;return m(),x("div",Ml,[h("div",Al,[h("div",Ll,[h("div",$l,[h("h3",El,w(r.value),1),i.value?(m(),x("p",Il,w(i.value),1)):q("",!0)]),h("div",Rl,[h("span",Pl,w(e.chart.spec.type),1),F(L,{open:s.value,"onUpdate:open":C[2]||(C[2]=E=>s.value=E),ui:{overlay:"z-[10040] backdrop-blur-sm",content:"z-[10050] w-[96vw] max-w-6xl max-h-[92vh] overflow-hidden"}},{content:de(()=>[h("div",Hl,[h("div",Nl,[h("div",zl,[h("h3",Ol,w(r.value),1),i.value?(m(),x("p",Bl,w(i.value),1)):q("",!0),h("p",Dl,w(l.value),1)]),F(z,{icon:"i-heroicons-x-mark",size:"sm",color:"neutral",variant:"ghost",class:"shrink-0",title:k(t)("common.close"),"aria-label":k(t)("common.close"),onClick:C[1]||(C[1]=E=>s.value=!1)},null,8,["title","aria-label"])]),h("div",jl,[h("div",{class:"mx-auto w-full",style:xi({minWidth:M.value})},[o.value?(m(),x("div",Fl,w(k(t)("ai.chat.message.chart.empty")),1)):e.chart.spec.type==="bar"?(m(),ae(hs,{key:1,data:c.value,height:_.value,mode:"expanded",horizontal:e.chart.spec.display?.horizontal},null,8,["data","height","horizontal"])):e.chart.spec.type==="line"?(m(),ae(fs,{key:2,data:u.value,height:_.value,mode:"expanded"},null,8,["data","height"])):e.chart.spec.type==="pie"?(m(),ae(bs,{key:3,data:d.value,height:_.value,mode:"expanded","show-legend":e.chart.spec.display?.showLegend??!0},null,8,["data","height","show-legend"])):e.chart.spec.type==="heatmap"?(m(),ae(ws,{key:4,data:p.value,height:_.value,mode:"expanded"},null,8,["data","height"])):q("",!0)],4)])])]),default:de(()=>[F(z,{icon:"i-heroicons-arrows-pointing-out",size:"xs",color:"neutral",variant:"ghost",class:"no-capture",title:k(t)("ai.chat.message.chart.expand"),"aria-label":k(t)("ai.chat.message.chart.expand"),onClick:C[0]||(C[0]=mt(()=>{},["stop"]))},null,8,["title","aria-label"])]),_:1},8,["open"])])]),h("p",ql,w(l.value),1)]),h("div",Ul,[o.value?(m(),x("div",Kl,w(k(t)("ai.chat.message.chart.empty")),1)):e.chart.spec.type==="bar"?(m(),ae(hs,{key:1,data:c.value,height:y.value,mode:"compact",horizontal:e.chart.spec.display?.horizontal},null,8,["data","height","horizontal"])):e.chart.spec.type==="line"?(m(),ae(fs,{key:2,data:u.value,height:y.value,mode:"compact"},null,8,["data","height"])):e.chart.spec.type==="pie"?(m(),ae(bs,{key:3,data:d.value,height:y.value,mode:"compact","show-legend":e.chart.spec.display?.showLegend??!0},null,8,["data","height","show-legend"])):e.chart.spec.type==="heatmap"?(m(),ae(ws,{key:4,data:p.value,height:y.value,mode:"compact"},null,8,["data","height"])):q("",!0)])])}}}),Vl=["data-open","aria-hidden","inert"],Gl={class:"ai-process-fold-inner"},Kt=be({__name:"ProcessDisclosure",props:{lazy:{type:Boolean,default:!1}},setup(e){const t=e,n=J(!1),s=J(!1);function r(){n.value||(s.value=!0),n.value=!n.value}return(i,a)=>(m(),x("div",null,[Rt(i.$slots,"summary",{open:n.value,toggle:r}),h("div",{class:"ai-process-fold","data-open":n.value||void 0,"aria-hidden":!n.value,inert:n.value?void 0:!0},[h("div",Gl,[!t.lazy||s.value?Rt(i.$slots,"default",{key:0}):q("",!0)])],8,Vl)]))}}),Yl={class:"relative flex h-4 w-4 shrink-0 items-center justify-center","aria-hidden":"true"},Wt=be({__name:"ProcessDisclosureIcon",props:{icon:{},open:{type:Boolean},iconClass:{default:"text-gray-400 dark:text-gray-500"}},setup(e){return(t,n)=>{const s=Ne;return m(),x("span",Yl,[e.open?q("",!0):(m(),ae(s,{key:0,name:e.icon,class:Y(["absolute h-3.5 w-3.5 transition-opacity duration-100 group-hover/process-toggle:opacity-0",e.iconClass])},null,8,["name","class"])),F(s,{name:"i-heroicons-chevron-down",class:Y(["absolute h-3.5 w-3.5 text-gray-500 transition-opacity duration-100 dark:text-gray-400",e.open?"opacity-100":"opacity-0 group-hover/process-toggle:opacity-100"])},null,8,["class"])])}}}),Ql=["aria-expanded","onClick"],Jl={class:"shrink-0 text-gray-600 dark:text-gray-300"},Zl={class:"ml-auto flex min-w-0 items-center gap-2"},Xl={key:0,class:"truncate text-[11px] text-gray-400 dark:text-gray-500"},ec={class:"evidence-details mx-px mt-1 rounded-lg border border-gray-200/60 bg-gray-50/80 px-3 py-2 dark:border-white/5 dark:bg-white/[0.03]"},tc={class:"mb-2 space-y-0.5 text-xs text-gray-600 dark:text-gray-400"},nc={class:"font-medium"},rc={key:0},sc={class:"font-medium"},ac={key:0,class:"mb-2 space-y-1"},ic={key:1,class:"py-1.5 text-center text-xs text-gray-400 dark:text-gray-500"},oc={key:2,class:"space-y-2"},lc={class:"flex items-center gap-2"},cc={class:"ml-auto shrink-0 text-[11px] text-gray-400 dark:text-gray-500"},uc={key:0,class:"mt-1 text-[11px] text-gray-500 dark:text-gray-400"},dc={class:"mt-1 space-y-0.5"},pc=["onClick"],hc={class:"min-w-0 flex-1 text-xs leading-snug text-gray-600 dark:text-gray-300"},fc={key:0,class:"mr-1 text-gray-400 dark:text-gray-500"},gc={class:"line-clamp-2 break-words align-middle"},mc={key:3,class:"mt-1.5 text-right text-[11px] text-gray-400 dark:text-gray-500"},yc=be({__name:"EvidenceBlock",props:{evidence:{}},setup(e){const t=e,{t:n}=qe(),s=Xn(),r=["included","uncertain","excluded"],i=S(()=>[...t.evidence.groups].sort((p,f)=>r.indexOf(p.status)-r.indexOf(f.status))),a=S(()=>t.evidence.groups.reduce((p,f)=>p+f.sources.length,0)),o=S(()=>r.map(p=>({status:p,count:t.evidence.groups.filter(f=>f.status===p).length})).filter(p=>p.count>0)),l=S(()=>t.evidence.warnings??[]),c={included:"bg-emerald-50 text-emerald-600 dark:bg-emerald-900/20 dark:text-emerald-400",uncertain:"bg-amber-50 text-amber-600 dark:bg-amber-900/20 dark:text-amber-400",excluded:"bg-gray-100 text-gray-500 dark:bg-gray-800/40 dark:text-gray-400"},u={included:"bg-emerald-500",uncertain:"bg-amber-500",excluded:"bg-gray-400"};function d(p){s.openChatRecordDrawer({scrollToMessageId:p})}return(p,f)=>{const y=Ne;return m(),ae(Kt,{lazy:"",class:"w-full text-[13px]"},{summary:de(({open:_,toggle:M})=>[h("button",{type:"button",class:"group/process-toggle flex h-7 w-full items-center gap-2 rounded-md text-left text-sm leading-7 text-gray-500 transition-colors hover:bg-gray-50/80 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/30 dark:hover:text-gray-300","aria-expanded":_,onClick:M},[F(Wt,{icon:"i-heroicons-document-magnifying-glass",open:_},null,8,["open"]),h("span",Jl,w(k(n)("ai.chat.evidence.title")),1),h("div",Zl,[(m(!0),x(me,null,_e(o.value,v=>(m(),x("span",{key:v.status,class:"flex shrink-0 items-center gap-1 text-[11px] text-gray-500 dark:text-gray-400"},[h("span",{class:Y(["h-1.5 w-1.5 rounded-full",u[v.status]])},null,2),He(" "+w(k(n)(`ai.chat.evidence.group.${v.status}`))+" "+w(v.count),1)]))),128)),o.value.length===0?(m(),x("span",Xl,w(k(n)("ai.chat.evidence.empty")),1)):q("",!0)])],8,Ql)]),default:de(()=>[h("div",ec,[h("div",tc,[h("div",null,[h("span",nc,w(k(n)("ai.chat.evidence.query"))+":",1),He(" "+w(e.evidence.query),1)]),e.evidence.criteria?(m(),x("div",rc,[h("span",sc,w(k(n)("ai.chat.evidence.criteria"))+":",1),He(" "+w(e.evidence.criteria),1)])):q("",!0)]),l.value.length>0?(m(),x("div",ac,[(m(!0),x(me,null,_e(l.value,_=>(m(),x("div",{key:_,class:"flex items-start gap-1.5 rounded bg-amber-50/70 px-2 py-1 text-[11px] text-amber-600 dark:bg-amber-900/15 dark:text-amber-400"},[F(y,{name:"i-heroicons-exclamation-triangle",class:"mt-0.5 h-3 w-3 shrink-0"}),h("span",null,w(k(n)(`ai.chat.evidence.warning.${_}`)),1)]))),128))])):q("",!0),i.value.length===0?(m(),x("div",ic,w(k(n)("ai.chat.evidence.empty")),1)):(m(),x("div",oc,[(m(!0),x(me,null,_e(i.value,_=>(m(),x("div",{key:_.id,class:"rounded-md border border-gray-200/80 bg-white px-2.5 py-1.5 dark:border-gray-700/50 dark:bg-page-dark/30"},[h("div",lc,[h("span",{class:Y(["rounded px-1.5 py-0.5 text-[11px] font-medium",c[_.status]])},w(k(n)(`ai.chat.evidence.group.${_.status}`)),3),h("span",cc,w(_.title),1)]),_.reason?(m(),x("div",uc,w(_.reason),1)):q("",!0),h("ul",dc,[(m(!0),x(me,null,_e(_.sources,(M,v)=>(m(),x("li",{key:`${_.id}-${v}`,class:"group/source flex cursor-pointer items-start gap-1.5 rounded px-1.5 py-1 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/40",onClick:C=>d(M.messageId)},[h("div",hc,[M.senderName?(m(),x("span",fc,w(M.senderName)+": ",1)):q("",!0),h("span",gc,w(M.snippet),1)]),F(y,{name:"i-heroicons-arrow-top-right-on-square",class:"mt-0.5 h-3 w-3 shrink-0 text-gray-400 opacity-0 transition-opacity group-hover/source:opacity-100 dark:text-gray-500"})],8,pc))),128))])]))),128))])),i.value.length>0?(m(),x("div",mc,w(k(n)("ai.chat.evidence.totalSources",{count:a.value})),1)):q("",!0)])]),_:1})}}}),vc=nr(yc,[["__scopeId","data-v-812e30c9"]]),kc=["aria-expanded","onClick"],xc={class:"shrink-0 text-gray-600 dark:text-gray-300"},bc={class:"ml-auto shrink-0 text-[11px] text-gray-400 dark:text-gray-500"},wc={class:"cross-chat-evidence-details mx-px mt-1 rounded-lg border border-gray-200/60 bg-gray-50/80 px-3 py-2 dark:border-white/5 dark:bg-white/[0.03]"},_c={class:"mb-2 flex items-start gap-2 text-xs text-gray-500 dark:text-gray-400"},Tc={class:"min-w-0 flex-1"},Cc={class:"text-gray-600 dark:text-gray-300"},Sc={key:0,class:"shrink-0 rounded bg-amber-50 px-1.5 py-0.5 text-[11px] text-amber-600 dark:bg-amber-900/20 dark:text-amber-400"},Mc={key:0,class:"py-2 text-center text-xs text-gray-400 dark:text-gray-500"},Ac={key:1,class:"space-y-2"},Lc={class:"mb-1 flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-300"},$c={class:"min-w-0 flex-1 truncate"},Ec={class:"shrink-0 text-[11px] text-gray-400"},Ic=["onClick"],Rc={class:"min-w-0 flex-1 text-xs leading-snug text-gray-600 dark:text-gray-300"},Pc={class:"mr-1 text-gray-400 dark:text-gray-500"},Hc={class:"line-clamp-2 break-words"},Nc={class:"mt-2 text-right text-[11px] text-gray-400 dark:text-gray-500"},zc=be({__name:"CrossChatEvidenceBlock",props:{evidence:{}},setup(e){const t=e,{t:n}=qe(),s=Xn(),r=S(()=>{const a=new Map;for(const o of t.evidence.sources){const l=a.get(o.sessionId);l?l.sources.push(o):a.set(o.sessionId,{sessionName:o.sessionName,sessionType:o.sessionType,sources:[o]})}return[...a.entries()].map(([o,l])=>({sessionId:o,...l}))});function i(a){s.openChatRecordDrawer({sessionId:a.sessionId,scrollToMessageId:a.messageId})}return(a,o)=>{const l=Ne;return m(),ae(Kt,{lazy:"",class:"w-full text-[13px]"},{summary:de(({open:c,toggle:u})=>[h("button",{type:"button",class:"group/process-toggle flex h-7 w-full items-center gap-2 rounded-md text-left text-sm leading-7 text-gray-500 transition-colors hover:bg-gray-50/80 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/30 dark:hover:text-gray-300","aria-expanded":c,onClick:u},[F(Wt,{icon:"i-heroicons-document-magnifying-glass",open:c},null,8,["open"]),h("span",xc,w(k(n)("ai.chat.crossChatEvidence.title")),1),h("span",bc,w(k(n)("ai.chat.crossChatEvidence.summary",{sources:e.evidence.sources.length,sessions:r.value.length})),1)],8,kc)]),default:de(()=>[h("div",wc,[h("div",_c,[h("span",Tc,[h("span",Cc,w(k(n)("ai.chat.crossChatEvidence.query"))+":",1),He(" "+w(e.evidence.query),1)]),e.evidence.coverage.truncated?(m(),x("span",Sc,w(k(n)("ai.chat.crossChatEvidence.partial")),1)):q("",!0)]),r.value.length===0?(m(),x("div",Mc,w(k(n)("ai.chat.crossChatEvidence.empty")),1)):(m(),x("div",Ac,[(m(!0),x(me,null,_e(r.value,c=>(m(),x("section",{key:c.sessionId,class:"rounded-md border border-gray-200/80 bg-white px-2.5 py-2 dark:border-gray-700/50 dark:bg-page-dark/30"},[h("div",Lc,[F(l,{name:c.sessionType==="group"?"i-heroicons-user-group":"i-heroicons-user",class:"h-3.5 w-3.5 shrink-0 text-gray-400"},null,8,["name"]),h("span",$c,w(c.sessionName),1),h("span",Ec,w(k(n)("ai.chat.crossChatEvidence.sourceCount",{count:c.sources.length})),1)]),(m(!0),x(me,null,_e(c.sources,u=>(m(),x("button",{key:`${u.sessionId}:${u.messageId}`,type:"button",class:"group/source flex w-full items-start gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/40",onClick:d=>i(u)},[h("div",Rc,[h("span",Pc,w(u.senderName)+":",1),h("span",Hc,w(u.snippet),1)]),F(l,{name:"i-heroicons-arrow-top-right-on-square",class:"mt-0.5 h-3 w-3 shrink-0 text-gray-400 opacity-0 transition-opacity group-hover/source:opacity-100"})],8,Ic))),128))]))),128))])),h("p",Nc,w(k(n)("ai.chat.crossChatEvidence.coverage",{scanned:e.evidence.coverage.scannedSessions,candidates:e.evidence.coverage.candidateSessions})),1)])]),_:1})}}}),Oc=nr(zc,[["__scopeId","data-v-8bc36d76"]]),Bc=/^\s*!\[[^\]\n]*\]\(\s*(?:(?:https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?)?\/?|\.\/)?chart[\w-]*(?:\.(?:png|jpg|jpeg|webp|svg))?(?:\?[^)\s]*)?\s*(?:"[^"]*")?\s*\)\s*$/gim;function Dc(e){return e&&e.replace(Bc,"").replace(/\n{3,}/g,`
7
7
 
@@ -1 +1 @@
1
- import{Z as a,a5 as n}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.37.1"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
1
+ import{Z as a,a5 as n}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.37.3"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
@@ -1 +1 @@
1
- import{S as i,V as r,W as s,T as l}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
1
+ import{S as i,V as r,W as s,T as l}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
@@ -1 +1 @@
1
- import{S as a,V as t,W as n,T as e}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getAll(){return a("/ai/assistants")}async getConfig(s){try{return await a(`/ai/assistants/${s}`)}catch{return null}}async create(s){return t("/ai/assistants",s)}async update(s,r){return n(`/ai/assistants/${s}`,r)}async delete(s){return e(`/ai/assistants/${s}`)}async reset(s){return t(`/ai/assistants/${s}/reset`,{})}async getUpgradeInfo(s){return a(`/ai/assistants/${s}/upgrade-status`)}async upgradeWithBackup(s,r){return t(`/ai/assistants/${s}/upgrade`,{backupName:r})}async importFromMd(s){return t("/ai/assistants/import",{rawMd:s})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{o as FetchAssistantAdapter};
1
+ import{S as a,V as t,W as n,T as e}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getAll(){return a("/ai/assistants")}async getConfig(s){try{return await a(`/ai/assistants/${s}`)}catch{return null}}async create(s){return t("/ai/assistants",s)}async update(s,r){return n(`/ai/assistants/${s}`,r)}async delete(s){return e(`/ai/assistants/${s}`)}async reset(s){return t(`/ai/assistants/${s}/reset`,{})}async getUpgradeInfo(s){return a(`/ai/assistants/${s}/upgrade-status`)}async upgradeWithBackup(s,r){return t(`/ai/assistants/${s}/upgrade`,{backupName:r})}async importFromMd(s){return t("/ai/assistants/import",{rawMd:s})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{o as FetchAssistantAdapter};
@@ -1 +1 @@
1
- import{S as s,W as l,V as o,T as i}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
1
+ import{S as s,W as l,V as o,T as i}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
@@ -1,4 +1,4 @@
1
- import{Z as r,$ as m}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return m("data")}const c=`(SELECT mc.message_id FROM message_context mc
1
+ import{Z as r,$ as m}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return m("data")}const c=`(SELECT mc.message_id FROM message_context mc
2
2
  JOIN message first_msg ON first_msg.id = mc.message_id
3
3
  WHERE mc.segment_id = segment.id ORDER BY first_msg.ts ASC, first_msg.id ASC LIMIT 1) as firstMessageId`;class l{async generate(s,t=1800){const e=await r(`/_web/sessions/${s}/generate-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!e.ok)throw new Error(`Failed to generate session index: ${e.status}`);return(await e.json()).sessionCount}async generateIncremental(s,t=1800){const e=await r(`/_web/sessions/${s}/generate-incremental-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!e.ok)throw new Error(`Failed to generate incremental session index: ${e.status}`);return(await e.json()).sessionCount}async hasIndex(s){return(await this.getStats(s)).hasIndex}async getStats(s){try{const e=(await u().pluginQuery(s,"SELECT COUNT(*) as cnt FROM segment",[]))[0]?.cnt??0;return{hasIndex:e>0,sessionCount:e,gapThreshold:1800}}catch{return{hasIndex:!1,sessionCount:0,gapThreshold:1800}}}async getAllIndexStats(){const s=await r("/_web/sessions/index-stats");return s.ok?await s.json():[]}async clear(s){return await r(`/_web/sessions/${s}/clear-index`,{method:"POST"}),!0}async updateGapThreshold(s,t){return!0}async getSessions(s){return u().pluginQuery(s,`SELECT id, start_ts as startTs, end_ts as endTs, message_count as messageCount, summary,
4
4
  summary_message_count as summaryMessageCount, ${c}
@@ -1 +1 @@
1
- import{S as t,V as e}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async openDataDirCleanup(a){return e("/cache/data-dir/cleanup/open",{cleanupId:a})}async dismissDataDirCleanupNotice(a){return e("/cache/data-dir/cleanup/dismiss",{cleanupId:a})}async deleteDataDirCleanup(a){return e("/cache/data-dir/cleanup/delete",{cleanupId:a})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{o as FetchCacheAdapter};
1
+ import{S as t,V as e}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async openDataDirCleanup(a){return e("/cache/data-dir/cleanup/open",{cleanupId:a})}async dismissDataDirCleanupNotice(a){return e("/cache/data-dir/cleanup/dismiss",{cleanupId:a})}async deleteDataDirCleanup(a){return e("/cache/data-dir/cleanup/delete",{cleanupId:a})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{o as FetchCacheAdapter};
@@ -1,4 +1,4 @@
1
- import{Z as d,ax as l,S as I}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";function g(i){return{success:i.success,sessionId:i.sessionId,platform:i.platform,error:i.error,importMode:i.importMode,matchedBy:i.matchedBy,createReason:i.createReason,newMessageCount:i.newMessageCount,duplicateCount:i.duplicateCount,messageCount:i.messageCount,memberCount:i.memberCount,diagnostics:i.diagnostics}}async function S(i,e,t){const o=i.body?.getReader();if(!o)return e;const s=new TextDecoder;let r="",a=e;for(;;){const{done:n,value:y}=await o.read();if(n)break;r+=s.decode(y,{stream:!0});const w=r.split(`
1
+ import{Z as d,ax as l,S as I}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function g(i){return{success:i.success,sessionId:i.sessionId,platform:i.platform,error:i.error,importMode:i.importMode,matchedBy:i.matchedBy,createReason:i.createReason,newMessageCount:i.newMessageCount,duplicateCount:i.duplicateCount,messageCount:i.messageCount,memberCount:i.memberCount,diagnostics:i.diagnostics}}async function S(i,e,t){const o=i.body?.getReader();if(!o)return e;const s=new TextDecoder;let r="",a=e;for(;;){const{done:n,value:y}=await o.read();if(n)break;r+=s.decode(y,{stream:!0});const w=r.split(`
2
2
  `);r=w.pop()||"";let p="";for(const u of w)if(u.startsWith("event: "))p=u.slice(7).trim();else if(u.startsWith("data: ")){const f=JSON.parse(u.slice(6));p==="progress"?t?.(f):(p==="done"||p==="error")&&(a=f),p=""}}return a}class B{constructor(){this.activeBatch=null}async requestBatchCancellation(e){try{await d(`${l()}/import/batch/${encodeURIComponent(e)}/cancel`,{method:"POST"})}catch{}}async importFile(e,t,o){if(typeof e=="string")return{success:!1,error:"File path import is not supported in Web mode"};const s=new FormData;s.append("file",e),t?.formatId&&s.append("formatId",t.formatId),t?.chatIndex!==void 0&&s.append("chatIndex",String(t.chatIndex)),t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r=await d(`${l()}/import`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}async importBatch(e,t,o){if(e.some(n=>typeof n.file=="string"))return e.map(n=>({id:n.id,status:"failed",error:"File path import is not supported in Web mode"}));const s=new FormData;for(const n of e)s.append("files",n.file);t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r={id:crypto.randomUUID(),cancelRequested:!1};this.activeBatch=r;const a=Array(e.length);try{const n=await d(`${l()}/import/batch`,{method:"POST",body:s,headers:{"X-ChatLab-Import-Batch-Id":r.id}});if(r.cancelRequested&&await this.requestBatchCancellation(r.id),!n.ok||!n.body){const m=await n.text();return e.map(T=>({id:T.id,status:"failed",error:`HTTP ${n.status}: ${m}`}))}const y=n.body.getReader(),w=new TextDecoder;let p="",u=null,f=null,c="";for(;;){const{done:m,value:T}=await y.read();if(m)break;p+=w.decode(T,{stream:!0});const v=p.split(`
3
3
  `);p=v.pop()||"";for(const b of v){if(b.startsWith("event: ")){c=b.slice(7).trim();continue}if(!b.startsWith("data: "))continue;const h=JSON.parse(b.slice(6));if(c==="batch-start")o?.({index:h.index,event:"start"});else if(c==="batch-progress")o?.({index:h.index,event:"progress",progress:h.progress});else if(c==="batch-complete"){const $=x(e,h.index,h.result);a[h.index]=$,o?.({index:h.index,event:"complete",result:$})}else c==="done"?u=h.map(($,C)=>x(e,C,$)):c==="error"&&(f=typeof h?.error=="string"?h.error:"Batch import failed");c=""}}return u??e.map((m,T)=>a[T]??{id:m.id,status:"failed",error:f??"Batch response ended without results"})}catch(n){return e.map((y,w)=>a[w]??{id:y.id,status:"failed",error:n instanceof Error?n.message:String(n)})}finally{this.activeBatch===r&&(this.activeBatch=null)}}cancelActiveImport(){this.activeBatch&&(this.activeBatch.cancelRequested=!0,this.requestBatchCancellation(this.activeBatch.id))}async detectFormat(e){if(typeof e=="string")return null;const t=new FormData;t.append("file",e);const o=await d(`${l()}/detect-format`,{method:"POST",body:t});return o.ok?(await o.json()).format:null}async scanMultiChatFile(e){if(typeof e=="string")return[];const t=new FormData;t.append("file",e);const o=await d(`${l()}/scan-multi-chat`,{method:"POST",body:t});return o.ok?(await o.json()).chats:[]}async prepareImportSource(e){if(typeof e=="string")return{success:!1,error:"File path import is not supported in Web mode"};const t=new FormData;t.append("file",e);const o=await d(`${l()}/import-sources`,{method:"POST",body:t}),s=await o.json().catch(()=>null);return o.ok?s??{success:!1,error:"Invalid import source response"}:{success:!1,error:s?.error||`HTTP ${o.status}`}}async importPreparedChat(e,t,o,s){const r=await d(`${l()}/import-sources/${encodeURIComponent(e)}/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatId:t,sessionGapThreshold:s?.sessionGapThreshold})});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}async releaseImportSource(e){await d(`${l()}/import-sources/${encodeURIComponent(e)}`,{method:"DELETE"})}getSupportedFormats(){return I("/supported-formats")}async importDemo(e,t,o){return new Promise(s=>{d(`${l()}/demo/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,sessionGapThreshold:o?.sessionGapThreshold})}).then(async r=>{if(!r.ok||!r.body){s({success:!1,error:`HTTP ${r.status}`});return}const a=r.body.getReader(),n=new TextDecoder;let y="";for(;;){const{done:w,value:p}=await a.read();if(w)break;y+=n.decode(p,{stream:!0});const u=y.split(`
4
4
  `);y=u.pop()||"";let f="";for(const c of u)if(c.startsWith("event: "))f=c.slice(7).trim();else if(c.startsWith("data: ")){const m=JSON.parse(c.slice(6));if(f==="progress")(m.stage==="downloading"||m.stage==="importing")&&t?.({stage:m.stage});else if(f==="result"){s(m);return}f=""}}s({success:!1,error:"Stream ended without result"})}).catch(r=>s({success:!1,error:String(r)}))})}async analyzeIncrementalImport(e,t){if(typeof t=="string")return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:"File path not supported in Web mode"};const o=new FormData;o.append("file",t);const s=await d(`${l()}/sessions/${e}/import/incremental/analyze`,{method:"POST",body:o});if(!s.ok){const r=await s.text();return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:`HTTP ${s.status}: ${r}`}}return await s.json()}async incrementalImport(e,t,o){if(typeof t=="string")return{success:!1,newMessageCount:0,error:"File path not supported in Web mode"};const s=new FormData;s.append("file",t);const r=await d(`${l()}/sessions/${e}/import/incremental`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,newMessageCount:0,error:`HTTP ${r.status}: ${a}`}}return S(r,{success:!1,newMessageCount:0,error:"Unknown error"},o)}async importDirectory(e,t,o){if(typeof e=="string")return{success:!1,error:"Directory path import is not supported in Web mode"};if(e.length===0)return{success:!1,error:"No files in directory"};const s=new FormData;for(const a of e)s.append("files",a),s.append("relativePaths",a.webkitRelativePath||a.name);t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r=await d(`${l()}/import-directory`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}}function x(i,e,t){const o=i[e]?.id??String(e);return t?.status==="cancelled"?{id:o,status:"cancelled"}:t?.status==="success"?{id:o,status:"success",result:g(t.result)}:{id:o,status:"failed",error:t?.error??t?.result?.error??"error.import_failed",result:t?.result?g(t.result):void 0}}export{B as FetchImportAdapter};
@@ -1 +1 @@
1
- import{Z as c}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class p{preflight(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/preflight`,{method:"POST",body:JSON.stringify(n)})}start(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs`,{method:"POST",body:JSON.stringify(n)})}generateDay(e,n,o,t){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}/generate`,{method:"POST",body:JSON.stringify({timezone:o,locale:t})})}getLatestRun(e){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/latest`)}getRun(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}`)}pause(e,n){return this.runAction(e,n,"pause")}resume(e,n){return this.runAction(e,n,"resume")}cancel(e,n){return this.runAction(e,n,"cancel")}getDay(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}?timezone=${encodeURIComponent(o)}`)}async deleteDay(e,n){return(await s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}`,{method:"DELETE"})).success}runAction(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}/${o}`,{method:"POST"})}}async function s(r,e={}){const n=new Headers(e.headers);e.body!==void 0&&n.set("Content-Type","application/json");const o=await c(r,{...e,headers:n});if(!o.ok){const t=await o.json().catch(()=>null);throw new Error(t?.error||t?.message||`HTTP ${o.status}`)}return o.json()}export{p as FetchChatTopicsAdapter};
1
+ import{Z as c}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class p{preflight(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/preflight`,{method:"POST",body:JSON.stringify(n)})}start(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs`,{method:"POST",body:JSON.stringify(n)})}generateDay(e,n,o,t){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}/generate`,{method:"POST",body:JSON.stringify({timezone:o,locale:t})})}getLatestRun(e){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/latest`)}getRun(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}`)}pause(e,n){return this.runAction(e,n,"pause")}resume(e,n){return this.runAction(e,n,"resume")}cancel(e,n){return this.runAction(e,n,"cancel")}getDay(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}?timezone=${encodeURIComponent(o)}`)}async deleteDay(e,n){return(await s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}`,{method:"DELETE"})).success}runAction(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}/${o}`,{method:"POST"})}}async function s(r,e={}){const n=new Headers(e.headers);e.body!==void 0&&n.set("Content-Type","application/json");const o=await c(r,{...e,headers:n});if(!o.ok){const t=await o.json().catch(()=>null);throw new Error(t?.error||t?.message||`HTTP ${o.status}`)}return o.json()}export{p as FetchChatTopicsAdapter};
@@ -1 +1 @@
1
- import{S as r,V as a,W as u,T as m,Z as y}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";const g="This feature is not available in web mode";class A{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async getGlobalAIChats(){return r("/ai/global-chats")}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async createGlobalAIChat(e,t){return a("/ai/global-chats",{title:e,assistantId:t})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return m(`/ai/chats/${e}`)}async getAIMemories(e){if(!e)return r("/ai/memories");const t=new URLSearchParams({scopeType:e.scopeType});return e.scopeId&&t.set("scopeId",e.scopeId),r(`/ai/memories?${t.toString()}`)}async createAIMemory(e){return a("/ai/memories",e)}async updateAIMemory(e,t){return u(`/ai/memories/${e}`,{content:t})}async deleteAIMemory(e){return m(`/ai/memories/${e}`)}async clearAIMemories(e){return a("/ai/memories/clear",e)}async linkAIMemorySources(e){return a("/ai/memories/link-sources",e)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessagePair(e,t,s){return a(`/ai/chats/${e}/message-pair`,{userMessage:t,assistantMessage:s})}async replaceLatestMessageRound(e,t){return a(`/ai/chats/${e}/replace-latest-message-round`,t)}async addMessage(e,t,s,c,n,o,i,l){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i,entityRefs:l})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t,s){await u(`/ai/messages/${e}/content`,{content:t,entityRefs:s})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o,entityRefs:i})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await y(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{A as FetchAIAdapter};
1
+ import{S as r,V as a,W as u,T as m,Z as y}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";const g="This feature is not available in web mode";class A{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async getGlobalAIChats(){return r("/ai/global-chats")}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async createGlobalAIChat(e,t){return a("/ai/global-chats",{title:e,assistantId:t})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return m(`/ai/chats/${e}`)}async getAIMemories(e){if(!e)return r("/ai/memories");const t=new URLSearchParams({scopeType:e.scopeType});return e.scopeId&&t.set("scopeId",e.scopeId),r(`/ai/memories?${t.toString()}`)}async createAIMemory(e){return a("/ai/memories",e)}async updateAIMemory(e,t){return u(`/ai/memories/${e}`,{content:t})}async deleteAIMemory(e){return m(`/ai/memories/${e}`)}async clearAIMemories(e){return a("/ai/memories/clear",e)}async linkAIMemorySources(e){return a("/ai/memories/link-sources",e)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessagePair(e,t,s){return a(`/ai/chats/${e}/message-pair`,{userMessage:t,assistantMessage:s})}async replaceLatestMessageRound(e,t){return a(`/ai/chats/${e}/replace-latest-message-round`,t)}async addMessage(e,t,s,c,n,o,i,l){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i,entityRefs:l})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t,s){await u(`/ai/messages/${e}/content`,{content:t,entityRefs:s})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o,entityRefs:i})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await y(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{A as FetchAIAdapter};
@@ -1 +1 @@
1
- import{S as t,W as o,T as r}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class u{load(){return t("/navigation-layout")}save(a){return o("/navigation-layout",a)}reset(){return r("/navigation-layout")}}export{u as FetchNavigationLayoutAdapter};
1
+ import{S as t,W as o,T as r}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class u{load(){return t("/navigation-layout")}save(a){return o("/navigation-layout",a)}reset(){return r("/navigation-layout")}}export{u as FetchNavigationLayoutAdapter};
@@ -1,4 +1,4 @@
1
- import{$ as O}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";const N=`
1
+ import{$ as R}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";const S=`
2
2
  msg.id,
3
3
  m.id as senderId,
4
4
  COALESCE(m.group_nickname, m.account_name, m.platform_id) as senderName,
@@ -10,22 +10,20 @@ import{$ as O}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";con
10
10
  msg.type,
11
11
  msg.reply_to_message_id as replyToMessageId,
12
12
  reply_msg.content as replyToContent,
13
- COALESCE(reply_m.group_nickname, reply_m.account_name, reply_m.platform_id) as replyToSenderName`,R=`
13
+ COALESCE(reply_m.group_nickname, reply_m.account_name, reply_m.platform_id) as replyToSenderName`,C=`
14
14
  FROM message msg
15
15
  JOIN member m ON msg.sender_id = m.id
16
16
  LEFT JOIN message reply_msg ON msg.reply_to_message_id = reply_msg.platform_message_id
17
- LEFT JOIN member reply_m ON reply_msg.sender_id = reply_m.id`,i=`SELECT ${N} ${R}`,y="FROM message msg JOIN member m ON msg.sender_id = m.id",S="COALESCE(m.account_name, '') != '系统消息'",I="msg.type = 0 AND msg.content IS NOT NULL AND msg.content != ''";function u(s){let e=[];try{const t=JSON.parse(s.aliasesJson||"[]");Array.isArray(t)&&(e=t)}catch{}return{id:Number(s.id),senderId:Number(s.senderId),senderName:String(s.senderName||""),senderPlatformId:String(s.senderPlatformId||""),senderAliases:e,senderAvatar:s.senderAvatar||null,content:s.content!=null?String(s.content):"",timestamp:Number(s.timestamp),type:Number(s.type),replyToMessageId:s.replyToMessageId||null,replyToContent:s.replyToContent||null,replyToSenderName:s.replyToSenderName||null}}function f(s){return s.replace(/[\\%_]/g,e=>`\\${e}`)}function _(s,e="msg.content"){const t=[],n=[];for(const a of s)t.push(`(${e} IS NULL OR lower(${e}) NOT LIKE ? ESCAPE '\\')`),n.push(`%${f(a.toLowerCase())}%`);return{conditions:t,params:n}}function C(s){const e=[],t=[];if(s?.startTs!=null&&(e.push("msg.ts >= ?"),t.push(s.startTs)),s?.endTs!=null&&(e.push("msg.ts <= ?"),t.push(s.endTs)),s?.senderId!=null)e.push("msg.sender_id = ?"),t.push(s.senderId);else if(s?.senderIds){const n=[...new Set(s.senderIds)];n.length===0?e.push("1 = 0"):(e.push(`msg.sender_id IN (${n.map(()=>"?").join(", ")})`),t.push(...n))}if(s?.memberId!=null&&(e.push("msg.sender_id = ?"),t.push(s.memberId)),s?.keywords&&s.keywords.length>0){const n=s.matchMode==="all"?" AND ":" OR ",a=s.keywords.map(()=>"msg.content LIKE ? ESCAPE '\\'");e.push(`(${a.join(n)})`),t.push(...s.keywords.map(r=>`%${f(r)}%`))}if(s?.excludeKeywords&&s.excludeKeywords.length>0){const n=_(s.excludeKeywords);e.push(...n.conditions),t.push(...n.params)}return s?.systemFilter&&e.push(S),s?.textOnlyFilter&&e.push(I),{clause:e.length>0?"AND "+e.join(" AND "):"",params:t}}function h(s,e,t){return C({startTs:s?.startTs,endTs:s?.endTs,senderId:e,memberId:s?.memberId,keywords:t})}async function T(s,e,t=50,n,a,r){const{clause:o,params:c}=h(n,a,r),l=`${i}
17
+ LEFT JOIN member reply_m ON reply_msg.sender_id = reply_m.id`,i=`SELECT ${S} ${C}`,f="FROM message msg JOIN member m ON msg.sender_id = m.id",O="COALESCE(m.account_name, '') != '系统消息'",T="msg.type = 0 AND msg.content IS NOT NULL AND msg.content != ''";function u(s){let e=[];try{const t=JSON.parse(s.aliasesJson||"[]");Array.isArray(t)&&(e=t)}catch{}return{id:Number(s.id),senderId:Number(s.senderId),senderName:String(s.senderName||""),senderPlatformId:String(s.senderPlatformId||""),senderAliases:e,senderAvatar:s.senderAvatar||null,content:s.content!=null?String(s.content):"",timestamp:Number(s.timestamp),type:Number(s.type),replyToMessageId:s.replyToMessageId||null,replyToContent:s.replyToContent||null,replyToSenderName:s.replyToSenderName||null}}function h(s){return s.replace(/[\\%_]/g,e=>`\\${e}`)}function _(s,e="msg.content"){const t=[],n=[];for(const a of s)t.push(`(${e} IS NULL OR lower(${e}) NOT LIKE ? ESCAPE '\\')`),n.push(`%${h(a.toLowerCase())}%`);return{conditions:t,params:n}}function I(s){const e=[],t=[];if(s?.startTs!=null&&(e.push("msg.ts >= ?"),t.push(s.startTs)),s?.endTs!=null&&(e.push("msg.ts <= ?"),t.push(s.endTs)),s?.senderId!=null)e.push("msg.sender_id = ?"),t.push(s.senderId);else if(s?.senderIds){const n=[...new Set(s.senderIds)];n.length===0?e.push("1 = 0"):(e.push(`msg.sender_id IN (${n.map(()=>"?").join(", ")})`),t.push(...n))}if(s?.memberId!=null&&(e.push("msg.sender_id = ?"),t.push(s.memberId)),s?.keywords&&s.keywords.length>0){const n=s.matchMode==="all"?" AND ":" OR ",a=s.keywords.map(()=>"msg.content LIKE ? ESCAPE '\\'");e.push(`(${a.join(n)})`),t.push(...s.keywords.map(r=>`%${h(r)}%`))}if(s?.excludeKeywords&&s.excludeKeywords.length>0){const n=_(s.excludeKeywords);e.push(...n.conditions),t.push(...n.params)}return s?.systemFilter&&e.push(O),s?.textOnlyFilter&&e.push(T),{clause:e.length>0?"AND "+e.join(" AND "):"",params:t}}function y(s,e,t){return I({startTs:s?.startTs,endTs:s?.endTs,senderId:e,memberId:s?.memberId,keywords:t})}async function N(s,e,t=50,n,a,r){const{clause:m,params:c}=y(n,a,r),l=`${i}
18
18
  JOIN message anchor ON anchor.id = ?
19
19
  WHERE (msg.ts < anchor.ts OR (msg.ts = anchor.ts AND msg.id < anchor.id))
20
- ${o}
21
- ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`,m=await s.all(l,[e,...c,t+1]),d=m.length>t;return{messages:(d?m.slice(0,t):m).map(u).reverse(),hasMore:d}}async function A(s,e,t=50,n,a,r){const{clause:o,params:c}=h(n,a,r),l=`${i}
20
+ ${m}
21
+ ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`,o=await s.all(l,[e,...c,t+1]),d=o.length>t;return{messages:(d?o.slice(0,t):o).map(u).reverse(),hasMore:d}}async function L(s,e,t=50,n,a,r){const{clause:m,params:c}=y(n,a,r),l=`${i}
22
22
  JOIN message anchor ON anchor.id = ?
23
23
  WHERE (msg.ts > anchor.ts OR (msg.ts = anchor.ts AND msg.id > anchor.id))
24
- ${o}
25
- ORDER BY msg.ts ASC, msg.id ASC LIMIT ?`,m=await s.all(l,[e,...c,t+1]),d=m.length>t;return{messages:(d?m.slice(0,t):m).map(u),hasMore:d}}async function L(s,e,t,n=20,a=0,r){const{clause:o,params:c}=h(t,r,e),l=`SELECT COUNT(*) as total ${y} WHERE 1=1 ${o}`,d=(await s.get(l,c))?.total??0,E=`${i} WHERE 1=1 ${o} ORDER BY msg.ts DESC LIMIT ? OFFSET ?`;return{messages:(await s.all(E,[...c,n,a])).map(u),total:d}}async function M(s,e,t=20){const n=Array.isArray(e)?e:[e];if(n.length===0)return[];const a=new Set;for(const m of n)a.add(m),t>0&&((await s.all(`SELECT msg.id FROM message msg
26
- JOIN message anchor ON anchor.id = ?
27
- WHERE msg.ts < anchor.ts OR (msg.ts = anchor.ts AND msg.id < anchor.id)
28
- ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`,[m,t])).forEach(p=>a.add(p.id)),(await s.all(`SELECT msg.id FROM message msg
29
- JOIN message anchor ON anchor.id = ?
30
- WHERE msg.ts > anchor.ts OR (msg.ts = anchor.ts AND msg.id > anchor.id)
31
- ORDER BY msg.ts ASC, msg.id ASC LIMIT ?`,[m,t])).forEach(p=>a.add(p.id)));const r=Array.from(a).sort((m,d)=>m-d);if(r.length===0)return[];const o=r.map(()=>"?").join(", "),c=`${i} WHERE msg.id IN (${o}) ORDER BY msg.ts ASC, msg.id ASC`;return(await s.all(c,r)).map(u)}async function w(s,e,t=100){const{clause:n,params:a}=h(e),r=`SELECT COUNT(*) as total ${y} WHERE 1=1 ${n}`,c=(await s.get(r,a))?.total??0,l=`${i} WHERE 1=1 ${n} ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`;return{messages:(await s.all(l,[...a,t])).map(u).reverse(),total:c}}function D(){return O("data")}function g(s){const e=D();return{all(t,n=[]){return e.pluginQuery(s,t,n)},async get(t,n=[]){return(await e.pluginQuery(s,t,n))[0]}}}class b{async getMessagesBefore(e,t,n=50,a,r,o){const c=g(e);return T(c,t,n,a,r,o)}async getMessagesAfter(e,t,n=50,a,r,o){const c=g(e);return A(c,t,n,a,r,o)}async getMessageContext(e,t,n=20){const a=g(e);return M(a,t,n)}async searchMessages(e,t,n,a=100,r=0,o){const c=g(e);return L(c,t,n,a,r,o)}async getAllRecentMessages(e,t,n=100){const a=g(e);return w(a,t,n)}}export{b as FetchMessageAdapter};
24
+ ${m}
25
+ ORDER BY msg.ts ASC, msg.id ASC LIMIT ?`,o=await s.all(l,[e,...c,t+1]),d=o.length>t;return{messages:(d?o.slice(0,t):o).map(u),hasMore:d}}async function M(s,e,t,n=20,a=0,r){const{clause:m,params:c}=y(t,r,e),l=`SELECT COUNT(*) as total ${f} WHERE 1=1 ${m}`,d=(await s.get(l,c))?.total??0,E=`${i} WHERE 1=1 ${m} ORDER BY msg.ts DESC LIMIT ? OFFSET ?`;return{messages:(await s.all(E,[...c,n,a])).map(u),total:d}}async function A(s,e,t=20){const n=Array.isArray(e)?e:[e];if(n.length===0)return[];const a=new Set;for(const o of n)a.add(o),t>0&&((await s.all(`SELECT msg.id FROM message msg
26
+ WHERE (msg.ts, msg.id) < (SELECT ts, id FROM message WHERE id = ?)
27
+ ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`,[o,t])).forEach(p=>a.add(p.id)),(await s.all(`SELECT msg.id FROM message msg
28
+ WHERE (msg.ts, msg.id) > (SELECT ts, id FROM message WHERE id = ?)
29
+ ORDER BY msg.ts ASC, msg.id ASC LIMIT ?`,[o,t])).forEach(p=>a.add(p.id)));const r=Array.from(a).sort((o,d)=>o-d);if(r.length===0)return[];const m=r.map(()=>"?").join(", "),c=`${i} WHERE msg.id IN (${m}) ORDER BY msg.ts ASC, msg.id ASC`;return(await s.all(c,r)).map(u)}async function w(s,e,t=100){const{clause:n,params:a}=y(e),r=`SELECT COUNT(*) as total ${f} WHERE 1=1 ${n}`,c=(await s.get(r,a))?.total??0,l=`${i} WHERE 1=1 ${n} ORDER BY msg.ts DESC, msg.id DESC LIMIT ?`;return{messages:(await s.all(l,[...a,t])).map(u).reverse(),total:c}}function $(){return R("data")}function g(s){const e=$();return{all(t,n=[]){return e.pluginQuery(s,t,n)},async get(t,n=[]){return(await e.pluginQuery(s,t,n))[0]}}}class b{async getMessagesBefore(e,t,n=50,a,r,m){const c=g(e);return N(c,t,n,a,r,m)}async getMessagesAfter(e,t,n=50,a,r,m){const c=g(e);return L(c,t,n,a,r,m)}async getMessageContext(e,t,n=20){const a=g(e);return A(a,t,n)}async searchMessages(e,t,n,a=100,r=0,m){const c=g(e);return M(c,t,n,a,r,m)}async getAllRecentMessages(e,t,n=100){const a=g(e);return w(a,t,n)}}export{b as FetchMessageAdapter};
@@ -1 +1 @@
1
- import{S as c,T as o,U as l,V as m,W as $,X as a,Y as y}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";function S(i,e){e&&(e.startTs&&i.set("startTs",String(e.startTs)),e.endTs&&i.set("endTs",String(e.endTs)),e.memberId&&i.set("memberId",String(e.memberId)))}function n(i){const e=new URLSearchParams;S(e,i);const s=e.toString();return s?`?${s}`:""}function u(i){const e=new URLSearchParams;i?.mode&&e.set("mode",i.mode),i?.year&&e.set("year",String(i.year)),i?.days&&e.set("days",String(i.days)),i?.acceptStale&&e.set("acceptStale","1");const s=e.toString();return s?`?${s}`:""}class h{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await l(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await l(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async excludeOwnerSession(e){return(await m(`/sessions/${e}/owner/exclude`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await $(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset),s?.graphScope&&t.set("scope",s.graphScope);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAnnualSummary(e){return c(`/global-insight/annual-summary${u(e)}`)}recomputeAnnualSummary(e){return m(`/global-insight/annual-summary/recompute${u(e)}`,{})}getTimeInvestment(e){return c(`/global-insight/time-investment${u(e)}`)}recomputeTimeInvestment(e){return m(`/global-insight/time-investment/recompute${u(e)}`,{})}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const g=r.toString();return a(`/sessions/${e}/analytics/long-message-count${g?`?${g}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getWordFrequency(e,s){return y("/nlp/word-frequency",{sessionId:e,...s})}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await l(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}async deleteMembers(e,s){return(await m(`/sessions/${e}/members/batch-delete`,{memberIds:s})).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const g=new URLSearchParams;return g.set("locale",s),t?.startTs&&g.set("startTs",String(t.startTs)),t?.endTs&&g.set("endTs",String(t.endTs)),t?.memberId&&g.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${g}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getGroupRelationshipGalaxy(e,s){return a(`/sessions/${e}/analytics/relationship-galaxy${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const g=r.toString();return a(`/sessions/${e}/analytics/cluster${g?`?${g}`:""}`)}getLaughAnalysis(e,s,t){return y(`/sessions/${e}/analytics/laugh${n(s)}`,{keywords:t??[]})}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}getJourneyStats(e,s){return a(`/sessions/${e}/analytics/journey${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{h as FetchDataAdapter};
1
+ import{S as c,T as o,U as l,V as m,W as $,X as a,Y as y}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function S(i,e){e&&(e.startTs&&i.set("startTs",String(e.startTs)),e.endTs&&i.set("endTs",String(e.endTs)),e.memberId&&i.set("memberId",String(e.memberId)))}function n(i){const e=new URLSearchParams;S(e,i);const s=e.toString();return s?`?${s}`:""}function u(i){const e=new URLSearchParams;i?.mode&&e.set("mode",i.mode),i?.year&&e.set("year",String(i.year)),i?.days&&e.set("days",String(i.days)),i?.acceptStale&&e.set("acceptStale","1");const s=e.toString();return s?`?${s}`:""}class h{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await l(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await l(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async excludeOwnerSession(e){return(await m(`/sessions/${e}/owner/exclude`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await $(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset),s?.graphScope&&t.set("scope",s.graphScope);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAnnualSummary(e){return c(`/global-insight/annual-summary${u(e)}`)}recomputeAnnualSummary(e){return m(`/global-insight/annual-summary/recompute${u(e)}`,{})}getTimeInvestment(e){return c(`/global-insight/time-investment${u(e)}`)}recomputeTimeInvestment(e){return m(`/global-insight/time-investment/recompute${u(e)}`,{})}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const g=r.toString();return a(`/sessions/${e}/analytics/long-message-count${g?`?${g}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getWordFrequency(e,s){return y("/nlp/word-frequency",{sessionId:e,...s})}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await l(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}async deleteMembers(e,s){return(await m(`/sessions/${e}/members/batch-delete`,{memberIds:s})).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const g=new URLSearchParams;return g.set("locale",s),t?.startTs&&g.set("startTs",String(t.startTs)),t?.endTs&&g.set("endTs",String(t.endTs)),t?.memberId&&g.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${g}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getGroupRelationshipGalaxy(e,s){return a(`/sessions/${e}/analytics/relationship-galaxy${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const g=r.toString();return a(`/sessions/${e}/analytics/cluster${g?`?${g}`:""}`)}getLaughAnalysis(e,s,t){return y(`/sessions/${e}/analytics/laugh${n(s)}`,{keywords:t??[]})}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}getJourneyStats(e,s){return a(`/sessions/${e}/analytics/journey${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{h as FetchDataAdapter};
@@ -1 +1 @@
1
- import{S as r,U as n}from"./index-B1oj9KDv.js";import"./vendor-snapdom--nZvo8Sg.js";class a{getPresentationPreferences(){return r("/preferences/bootstrap")}getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{a as FetchPreferencesAdapter};
1
+ import{S as r,U as n}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class a{getPresentationPreferences(){return r("/preferences/bootstrap")}getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{a as FetchPreferencesAdapter};
@@ -1 +1 @@
1
- import{J as t,K as o,L as r}from"./index-B1oj9KDv.js";import{A as s}from"./service-tEx-5LUL.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{get:e=>r().getAnnualSummary(e),recompute:e=>r().recomputeAnnualSummary(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(a,i)=>{i&&!a&&e()})}}}function g(e){e.register(s,u())}export{u as createAnnualSummaryUiService,g as registerAnnualSummaryUiService};
1
+ import{J as t,K as o,L as r}from"./index-bQ9oj54q.js";import{A as s}from"./service-DQjyjQZx.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{get:e=>r().getAnnualSummary(e),recompute:e=>r().recomputeAnnualSummary(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(a,i)=>{i&&!a&&e()})}}}function g(e){e.register(s,u())}export{u as createAnnualSummaryUiService,g as registerAnnualSummaryUiService};
@@ -1 +1 @@
1
- import{J as t,K as o,L as r,Q as m}from"./index-B1oj9KDv.js";import{T as a}from"./service-BYOUkk7V.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{canConfigureOwner:!m.usesBrowserRuntime,get:e=>r().getTimeInvestment(e),recompute:e=>r().recomputeTimeInvestment(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(s,i)=>{i&&!s&&e()})}}}function g(e){e.register(a,u())}export{u as createTimeInvestmentUiService,g as registerTimeInvestmentUiService};
1
+ import{J as t,K as o,L as r,Q as m}from"./index-bQ9oj54q.js";import{T as a}from"./service-Dtve_40X.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{canConfigureOwner:!m.usesBrowserRuntime,get:e=>r().getTimeInvestment(e),recompute:e=>r().recomputeTimeInvestment(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(s,i)=>{i&&!s&&e()})}}}function g(e){e.register(a,u())}export{u as createTimeInvestmentUiService,g as registerTimeInvestmentUiService};
@@ -1 +1 @@
1
- import{ar as W,as as D,E as z,b6 as F,b as g,aW as N,b7 as U,K as E,o as d,f as K,w as x,a as c,n as u,g as t,c as m,z as y,r as h,a9 as b,p as l,l as _,P as L,e as w,aw as S,av as O,H as P,b8 as R,b9 as A,d as M,a6 as H,ay as T,aD as G,az as J,aR as Q,aq as X,a8 as Y}from"./index-B1oj9KDv.js";import{_ as Z}from"./Checkbox-_eH64bb0.js";import{L as ee}from"./Label-DCIcxkhU.js";import{_ as te}from"./ThemeCard.vue_vue_type_script_setup_true_lang-D2outEOV.js";import"./vendor-snapdom--nZvo8Sg.js";import"./useFormControl-CrWi_6Hn.js";import"./VisuallyHiddenInput-BAFpkxMI.js";import"./RovingFocusItem-BJMUQ5DJ.js";const ae={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md"}},re=["id"],oe=["id"],se=["id"],le=["id"],ne={__name:"FormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:"vertical"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(V){const s=V,n=W(),e=D("formField",s),k=O(),r=w(()=>S({extend:S(ae),...k.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),v=z(F,null),o=w(()=>e.error||v?.value?.find(a=>a.name===e.name||e.errorPattern&&a.name?.match(e.errorPattern))?.message),i=g(N()),f=i.value,q=z(U,void 0);return E(i,()=>{q&&e.name&&(q.value[e.name]={id:i.value,pattern:e.errorPattern})},{immediate:!0}),P(R,i),P(A,w(()=>({error:o.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:f}))),(a,p)=>(d(),K(t(L),{as:t(e).as,"data-orientation":t(e).orientation,"data-slot":"root",class:u(r.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:x(()=>[c("div",{"data-slot":"wrapper",class:u(r.value.wrapper({class:t(e).ui?.wrapper}))},[t(e).label||n.label?(d(),m("div",{key:0,"data-slot":"labelWrapper",class:u(r.value.labelWrapper({class:t(e).ui?.labelWrapper}))},[y(t(ee),{for:i.value,"data-slot":"label",class:u(r.value.label({class:t(e).ui?.label}))},{default:x(()=>[h(a.$slots,"label",{label:t(e).label},()=>[b(l(t(e).label),1)])]),_:3},8,["for","class"]),t(e).hint||n.hint?(d(),m("span",{key:0,id:`${t(f)}-hint`,"data-slot":"hint",class:u(r.value.hint({class:t(e).ui?.hint}))},[h(a.$slots,"hint",{hint:t(e).hint},()=>[b(l(t(e).hint),1)])],10,re)):_("",!0)],2)):_("",!0),t(e).description||n.description?(d(),m("p",{key:1,id:`${t(f)}-description`,"data-slot":"description",class:u(r.value.description({class:t(e).ui?.description}))},[h(a.$slots,"description",{description:t(e).description},()=>[b(l(t(e).description),1)])],10,oe)):_("",!0)],2),c("div",{class:u([(t(e).label||!!n.label||t(e).description||!!n.description)&&r.value.container({class:t(e).ui?.container})])},[h(a.$slots,"default",{error:o.value}),t(e).error!==!1&&(typeof o.value=="string"&&o.value||n.error)?(d(),m("div",{key:0,id:`${t(f)}-error`,"data-slot":"error",class:u(r.value.error({class:t(e).ui?.error}))},[h(a.$slots,"error",{error:o.value},()=>[b(l(o.value),1)])],10,se)):t(e).help||n.help?(d(),m("div",{key:1,id:`${t(f)}-help`,"data-slot":"help",class:u(r.value.help({class:t(e).ui?.help}))},[h(a.$slots,"help",{help:t(e).help},()=>[b(l(t(e).help),1)])],10,le)):_("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}},ie={class:"flex min-h-screen items-center justify-center bg-gray-50 dark:bg-page-dark"},ue={class:"text-center"},ce={class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},de={key:0,class:"text-sm text-red-500"},pe={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400"},me={class:"text-center text-xs text-gray-400 dark:text-gray-500"},fe={key:0,class:"text-center text-xs text-amber-500 dark:text-amber-400"},qe=M({__name:"index",setup(V){const{t:s}=H(),n=T(),e=G(),k=J(),r=g(""),v=g(k.rememberDevice),o=g(""),i=g(!1);function f(a){return!a||!a.startsWith("/")||a.startsWith("/login")?"/":a}async function q(){const a=r.value.trim();if(!a){o.value=s("common.login.errorEmpty");return}i.value=!0,o.value="";try{if(!(await fetch("/api/v1/status",{headers:{Authorization:`Bearer ${a}`}})).ok){o.value=s("common.login.errorInvalid");return}k.login(a,v.value);const $=f(e.query.redirect);n.replace($)}catch{o.value=s("common.login.errorNetwork")}finally{i.value=!1}}return(a,p)=>{const $=X,j=ne,B=Z,C=Y;return d(),m("div",ie,[y(t(te),{class:"w-full max-w-sm space-y-6 p-8"},{default:x(()=>[c("div",ue,[p[2]||(p[2]=c("h1",{class:"text-2xl font-bold text-gray-900 dark:text-white"},"ChatLab",-1)),c("p",ce,l(t(s)("common.login.description")),1)]),c("form",{class:"space-y-4",onSubmit:Q(q,["prevent"])},[y(j,{label:t(s)("common.login.tokenLabel")},{default:x(()=>[y($,{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=I=>r.value=I),type:"password",placeholder:t(s)("common.login.tokenPlaceholder"),autocomplete:"off",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o.value?(d(),m("p",de,l(o.value),1)):_("",!0),c("label",pe,[y(B,{modelValue:v.value,"onUpdate:modelValue":p[1]||(p[1]=I=>v.value=I)},null,8,["modelValue"]),c("span",null,l(t(s)("common.login.rememberDevice")),1)]),y(C,{type:"submit",block:"",loading:i.value,color:"primary"},{default:x(()=>[b(l(t(s)("common.login.submit")),1)]),_:1},8,["loading"])],32),c("p",me,l(t(s)("common.login.hint")),1),v.value?(d(),m("p",fe,l(t(s)("common.login.rememberWarning")),1)):_("",!0)]),_:1})])}}});export{qe as default};
1
+ import{ar as W,as as D,E as z,b6 as F,b as g,aW as N,b7 as U,K as E,o as d,f as K,w as x,a as c,n as u,g as t,c as m,z as y,r as h,a9 as b,p as l,l as _,P as L,e as w,aw as S,av as O,H as P,b8 as R,b9 as A,d as M,a6 as H,ay as T,aD as G,az as J,aR as Q,aq as X,a8 as Y}from"./index-bQ9oj54q.js";import{_ as Z}from"./Checkbox-CrlY3jiJ.js";import{L as ee}from"./Label-CaVKlQnJ.js";import{_ as te}from"./ThemeCard.vue_vue_type_script_setup_true_lang-BLmTpx4f.js";import"./vendor-snapdom--nZvo8Sg.js";import"./useFormControl-CNmp_2bd.js";import"./VisuallyHiddenInput-J2KEIQBX.js";import"./RovingFocusItem-FpYwYEP_.js";const ae={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md"}},re=["id"],oe=["id"],se=["id"],le=["id"],ne={__name:"FormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:"vertical"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(V){const s=V,n=W(),e=D("formField",s),k=O(),r=w(()=>S({extend:S(ae),...k.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),v=z(F,null),o=w(()=>e.error||v?.value?.find(a=>a.name===e.name||e.errorPattern&&a.name?.match(e.errorPattern))?.message),i=g(N()),f=i.value,q=z(U,void 0);return E(i,()=>{q&&e.name&&(q.value[e.name]={id:i.value,pattern:e.errorPattern})},{immediate:!0}),P(R,i),P(A,w(()=>({error:o.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:f}))),(a,p)=>(d(),K(t(L),{as:t(e).as,"data-orientation":t(e).orientation,"data-slot":"root",class:u(r.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:x(()=>[c("div",{"data-slot":"wrapper",class:u(r.value.wrapper({class:t(e).ui?.wrapper}))},[t(e).label||n.label?(d(),m("div",{key:0,"data-slot":"labelWrapper",class:u(r.value.labelWrapper({class:t(e).ui?.labelWrapper}))},[y(t(ee),{for:i.value,"data-slot":"label",class:u(r.value.label({class:t(e).ui?.label}))},{default:x(()=>[h(a.$slots,"label",{label:t(e).label},()=>[b(l(t(e).label),1)])]),_:3},8,["for","class"]),t(e).hint||n.hint?(d(),m("span",{key:0,id:`${t(f)}-hint`,"data-slot":"hint",class:u(r.value.hint({class:t(e).ui?.hint}))},[h(a.$slots,"hint",{hint:t(e).hint},()=>[b(l(t(e).hint),1)])],10,re)):_("",!0)],2)):_("",!0),t(e).description||n.description?(d(),m("p",{key:1,id:`${t(f)}-description`,"data-slot":"description",class:u(r.value.description({class:t(e).ui?.description}))},[h(a.$slots,"description",{description:t(e).description},()=>[b(l(t(e).description),1)])],10,oe)):_("",!0)],2),c("div",{class:u([(t(e).label||!!n.label||t(e).description||!!n.description)&&r.value.container({class:t(e).ui?.container})])},[h(a.$slots,"default",{error:o.value}),t(e).error!==!1&&(typeof o.value=="string"&&o.value||n.error)?(d(),m("div",{key:0,id:`${t(f)}-error`,"data-slot":"error",class:u(r.value.error({class:t(e).ui?.error}))},[h(a.$slots,"error",{error:o.value},()=>[b(l(o.value),1)])],10,se)):t(e).help||n.help?(d(),m("div",{key:1,id:`${t(f)}-help`,"data-slot":"help",class:u(r.value.help({class:t(e).ui?.help}))},[h(a.$slots,"help",{help:t(e).help},()=>[b(l(t(e).help),1)])],10,le)):_("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}},ie={class:"flex min-h-screen items-center justify-center bg-gray-50 dark:bg-page-dark"},ue={class:"text-center"},ce={class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},de={key:0,class:"text-sm text-red-500"},pe={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400"},me={class:"text-center text-xs text-gray-400 dark:text-gray-500"},fe={key:0,class:"text-center text-xs text-amber-500 dark:text-amber-400"},qe=M({__name:"index",setup(V){const{t:s}=H(),n=T(),e=G(),k=J(),r=g(""),v=g(k.rememberDevice),o=g(""),i=g(!1);function f(a){return!a||!a.startsWith("/")||a.startsWith("/login")?"/":a}async function q(){const a=r.value.trim();if(!a){o.value=s("common.login.errorEmpty");return}i.value=!0,o.value="";try{if(!(await fetch("/api/v1/status",{headers:{Authorization:`Bearer ${a}`}})).ok){o.value=s("common.login.errorInvalid");return}k.login(a,v.value);const $=f(e.query.redirect);n.replace($)}catch{o.value=s("common.login.errorNetwork")}finally{i.value=!1}}return(a,p)=>{const $=X,j=ne,B=Z,C=Y;return d(),m("div",ie,[y(t(te),{class:"w-full max-w-sm space-y-6 p-8"},{default:x(()=>[c("div",ue,[p[2]||(p[2]=c("h1",{class:"text-2xl font-bold text-gray-900 dark:text-white"},"ChatLab",-1)),c("p",ce,l(t(s)("common.login.description")),1)]),c("form",{class:"space-y-4",onSubmit:Q(q,["prevent"])},[y(j,{label:t(s)("common.login.tokenLabel")},{default:x(()=>[y($,{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=I=>r.value=I),type:"password",placeholder:t(s)("common.login.tokenPlaceholder"),autocomplete:"off",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o.value?(d(),m("p",de,l(o.value),1)):_("",!0),c("label",pe,[y(B,{modelValue:v.value,"onUpdate:modelValue":p[1]||(p[1]=I=>v.value=I)},null,8,["modelValue"]),c("span",null,l(t(s)("common.login.rememberDevice")),1)]),y(C,{type:"submit",block:"",loading:i.value,color:"primary"},{default:x(()=>[b(l(t(s)("common.login.submit")),1)]),_:1},8,["loading"])],32),c("p",me,l(t(s)("common.login.hint")),1),v.value?(d(),m("p",fe,l(t(s)("common.login.rememberWarning")),1)):_("",!0)]),_:1})])}}});export{qe as default};