hermes-web-ui 0.4.2 → 0.4.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 (97) hide show
  1. package/bin/hermes-web-ui.mjs +76 -9
  2. package/dist/client/assets/Add-DiTv65Se.js +1 -0
  3. package/dist/client/assets/{Button-pgPN7RfC.js → Button-vKfgky-Y.js} +3 -3
  4. package/dist/client/assets/{ChannelsView-qFMvJ9rS.js → ChannelsView-CHWtzAkF.js} +1 -1
  5. package/dist/client/assets/ChatView--lvFbW3I.js +127 -0
  6. package/dist/client/assets/ChatView-b0_L3ucp.css +1 -0
  7. package/dist/client/assets/{Close-CXC76d7R.js → Close-Brba3ay5.js} +2 -2
  8. package/dist/client/assets/{FormItem-DIcSMjKz.js → FormItem-kXuCeSKq.js} +3 -3
  9. package/dist/client/assets/GatewaysView-DUPP1UyD.js +1 -0
  10. package/dist/client/assets/Input-BS71ZaoJ.js +234 -0
  11. package/dist/client/assets/{InputNumber-Btyn8bQo.js → InputNumber-BXy4reTI.js} +2 -2
  12. package/dist/client/assets/JobsView-CXa1h0NF.js +2 -0
  13. package/dist/client/assets/LoginView-Cpod3SAL.js +1 -0
  14. package/dist/client/assets/LoginView-DfWYTzX1.css +1 -0
  15. package/dist/client/assets/LogsView-CgxeVMn-.js +1 -0
  16. package/dist/client/assets/{MarkdownRenderer-G4nly1xR.js → MarkdownRenderer-B7t0ZEw0.js} +9 -9
  17. package/dist/client/assets/MemoryView-BQjYVDJc.js +7 -0
  18. package/dist/client/assets/{Modal-rKb1tfQv.js → Modal-6Bv1v4kO.js} +4 -4
  19. package/dist/client/assets/ModelsView-CVghPzgk.js +1 -0
  20. package/dist/client/assets/Popconfirm-Bpz_dC1j.js +16 -0
  21. package/dist/client/assets/Popover-CXrjClQw.js +117 -0
  22. package/dist/client/assets/ProfilesView-Brpyzl-Q.js +440 -0
  23. package/dist/client/assets/{Select-CpNY3UGb.js → Select-Z20Mp4nQ.js} +5 -5
  24. package/dist/client/assets/SettingRow-Cz749k-e.js +1 -0
  25. package/dist/client/assets/SettingsView-C3HbKb4w.js +352 -0
  26. package/dist/client/assets/{SettingsView-CX312EGG.css → SettingsView-Cw4iOwXj.css} +1 -1
  27. package/dist/client/assets/SkillsView-qVZkbI37.js +1 -0
  28. package/dist/client/assets/Spin-DKwUVt1F.js +43 -0
  29. package/dist/client/assets/Suffix-C1Mw6UwH.js +90 -0
  30. package/dist/client/assets/{Switch-haCJAcVn.js → Switch-DG-3EwdR.js} +2 -2
  31. package/dist/client/assets/{Tag-CKzgX6hi.js → Tag-BWD1u63m.js} +2 -2
  32. package/dist/client/assets/{TerminalView-CmSON012.js → TerminalView-DTR8bNOy.js} +6 -6
  33. package/dist/client/assets/Tooltip-Dka1-DNs.js +1 -0
  34. package/dist/client/assets/UsageView-elTUQCED.js +1 -0
  35. package/dist/client/assets/{Warning-B2AD2ulw.js → Warning-CCZES7el.js} +1 -1
  36. package/dist/client/assets/{_plugin-vue_export-helper-DXZ6IauR.js → _plugin-vue_export-helper-Bl_Pm_OI.js} +2 -2
  37. package/dist/client/assets/app-BMD_VOYs.js +1 -0
  38. package/dist/client/assets/{app-Du5RZCLa.js → app-y8cD3FPg.js} +1 -1
  39. package/dist/client/assets/auth-BPBv1nNQ.js +1 -0
  40. package/dist/client/assets/browser-DlPqZ-4M.js +47 -0
  41. package/dist/client/assets/chat-3-o9JAHE.js +6 -0
  42. package/dist/client/assets/composables-CoSqDggz.js +1 -0
  43. package/dist/client/assets/{fade-in.cssr-CkQxIGt5.js → fade-in.cssr-D0suZaLL.js} +2 -2
  44. package/dist/client/assets/index-BRXOdlZt.css +1 -0
  45. package/dist/client/assets/index-CeFFa_Wg.js +284 -0
  46. package/dist/client/assets/{jobs-BnXwbdOs.js → jobs-DMiCP2Li.js} +1 -1
  47. package/dist/client/assets/light-BNuYwJcs.js +1 -0
  48. package/dist/client/assets/{light-BZfVIZ0W.js → light-DLz3o2il.js} +1 -1
  49. package/dist/client/assets/{light-Bdfae2y3.js → light-DbUQYfY2.js} +1 -1
  50. package/dist/client/assets/{light-Jn66LOmu.js → light-DcGe0-g1.js} +1 -1
  51. package/dist/client/assets/{light-Dgzhn0jz.js → light-cIgLWDVk.js} +1 -1
  52. package/dist/client/assets/{models-mCQyOPuV.js → models-EKNn3-zC.js} +1 -1
  53. package/dist/client/assets/{pinia-Jb4QOAzE.js → pinia-C8BDM-Fc.js} +1 -1
  54. package/dist/client/assets/profiles-1vZTTlBc.js +1 -0
  55. package/dist/client/assets/{router-qWVkGgap.js → router-kR4kqS2l.js} +2 -2
  56. package/dist/client/assets/{session-browser-prefs-Bh1and1f.js → session-browser-prefs-BI-rZu2N.js} +1 -1
  57. package/dist/client/assets/sessions-CJI89wYu.js +1 -0
  58. package/dist/client/assets/{skills-BIFy9nXD.js → skills-DjdZmDZP.js} +1 -1
  59. package/dist/client/assets/{use-message-Do_vF1fs.js → use-message-sSsrvqld.js} +1 -1
  60. package/dist/client/assets/{useTheme-BFm8wMmc.js → useTheme-DgQIobZP.js} +1 -1
  61. package/dist/client/index.html +29 -30
  62. package/dist/server/index.js +1067 -329
  63. package/dist/server/index.js.map +4 -4
  64. package/package.json +2 -2
  65. package/dist/client/assets/Add-COjp_zn3.js +0 -1
  66. package/dist/client/assets/ChatView-DVQv3z6i.js +0 -127
  67. package/dist/client/assets/ChatView-w9DKSiie.css +0 -1
  68. package/dist/client/assets/GatewaysView-BeaZvbdd.js +0 -1
  69. package/dist/client/assets/Input-CxMM68Q2.js +0 -234
  70. package/dist/client/assets/JobsView-DhosFF52.js +0 -2
  71. package/dist/client/assets/LoginView-DHPxG3eC.css +0 -1
  72. package/dist/client/assets/LoginView-DrjDX7xD.js +0 -1
  73. package/dist/client/assets/LogsView-BpW_vgEs.js +0 -1
  74. package/dist/client/assets/MemoryView-CP3K8mDG.js +0 -7
  75. package/dist/client/assets/ModelsView-DdQUiiu6.js +0 -1
  76. package/dist/client/assets/Popconfirm-DnYCLqNF.js +0 -16
  77. package/dist/client/assets/Popover-DAXLiB78.js +0 -117
  78. package/dist/client/assets/ProfilesView-Bkhqt3QB.js +0 -440
  79. package/dist/client/assets/SettingRow-B4_BuJSm.js +0 -1
  80. package/dist/client/assets/SettingsView-ZwzxJZVc.js +0 -352
  81. package/dist/client/assets/SkillsView-B3X9y2kZ.js +0 -1
  82. package/dist/client/assets/Spin-CAOjab_F.js +0 -43
  83. package/dist/client/assets/Suffix-DQWmhzzW.js +0 -90
  84. package/dist/client/assets/Tooltip-U6DmMv6W.js +0 -1
  85. package/dist/client/assets/UsageView-rmIKdR1u.js +0 -1
  86. package/dist/client/assets/app-lD2ZIoa4.js +0 -1
  87. package/dist/client/assets/browser-DcLLT85r.js +0 -47
  88. package/dist/client/assets/chat-DJP53-h1.js +0 -6
  89. package/dist/client/assets/composables-CjmuafMO.js +0 -1
  90. package/dist/client/assets/index-BfU2Be-n.css +0 -1
  91. package/dist/client/assets/index-BqaBjme9.js +0 -284
  92. package/dist/client/assets/light-ZuZhSzix.js +0 -1
  93. package/dist/client/assets/light-ba4gwt1q.js +0 -1
  94. package/dist/client/assets/omit-1BRB6K75.js +0 -1
  95. package/dist/client/assets/profiles-PisKQKsd.js +0 -1
  96. package/dist/client/assets/sessions-smjenK_5.js +0 -1
  97. /package/dist/client/assets/{_common-Yp55QE79.js → _common-D_mHAddk.js} +0 -0
@@ -48,12 +48,81 @@ function ensureToken() {
48
48
  return token
49
49
  }
50
50
 
51
- function getPort() {
51
+ function getNodeBinDir() {
52
+ return dirname(process.execPath)
53
+ }
54
+
55
+ function getNpmBin() {
56
+ return join(getNodeBinDir(), process.platform === 'win32' ? 'npm.cmd' : 'npm')
57
+ }
58
+
59
+ function getCliBin() {
60
+ return join(getNodeBinDir(), process.platform === 'win32' ? 'hermes-web-ui.cmd' : 'hermes-web-ui')
61
+ }
62
+
63
+ function getWindowsShell() {
64
+ return process.env.ComSpec || 'cmd.exe'
65
+ }
66
+
67
+ function quoteForWindowsCommand(value) {
68
+ return `"${value.replace(/"/g, '""')}"`
69
+ }
70
+
71
+ function spawnCli(command, args, options) {
72
+ if (process.platform === 'win32') {
73
+ const commandLine = `${quoteForWindowsCommand(command)} ${args.map(arg => String(arg)).join(' ')}`
74
+ return spawn(getWindowsShell(), ['/d', '/s', '/c', commandLine], options)
75
+ }
76
+
77
+ return spawn(command, args, options)
78
+ }
79
+
80
+ function getPortFromArgs() {
52
81
  if (process.argv[3] && !isNaN(process.argv[3])) return parseInt(process.argv[3])
53
82
  if (process.argv.includes('--port')) return parseInt(process.argv[process.argv.indexOf('--port') + 1])
83
+ return null
84
+ }
85
+
86
+ function getRunningPort() {
87
+ const pid = getPid()
88
+ if (!pid || !isRunning(pid)) return null
89
+
90
+ try {
91
+ if (process.platform === 'win32') {
92
+ const out = execSync(`netstat -aon -p tcp | findstr LISTENING | findstr " ${pid}$"`, { encoding: 'utf-8' }).trim()
93
+ const line = out.split('\n').find(Boolean)
94
+ const address = line?.trim().split(/\s+/)[1]
95
+ const port = address?.split(':').pop()
96
+ return port ? parseInt(port, 10) : null
97
+ }
98
+
99
+ const out = execSync(`lsof -Pan -p ${pid} -iTCP -sTCP:LISTEN`, { encoding: 'utf-8' }).trim()
100
+ const lines = out.split('\n').slice(1)
101
+ for (const line of lines) {
102
+ const match = line.match(/:(\d+)\s+\(LISTEN\)$/)
103
+ if (match) return parseInt(match[1], 10)
104
+ }
105
+ } catch {}
106
+
107
+ return null
108
+ }
109
+
110
+ function getUpdatePort() {
111
+ const argPort = getPortFromArgs()
112
+ if (argPort !== null) return argPort
113
+
114
+ const runningPort = getRunningPort()
115
+ if (runningPort !== null) return runningPort
116
+
117
+ if (process.env.PORT && !isNaN(process.env.PORT)) return parseInt(process.env.PORT)
54
118
  return DEFAULT_PORT
55
119
  }
56
120
 
121
+ function getPort() {
122
+ const argPort = getPortFromArgs()
123
+ return argPort ?? DEFAULT_PORT
124
+ }
125
+
57
126
  function getPid() {
58
127
  try {
59
128
  return parseInt(readFileSync(PID_FILE, 'utf-8').trim())
@@ -280,14 +349,9 @@ Options:
280
349
  }
281
350
 
282
351
  function doUpdate() {
283
- const isWin = process.platform === 'win32'
284
- const cmd = isWin
285
- ? 'cmd /c npm install -g hermes-web-ui@latest'
286
- : 'npm install -g hermes-web-ui@latest'
287
-
288
352
  console.log(' ⬆ Updating hermes-web-ui...')
289
353
 
290
- const child = spawn(isWin ? 'cmd' : 'sh', isWin ? ['/c', ...cmd.split(' ')] : ['-c', cmd], {
354
+ const child = spawnCli(getNpmBin(), ['install', '-g', 'hermes-web-ui@latest'], {
291
355
  stdio: 'inherit',
292
356
  windowsHide: true,
293
357
  })
@@ -295,8 +359,11 @@ function doUpdate() {
295
359
  child.on('exit', (code) => {
296
360
  if (code === 0) {
297
361
  console.log(' ✓ Update complete, restarting...')
298
- stopDaemon()
299
- setTimeout(() => startDaemon(getPort()), 500)
362
+ const restart = spawnCli(getCliBin(), ['restart', '--port', String(getUpdatePort())], {
363
+ stdio: 'inherit',
364
+ windowsHide: true,
365
+ })
366
+ restart.on('exit', (restartCode) => process.exit(restartCode ?? 1))
300
367
  } else {
301
368
  console.log(' ✗ Update failed')
302
369
  }
@@ -0,0 +1 @@
1
+ import{M as e,P as t}from"./router-kR4kqS2l.js";var n=e({name:`Add`,render(){return t(`svg`,{width:`512`,height:`512`,viewBox:`0 0 512 512`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t(`path`,{d:`M256 112V400M400 256H112`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linecap":`round`,"stroke-linejoin":`round`}))}});export{n as t};
@@ -1,4 +1,4 @@
1
- import{C as e,F as t,N as n,R as r,V as i,ct as a,d as o,dt as s,f as c,j as l}from"./router-qWVkGgap.js";import{$ as u,B as d,K as f,Q as p,R as m,U as h,a as g,c as _,ct as v,d as y,dt as b,ft as x,l as S,n as C,nt as w,o as T,pt as E,q as D,r as O,rt as k,st as A,t as j,tt as M,u as N,ut as P,z as F}from"./browser-DcLLT85r.js";function I(e){return e.replace(/#|\(|\)|,|\s|\./g,`_`)}var L=l({name:`FadeInExpandTransition`,props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function r(t){e.width?t.style.maxWidth=`${t.offsetWidth}px`:t.style.maxHeight=`${t.offsetHeight}px`,t.offsetWidth}function i(t){e.width?t.style.maxWidth=`0`:t.style.maxHeight=`0`,t.offsetWidth;let{onLeave:n}=e;n&&n()}function a(t){e.width?t.style.maxWidth=``:t.style.maxHeight=``;let{onAfterLeave:n}=e;n&&n()}function s(t){if(t.style.transition=`none`,e.width){let e=t.offsetWidth;t.style.maxWidth=`0`,t.offsetWidth,t.style.transition=``,t.style.maxWidth=`${e}px`}else if(e.reverse)t.style.maxHeight=`${t.offsetHeight}px`,t.offsetHeight,t.style.transition=``,t.style.maxHeight=`0`;else{let e=t.offsetHeight;t.style.maxHeight=`0`,t.offsetWidth,t.style.transition=``,t.style.maxHeight=`${e}px`}t.offsetWidth}function l(t){var n;e.width?t.style.maxWidth=``:e.reverse||(t.style.maxHeight=``),(n=e.onAfterEnter)==null||n.call(e)}return()=>{let{group:u,width:d,appear:f,mode:p}=e,m=u?c:o,h={name:d?`fade-in-width-expand-transition`:`fade-in-height-expand-transition`,appear:f,onEnter:s,onAfterEnter:l,onBeforeLeave:r,onLeave:i,onAfterLeave:a};return u||(h.mode=p),n(m,h,t)}}}),{cubicBezierEaseInOut:R}=N;function z({duration:e=`.2s`,delay:t=`.1s`}={}){return[A(`&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to`,{opacity:1}),A(`&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from`,`
1
+ import{H as e,I as t,M as n,P as r,f as i,ft as a,lt as o,p as s,w as c,z as l}from"./router-kR4kqS2l.js";import{$ as u,B as d,K as f,Q as p,R as m,U as h,a as g,c as _,ct as v,d as y,dt as b,ft as x,l as S,n as C,nt as w,o as T,pt as E,q as D,r as O,rt as k,st as A,t as j,tt as M,u as N,ut as P,z as F}from"./browser-DlPqZ-4M.js";function I(e){return e.replace(/#|\(|\)|,|\s|\./g,`_`)}var L=n({name:`FadeInExpandTransition`,props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function n(t){e.width?t.style.maxWidth=`${t.offsetWidth}px`:t.style.maxHeight=`${t.offsetHeight}px`,t.offsetWidth}function a(t){e.width?t.style.maxWidth=`0`:t.style.maxHeight=`0`,t.offsetWidth;let{onLeave:n}=e;n&&n()}function o(t){e.width?t.style.maxWidth=``:t.style.maxHeight=``;let{onAfterLeave:n}=e;n&&n()}function c(t){if(t.style.transition=`none`,e.width){let e=t.offsetWidth;t.style.maxWidth=`0`,t.offsetWidth,t.style.transition=``,t.style.maxWidth=`${e}px`}else if(e.reverse)t.style.maxHeight=`${t.offsetHeight}px`,t.offsetHeight,t.style.transition=``,t.style.maxHeight=`0`;else{let e=t.offsetHeight;t.style.maxHeight=`0`,t.offsetWidth,t.style.transition=``,t.style.maxHeight=`${e}px`}t.offsetWidth}function l(t){var n;e.width?t.style.maxWidth=``:e.reverse||(t.style.maxHeight=``),(n=e.onAfterEnter)==null||n.call(e)}return()=>{let{group:u,width:d,appear:f,mode:p}=e,m=u?s:i,h={name:d?`fade-in-width-expand-transition`:`fade-in-height-expand-transition`,appear:f,onEnter:c,onAfterEnter:l,onBeforeLeave:n,onLeave:a,onAfterLeave:o};return u||(h.mode=p),r(m,h,t)}}}),{cubicBezierEaseInOut:R}=N;function z({duration:e=`.2s`,delay:t=`.1s`}={}){return[A(`&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to`,{opacity:1}),A(`&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from`,`
2
2
  opacity: 0!important;
3
3
  margin-left: 0!important;
4
4
  margin-right: 0!important;
@@ -23,7 +23,7 @@ import{C as e,F as t,N as n,R as r,V as i,ct as a,d as o,dt as s,f as c,j as l}f
23
23
  top: 0;
24
24
  bottom: 0;
25
25
  border-radius: inherit;
26
- `),V=l({name:`BaseWave`,props:{clsPrefix:{type:String,required:!0}},setup(e){S(`-base-wave`,B,s(e,`clsPrefix`));let t=a(null),n=a(!1),o=null;return i(()=>{o!==null&&window.clearTimeout(o)}),{active:n,selfRef:t,play(){o!==null&&(window.clearTimeout(o),n.value=!1,o=null),r(()=>{var e;(e=t.value)==null||e.offsetHeight,n.value=!0,o=window.setTimeout(()=>{n.value=!1,o=null},1e3)})}}},render(){let{clsPrefix:e}=this;return n(`div`,{ref:`selfRef`,"aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}});function H(e){return k(e,[255,255,255,.16])}function U(e){return k(e,[0,0,0,.12])}var W=u(`n-button-group`),G={paddingTiny:`0 6px`,paddingSmall:`0 10px`,paddingMedium:`0 14px`,paddingLarge:`0 18px`,paddingRoundTiny:`0 10px`,paddingRoundSmall:`0 14px`,paddingRoundMedium:`0 18px`,paddingRoundLarge:`0 22px`,iconMarginTiny:`6px`,iconMarginSmall:`6px`,iconMarginMedium:`6px`,iconMarginLarge:`6px`,iconSizeTiny:`14px`,iconSizeSmall:`18px`,iconSizeMedium:`18px`,iconSizeLarge:`20px`,rippleDuration:`.6s`};function K(e){let{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadius:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,textColor2:d,textColor3:f,primaryColorHover:p,primaryColorPressed:m,borderColor:h,primaryColor:g,baseColor:_,infoColor:v,infoColorHover:y,infoColorPressed:b,successColor:x,successColorHover:S,successColorPressed:C,warningColor:w,warningColorHover:T,warningColorPressed:E,errorColor:D,errorColorHover:O,errorColorPressed:k,fontWeight:A,buttonColor2:j,buttonColor2Hover:M,buttonColor2Pressed:N,fontWeightStrong:P}=e;return Object.assign(Object.assign({},G),{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadiusTiny:a,borderRadiusSmall:a,borderRadiusMedium:a,borderRadiusLarge:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,colorOpacitySecondary:`0.16`,colorOpacitySecondaryHover:`0.22`,colorOpacitySecondaryPressed:`0.28`,colorSecondary:j,colorSecondaryHover:M,colorSecondaryPressed:N,colorTertiary:j,colorTertiaryHover:M,colorTertiaryPressed:N,colorQuaternary:`#0000`,colorQuaternaryHover:M,colorQuaternaryPressed:N,color:`#0000`,colorHover:`#0000`,colorPressed:`#0000`,colorFocus:`#0000`,colorDisabled:`#0000`,textColor:d,textColorTertiary:f,textColorHover:p,textColorPressed:m,textColorFocus:p,textColorDisabled:d,textColorText:d,textColorTextHover:p,textColorTextPressed:m,textColorTextFocus:p,textColorTextDisabled:d,textColorGhost:d,textColorGhostHover:p,textColorGhostPressed:m,textColorGhostFocus:p,textColorGhostDisabled:d,border:`1px solid ${h}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${m}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${h}`,rippleColor:g,colorPrimary:g,colorHoverPrimary:p,colorPressedPrimary:m,colorFocusPrimary:p,colorDisabledPrimary:g,textColorPrimary:_,textColorHoverPrimary:_,textColorPressedPrimary:_,textColorFocusPrimary:_,textColorDisabledPrimary:_,textColorTextPrimary:g,textColorTextHoverPrimary:p,textColorTextPressedPrimary:m,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:d,textColorGhostPrimary:g,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:m,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:g,borderPrimary:`1px solid ${g}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${m}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${g}`,rippleColorPrimary:g,colorInfo:v,colorHoverInfo:y,colorPressedInfo:b,colorFocusInfo:y,colorDisabledInfo:v,textColorInfo:_,textColorHoverInfo:_,textColorPressedInfo:_,textColorFocusInfo:_,textColorDisabledInfo:_,textColorTextInfo:v,textColorTextHoverInfo:y,textColorTextPressedInfo:b,textColorTextFocusInfo:y,textColorTextDisabledInfo:d,textColorGhostInfo:v,textColorGhostHoverInfo:y,textColorGhostPressedInfo:b,textColorGhostFocusInfo:y,textColorGhostDisabledInfo:v,borderInfo:`1px solid ${v}`,borderHoverInfo:`1px solid ${y}`,borderPressedInfo:`1px solid ${b}`,borderFocusInfo:`1px solid ${y}`,borderDisabledInfo:`1px solid ${v}`,rippleColorInfo:v,colorSuccess:x,colorHoverSuccess:S,colorPressedSuccess:C,colorFocusSuccess:S,colorDisabledSuccess:x,textColorSuccess:_,textColorHoverSuccess:_,textColorPressedSuccess:_,textColorFocusSuccess:_,textColorDisabledSuccess:_,textColorTextSuccess:x,textColorTextHoverSuccess:S,textColorTextPressedSuccess:C,textColorTextFocusSuccess:S,textColorTextDisabledSuccess:d,textColorGhostSuccess:x,textColorGhostHoverSuccess:S,textColorGhostPressedSuccess:C,textColorGhostFocusSuccess:S,textColorGhostDisabledSuccess:x,borderSuccess:`1px solid ${x}`,borderHoverSuccess:`1px solid ${S}`,borderPressedSuccess:`1px solid ${C}`,borderFocusSuccess:`1px solid ${S}`,borderDisabledSuccess:`1px solid ${x}`,rippleColorSuccess:x,colorWarning:w,colorHoverWarning:T,colorPressedWarning:E,colorFocusWarning:T,colorDisabledWarning:w,textColorWarning:_,textColorHoverWarning:_,textColorPressedWarning:_,textColorFocusWarning:_,textColorDisabledWarning:_,textColorTextWarning:w,textColorTextHoverWarning:T,textColorTextPressedWarning:E,textColorTextFocusWarning:T,textColorTextDisabledWarning:d,textColorGhostWarning:w,textColorGhostHoverWarning:T,textColorGhostPressedWarning:E,textColorGhostFocusWarning:T,textColorGhostDisabledWarning:w,borderWarning:`1px solid ${w}`,borderHoverWarning:`1px solid ${T}`,borderPressedWarning:`1px solid ${E}`,borderFocusWarning:`1px solid ${T}`,borderDisabledWarning:`1px solid ${w}`,rippleColorWarning:w,colorError:D,colorHoverError:O,colorPressedError:k,colorFocusError:O,colorDisabledError:D,textColorError:_,textColorHoverError:_,textColorPressedError:_,textColorFocusError:_,textColorDisabledError:_,textColorTextError:D,textColorTextHoverError:O,textColorTextPressedError:k,textColorTextFocusError:O,textColorTextDisabledError:d,textColorGhostError:D,textColorGhostHoverError:O,textColorGhostPressedError:k,textColorGhostFocusError:O,textColorGhostDisabledError:D,borderError:`1px solid ${D}`,borderHoverError:`1px solid ${O}`,borderPressedError:`1px solid ${k}`,borderFocusError:`1px solid ${O}`,borderDisabledError:`1px solid ${D}`,rippleColorError:D,waveOpacity:`0.6`,fontWeight:A,fontWeightStrong:P})}var q={name:`Button`,common:C,self:K},J=A([v(`button`,`
26
+ `),V=n({name:`BaseWave`,props:{clsPrefix:{type:String,required:!0}},setup(t){S(`-base-wave`,B,a(t,`clsPrefix`));let n=o(null),r=o(!1),i=null;return e(()=>{i!==null&&window.clearTimeout(i)}),{active:r,selfRef:n,play(){i!==null&&(window.clearTimeout(i),r.value=!1,i=null),l(()=>{var e;(e=n.value)==null||e.offsetHeight,r.value=!0,i=window.setTimeout(()=>{r.value=!1,i=null},1e3)})}}},render(){let{clsPrefix:e}=this;return r(`div`,{ref:`selfRef`,"aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}});function H(e){return k(e,[255,255,255,.16])}function U(e){return k(e,[0,0,0,.12])}var W=u(`n-button-group`),G={paddingTiny:`0 6px`,paddingSmall:`0 10px`,paddingMedium:`0 14px`,paddingLarge:`0 18px`,paddingRoundTiny:`0 10px`,paddingRoundSmall:`0 14px`,paddingRoundMedium:`0 18px`,paddingRoundLarge:`0 22px`,iconMarginTiny:`6px`,iconMarginSmall:`6px`,iconMarginMedium:`6px`,iconMarginLarge:`6px`,iconSizeTiny:`14px`,iconSizeSmall:`18px`,iconSizeMedium:`18px`,iconSizeLarge:`20px`,rippleDuration:`.6s`};function K(e){let{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadius:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,textColor2:d,textColor3:f,primaryColorHover:p,primaryColorPressed:m,borderColor:h,primaryColor:g,baseColor:_,infoColor:v,infoColorHover:y,infoColorPressed:b,successColor:x,successColorHover:S,successColorPressed:C,warningColor:w,warningColorHover:T,warningColorPressed:E,errorColor:D,errorColorHover:O,errorColorPressed:k,fontWeight:A,buttonColor2:j,buttonColor2Hover:M,buttonColor2Pressed:N,fontWeightStrong:P}=e;return Object.assign(Object.assign({},G),{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadiusTiny:a,borderRadiusSmall:a,borderRadiusMedium:a,borderRadiusLarge:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,colorOpacitySecondary:`0.16`,colorOpacitySecondaryHover:`0.22`,colorOpacitySecondaryPressed:`0.28`,colorSecondary:j,colorSecondaryHover:M,colorSecondaryPressed:N,colorTertiary:j,colorTertiaryHover:M,colorTertiaryPressed:N,colorQuaternary:`#0000`,colorQuaternaryHover:M,colorQuaternaryPressed:N,color:`#0000`,colorHover:`#0000`,colorPressed:`#0000`,colorFocus:`#0000`,colorDisabled:`#0000`,textColor:d,textColorTertiary:f,textColorHover:p,textColorPressed:m,textColorFocus:p,textColorDisabled:d,textColorText:d,textColorTextHover:p,textColorTextPressed:m,textColorTextFocus:p,textColorTextDisabled:d,textColorGhost:d,textColorGhostHover:p,textColorGhostPressed:m,textColorGhostFocus:p,textColorGhostDisabled:d,border:`1px solid ${h}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${m}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${h}`,rippleColor:g,colorPrimary:g,colorHoverPrimary:p,colorPressedPrimary:m,colorFocusPrimary:p,colorDisabledPrimary:g,textColorPrimary:_,textColorHoverPrimary:_,textColorPressedPrimary:_,textColorFocusPrimary:_,textColorDisabledPrimary:_,textColorTextPrimary:g,textColorTextHoverPrimary:p,textColorTextPressedPrimary:m,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:d,textColorGhostPrimary:g,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:m,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:g,borderPrimary:`1px solid ${g}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${m}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${g}`,rippleColorPrimary:g,colorInfo:v,colorHoverInfo:y,colorPressedInfo:b,colorFocusInfo:y,colorDisabledInfo:v,textColorInfo:_,textColorHoverInfo:_,textColorPressedInfo:_,textColorFocusInfo:_,textColorDisabledInfo:_,textColorTextInfo:v,textColorTextHoverInfo:y,textColorTextPressedInfo:b,textColorTextFocusInfo:y,textColorTextDisabledInfo:d,textColorGhostInfo:v,textColorGhostHoverInfo:y,textColorGhostPressedInfo:b,textColorGhostFocusInfo:y,textColorGhostDisabledInfo:v,borderInfo:`1px solid ${v}`,borderHoverInfo:`1px solid ${y}`,borderPressedInfo:`1px solid ${b}`,borderFocusInfo:`1px solid ${y}`,borderDisabledInfo:`1px solid ${v}`,rippleColorInfo:v,colorSuccess:x,colorHoverSuccess:S,colorPressedSuccess:C,colorFocusSuccess:S,colorDisabledSuccess:x,textColorSuccess:_,textColorHoverSuccess:_,textColorPressedSuccess:_,textColorFocusSuccess:_,textColorDisabledSuccess:_,textColorTextSuccess:x,textColorTextHoverSuccess:S,textColorTextPressedSuccess:C,textColorTextFocusSuccess:S,textColorTextDisabledSuccess:d,textColorGhostSuccess:x,textColorGhostHoverSuccess:S,textColorGhostPressedSuccess:C,textColorGhostFocusSuccess:S,textColorGhostDisabledSuccess:x,borderSuccess:`1px solid ${x}`,borderHoverSuccess:`1px solid ${S}`,borderPressedSuccess:`1px solid ${C}`,borderFocusSuccess:`1px solid ${S}`,borderDisabledSuccess:`1px solid ${x}`,rippleColorSuccess:x,colorWarning:w,colorHoverWarning:T,colorPressedWarning:E,colorFocusWarning:T,colorDisabledWarning:w,textColorWarning:_,textColorHoverWarning:_,textColorPressedWarning:_,textColorFocusWarning:_,textColorDisabledWarning:_,textColorTextWarning:w,textColorTextHoverWarning:T,textColorTextPressedWarning:E,textColorTextFocusWarning:T,textColorTextDisabledWarning:d,textColorGhostWarning:w,textColorGhostHoverWarning:T,textColorGhostPressedWarning:E,textColorGhostFocusWarning:T,textColorGhostDisabledWarning:w,borderWarning:`1px solid ${w}`,borderHoverWarning:`1px solid ${T}`,borderPressedWarning:`1px solid ${E}`,borderFocusWarning:`1px solid ${T}`,borderDisabledWarning:`1px solid ${w}`,rippleColorWarning:w,colorError:D,colorHoverError:O,colorPressedError:k,colorFocusError:O,colorDisabledError:D,textColorError:_,textColorHoverError:_,textColorPressedError:_,textColorFocusError:_,textColorDisabledError:_,textColorTextError:D,textColorTextHoverError:O,textColorTextPressedError:k,textColorTextFocusError:O,textColorTextDisabledError:d,textColorGhostError:D,textColorGhostHoverError:O,textColorGhostPressedError:k,textColorGhostFocusError:O,textColorGhostDisabledError:D,borderError:`1px solid ${D}`,borderHoverError:`1px solid ${O}`,borderPressedError:`1px solid ${k}`,borderFocusError:`1px solid ${O}`,borderDisabledError:`1px solid ${D}`,rippleColorError:D,waveOpacity:`0.6`,fontWeight:A,fontWeightStrong:P})}var q={name:`Button`,common:C,self:K},J=A([v(`button`,`
27
27
  margin: 0;
28
28
  font-weight: var(--n-font-weight);
29
29
  line-height: 1;
@@ -106,4 +106,4 @@ import{C as e,F as t,N as n,R as r,V as i,ct as a,d as o,dt as s,f as c,j as l}f
106
106
  `,[A(`~`,[P(`icon`,{margin:`var(--n-icon-margin)`,marginRight:0})])]),b(`block`,`
107
107
  display: flex;
108
108
  width: 100%;
109
- `),b(`dashed`,[P(`border, state-border`,{borderStyle:`dashed !important`})]),b(`disabled`,{cursor:`not-allowed`,opacity:`var(--n-opacity-disabled)`})]),A(`@keyframes button-wave-spread`,{from:{boxShadow:`0 0 0.5px 0 var(--n-ripple-color)`},to:{boxShadow:`0 0 0.5px 4.5px var(--n-ripple-color)`}}),A(`@keyframes button-wave-opacity`,{from:{opacity:`var(--n-wave-opacity)`},to:{opacity:0}})]),Y=l({name:`Button`,props:Object.assign(Object.assign({},_.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:`button`},type:{type:String,default:`default`},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:`left`},attrType:{type:String,default:`button`},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!j},spinProps:Object}),slots:Object,setup(n){let r=a(null),i=a(null),o=a(!1),s=M(()=>!n.quaternary&&!n.tertiary&&!n.secondary&&!n.text&&(!n.color||n.ghost||n.dashed)&&n.bordered),c=t(W,{}),{inlineThemeDisabled:l,mergedClsPrefixRef:u,mergedRtlRef:f,mergedComponentPropsRef:p}=d(n),{mergedSizeRef:h}=m({},{defaultSize:`medium`,mergedSize:e=>{let{size:t}=n;if(t)return t;let{size:r}=c;if(r)return r;let{mergedSize:i}=e||{};return i?i.value:p?.value?.Button?.size||`medium`}}),g=e(()=>n.focusable&&!n.disabled),v=e=>{var t;g.value||e.preventDefault(),!n.nativeFocusBehavior&&(e.preventDefault(),!n.disabled&&g.value&&((t=r.value)==null||t.focus({preventScroll:!0})))},b=e=>{var t;if(!n.disabled&&!n.loading){let{onClick:r}=n;r&&D(r,e),n.text||(t=i.value)==null||t.play()}},x=e=>{switch(e.key){case`Enter`:if(!n.keyboard)return;o.value=!1}},S=e=>{switch(e.key){case`Enter`:if(!n.keyboard||n.loading){e.preventDefault();return}o.value=!0}},C=()=>{o.value=!1},T=_(`Button`,`-button`,J,q,n,u),O=y(`Button`,f,u),k=e(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseOut:t},self:r}=T.value,{rippleDuration:i,opacityDisabled:a,fontWeight:o,fontWeightStrong:s}=r,c=h.value,{dashed:l,type:u,ghost:d,text:f,color:p,round:m,circle:g,textColor:_,secondary:v,tertiary:y,quaternary:b,strong:x}=n,S={"--n-font-weight":x?s:o},C={"--n-color":`initial`,"--n-color-hover":`initial`,"--n-color-pressed":`initial`,"--n-color-focus":`initial`,"--n-color-disabled":`initial`,"--n-ripple-color":`initial`,"--n-text-color":`initial`,"--n-text-color-hover":`initial`,"--n-text-color-pressed":`initial`,"--n-text-color-focus":`initial`,"--n-text-color-disabled":`initial`},D=u===`tertiary`,O=u===`default`,k=D?`default`:u;if(f){let e=_||p;C={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":`#0000`,"--n-text-color":e||r[E(`textColorText`,k)],"--n-text-color-hover":e?H(e):r[E(`textColorTextHover`,k)],"--n-text-color-pressed":e?U(e):r[E(`textColorTextPressed`,k)],"--n-text-color-focus":e?H(e):r[E(`textColorTextHover`,k)],"--n-text-color-disabled":e||r[E(`textColorTextDisabled`,k)]}}else if(d||l){let e=_||p;C={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":p||r[E(`rippleColor`,k)],"--n-text-color":e||r[E(`textColorGhost`,k)],"--n-text-color-hover":e?H(e):r[E(`textColorGhostHover`,k)],"--n-text-color-pressed":e?U(e):r[E(`textColorGhostPressed`,k)],"--n-text-color-focus":e?H(e):r[E(`textColorGhostHover`,k)],"--n-text-color-disabled":e||r[E(`textColorGhostDisabled`,k)]}}else if(v){let e=O?r.textColor:D?r.textColorTertiary:r[E(`color`,k)],t=p||e,n=u!==`default`&&u!==`tertiary`;C={"--n-color":n?w(t,{alpha:Number(r.colorOpacitySecondary)}):r.colorSecondary,"--n-color-hover":n?w(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-pressed":n?w(t,{alpha:Number(r.colorOpacitySecondaryPressed)}):r.colorSecondaryPressed,"--n-color-focus":n?w(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-disabled":r.colorSecondary,"--n-ripple-color":`#0000`,"--n-text-color":t,"--n-text-color-hover":t,"--n-text-color-pressed":t,"--n-text-color-focus":t,"--n-text-color-disabled":t}}else if(y||b){let e=O?r.textColor:D?r.textColorTertiary:r[E(`color`,k)],t=p||e;y?(C[`--n-color`]=r.colorTertiary,C[`--n-color-hover`]=r.colorTertiaryHover,C[`--n-color-pressed`]=r.colorTertiaryPressed,C[`--n-color-focus`]=r.colorSecondaryHover,C[`--n-color-disabled`]=r.colorTertiary):(C[`--n-color`]=r.colorQuaternary,C[`--n-color-hover`]=r.colorQuaternaryHover,C[`--n-color-pressed`]=r.colorQuaternaryPressed,C[`--n-color-focus`]=r.colorQuaternaryHover,C[`--n-color-disabled`]=r.colorQuaternary),C[`--n-ripple-color`]=`#0000`,C[`--n-text-color`]=t,C[`--n-text-color-hover`]=t,C[`--n-text-color-pressed`]=t,C[`--n-text-color-focus`]=t,C[`--n-text-color-disabled`]=t}else C={"--n-color":p||r[E(`color`,k)],"--n-color-hover":p?H(p):r[E(`colorHover`,k)],"--n-color-pressed":p?U(p):r[E(`colorPressed`,k)],"--n-color-focus":p?H(p):r[E(`colorFocus`,k)],"--n-color-disabled":p||r[E(`colorDisabled`,k)],"--n-ripple-color":p||r[E(`rippleColor`,k)],"--n-text-color":_||(p?r.textColorPrimary:D?r.textColorTertiary:r[E(`textColor`,k)]),"--n-text-color-hover":_||(p?r.textColorHoverPrimary:r[E(`textColorHover`,k)]),"--n-text-color-pressed":_||(p?r.textColorPressedPrimary:r[E(`textColorPressed`,k)]),"--n-text-color-focus":_||(p?r.textColorFocusPrimary:r[E(`textColorFocus`,k)]),"--n-text-color-disabled":_||(p?r.textColorDisabledPrimary:r[E(`textColorDisabled`,k)])};let A={"--n-border":`initial`,"--n-border-hover":`initial`,"--n-border-pressed":`initial`,"--n-border-focus":`initial`,"--n-border-disabled":`initial`};A=f?{"--n-border":`none`,"--n-border-hover":`none`,"--n-border-pressed":`none`,"--n-border-focus":`none`,"--n-border-disabled":`none`}:{"--n-border":r[E(`border`,k)],"--n-border-hover":r[E(`borderHover`,k)],"--n-border-pressed":r[E(`borderPressed`,k)],"--n-border-focus":r[E(`borderFocus`,k)],"--n-border-disabled":r[E(`borderDisabled`,k)]};let{[E(`height`,c)]:j,[E(`fontSize`,c)]:M,[E(`padding`,c)]:N,[E(`paddingRound`,c)]:P,[E(`iconSize`,c)]:F,[E(`borderRadius`,c)]:I,[E(`iconMargin`,c)]:L,waveOpacity:R}=r,z={"--n-width":g&&!f?j:`initial`,"--n-height":f?`initial`:j,"--n-font-size":M,"--n-padding":g||f?`initial`:m?P:N,"--n-icon-size":F,"--n-icon-margin":L,"--n-border-radius":f?`initial`:g||m?j:I};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":e,"--n-bezier-ease-out":t,"--n-ripple-duration":i,"--n-opacity-disabled":a,"--n-wave-opacity":R},S),C),A),z)}),A=l?F(`button`,e(()=>{let e=``,{dashed:t,type:r,ghost:i,text:a,color:o,round:s,circle:c,textColor:l,secondary:u,tertiary:d,quaternary:f,strong:p}=n;t&&(e+=`a`),i&&(e+=`b`),a&&(e+=`c`),s&&(e+=`d`),c&&(e+=`e`),u&&(e+=`f`),d&&(e+=`g`),f&&(e+=`h`),p&&(e+=`i`),o&&(e+=`j${I(o)}`),l&&(e+=`k${I(l)}`);let{value:m}=h;return e+=`l${m[0]}`,e+=`m${r[0]}`,e}),k,n):void 0;return{selfElRef:r,waveElRef:i,mergedClsPrefix:u,mergedFocusable:g,mergedSize:h,showBorder:s,enterPressed:o,rtlEnabled:O,handleMousedown:v,handleKeydown:S,handleBlur:C,handleKeyup:x,handleClick:b,customColorCssVars:e(()=>{let{color:e}=n;if(!e)return null;let t=H(e);return{"--n-border-color":e,"--n-border-color-hover":t,"--n-border-color-pressed":U(e),"--n-border-color-focus":t,"--n-border-color-disabled":e}}),cssVars:l?void 0:k,themeClass:A?.themeClass,onRender:A?.onRender}},render(){let{mergedClsPrefix:e,tag:t,onRender:r}=this;r?.();let i=f(this.$slots.default,t=>t&&n(`span`,{class:`${e}-button__content`},t));return n(t,{ref:`selfElRef`,class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement===`right`&&i,n(L,{width:!0},{default:()=>f(this.$slots.icon,t=>(this.loading||this.renderIcon||t)&&n(`span`,{class:`${e}-button__icon`,style:{margin:h(this.$slots.default)?`0`:``}},n(T,null,{default:()=>this.loading?n(O,Object.assign({clsPrefix:e,key:`loading`,class:`${e}-icon-slot`,strokeWidth:20},this.spinProps)):n(`div`,{key:`icon`,class:`${e}-icon-slot`,role:`none`},this.renderIcon?this.renderIcon():t)})))}),this.iconPlacement===`left`&&i,this.text?null:n(V,{ref:`waveElRef`,clsPrefix:e}),this.showBorder?n(`div`,{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?n(`div`,{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),X=Y;export{L as a,K as i,X as n,I as o,q as r,Y as t};
109
+ `),b(`dashed`,[P(`border, state-border`,{borderStyle:`dashed !important`})]),b(`disabled`,{cursor:`not-allowed`,opacity:`var(--n-opacity-disabled)`})]),A(`@keyframes button-wave-spread`,{from:{boxShadow:`0 0 0.5px 0 var(--n-ripple-color)`},to:{boxShadow:`0 0 0.5px 4.5px var(--n-ripple-color)`}}),A(`@keyframes button-wave-opacity`,{from:{opacity:`var(--n-wave-opacity)`},to:{opacity:0}})]),Y=n({name:`Button`,props:Object.assign(Object.assign({},_.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:`button`},type:{type:String,default:`default`},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:`left`},attrType:{type:String,default:`button`},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!j},spinProps:Object}),slots:Object,setup(e){let n=o(null),r=o(null),i=o(!1),a=M(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),s=t(W,{}),{inlineThemeDisabled:l,mergedClsPrefixRef:u,mergedRtlRef:f,mergedComponentPropsRef:p}=d(e),{mergedSizeRef:h}=m({},{defaultSize:`medium`,mergedSize:t=>{let{size:n}=e;if(n)return n;let{size:r}=s;if(r)return r;let{mergedSize:i}=t||{};return i?i.value:p?.value?.Button?.size||`medium`}}),g=c(()=>e.focusable&&!e.disabled),v=t=>{var r;g.value||t.preventDefault(),!e.nativeFocusBehavior&&(t.preventDefault(),!e.disabled&&g.value&&((r=n.value)==null||r.focus({preventScroll:!0})))},b=t=>{var n;if(!e.disabled&&!e.loading){let{onClick:i}=e;i&&D(i,t),e.text||(n=r.value)==null||n.play()}},x=t=>{switch(t.key){case`Enter`:if(!e.keyboard)return;i.value=!1}},S=t=>{switch(t.key){case`Enter`:if(!e.keyboard||e.loading){t.preventDefault();return}i.value=!0}},C=()=>{i.value=!1},T=_(`Button`,`-button`,J,q,e,u),O=y(`Button`,f,u),k=c(()=>{let{common:{cubicBezierEaseInOut:t,cubicBezierEaseOut:n},self:r}=T.value,{rippleDuration:i,opacityDisabled:a,fontWeight:o,fontWeightStrong:s}=r,c=h.value,{dashed:l,type:u,ghost:d,text:f,color:p,round:m,circle:g,textColor:_,secondary:v,tertiary:y,quaternary:b,strong:x}=e,S={"--n-font-weight":x?s:o},C={"--n-color":`initial`,"--n-color-hover":`initial`,"--n-color-pressed":`initial`,"--n-color-focus":`initial`,"--n-color-disabled":`initial`,"--n-ripple-color":`initial`,"--n-text-color":`initial`,"--n-text-color-hover":`initial`,"--n-text-color-pressed":`initial`,"--n-text-color-focus":`initial`,"--n-text-color-disabled":`initial`},D=u===`tertiary`,O=u===`default`,k=D?`default`:u;if(f){let e=_||p;C={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":`#0000`,"--n-text-color":e||r[E(`textColorText`,k)],"--n-text-color-hover":e?H(e):r[E(`textColorTextHover`,k)],"--n-text-color-pressed":e?U(e):r[E(`textColorTextPressed`,k)],"--n-text-color-focus":e?H(e):r[E(`textColorTextHover`,k)],"--n-text-color-disabled":e||r[E(`textColorTextDisabled`,k)]}}else if(d||l){let e=_||p;C={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":p||r[E(`rippleColor`,k)],"--n-text-color":e||r[E(`textColorGhost`,k)],"--n-text-color-hover":e?H(e):r[E(`textColorGhostHover`,k)],"--n-text-color-pressed":e?U(e):r[E(`textColorGhostPressed`,k)],"--n-text-color-focus":e?H(e):r[E(`textColorGhostHover`,k)],"--n-text-color-disabled":e||r[E(`textColorGhostDisabled`,k)]}}else if(v){let e=O?r.textColor:D?r.textColorTertiary:r[E(`color`,k)],t=p||e,n=u!==`default`&&u!==`tertiary`;C={"--n-color":n?w(t,{alpha:Number(r.colorOpacitySecondary)}):r.colorSecondary,"--n-color-hover":n?w(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-pressed":n?w(t,{alpha:Number(r.colorOpacitySecondaryPressed)}):r.colorSecondaryPressed,"--n-color-focus":n?w(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-disabled":r.colorSecondary,"--n-ripple-color":`#0000`,"--n-text-color":t,"--n-text-color-hover":t,"--n-text-color-pressed":t,"--n-text-color-focus":t,"--n-text-color-disabled":t}}else if(y||b){let e=O?r.textColor:D?r.textColorTertiary:r[E(`color`,k)],t=p||e;y?(C[`--n-color`]=r.colorTertiary,C[`--n-color-hover`]=r.colorTertiaryHover,C[`--n-color-pressed`]=r.colorTertiaryPressed,C[`--n-color-focus`]=r.colorSecondaryHover,C[`--n-color-disabled`]=r.colorTertiary):(C[`--n-color`]=r.colorQuaternary,C[`--n-color-hover`]=r.colorQuaternaryHover,C[`--n-color-pressed`]=r.colorQuaternaryPressed,C[`--n-color-focus`]=r.colorQuaternaryHover,C[`--n-color-disabled`]=r.colorQuaternary),C[`--n-ripple-color`]=`#0000`,C[`--n-text-color`]=t,C[`--n-text-color-hover`]=t,C[`--n-text-color-pressed`]=t,C[`--n-text-color-focus`]=t,C[`--n-text-color-disabled`]=t}else C={"--n-color":p||r[E(`color`,k)],"--n-color-hover":p?H(p):r[E(`colorHover`,k)],"--n-color-pressed":p?U(p):r[E(`colorPressed`,k)],"--n-color-focus":p?H(p):r[E(`colorFocus`,k)],"--n-color-disabled":p||r[E(`colorDisabled`,k)],"--n-ripple-color":p||r[E(`rippleColor`,k)],"--n-text-color":_||(p?r.textColorPrimary:D?r.textColorTertiary:r[E(`textColor`,k)]),"--n-text-color-hover":_||(p?r.textColorHoverPrimary:r[E(`textColorHover`,k)]),"--n-text-color-pressed":_||(p?r.textColorPressedPrimary:r[E(`textColorPressed`,k)]),"--n-text-color-focus":_||(p?r.textColorFocusPrimary:r[E(`textColorFocus`,k)]),"--n-text-color-disabled":_||(p?r.textColorDisabledPrimary:r[E(`textColorDisabled`,k)])};let A={"--n-border":`initial`,"--n-border-hover":`initial`,"--n-border-pressed":`initial`,"--n-border-focus":`initial`,"--n-border-disabled":`initial`};A=f?{"--n-border":`none`,"--n-border-hover":`none`,"--n-border-pressed":`none`,"--n-border-focus":`none`,"--n-border-disabled":`none`}:{"--n-border":r[E(`border`,k)],"--n-border-hover":r[E(`borderHover`,k)],"--n-border-pressed":r[E(`borderPressed`,k)],"--n-border-focus":r[E(`borderFocus`,k)],"--n-border-disabled":r[E(`borderDisabled`,k)]};let{[E(`height`,c)]:j,[E(`fontSize`,c)]:M,[E(`padding`,c)]:N,[E(`paddingRound`,c)]:P,[E(`iconSize`,c)]:F,[E(`borderRadius`,c)]:I,[E(`iconMargin`,c)]:L,waveOpacity:R}=r,z={"--n-width":g&&!f?j:`initial`,"--n-height":f?`initial`:j,"--n-font-size":M,"--n-padding":g||f?`initial`:m?P:N,"--n-icon-size":F,"--n-icon-margin":L,"--n-border-radius":f?`initial`:g||m?j:I};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":t,"--n-bezier-ease-out":n,"--n-ripple-duration":i,"--n-opacity-disabled":a,"--n-wave-opacity":R},S),C),A),z)}),A=l?F(`button`,c(()=>{let t=``,{dashed:n,type:r,ghost:i,text:a,color:o,round:s,circle:c,textColor:l,secondary:u,tertiary:d,quaternary:f,strong:p}=e;n&&(t+=`a`),i&&(t+=`b`),a&&(t+=`c`),s&&(t+=`d`),c&&(t+=`e`),u&&(t+=`f`),d&&(t+=`g`),f&&(t+=`h`),p&&(t+=`i`),o&&(t+=`j${I(o)}`),l&&(t+=`k${I(l)}`);let{value:m}=h;return t+=`l${m[0]}`,t+=`m${r[0]}`,t}),k,e):void 0;return{selfElRef:n,waveElRef:r,mergedClsPrefix:u,mergedFocusable:g,mergedSize:h,showBorder:a,enterPressed:i,rtlEnabled:O,handleMousedown:v,handleKeydown:S,handleBlur:C,handleKeyup:x,handleClick:b,customColorCssVars:c(()=>{let{color:t}=e;if(!t)return null;let n=H(t);return{"--n-border-color":t,"--n-border-color-hover":n,"--n-border-color-pressed":U(t),"--n-border-color-focus":n,"--n-border-color-disabled":t}}),cssVars:l?void 0:k,themeClass:A?.themeClass,onRender:A?.onRender}},render(){let{mergedClsPrefix:e,tag:t,onRender:n}=this;n?.();let i=f(this.$slots.default,t=>t&&r(`span`,{class:`${e}-button__content`},t));return r(t,{ref:`selfElRef`,class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement===`right`&&i,r(L,{width:!0},{default:()=>f(this.$slots.icon,t=>(this.loading||this.renderIcon||t)&&r(`span`,{class:`${e}-button__icon`,style:{margin:h(this.$slots.default)?`0`:``}},r(T,null,{default:()=>this.loading?r(O,Object.assign({clsPrefix:e,key:`loading`,class:`${e}-icon-slot`,strokeWidth:20},this.spinProps)):r(`div`,{key:`icon`,class:`${e}-icon-slot`,role:`none`},this.renderIcon?this.renderIcon():t)})))}),this.iconPlacement===`left`&&i,this.text?null:r(V,{ref:`waveElRef`,clsPrefix:e}),this.showBorder?r(`div`,{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?r(`div`,{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),X=Y;export{L as a,K as i,X as n,I as o,q as r,Y as t};
@@ -1 +1 @@
1
- import{A as e,C as t,D as n,E as r,G as i,J as a,Q as o,T as s,U as c,W as l,Y as u,ct as d,gt as f,j as p,k as m,mt as h,ot as g,pt as _,q as v,w as y,y as b}from"./router-qWVkGgap.js";import{r as x,t as S}from"./_plugin-vue_export-helper-DXZ6IauR.js";import{t as C}from"./Button-pgPN7RfC.js";import{t as w}from"./Input-CxMM68Q2.js";import{t as T}from"./Tag-CKzgX6hi.js";import{t as E}from"./use-message-Do_vF1fs.js";import{t as D}from"./Switch-haCJAcVn.js";import{t as O}from"./Spin-CAOjab_F.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./SettingRow-B4_BuJSm.js";var F={class:`platform-info`},I=[`innerHTML`],L={class:`platform-name`},R={key:0,class:`platform-card-body`},z=S(p({__name:`PlatformCard`,props:{name:{},icon:{},config:{},credentials:{}},setup(s){let c=s,l=d(!0),{t:u}=x(),p=t(()=>{let e=c.credentials;if(!e)return!1;let t=[`token`,`api_key`,`app_id`,`client_id`,`secret`,`app_secret`,`client_secret`,`access_token`,`bot_id`,`account_id`,`enabled`];return[e,e.extra].filter(Boolean).some(e=>t.some(t=>{let n=e[t];return n!=null&&n!==``&&n!==!1}))});return(t,c)=>(i(),n(`div`,{class:h([`platform-card`,{configured:p.value}])},[y(`div`,{class:`platform-card-header`,onClick:c[0]||=e=>l.value=!l.value},[y(`div`,F,[y(`span`,{class:`platform-icon`,innerHTML:s.icon},null,8,I),y(`span`,L,f(s.name),1),e(_(T),{type:p.value?`success`:`default`,size:`small`,round:``},{default:o(()=>[m(f(p.value?_(u)(`common.configured`):_(u)(`common.notConfigured`)),1)]),_:1},8,[`type`])]),y(`span`,{class:h([`expand-icon`,{expanded:l.value}])},`▾`,2)]),l.value?(i(),n(`div`,R,[a(t.$slots,`default`,{},void 0,!0)])):r(``,!0)],2))}}),[[`__scopeId`,`data-v-cee18614`]]),B={class:`settings-section`},V={class:`weixin-qr-section`},H={key:1,class:`weixin-qr-loading`},U={key:2,class:`weixin-qr-hint`},W=S(p({__name:`PlatformSettings`,setup(t){let a=j(),c=E(),{t:p}=x(),h=g({});function S(e,t){return`${e}.${t}`}function T(e,t){return!!h[S(e,t)]}async function O(e,t,n){let r=S(e,t);h[r]=!0;try{await n(),c.success(p(`settings.saved`))}catch{c.error(p(`settings.saveFailed`))}finally{h[r]=!1}}async function F(e,t,n){O(e,t,()=>a.saveSection(e,n))}async function I(e,t,n){O(e,t,async()=>{await k(e,n),await a.fetchSettings()})}function L(e){return a.platforms[e]||{}}let R=d(``),W=d(``),G=d(`idle`),K=null;async function q(){G.value=`loading`,R.value=``,W.value=``,Y();try{let e=await N();W.value=e.qrcode,R.value=e.qrcode_url,window.open(e.qrcode_url,`_blank`),G.value=`waiting`,J()}catch(e){G.value=`error`,c.error(e.message||p(`platform.qrFetching`))}}function J(){W.value&&(K=setTimeout(async()=>{try{let e=await A(W.value);e.status===`wait`?J():e.status===`scaned`?(G.value=`scaned`,J()):e.status===`expired`?G.value=`expired`:e.status===`confirmed`&&(G.value=`confirmed`,await M({account_id:e.account_id,token:e.token,base_url:e.base_url}),await a.fetchSettings(),c.success(p(`settings.saved`)))}catch{J()}},3e3))}function Y(){K&&=(clearTimeout(K),null)}l(()=>{Y()});let X=[{key:`telegram`,name:`Telegram`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>`},{key:`discord`,name:`Discord`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>`},{key:`slack`,name:`Slack`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>`},{key:`whatsapp`,name:`WhatsApp`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>`},{key:`matrix`,name:`Matrix`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>`},{key:`feishu`,name:`Feishu`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>`},{key:`weixin`,name:`Weixin`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`},{key:`wecom`,name:`WeCom`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`}];return(t,c)=>{let l=u(`NSpin`);return i(),n(`section`,B,[(i(),n(b,null,v(X,t=>e(z,{key:t.key,name:t.name,icon:t.icon,config:_(a)[t.key],credentials:L(t.key)},{default:o(()=>[t.key===`telegram`?(i(),n(b,{key:0},[e(P,{label:_(p)(`platform.botToken`),hint:_(p)(`platform.botTokenHint`)},{default:o(()=>[e(_(w),{"default-value":L(`telegram`).token||``,loading:T(`telegram`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`123456:ABC-DEF...`,onChange:c[0]||=e=>I(`telegram`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionGroup`)},{default:o(()=>[e(_(D),{value:_(a).telegram.require_mention,loading:T(`telegram`,`require_mention`),"onUpdate:value":c[1]||=e=>F(`telegram`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.reactions`),hint:_(p)(`platform.reactionsHint`)},{default:o(()=>[e(_(D),{value:_(a).telegram.reactions,loading:T(`telegram`,`reactions`),"onUpdate:value":c[2]||=e=>F(`telegram`,`reactions`,{reactions:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChats`),hint:_(p)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).telegram.free_response_chats||``,loading:T(`telegram`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:c[3]||=e=>F(`telegram`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.mentionPatterns`),hint:_(p)(`platform.mentionPatternsHint`)},{default:o(()=>[e(_(w),{"default-value":(_(a).telegram.mention_patterns||[]).join(`, `),loading:T(`telegram`,`mention_patterns`),size:`small`,placeholder:`pattern1, pattern2`,onChange:c[4]||=e=>F(`telegram`,`mention_patterns`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`discord`?(i(),n(b,{key:1},[e(P,{label:_(p)(`platform.botToken`),hint:_(p)(`platform.botTokenHint`)},{default:o(()=>[e(_(w),{"default-value":L(`discord`).token||``,loading:T(`discord`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Bot token...`,onChange:c[5]||=e=>I(`discord`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionChannel`)},{default:o(()=>[e(_(D),{value:_(a).discord.require_mention,loading:T(`discord`,`require_mention`),"onUpdate:value":c[6]||=e=>F(`discord`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.autoThread`),hint:_(p)(`platform.autoThreadHint`)},{default:o(()=>[e(_(D),{value:_(a).discord.auto_thread,loading:T(`discord`,`auto_thread`),"onUpdate:value":c[7]||=e=>F(`discord`,`auto_thread`,{auto_thread:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.reactions`),hint:_(p)(`platform.reactionsHint`)},{default:o(()=>[e(_(D),{value:_(a).discord.reactions,loading:T(`discord`,`reactions`),"onUpdate:value":c[8]||=e=>F(`discord`,`reactions`,{reactions:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChannels`),hint:_(p)(`platform.freeResponseChannelsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).discord.free_response_channels||``,loading:T(`discord`,`free_response_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:c[9]||=e=>F(`discord`,`free_response_channels`,{free_response_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.allowedChannels`),hint:_(p)(`platform.allowedChannelsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).discord.allowed_channels||``,loading:T(`discord`,`allowed_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:c[10]||=e=>F(`discord`,`allowed_channels`,{allowed_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.ignoredChannels`),hint:_(p)(`platform.ignoredChannelsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).discord.ignored_channels||``,loading:T(`discord`,`ignored_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:c[11]||=e=>F(`discord`,`ignored_channels`,{ignored_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.noThreadChannels`),hint:_(p)(`platform.noThreadChannelsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).discord.no_thread_channels||``,loading:T(`discord`,`no_thread_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:c[12]||=e=>F(`discord`,`no_thread_channels`,{no_thread_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`slack`?(i(),n(b,{key:2},[e(P,{label:_(p)(`platform.botToken`),hint:_(p)(`platform.botTokenHint`)},{default:o(()=>[e(_(w),{"default-value":L(`slack`).token||``,loading:T(`slack`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`xoxb-...`,onChange:c[13]||=e=>I(`slack`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionChannel`)},{default:o(()=>[e(_(D),{value:_(a).slack.require_mention,loading:T(`slack`,`require_mention`),"onUpdate:value":c[14]||=e=>F(`slack`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.allowBots`),hint:_(p)(`platform.allowBotsHint`)},{default:o(()=>[e(_(D),{value:_(a).slack.allow_bots,loading:T(`slack`,`allow_bots`),"onUpdate:value":c[15]||=e=>F(`slack`,`allow_bots`,{allow_bots:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChannels`),hint:_(p)(`platform.freeResponseChannelsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).slack.free_response_channels||``,loading:T(`slack`,`free_response_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:c[16]||=e=>F(`slack`,`free_response_channels`,{free_response_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`whatsapp`?(i(),n(b,{key:3},[e(P,{label:_(p)(`platform.waEnabled`),hint:_(p)(`platform.waEnabledHint`)},{default:o(()=>[e(_(D),{value:L(`whatsapp`).enabled,loading:T(`whatsapp`,`enabled`),"onUpdate:value":c[17]||=e=>I(`whatsapp`,`enabled`,{enabled:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionGroup`)},{default:o(()=>[e(_(D),{value:_(a).whatsapp.require_mention,loading:T(`whatsapp`,`require_mention`),"onUpdate:value":c[18]||=e=>F(`whatsapp`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChats`),hint:_(p)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).whatsapp.free_response_chats||``,loading:T(`whatsapp`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:c[19]||=e=>F(`whatsapp`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.mentionPatterns`),hint:_(p)(`platform.mentionPatternsHint`)},{default:o(()=>[e(_(w),{"default-value":(_(a).whatsapp.mention_patterns||[]).join(`, `),loading:T(`whatsapp`,`mention_patterns`),size:`small`,placeholder:`pattern1, pattern2`,onChange:c[20]||=e=>F(`whatsapp`,`mention_patterns`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`matrix`?(i(),n(b,{key:4},[e(P,{label:_(p)(`platform.accessToken`),hint:_(p)(`platform.accessTokenHint`)},{default:o(()=>[e(_(w),{"default-value":L(`matrix`).token||``,loading:T(`matrix`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`syt_...`,onChange:c[21]||=e=>I(`matrix`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.homeserver`),hint:_(p)(`platform.homeserverHint`)},{default:o(()=>[e(_(w),{"default-value":L(`matrix`).extra?.homeserver||``,loading:T(`matrix`,`homeserver`),clearable:``,size:`small`,class:`input-lg`,placeholder:`https://matrix.org`,onChange:c[22]||=e=>I(`matrix`,`homeserver`,{extra:{...L(`matrix`).extra,homeserver:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionRoom`)},{default:o(()=>[e(_(D),{value:_(a).matrix.require_mention,loading:T(`matrix`,`require_mention`),"onUpdate:value":c[23]||=e=>F(`matrix`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.autoThread`),hint:_(p)(`platform.autoThreadHintRoom`)},{default:o(()=>[e(_(D),{value:_(a).matrix.auto_thread,loading:T(`matrix`,`auto_thread`),"onUpdate:value":c[24]||=e=>F(`matrix`,`auto_thread`,{auto_thread:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.dmMentionThreads`),hint:_(p)(`platform.dmMentionThreadsHint`)},{default:o(()=>[e(_(D),{value:_(a).matrix.dm_mention_threads,loading:T(`matrix`,`dm_mention_threads`),"onUpdate:value":c[25]||=e=>F(`matrix`,`dm_mention_threads`,{dm_mention_threads:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseRooms`),hint:_(p)(`platform.freeResponseRoomsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).matrix.free_response_rooms||``,loading:T(`matrix`,`free_response_rooms`),size:`small`,placeholder:`room_id1,room_id2`,onChange:c[26]||=e=>F(`matrix`,`free_response_rooms`,{free_response_rooms:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`feishu`?(i(),n(b,{key:5},[e(P,{label:_(p)(`platform.appId`),hint:_(p)(`platform.appIdHint`)},{default:o(()=>[e(_(w),{"default-value":L(`feishu`).extra?.app_id||``,loading:T(`feishu`,`app_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`cli_...`,onChange:c[27]||=e=>I(`feishu`,`app_id`,{extra:{...L(`feishu`).extra,app_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.appSecret`),hint:_(p)(`platform.appSecretHint`)},{default:o(()=>[e(_(w),{"default-value":L(`feishu`).extra?.app_secret||``,loading:T(`feishu`,`app_secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`App Secret`,onChange:c[28]||=e=>I(`feishu`,`app_secret`,{extra:{...L(`feishu`).extra,app_secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionGroup`)},{default:o(()=>[e(_(D),{value:_(a).feishu.require_mention,loading:T(`feishu`,`require_mention`),"onUpdate:value":c[29]||=e=>F(`feishu`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChats`),hint:_(p)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).feishu.free_response_chats||``,loading:T(`feishu`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:c[30]||=e=>F(`feishu`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`dingtalk`?(i(),n(b,{key:6},[e(P,{label:_(p)(`platform.clientId`),hint:_(p)(`platform.clientIdHint`)},{default:o(()=>[e(_(w),{"default-value":L(`dingtalk`).extra?.client_id||``,loading:T(`dingtalk`,`client_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Client ID`,onChange:c[31]||=e=>I(`dingtalk`,`client_id`,{extra:{...L(`dingtalk`).extra,client_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.clientSecret`),hint:_(p)(`platform.clientSecretHint`)},{default:o(()=>[e(_(w),{"default-value":L(`dingtalk`).extra?.client_secret||``,loading:T(`dingtalk`,`client_secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Client Secret`,onChange:c[32]||=e=>I(`dingtalk`,`client_secret`,{extra:{...L(`dingtalk`).extra,client_secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.requireMention`),hint:_(p)(`platform.requireMentionGroup`)},{default:o(()=>[e(_(D),{value:_(a).dingtalk.require_mention,loading:T(`dingtalk`,`require_mention`),"onUpdate:value":c[33]||=e=>F(`dingtalk`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.freeResponseChats`),hint:_(p)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(_(w),{"default-value":_(a).dingtalk.free_response_chats||``,loading:T(`dingtalk`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:c[34]||=e=>F(`dingtalk`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`weixin`?(i(),n(b,{key:7},[y(`div`,V,[G.value===`idle`||G.value===`error`||G.value===`expired`||G.value===`confirmed`?(i(),s(_(C),{key:0,type:`primary`,size:`small`,onClick:q},{default:o(()=>[m(f(G.value===`confirmed`?_(p)(`platform.qrRelogin`):_(p)(`platform.qrLogin`)),1)]),_:1})):r(``,!0),G.value===`loading`?(i(),n(`div`,H,[e(l,{size:`small`}),y(`span`,null,f(_(p)(`platform.qrFetching`)),1)])):r(``,!0),G.value===`waiting`||G.value===`scaned`?(i(),n(`div`,U,f(G.value===`scaned`?_(p)(`platform.qrScanedHint`):_(p)(`platform.qrScanHint`)),1)):r(``,!0)]),e(P,{label:_(p)(`platform.weixinToken`),hint:_(p)(`platform.weixinTokenHint`)},{default:o(()=>[e(_(w),{"default-value":L(`weixin`).token||``,loading:T(`weixin`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Token`,onChange:c[35]||=e=>I(`weixin`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.accountId`),hint:_(p)(`platform.accountIdHint`)},{default:o(()=>[e(_(w),{"default-value":L(`weixin`).extra?.account_id||``,loading:T(`weixin`,`account_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Account ID`,onChange:c[36]||=e=>I(`weixin`,`account_id`,{extra:{...L(`weixin`).extra,account_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`wecom`?(i(),n(b,{key:8},[e(P,{label:_(p)(`platform.botId`),hint:_(p)(`platform.botIdHint`)},{default:o(()=>[e(_(w),{"default-value":L(`wecom`).extra?.bot_id||``,loading:T(`wecom`,`bot_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Bot ID`,onChange:c[37]||=e=>I(`wecom`,`bot_id`,{extra:{...L(`wecom`).extra,bot_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),e(P,{label:_(p)(`platform.appSecret`),hint:_(p)(`platform.wecomSecretHint`)},{default:o(()=>[e(_(w),{"default-value":L(`wecom`).extra?.secret||``,loading:T(`wecom`,`secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Secret`,onChange:c[38]||=e=>I(`wecom`,`secret`,{extra:{...L(`wecom`).extra,secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0)]),_:2},1032,[`name`,`icon`,`config`,`credentials`])),64))])}}}),[[`__scopeId`,`data-v-c7999829`]]),G={class:`channels-view`},K={class:`page-header`},q={class:`header-title`},J={class:`channels-content`},Y=S(p({__name:`ChannelsView`,setup(t){let a=j(),{t:l}=x();return c(()=>{a.fetchSettings()}),(t,c)=>(i(),n(`div`,G,[y(`header`,K,[y(`h2`,q,f(_(l)(`sidebar.channels`)),1)]),y(`div`,J,[e(_(O),{show:_(a).loading||_(a).saving,size:`large`,description:_(l)(`common.loading`)},{default:o(()=>[_(a).loading?r(``,!0):(i(),s(W,{key:0}))]),_:1},8,[`show`,`description`])])]))}}),[[`__scopeId`,`data-v-e25dbf6c`]]);export{Y as default};
1
+ import{$ as e,A as t,D as n,E as r,G as i,J as a,K as o,M as s,O as c,T as l,W as u,X as d,Y as f,_t as p,b as m,ht as h,j as g,lt as _,mt as v,st as y,w as b}from"./router-kR4kqS2l.js";import{r as x,t as S}from"./_plugin-vue_export-helper-Bl_Pm_OI.js";import{t as C}from"./Button-vKfgky-Y.js";import{t as w}from"./Input-BS71ZaoJ.js";import{t as T}from"./Tag-BWD1u63m.js";import{t as E}from"./use-message-sSsrvqld.js";import{t as D}from"./Spin-DKwUVt1F.js";import{t as O}from"./Switch-DG-3EwdR.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./SettingRow-Cz749k-e.js";var F={class:`platform-info`},I=[`innerHTML`],L={class:`platform-name`},R={key:0,class:`platform-card-body`},z=S(s({__name:`PlatformCard`,props:{name:{},icon:{},config:{},credentials:{}},setup(r){let i=r,a=_(!0),{t:s}=x(),u=b(()=>{let e=i.credentials;if(!e)return!1;let t=[`token`,`api_key`,`app_id`,`client_id`,`secret`,`app_secret`,`client_secret`,`access_token`,`bot_id`,`account_id`,`enabled`];return[e,e.extra].filter(Boolean).some(e=>t.some(t=>{let n=e[t];return n!=null&&n!==``&&n!==!1}))});return(i,d)=>(o(),c(`div`,{class:h([`platform-card`,{configured:u.value}])},[l(`div`,{class:`platform-card-header`,onClick:d[0]||=e=>a.value=!a.value},[l(`div`,F,[l(`span`,{class:`platform-icon`,innerHTML:r.icon},null,8,I),l(`span`,L,p(r.name),1),g(v(T),{type:u.value?`success`:`default`,size:`small`,round:``},{default:e(()=>[t(p(u.value?v(s)(`common.configured`):v(s)(`common.notConfigured`)),1)]),_:1},8,[`type`])]),l(`span`,{class:h([`expand-icon`,{expanded:a.value}])},`▾`,2)]),a.value?(o(),c(`div`,R,[f(i.$slots,`default`,{},void 0,!0)])):n(``,!0)],2))}}),[[`__scopeId`,`data-v-cee18614`]]),B={class:`settings-section`},V={class:`weixin-qr-section`},H={key:1,class:`weixin-qr-loading`},U={key:2,class:`weixin-qr-hint`},W=S(s({__name:`PlatformSettings`,setup(s){let u=j(),f=E(),{t:h}=x(),b=y({});function S(e,t){return`${e}.${t}`}function T(e,t){return!!b[S(e,t)]}async function D(e,t,n){let r=S(e,t);b[r]=!0;try{await n(),f.success(h(`settings.saved`))}catch{f.error(h(`settings.saveFailed`))}finally{b[r]=!1}}async function F(e,t,n){D(e,t,()=>u.saveSection(e,n))}async function I(e,t,n){D(e,t,async()=>{await k(e,n),await u.fetchSettings()})}function L(e){return u.platforms[e]||{}}let R=_(``),W=_(``),G=_(`idle`),K=null;async function q(){G.value=`loading`,R.value=``,W.value=``,Y();try{let e=await N();W.value=e.qrcode,R.value=e.qrcode_url,window.open(e.qrcode_url,`_blank`),G.value=`waiting`,J()}catch(e){G.value=`error`,f.error(e.message||h(`platform.qrFetching`))}}function J(){W.value&&(K=setTimeout(async()=>{try{let e=await A(W.value);e.status===`wait`?J():e.status===`scaned`?(G.value=`scaned`,J()):e.status===`expired`?G.value=`expired`:e.status===`confirmed`&&(G.value=`confirmed`,await M({account_id:e.account_id,token:e.token,base_url:e.base_url}),await u.fetchSettings(),f.success(h(`settings.saved`)))}catch{J()}},3e3))}function Y(){K&&=(clearTimeout(K),null)}i(()=>{Y()});let X=[{key:`telegram`,name:`Telegram`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>`},{key:`discord`,name:`Discord`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>`},{key:`slack`,name:`Slack`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>`},{key:`whatsapp`,name:`WhatsApp`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>`},{key:`matrix`,name:`Matrix`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>`},{key:`feishu`,name:`Feishu`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>`},{key:`weixin`,name:`Weixin`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`},{key:`wecom`,name:`WeCom`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`}];return(i,s)=>{let f=d(`NSpin`);return o(),c(`section`,B,[(o(),c(m,null,a(X,i=>g(z,{key:i.key,name:i.name,icon:i.icon,config:v(u)[i.key],credentials:L(i.key)},{default:e(()=>[i.key===`telegram`?(o(),c(m,{key:0},[g(P,{label:v(h)(`platform.botToken`),hint:v(h)(`platform.botTokenHint`)},{default:e(()=>[g(v(w),{"default-value":L(`telegram`).token||``,loading:T(`telegram`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`123456:ABC-DEF...`,onChange:s[0]||=e=>I(`telegram`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionGroup`)},{default:e(()=>[g(v(O),{value:v(u).telegram.require_mention,loading:T(`telegram`,`require_mention`),"onUpdate:value":s[1]||=e=>F(`telegram`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.reactions`),hint:v(h)(`platform.reactionsHint`)},{default:e(()=>[g(v(O),{value:v(u).telegram.reactions,loading:T(`telegram`,`reactions`),"onUpdate:value":s[2]||=e=>F(`telegram`,`reactions`,{reactions:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChats`),hint:v(h)(`platform.freeResponseChatsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).telegram.free_response_chats||``,loading:T(`telegram`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:s[3]||=e=>F(`telegram`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.mentionPatterns`),hint:v(h)(`platform.mentionPatternsHint`)},{default:e(()=>[g(v(w),{"default-value":(v(u).telegram.mention_patterns||[]).join(`, `),loading:T(`telegram`,`mention_patterns`),size:`small`,placeholder:`pattern1, pattern2`,onChange:s[4]||=e=>F(`telegram`,`mention_patterns`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`discord`?(o(),c(m,{key:1},[g(P,{label:v(h)(`platform.botToken`),hint:v(h)(`platform.botTokenHint`)},{default:e(()=>[g(v(w),{"default-value":L(`discord`).token||``,loading:T(`discord`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Bot token...`,onChange:s[5]||=e=>I(`discord`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionChannel`)},{default:e(()=>[g(v(O),{value:v(u).discord.require_mention,loading:T(`discord`,`require_mention`),"onUpdate:value":s[6]||=e=>F(`discord`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.autoThread`),hint:v(h)(`platform.autoThreadHint`)},{default:e(()=>[g(v(O),{value:v(u).discord.auto_thread,loading:T(`discord`,`auto_thread`),"onUpdate:value":s[7]||=e=>F(`discord`,`auto_thread`,{auto_thread:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.reactions`),hint:v(h)(`platform.reactionsHint`)},{default:e(()=>[g(v(O),{value:v(u).discord.reactions,loading:T(`discord`,`reactions`),"onUpdate:value":s[8]||=e=>F(`discord`,`reactions`,{reactions:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChannels`),hint:v(h)(`platform.freeResponseChannelsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).discord.free_response_channels||``,loading:T(`discord`,`free_response_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:s[9]||=e=>F(`discord`,`free_response_channels`,{free_response_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.allowedChannels`),hint:v(h)(`platform.allowedChannelsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).discord.allowed_channels||``,loading:T(`discord`,`allowed_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:s[10]||=e=>F(`discord`,`allowed_channels`,{allowed_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.ignoredChannels`),hint:v(h)(`platform.ignoredChannelsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).discord.ignored_channels||``,loading:T(`discord`,`ignored_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:s[11]||=e=>F(`discord`,`ignored_channels`,{ignored_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.noThreadChannels`),hint:v(h)(`platform.noThreadChannelsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).discord.no_thread_channels||``,loading:T(`discord`,`no_thread_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:s[12]||=e=>F(`discord`,`no_thread_channels`,{no_thread_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`slack`?(o(),c(m,{key:2},[g(P,{label:v(h)(`platform.botToken`),hint:v(h)(`platform.botTokenHint`)},{default:e(()=>[g(v(w),{"default-value":L(`slack`).token||``,loading:T(`slack`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`xoxb-...`,onChange:s[13]||=e=>I(`slack`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionChannel`)},{default:e(()=>[g(v(O),{value:v(u).slack.require_mention,loading:T(`slack`,`require_mention`),"onUpdate:value":s[14]||=e=>F(`slack`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.allowBots`),hint:v(h)(`platform.allowBotsHint`)},{default:e(()=>[g(v(O),{value:v(u).slack.allow_bots,loading:T(`slack`,`allow_bots`),"onUpdate:value":s[15]||=e=>F(`slack`,`allow_bots`,{allow_bots:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChannels`),hint:v(h)(`platform.freeResponseChannelsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).slack.free_response_channels||``,loading:T(`slack`,`free_response_channels`),size:`small`,placeholder:`channel_id1,channel_id2`,onChange:s[16]||=e=>F(`slack`,`free_response_channels`,{free_response_channels:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`whatsapp`?(o(),c(m,{key:3},[g(P,{label:v(h)(`platform.waEnabled`),hint:v(h)(`platform.waEnabledHint`)},{default:e(()=>[g(v(O),{value:L(`whatsapp`).enabled,loading:T(`whatsapp`,`enabled`),"onUpdate:value":s[17]||=e=>I(`whatsapp`,`enabled`,{enabled:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionGroup`)},{default:e(()=>[g(v(O),{value:v(u).whatsapp.require_mention,loading:T(`whatsapp`,`require_mention`),"onUpdate:value":s[18]||=e=>F(`whatsapp`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChats`),hint:v(h)(`platform.freeResponseChatsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).whatsapp.free_response_chats||``,loading:T(`whatsapp`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:s[19]||=e=>F(`whatsapp`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.mentionPatterns`),hint:v(h)(`platform.mentionPatternsHint`)},{default:e(()=>[g(v(w),{"default-value":(v(u).whatsapp.mention_patterns||[]).join(`, `),loading:T(`whatsapp`,`mention_patterns`),size:`small`,placeholder:`pattern1, pattern2`,onChange:s[20]||=e=>F(`whatsapp`,`mention_patterns`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`matrix`?(o(),c(m,{key:4},[g(P,{label:v(h)(`platform.accessToken`),hint:v(h)(`platform.accessTokenHint`)},{default:e(()=>[g(v(w),{"default-value":L(`matrix`).token||``,loading:T(`matrix`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`syt_...`,onChange:s[21]||=e=>I(`matrix`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.homeserver`),hint:v(h)(`platform.homeserverHint`)},{default:e(()=>[g(v(w),{"default-value":L(`matrix`).extra?.homeserver||``,loading:T(`matrix`,`homeserver`),clearable:``,size:`small`,class:`input-lg`,placeholder:`https://matrix.org`,onChange:s[22]||=e=>I(`matrix`,`homeserver`,{extra:{...L(`matrix`).extra,homeserver:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionRoom`)},{default:e(()=>[g(v(O),{value:v(u).matrix.require_mention,loading:T(`matrix`,`require_mention`),"onUpdate:value":s[23]||=e=>F(`matrix`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.autoThread`),hint:v(h)(`platform.autoThreadHintRoom`)},{default:e(()=>[g(v(O),{value:v(u).matrix.auto_thread,loading:T(`matrix`,`auto_thread`),"onUpdate:value":s[24]||=e=>F(`matrix`,`auto_thread`,{auto_thread:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.dmMentionThreads`),hint:v(h)(`platform.dmMentionThreadsHint`)},{default:e(()=>[g(v(O),{value:v(u).matrix.dm_mention_threads,loading:T(`matrix`,`dm_mention_threads`),"onUpdate:value":s[25]||=e=>F(`matrix`,`dm_mention_threads`,{dm_mention_threads:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseRooms`),hint:v(h)(`platform.freeResponseRoomsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).matrix.free_response_rooms||``,loading:T(`matrix`,`free_response_rooms`),size:`small`,placeholder:`room_id1,room_id2`,onChange:s[26]||=e=>F(`matrix`,`free_response_rooms`,{free_response_rooms:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`feishu`?(o(),c(m,{key:5},[g(P,{label:v(h)(`platform.appId`),hint:v(h)(`platform.appIdHint`)},{default:e(()=>[g(v(w),{"default-value":L(`feishu`).extra?.app_id||``,loading:T(`feishu`,`app_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`cli_...`,onChange:s[27]||=e=>I(`feishu`,`app_id`,{extra:{...L(`feishu`).extra,app_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.appSecret`),hint:v(h)(`platform.appSecretHint`)},{default:e(()=>[g(v(w),{"default-value":L(`feishu`).extra?.app_secret||``,loading:T(`feishu`,`app_secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`App Secret`,onChange:s[28]||=e=>I(`feishu`,`app_secret`,{extra:{...L(`feishu`).extra,app_secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionGroup`)},{default:e(()=>[g(v(O),{value:v(u).feishu.require_mention,loading:T(`feishu`,`require_mention`),"onUpdate:value":s[29]||=e=>F(`feishu`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChats`),hint:v(h)(`platform.freeResponseChatsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).feishu.free_response_chats||``,loading:T(`feishu`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:s[30]||=e=>F(`feishu`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`dingtalk`?(o(),c(m,{key:6},[g(P,{label:v(h)(`platform.clientId`),hint:v(h)(`platform.clientIdHint`)},{default:e(()=>[g(v(w),{"default-value":L(`dingtalk`).extra?.client_id||``,loading:T(`dingtalk`,`client_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Client ID`,onChange:s[31]||=e=>I(`dingtalk`,`client_id`,{extra:{...L(`dingtalk`).extra,client_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.clientSecret`),hint:v(h)(`platform.clientSecretHint`)},{default:e(()=>[g(v(w),{"default-value":L(`dingtalk`).extra?.client_secret||``,loading:T(`dingtalk`,`client_secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Client Secret`,onChange:s[32]||=e=>I(`dingtalk`,`client_secret`,{extra:{...L(`dingtalk`).extra,client_secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.requireMention`),hint:v(h)(`platform.requireMentionGroup`)},{default:e(()=>[g(v(O),{value:v(u).dingtalk.require_mention,loading:T(`dingtalk`,`require_mention`),"onUpdate:value":s[33]||=e=>F(`dingtalk`,`require_mention`,{require_mention:e})},null,8,[`value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.freeResponseChats`),hint:v(h)(`platform.freeResponseChatsHint`)},{default:e(()=>[g(v(w),{"default-value":v(u).dingtalk.free_response_chats||``,loading:T(`dingtalk`,`free_response_chats`),size:`small`,placeholder:`chat_id1,chat_id2`,onChange:s[34]||=e=>F(`dingtalk`,`free_response_chats`,{free_response_chats:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`weixin`?(o(),c(m,{key:7},[l(`div`,V,[G.value===`idle`||G.value===`error`||G.value===`expired`||G.value===`confirmed`?(o(),r(v(C),{key:0,type:`primary`,size:`small`,onClick:q},{default:e(()=>[t(p(G.value===`confirmed`?v(h)(`platform.qrRelogin`):v(h)(`platform.qrLogin`)),1)]),_:1})):n(``,!0),G.value===`loading`?(o(),c(`div`,H,[g(f,{size:`small`}),l(`span`,null,p(v(h)(`platform.qrFetching`)),1)])):n(``,!0),G.value===`waiting`||G.value===`scaned`?(o(),c(`div`,U,p(G.value===`scaned`?v(h)(`platform.qrScanedHint`):v(h)(`platform.qrScanHint`)),1)):n(``,!0)]),g(P,{label:v(h)(`platform.weixinToken`),hint:v(h)(`platform.weixinTokenHint`)},{default:e(()=>[g(v(w),{"default-value":L(`weixin`).token||``,loading:T(`weixin`,`token`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Token`,onChange:s[35]||=e=>I(`weixin`,`token`,{token:e})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.accountId`),hint:v(h)(`platform.accountIdHint`)},{default:e(()=>[g(v(w),{"default-value":L(`weixin`).extra?.account_id||``,loading:T(`weixin`,`account_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Account ID`,onChange:s[36]||=e=>I(`weixin`,`account_id`,{extra:{...L(`weixin`).extra,account_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0),i.key===`wecom`?(o(),c(m,{key:8},[g(P,{label:v(h)(`platform.botId`),hint:v(h)(`platform.botIdHint`)},{default:e(()=>[g(v(w),{"default-value":L(`wecom`).extra?.bot_id||``,loading:T(`wecom`,`bot_id`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Bot ID`,onChange:s[37]||=e=>I(`wecom`,`bot_id`,{extra:{...L(`wecom`).extra,bot_id:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`]),g(P,{label:v(h)(`platform.appSecret`),hint:v(h)(`platform.wecomSecretHint`)},{default:e(()=>[g(v(w),{"default-value":L(`wecom`).extra?.secret||``,loading:T(`wecom`,`secret`),clearable:``,size:`small`,class:`input-lg`,placeholder:`Secret`,onChange:s[38]||=e=>I(`wecom`,`secret`,{extra:{...L(`wecom`).extra,secret:e}})},null,8,[`default-value`,`loading`])]),_:1},8,[`label`,`hint`])],64)):n(``,!0)]),_:2},1032,[`name`,`icon`,`config`,`credentials`])),64))])}}}),[[`__scopeId`,`data-v-c7999829`]]),G={class:`channels-view`},K={class:`page-header`},q={class:`header-title`},J={class:`channels-content`},Y=S(s({__name:`ChannelsView`,setup(t){let i=j(),{t:a}=x();return u(()=>{i.fetchSettings()}),(t,s)=>(o(),c(`div`,G,[l(`header`,K,[l(`h2`,q,p(v(a)(`sidebar.channels`)),1)]),l(`div`,J,[g(v(D),{show:v(i).loading||v(i).saving,size:`large`,description:v(a)(`common.loading`)},{default:e(()=>[v(i).loading?n(``,!0):(o(),r(W,{key:0}))]),_:1},8,[`show`,`description`])])]))}}),[[`__scopeId`,`data-v-e25dbf6c`]]);export{Y as default};
@@ -0,0 +1,127 @@
1
+ import{$ as e,A as t,D as n,E as r,G as i,H as a,I as o,J as s,K as c,M as l,O as u,P as d,R as f,T as p,V as m,W as h,Z as g,_,_t as v,b as y,ct as b,et as x,f as S,ft as C,gt as w,h as T,ht as E,j as D,lt as O,mt as k,q as A,s as j,st as M,v as N,w as P,z as F}from"./router-kR4kqS2l.js";import{r as I,t as L}from"./_plugin-vue_export-helper-Bl_Pm_OI.js";import{t as R}from"./logo-Cd-t_oGE.js";import{$ as z,B,X as V,c as H,ct as U,dt as W,ft as ee,pt as G,q as K,st as q,tt as J,ut as Y,z as te}from"./browser-DlPqZ-4M.js";import{C as ne,E as re,N as X,S as ie,T as ae,c as Z,g as oe,k as se,l as ce,m as le,n as ue,o as de,r as fe,t as pe}from"./Popover-CXrjClQw.js";import{r as me,t as he}from"./create-5zWq3BEB.js";import{d as ge,f as _e,p as ve,r as ye}from"./Suffix-C1Mw6UwH.js";import{t as be}from"./Modal-6Bv1v4kO.js";import{t as Q}from"./Button-vKfgky-Y.js";import{t as xe}from"./Input-BS71ZaoJ.js";import{i as Se,n as Ce,t as we}from"./chat-3-o9JAHE.js";import{t as Te}from"./Tooltip-Dka1-DNs.js";import{t as Ee}from"./use-message-sSsrvqld.js";import{t as De}from"./Popconfirm-Bpz_dC1j.js";import{t as Oe}from"./useTheme-DgQIobZP.js";import{t as ke}from"./app-y8cD3FPg.js";import{t as Ae}from"./profiles-1vZTTlBc.js";import{n as je,o as Me}from"./sessions-CJI89wYu.js";import{t as Ne}from"./session-browser-prefs-BI-rZu2N.js";import{i as Pe,n as Fe,r as Ie,t as Le}from"./MarkdownRenderer-B7t0ZEw0.js";function Re(e={},t){let n=M({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:r,keyup:i}=e,o=e=>{switch(e.key){case`Control`:n.ctrl=!0;break;case`Meta`:n.command=!0,n.win=!0;break;case`Shift`:n.shift=!0;break;case`Tab`:n.tab=!0;break}r!==void 0&&Object.keys(r).forEach(t=>{if(t!==e.key)return;let n=r[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},s=e=>{switch(e.key){case`Control`:n.ctrl=!1;break;case`Meta`:n.command=!1,n.win=!1;break;case`Shift`:n.shift=!1;break;case`Tab`:n.tab=!1;break}i!==void 0&&Object.keys(i).forEach(t=>{if(t!==e.key)return;let n=i[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},c=()=>{(t===void 0||t.value)&&(ve(`keydown`,document,o),ve(`keyup`,document,s)),t!==void 0&&g(t,e=>{e?(ve(`keydown`,document,o),ve(`keyup`,document,s)):(_e(`keydown`,document,o),_e(`keyup`,document,s))})};return X()?(m(c),a(()=>{(t===void 0||t.value)&&(_e(`keydown`,document,o),_e(`keyup`,document,s))})):c(),b(n)}function ze(e,t,n){if(!t)return e;let r=O(e.value),i=null;return g(e,e=>{i!==null&&window.clearTimeout(i),e===!0?n&&!n.value?r.value=!0:i=window.setTimeout(()=>{r.value=!0},t):r.value=!1}),r}function Be(e){return t=>{t?e.value=t.$el:e.value=null}}var Ve=l({name:`ChevronRight`,render(){return d(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},d(`path`,{d:`M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z`,fill:`currentColor`}))}}),He=z(`n-dropdown-menu`),Ue=z(`n-dropdown`),We=z(`n-dropdown-option`),Ge=l({name:`DropdownDivider`,props:{clsPrefix:{type:String,required:!0}},render(){return d(`div`,{class:`${this.clsPrefix}-dropdown-divider`})}}),Ke=l({name:`DropdownGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{showIconRef:e,hasSubmenuRef:t}=o(He),{renderLabelRef:n,labelFieldRef:r,nodePropsRef:i,renderOptionRef:a}=o(Ue);return{labelField:r,showIcon:e,hasSubmenu:t,renderLabel:n,nodeProps:i,renderOption:a}},render(){let{clsPrefix:e,hasSubmenu:t,showIcon:n,nodeProps:r,renderLabel:i,renderOption:a}=this,{rawNode:o}=this.tmNode,s=d(`div`,Object.assign({class:`${e}-dropdown-option`},r?.(o)),d(`div`,{class:`${e}-dropdown-option-body ${e}-dropdown-option-body--group`},d(`div`,{"data-dropdown-option":!0,class:[`${e}-dropdown-option-body__prefix`,n&&`${e}-dropdown-option-body__prefix--show-icon`]},Z(o.icon)),d(`div`,{class:`${e}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(o):Z(o.title??o[this.labelField])),d(`div`,{class:[`${e}-dropdown-option-body__suffix`,t&&`${e}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:s,option:o}):s}}),qe=U(`icon`,`
2
+ height: 1em;
3
+ width: 1em;
4
+ line-height: 1em;
5
+ text-align: center;
6
+ display: inline-block;
7
+ position: relative;
8
+ fill: currentColor;
9
+ `,[W(`color-transition`,{transition:`color .3s var(--n-bezier)`}),W(`depth`,{color:`var(--n-color)`},[q(`svg`,{opacity:`var(--n-opacity)`,transition:`opacity .3s var(--n-bezier)`})]),q(`svg`,{height:`1em`,width:`1em`})]),Je=l({_n_icon__:!0,name:`Icon`,inheritAttrs:!1,props:Object.assign(Object.assign({},H.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=B(e),r=H(`Icon`,`-icon`,qe,Ce,e,t),i=P(()=>{let{depth:t}=e,{common:{cubicBezierEaseInOut:n},self:i}=r.value;if(t!==void 0){let{color:e,[`opacity${t}Depth`]:r}=i;return{"--n-bezier":n,"--n-color":e,"--n-opacity":r}}return{"--n-bezier":n,"--n-color":``,"--n-opacity":``}}),a=n?te(`icon`,P(()=>`${e.depth||`d`}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:P(()=>{let{size:t,color:n}=e;return{fontSize:le(t),color:n}}),cssVars:n?void 0:i,themeClass:a?.themeClass,onRender:a?.onRender}},render(){let{$parent:e,depth:t,mergedClsPrefix:n,component:r,onRender:i,themeClass:a}=this;return e?.$options?._n_icon__&&V(`icon`,"don't wrap `n-icon` inside `n-icon`"),i?.(),d(`i`,f(this.$attrs,{role:`img`,class:[`${n}-icon`,a,{[`${n}-icon--depth`]:t,[`${n}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),r?d(r):this.$slots)}});function Ye(e,t){return e.type===`submenu`||e.type===void 0&&e[t]!==void 0}function Xe(e){return e.type===`group`}function Ze(e){return e.type===`divider`}function Qe(e){return e.type===`render`}var $e=l({name:`DropdownOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:`right-start`},props:Object,scrollable:Boolean},setup(e){let t=o(Ue),{hoverKeyRef:n,keyboardKeyRef:r,lastToggledSubmenuKeyRef:i,pendingKeyPathRef:a,activeKeyPathRef:s,animatedRef:c,mergedShowRef:l,renderLabelRef:u,renderIconRef:d,labelFieldRef:f,childrenFieldRef:p,renderOptionRef:m,nodePropsRef:h,menuPropsRef:g}=t,_=o(We,null),v=o(He),y=o(ae),b=P(()=>e.tmNode.rawNode),x=P(()=>{let{value:t}=p;return Ye(e.tmNode.rawNode,t)}),S=P(()=>{let{disabled:t}=e.tmNode;return t}),C=ze(P(()=>{if(!x.value)return!1;let{key:t,disabled:o}=e.tmNode;if(o)return!1;let{value:s}=n,{value:c}=r,{value:l}=i,{value:u}=a;return s===null?c===null?l===null?!1:u.includes(t):u.includes(t)&&u[u.length-1]!==t:u.includes(t)}),300,P(()=>r.value===null&&!c.value)),w=P(()=>!!_?.enteringSubmenuRef.value),T=O(!1);A(We,{enteringSubmenuRef:T});function E(){T.value=!0}function D(){T.value=!1}function k(){let{parentKey:t,tmNode:a}=e;a.disabled||l.value&&(i.value=t,r.value=null,n.value=a.key)}function j(){let{tmNode:t}=e;t.disabled||l.value&&n.value!==t.key&&k()}function M(t){if(e.tmNode.disabled||!l.value)return;let{relatedTarget:r}=t;r&&!me({target:r},`dropdownOption`)&&!me({target:r},`scrollbarRail`)&&(n.value=null)}function N(){let{value:n}=x,{tmNode:r}=e;l.value&&!n&&!r.disabled&&(t.doSelect(r.key,r.rawNode),t.doUpdateShow(!1))}return{labelField:f,renderLabel:u,renderIcon:d,siblingHasIcon:v.showIconRef,siblingHasSubmenu:v.hasSubmenuRef,menuProps:g,popoverBody:y,animated:c,mergedShowSubmenu:P(()=>C.value&&!w.value),rawNode:b,hasSubmenu:x,pending:J(()=>{let{value:t}=a,{key:n}=e.tmNode;return t.includes(n)}),childActive:J(()=>{let{value:t}=s,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r===-1?!1:r<t.length-1}),active:J(()=>{let{value:t}=s,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r===-1?!1:r===t.length-1}),mergedDisabled:S,renderOption:m,nodeProps:h,handleClick:N,handleMouseMove:j,handleMouseEnter:k,handleMouseLeave:M,handleSubmenuBeforeEnter:E,handleSubmenuAfterEnter:D}},render(){let{animated:e,rawNode:t,mergedShowSubmenu:n,clsPrefix:r,siblingHasIcon:i,siblingHasSubmenu:a,renderLabel:o,renderIcon:s,renderOption:c,nodeProps:l,props:u,scrollable:p}=this,m=null;if(n){let e=this.menuProps?.call(this,t,t.children);m=d(nt,Object.assign({},e,{clsPrefix:r,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}let h={class:[`${r}-dropdown-option-body`,this.pending&&`${r}-dropdown-option-body--pending`,this.active&&`${r}-dropdown-option-body--active`,this.childActive&&`${r}-dropdown-option-body--child-active`,this.mergedDisabled&&`${r}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},g=l?.(t),_=d(`div`,Object.assign({class:[`${r}-dropdown-option`,g?.class],"data-dropdown-option":!0},g),d(`div`,f(h,u),[d(`div`,{class:[`${r}-dropdown-option-body__prefix`,i&&`${r}-dropdown-option-body__prefix--show-icon`]},[s?s(t):Z(t.icon)]),d(`div`,{"data-dropdown-option":!0,class:`${r}-dropdown-option-body__label`},o?o(t):Z(t[this.labelField]??t.title)),d(`div`,{"data-dropdown-option":!0,class:[`${r}-dropdown-option-body__suffix`,a&&`${r}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?d(Je,null,{default:()=>d(Ve,null)}):null)]),this.hasSubmenu?d(ne,null,{default:()=>[d(ie,null,{default:()=>d(`div`,{class:`${r}-dropdown-offset-container`},d(oe,{show:this.mergedShowSubmenu,placement:this.placement,to:p&&this.popoverBody||void 0,teleportDisabled:!p},{default:()=>d(`div`,{class:`${r}-dropdown-menu-wrapper`},e?d(S,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:`fade-in-scale-up-transition`,appear:!0},{default:()=>m}):m)}))})]}):null);return c?c({node:_,option:t}):_}}),et=l({name:`NDropdownGroup`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){let{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:r}=e;return d(y,null,d(Ke,{clsPrefix:n,tmNode:e,key:e.key}),r?.map(e=>{let{rawNode:r}=e;return r.show===!1?null:Ze(r)?d(Ge,{clsPrefix:n,key:e.key}):e.isGroup?(V(`dropdown`,"`group` node is not allowed to be put in `group` node."),null):d($e,{clsPrefix:n,tmNode:e,parentKey:t,key:e.key})}))}}),tt=l({name:`DropdownRenderOption`,props:{tmNode:{type:Object,required:!0}},render(){let{rawNode:{render:e,props:t}}=this.tmNode;return d(`div`,t,[e?.()])}}),nt=l({name:`DropdownMenu`,props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){let{renderIconRef:t,childrenFieldRef:n}=o(Ue);A(He,{showIconRef:P(()=>{let n=t.value;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>n?n(e):e.icon);let{rawNode:t}=e;return n?n(t):t.icon})}),hasSubmenuRef:P(()=>{let{value:t}=n;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>Ye(e,t));let{rawNode:n}=e;return Ye(n,t)})})});let r=O(null);return A(re,null),A(se,null),A(ae,r),{bodyRef:r}},render(){let{parentKey:e,clsPrefix:t,scrollable:n}=this,r=this.tmNodes.map(r=>{let{rawNode:i}=r;return i.show===!1?null:Qe(i)?d(tt,{tmNode:r,key:r.key}):Ze(i)?d(Ge,{clsPrefix:t,key:r.key}):Xe(i)?d(et,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key}):d($e,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key,props:i.props,scrollable:n})});return d(`div`,{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:`bodyRef`},n?d(ye,{contentClass:`${t}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?fe({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),rt=U(`dropdown-menu`,`
10
+ transform-origin: var(--v-transform-origin);
11
+ background-color: var(--n-color);
12
+ border-radius: var(--n-border-radius);
13
+ box-shadow: var(--n-box-shadow);
14
+ position: relative;
15
+ transition:
16
+ background-color .3s var(--n-bezier),
17
+ box-shadow .3s var(--n-bezier);
18
+ `,[de(),U(`dropdown-option`,`
19
+ position: relative;
20
+ `,[q(`a`,`
21
+ text-decoration: none;
22
+ color: inherit;
23
+ outline: none;
24
+ `,[q(`&::before`,`
25
+ content: "";
26
+ position: absolute;
27
+ left: 0;
28
+ right: 0;
29
+ top: 0;
30
+ bottom: 0;
31
+ `)]),U(`dropdown-option-body`,`
32
+ display: flex;
33
+ cursor: pointer;
34
+ position: relative;
35
+ height: var(--n-option-height);
36
+ line-height: var(--n-option-height);
37
+ font-size: var(--n-font-size);
38
+ color: var(--n-option-text-color);
39
+ transition: color .3s var(--n-bezier);
40
+ `,[q(`&::before`,`
41
+ content: "";
42
+ position: absolute;
43
+ top: 0;
44
+ bottom: 0;
45
+ left: 4px;
46
+ right: 4px;
47
+ transition: background-color .3s var(--n-bezier);
48
+ border-radius: var(--n-border-radius);
49
+ `),ee(`disabled`,[W(`pending`,`
50
+ color: var(--n-option-text-color-hover);
51
+ `,[Y(`prefix, suffix`,`
52
+ color: var(--n-option-text-color-hover);
53
+ `),q(`&::before`,`background-color: var(--n-option-color-hover);`)]),W(`active`,`
54
+ color: var(--n-option-text-color-active);
55
+ `,[Y(`prefix, suffix`,`
56
+ color: var(--n-option-text-color-active);
57
+ `),q(`&::before`,`background-color: var(--n-option-color-active);`)]),W(`child-active`,`
58
+ color: var(--n-option-text-color-child-active);
59
+ `,[Y(`prefix, suffix`,`
60
+ color: var(--n-option-text-color-child-active);
61
+ `)])]),W(`disabled`,`
62
+ cursor: not-allowed;
63
+ opacity: var(--n-option-opacity-disabled);
64
+ `),W(`group`,`
65
+ font-size: calc(var(--n-font-size) - 1px);
66
+ color: var(--n-group-header-text-color);
67
+ `,[Y(`prefix`,`
68
+ width: calc(var(--n-option-prefix-width) / 2);
69
+ `,[W(`show-icon`,`
70
+ width: calc(var(--n-option-icon-prefix-width) / 2);
71
+ `)])]),Y(`prefix`,`
72
+ width: var(--n-option-prefix-width);
73
+ display: flex;
74
+ justify-content: center;
75
+ align-items: center;
76
+ color: var(--n-prefix-color);
77
+ transition: color .3s var(--n-bezier);
78
+ z-index: 1;
79
+ `,[W(`show-icon`,`
80
+ width: var(--n-option-icon-prefix-width);
81
+ `),U(`icon`,`
82
+ font-size: var(--n-option-icon-size);
83
+ `)]),Y(`label`,`
84
+ white-space: nowrap;
85
+ flex: 1;
86
+ z-index: 1;
87
+ `),Y(`suffix`,`
88
+ box-sizing: border-box;
89
+ flex-grow: 0;
90
+ flex-shrink: 0;
91
+ display: flex;
92
+ justify-content: flex-end;
93
+ align-items: center;
94
+ min-width: var(--n-option-suffix-width);
95
+ padding: 0 8px;
96
+ transition: color .3s var(--n-bezier);
97
+ color: var(--n-suffix-color);
98
+ z-index: 1;
99
+ `,[W(`has-submenu`,`
100
+ width: var(--n-option-icon-suffix-width);
101
+ `),U(`icon`,`
102
+ font-size: var(--n-option-icon-size);
103
+ `)]),U(`dropdown-menu`,`pointer-events: all;`)]),U(`dropdown-offset-container`,`
104
+ pointer-events: none;
105
+ position: absolute;
106
+ left: 0;
107
+ right: 0;
108
+ top: -4px;
109
+ bottom: -4px;
110
+ `)]),U(`dropdown-divider`,`
111
+ transition: background-color .3s var(--n-bezier);
112
+ background-color: var(--n-divider-color);
113
+ height: 1px;
114
+ margin: 4px 0;
115
+ `),U(`dropdown-menu-wrapper`,`
116
+ transform-origin: var(--v-transform-origin);
117
+ width: fit-content;
118
+ `),q(`>`,[U(`scrollbar`,`
119
+ height: inherit;
120
+ max-height: inherit;
121
+ `)]),ee(`scrollable`,`
122
+ padding: var(--n-padding);
123
+ `),W(`scrollable`,[Y(`content`,`
124
+ padding: var(--n-padding);
125
+ `)])]),it={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:String,inverted:Boolean,placement:{type:String,default:`bottom`},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:`label`},keyField:{type:String,default:`key`},childrenField:{type:String,default:`children`},value:[String,Number]},at=Object.keys(ue),ot=l({name:`Dropdown`,inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},ue),it),H.props),setup(e){let t=O(!1),n=ge(C(e,`show`),t),r=P(()=>{let{keyField:t,childrenField:n}=e;return he(e.options,{getKey(e){return e[t]},getDisabled(e){return e.disabled===!0},getIgnored(e){return e.type===`divider`||e.type===`render`},getChildren(e){return e[n]}})}),i=P(()=>r.value.treeNodes),a=O(null),o=O(null),s=O(null),c=P(()=>a.value??o.value??s.value??null),l=P(()=>r.value.getPath(c.value).keyPath),u=P(()=>r.value.getPath(e.value).keyPath),d=J(()=>e.keyboard&&n.value);Re({keydown:{ArrowUp:{prevent:!0,handler:T},ArrowRight:{prevent:!0,handler:w},ArrowDown:{prevent:!0,handler:E},ArrowLeft:{prevent:!0,handler:S},Enter:{prevent:!0,handler:D},Escape:x}},d);let{mergedClsPrefixRef:f,inlineThemeDisabled:p,mergedComponentPropsRef:m}=B(e),h=P(()=>e.size||m?.value?.Dropdown?.size||`medium`),_=H(`Dropdown`,`-dropdown`,rt,Se,e,f);A(Ue,{labelFieldRef:C(e,`labelField`),childrenFieldRef:C(e,`childrenField`),renderLabelRef:C(e,`renderLabel`),renderIconRef:C(e,`renderIcon`),hoverKeyRef:a,keyboardKeyRef:o,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:l,activeKeyPathRef:u,animatedRef:C(e,`animated`),mergedShowRef:n,nodePropsRef:C(e,`nodeProps`),renderOptionRef:C(e,`renderOption`),menuPropsRef:C(e,`menuProps`),doSelect:v,doUpdateShow:y}),g(n,t=>{!e.animated&&!t&&b()});function v(t,n){let{onSelect:r}=e;r&&K(r,t,n)}function y(n){let{"onUpdate:show":r,onUpdateShow:i}=e;r&&K(r,n),i&&K(i,n),t.value=n}function b(){a.value=null,o.value=null,s.value=null}function x(){y(!1)}function S(){j(`left`)}function w(){j(`right`)}function T(){j(`up`)}function E(){j(`down`)}function D(){let e=k();e?.isLeaf&&n.value&&(v(e.key,e.rawNode),y(!1))}function k(){let{value:e}=r,{value:t}=c;return!e||t===null?null:e.getNode(t)??null}function j(e){let{value:t}=c,{value:{getFirstAvailableNode:n}}=r,i=null;if(t===null){let e=n();e!==null&&(i=e.key)}else{let t=k();if(t){let n;switch(e){case`down`:n=t.getNext();break;case`up`:n=t.getPrev();break;case`right`:n=t.getChild();break;case`left`:n=t.getParent();break}n&&(i=n.key)}}i!==null&&(a.value=null,o.value=i)}let M=P(()=>{let{inverted:t}=e,n=h.value,{common:{cubicBezierEaseInOut:r},self:i}=_.value,{padding:a,dividerColor:o,borderRadius:s,optionOpacityDisabled:c,[G(`optionIconSuffixWidth`,n)]:l,[G(`optionSuffixWidth`,n)]:u,[G(`optionIconPrefixWidth`,n)]:d,[G(`optionPrefixWidth`,n)]:f,[G(`fontSize`,n)]:p,[G(`optionHeight`,n)]:m,[G(`optionIconSize`,n)]:g}=i,v={"--n-bezier":r,"--n-font-size":p,"--n-padding":a,"--n-border-radius":s,"--n-option-height":m,"--n-option-prefix-width":f,"--n-option-icon-prefix-width":d,"--n-option-suffix-width":u,"--n-option-icon-suffix-width":l,"--n-option-icon-size":g,"--n-divider-color":o,"--n-option-opacity-disabled":c};return t?(v[`--n-color`]=i.colorInverted,v[`--n-option-color-hover`]=i.optionColorHoverInverted,v[`--n-option-color-active`]=i.optionColorActiveInverted,v[`--n-option-text-color`]=i.optionTextColorInverted,v[`--n-option-text-color-hover`]=i.optionTextColorHoverInverted,v[`--n-option-text-color-active`]=i.optionTextColorActiveInverted,v[`--n-option-text-color-child-active`]=i.optionTextColorChildActiveInverted,v[`--n-prefix-color`]=i.prefixColorInverted,v[`--n-suffix-color`]=i.suffixColorInverted,v[`--n-group-header-text-color`]=i.groupHeaderTextColorInverted):(v[`--n-color`]=i.color,v[`--n-option-color-hover`]=i.optionColorHover,v[`--n-option-color-active`]=i.optionColorActive,v[`--n-option-text-color`]=i.optionTextColor,v[`--n-option-text-color-hover`]=i.optionTextColorHover,v[`--n-option-text-color-active`]=i.optionTextColorActive,v[`--n-option-text-color-child-active`]=i.optionTextColorChildActive,v[`--n-prefix-color`]=i.prefixColor,v[`--n-suffix-color`]=i.suffixColor,v[`--n-group-header-text-color`]=i.groupHeaderTextColor),v}),N=p?te(`dropdown`,P(()=>`${h.value[0]}${e.inverted?`i`:``}`),M,e):void 0;return{mergedClsPrefix:f,mergedTheme:_,mergedSize:h,tmNodes:i,mergedShow:n,handleAfterLeave:()=>{e.animated&&b()},doUpdateShow:y,cssVars:p?void 0:M,themeClass:N?.themeClass,onRender:N?.onRender}},render(){let e=(e,t,n,r,i)=>{var a;let{mergedClsPrefix:o,menuProps:s}=this;(a=this.onRender)==null||a.call(this);let c=s?.(void 0,this.tmNodes.map(e=>e.rawNode))||{},l={ref:Be(t),class:[e,`${o}-dropdown`,`${o}-dropdown--${this.mergedSize}-size`,this.themeClass],clsPrefix:o,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:r,onMouseleave:i};return d(nt,f(this.$attrs,l,c))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return d(pe,Object.assign({},ce(this.$props,at),n),{trigger:()=>{var e;return(e=this.$slots).default?.call(e)}})}}),st={telegram:`Telegram`,api_server:`API Server`,cli:`CLI`,discord:`Discord`,slack:`Slack`,matrix:`Matrix`,whatsapp:`WhatsApp`,signal:`Signal`,email:`Email`,sms:`SMS`,dingtalk:`DingTalk`,feishu:`Feishu`,wecom:`WeCom`,weixin:`WeChat`,bluebubbles:`iMessage`,mattermost:`Mattermost`,cron:`Cron`};function ct(e){return e?st[e]||e:``}function lt(e){if(!e)return``;let t=new Date(e),n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function ut(e){return lt(e*1e3)}var dt={class:`chat-input-area`},ft={class:`input-top-bar`},pt={key:1,class:`context-bar`},mt={key:0,class:`attachment-previews`},ht=[`src`,`alt`],gt={key:1,class:`attachment-file`},_t={class:`file-name`},vt={class:`file-size`},yt=[`onClick`],bt=[`placeholder`],xt={class:`input-actions`},St=2e5,Ct=L(l({__name:`ChatInput`,setup(i){let a=we(),{t:o}=I(),l=O(``),d=O(),f=O(),m=O([]),_=O(!1),b=O(0),S=O(!1),C=P(()=>l.value.trim()||m.value.length>0),A=O(2e5);async function j(){try{A.value=await je(Ae().activeProfileName||void 0)}catch{A.value=St}}h(j),g(()=>Ae().activeProfileName,j),g(()=>ke().selectedModel,j);let M=P(()=>(a.activeSession?.inputTokens??0)+(a.activeSession?.outputTokens??0)),N=P(()=>A.value-M.value),F=P(()=>Math.min(M.value/A.value*100,100));function L(e){return e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}function R(e){if(m.value.find(t=>t.name===e.name))return;let t=Date.now().toString(36)+Math.random().toString(36).slice(2,8),n=URL.createObjectURL(e);m.value.push({id:t,name:e.name,type:e.type,size:e.size,url:n,file:e})}function z(){f.value?.click()}function B(e){let t=e.target;if(t.files){for(let e of t.files)R(e);t.value=``}}function V(e){let t=Array.from(e.clipboardData?.items||[]).filter(e=>e.type.startsWith(`image/`));if(t.length){e.preventDefault();for(let e of t){let t=e.getAsFile();if(!t)continue;let n=e.type.split(`/`)[1]||`png`;R(new File([t],`pasted-${Date.now()}.${n}`,{type:e.type}))}}}function H(e){e.preventDefault()}function U(e){e.preventDefault(),e.dataTransfer?.types.includes(`Files`)&&(b.value++,_.value=!0)}function W(){b.value--,b.value<=0&&(b.value=0,_.value=!1)}function ee(e){e.preventDefault(),b.value=0,_.value=!1;let t=Array.from(e.dataTransfer?.files||[]);if(t.length){for(let e of t)R(e);d.value?.focus()}}function G(){let e=l.value.trim();!e&&m.value.length===0||(a.sendMessage(e,m.value.length>0?m.value:void 0),l.value=``,m.value=[],d.value&&(d.value.style.height=`auto`))}function K(){S.value=!0}function q(){requestAnimationFrame(()=>{S.value=!1})}function J(e){return S.value||e.isComposing||e.keyCode===229}function Y(e){e.key!==`Enter`||e.shiftKey||J(e)||(e.preventDefault(),G())}function te(e){let t=e.target;t.style.height=`auto`,t.style.height=Math.min(t.scrollHeight,100)+`px`}function ne(e){let t=m.value.findIndex(t=>t.id===e);t!==-1&&(URL.revokeObjectURL(m.value[t].url),m.value.splice(t,1))}function re(e){return e<1024?e+` B`:e<1024*1024?(e/1024).toFixed(1)+` KB`:(e/(1024*1024)).toFixed(1)+` MB`}function X(e){return e.startsWith(`image/`)}return(i,h)=>(c(),u(`div`,dt,[p(`div`,ft,[D(k(Te),{trigger:`hover`},{trigger:e(()=>[D(k(Q),{quaternary:``,size:`tiny`,onClick:z,circle:``},{icon:e(()=>[...h[2]||=[p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[p(`path`,{d:`M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`})],-1)]]),_:1})]),default:e(()=>[t(` `+v(k(o)(`chat.attachFiles`)),1)]),_:1}),M.value>0?(c(),u(`span`,{key:0,class:E([`context-info`,{"context-warning":F.value>80}])},v(L(M.value))+` / `+v(L(A.value))+` · `+v(k(o)(`chat.contextRemaining`))+` `+v(L(N.value)),3)):n(``,!0),M.value>0?(c(),u(`div`,pt,[p(`div`,{class:E([`context-bar-fill`,{"context-bar-warn":F.value>60&&F.value<=80,"context-bar-danger":F.value>80}]),style:w({width:`${F.value}%`})},null,6)])):n(``,!0)]),m.value.length>0?(c(),u(`div`,mt,[(c(!0),u(y,null,s(m.value,e=>(c(),u(`div`,{key:e.id,class:E([`attachment-preview`,{image:X(e.type)}])},[X(e.type)?(c(),u(`img`,{key:0,src:e.url,alt:e.name,class:`attachment-thumb`},null,8,ht)):(c(),u(`div`,gt,[h[3]||=p(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[p(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),p(`polyline`,{points:`14 2 14 8 20 8`})],-1),p(`span`,_t,v(e.name),1),p(`span`,vt,v(re(e.size)),1)])),p(`button`,{class:`attachment-remove`,onClick:t=>ne(e.id)},[...h[4]||=[p(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),p(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,yt)],2))),128))])):n(``,!0),p(`div`,{class:E([`input-wrapper`,{"drag-over":_.value}]),onDragover:H,onDragenter:U,onDragleave:W,onDrop:ee},[p(`input`,{ref_key:`fileInputRef`,ref:f,type:`file`,multiple:``,class:`file-input-hidden`,onChange:B},null,544),x(p(`textarea`,{ref_key:`textareaRef`,ref:d,"onUpdate:modelValue":h[0]||=e=>l.value=e,class:`input-textarea`,placeholder:k(o)(`chat.inputPlaceholder`),rows:`1`,onKeydown:Y,onCompositionstart:K,onCompositionend:q,onInput:te,onPaste:V},null,40,bt),[[T,l.value]]),p(`div`,xt,[k(a).isStreaming?(c(),r(k(Q),{key:0,size:`small`,type:`error`,onClick:h[1]||=e=>k(a).stopStreaming()},{default:e(()=>[t(v(k(o)(`chat.stop`)),1)]),_:1})):n(``,!0),D(k(Q),{size:`small`,type:`primary`,disabled:!C.value||k(a).isStreaming,onClick:G},{icon:e(()=>[...h[5]||=[p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),p(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})],-1)]]),default:e(()=>[t(` `+v(k(o)(`chat.send`)),1)]),_:1},8,[`disabled`])])],34)]))}}),[[`__scopeId`,`data-v-86c00ae3`]]);async function wt(e={}){let t=new URLSearchParams;return e.humanOnly===!1&&t.set(`humanOnly`,`false`),e.source&&t.set(`source`,e.source),e.limit!=null&&t.set(`limit`,String(e.limit)),(await j(`/api/hermes/sessions/conversations${t.toString()?`?${t.toString()}`:``}`)).sessions}async function Tt(e,t={}){let n=new URLSearchParams;t.humanOnly===!1&&n.set(`humanOnly`,`false`),t.source&&n.set(`source`,t.source);let r=n.toString()?`?${n.toString()}`:``;return j(`/api/hermes/sessions/conversations/${encodeURIComponent(e)}/messages${r}`)}var Et={class:`conversation-monitor`},Dt={class:`conversation-monitor__sidebar`},Ot={key:0,class:`conversation-monitor__empty`},kt={key:1,class:`conversation-monitor__empty`},At=[`aria-pressed`,`onClick`],jt={class:`conversation-monitor__session-title-row`},Mt={class:`conversation-monitor__session-title`},Nt={key:0,class:`conversation-monitor__session-live`},Pt={class:`conversation-monitor__session-meta`},Ft={key:0,class:`conversation-monitor__session-preview`},It={class:`conversation-monitor__detail`},Lt={key:0,class:`conversation-monitor__detail-header`},Rt={class:`conversation-monitor__detail-title`},zt={class:`conversation-monitor__detail-meta`},Bt={key:1,class:`conversation-monitor__empty conversation-monitor__empty--error`},Vt={key:2,class:`conversation-monitor__empty`},Ht={key:3,class:`conversation-monitor__empty`},Ut={key:4,class:`conversation-monitor__messages`},Wt={class:`conversation-monitor__message-meta`},Gt={class:`conversation-monitor__message-content`},Kt=15e3,qt=L(l({__name:`ConversationMonitorPane`,props:{humanOnly:{type:Boolean}},setup(e){let t=e,{t:r}=I(),a=O([]),o=O(null),l=O(null),d=O(!1),f=O(!1),m=O(``),_=null,b=0,x=0,S=P(()=>a.value.find(e=>e.id===o.value)||null);function C(e){return r(e===`user`?`chat.monitorRoleUser`:`chat.monitorRoleAssistant`)}function w(e){return r(`chat.linkedSessions`,{count:e})}function T(){b+=1,x+=1}async function D(e=!1){let n=++b;e||(d.value=!0,m.value=``);try{let e=await wt({humanOnly:t.humanOnly});if(n!==b)return;if(a.value=e,!e.length){o.value=null,l.value=null;return}(!o.value||!e.some(e=>e.id===o.value))&&(o.value=e[0].id)}catch(t){if(n!==b||e)return;m.value=t?.message||String(t),a.value=[],o.value=null,l.value=null}finally{!e&&n===b&&(d.value=!1)}}async function A(e,n=!1){let r=++x;if(!e){l.value=null;return}let i=t.humanOnly;n||(f.value=!0,m.value=``);try{let n=await Tt(e,{humanOnly:i});if(r!==x||e!==o.value||i!==t.humanOnly)return;l.value=n}catch(e){if(r!==x||n)return;m.value=e?.message||String(e),l.value=null}finally{!n&&r===x&&(f.value=!1)}}return g(o,async e=>{await A(e,!1)}),g(()=>t.humanOnly,async()=>{T(),o.value=null,l.value=null,await D(!1)}),h(async()=>{await D(!1),_=setInterval(async()=>{await D(!0),o.value&&await A(o.value,!0)},Kt)}),i(()=>{T(),_&&clearInterval(_)}),(e,t)=>(c(),u(`div`,Et,[p(`aside`,Dt,[d.value&&a.value.length===0?(c(),u(`div`,Ot,v(k(r)(`common.loading`)),1)):a.value.length===0?(c(),u(`div`,kt,v(k(r)(`chat.noSessions`)),1)):n(``,!0),(c(!0),u(y,null,s(a.value,e=>(c(),u(`button`,{key:e.id,class:E([`conversation-monitor__session`,{active:e.id===o.value}]),"aria-pressed":e.id===o.value,onClick:t=>o.value=e.id},[p(`div`,jt,[p(`span`,Mt,v(e.title||e.preview||e.id),1),e.is_active?(c(),u(`span`,Nt,v(k(r)(`chat.recentBadge`)),1)):n(``,!0)]),p(`div`,Pt,v(k(ct)(e.source))+` · `+v(k(ut)(e.last_active)),1),e.preview?(c(),u(`div`,Ft,v(e.preview),1)):n(``,!0)],10,At))),128))]),p(`section`,It,[S.value?(c(),u(`header`,Lt,[p(`div`,Rt,v(S.value.title||S.value.preview||S.value.id),1),p(`div`,zt,[p(`span`,null,v(k(ct)(S.value.source)),1),t[0]||=p(`span`,null,`·`,-1),p(`span`,null,v(S.value.model),1),t[1]||=p(`span`,null,`·`,-1),p(`span`,null,v(w(S.value.thread_session_count)),1)])])):n(``,!0),m.value?(c(),u(`div`,Bt,v(m.value),1)):f.value&&!l.value?(c(),u(`div`,Vt,v(k(r)(`common.loading`)),1)):!l.value||l.value.messages.length===0?(c(),u(`div`,Ht,v(k(r)(`chat.noVisibleMessages`)),1)):(c(),u(`div`,Ut,[(c(!0),u(y,null,s(l.value.messages,e=>(c(),u(`article`,{key:`${e.session_id}-${e.id}`,class:E([`conversation-monitor__message`,`role-${e.role}`])},[p(`div`,Wt,v(C(e.role))+` · `+v(k(ut)(e.timestamp)),1),p(`div`,Gt,v(e.content),1)],2))),128))]))])]))}}),[[`__scopeId`,`data-v-be298d0d`]]),Jt=[`id`],Yt={key:1,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,class:`tool-icon`},Xt={class:`tool-name`},Zt={key:2,class:`tool-preview`},Qt={key:3,class:`tool-spinner`},$t={key:4,class:`tool-error-badge`},en={key:0,class:`tool-detail-section`,"data-copy-source":`tool-args`},tn={class:`tool-detail-label`},nn=[`innerHTML`],rn={key:1,class:`tool-detail-section`,"data-copy-source":`tool-result`},an={class:`tool-detail-label`},on=[`innerHTML`],sn={key:1,class:`msg-body`},cn={key:0,src:R,alt:`Hermes`,class:`msg-avatar`},ln={key:0,class:`msg-attachments`},un=[`src`,`alt`],dn={key:1,class:`msg-attachment-file`},fn={class:`att-name`},pn={class:`att-size`},mn={key:2,class:`streaming-dots`},hn={class:`message-time`},$=2e3,gn=L(l({__name:`MessageItem`,props:{message:{},highlight:{type:Boolean}},setup(e){let t=e,{t:i}=I(),a=P(()=>t.message.role===`system`),o=O(!1),l=P(()=>new Date(t.message.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}));function d(e){return e.startsWith(`image/`)}function f(e){return e<1024?e+` B`:e<1024*1024?(e/1024).toFixed(1)+` KB`:(e/(1024*1024)).toFixed(1)+` MB`}function m(e){if(!e)return{full:``,display:``};try{let t=JSON.stringify(JSON.parse(e),null,2);return{full:t,display:t.length>$?t.slice(0,$)+`
126
+ `+i(`chat.truncated`):t,language:`json`}}catch{return{full:e,display:e.length>$?e.slice(0,$)+`
127
+ `+i(`chat.truncated`):e}}}function h(e,t){return Pe(e,t,i(`common.copy`),{maxHighlightLength:$})}async function g(e){let t=e.target;if(!(t instanceof HTMLElement))return;let n=t.closest(`[data-copy-code="true"]`);if(!n)return;e.preventDefault();let r=n.closest(`[data-copy-source]`)?.dataset.copySource;if(r===`tool-args`&&C.value){await Fe(C.value);return}if(r===`tool-result`&&T.value){await Fe(T.value);return}await Ie(e)}let _=P(()=>(t.message.attachments?.length??0)>0),b=P(()=>!!(t.message.toolArgs||t.message.toolResult)),x=P(()=>m(t.message.toolArgs)),S=P(()=>m(t.message.toolResult)),C=P(()=>x.value.full),w=P(()=>x.value.display),T=P(()=>S.value.full),D=P(()=>S.value.display),A=P(()=>w.value?h(w.value,x.value.language):``),j=P(()=>D.value?h(D.value,S.value.language):``);return(t,m)=>(c(),u(`div`,{class:E([`message`,[e.message.role,{highlight:e.highlight}]]),id:`message-${e.message.id}`},[e.message.role===`tool`?(c(),u(y,{key:0},[p(`div`,{class:E([`tool-line`,{expandable:b.value}]),onClick:m[0]||=e=>b.value&&(o.value=!o.value)},[b.value?(c(),u(`svg`,{key:0,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:E([`tool-chevron`,{rotated:o.value}])},[...m[1]||=[p(`polyline`,{points:`9 18 15 12 9 6`},null,-1)]],2)):(c(),u(`svg`,Yt,[...m[2]||=[p(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`},null,-1)]])),p(`span`,Xt,v(e.message.toolName),1),e.message.toolPreview&&!o.value?(c(),u(`span`,Zt,v(e.message.toolPreview),1)):n(``,!0),e.message.toolStatus===`running`?(c(),u(`span`,Qt)):n(``,!0),e.message.toolStatus===`error`?(c(),u(`span`,$t,v(k(i)(`chat.error`)),1)):n(``,!0)],2),o.value&&b.value?(c(),u(`div`,{key:0,class:`tool-details`,onClick:g},[w.value?(c(),u(`div`,en,[p(`div`,tn,v(k(i)(`chat.arguments`)),1),p(`div`,{class:`tool-detail-code-block`,innerHTML:A.value},null,8,nn)])):n(``,!0),D.value?(c(),u(`div`,rn,[p(`div`,an,v(k(i)(`chat.result`)),1),p(`div`,{class:`tool-detail-code-block`,innerHTML:j.value},null,8,on)])):n(``,!0)])):n(``,!0)],64)):(c(),u(`div`,sn,[e.message.role===`assistant`?(c(),u(`img`,cn)):n(``,!0),p(`div`,{class:E([`msg-content`,e.message.role])},[p(`div`,{class:E([`message-bubble`,{system:a.value}])},[_.value?(c(),u(`div`,ln,[(c(!0),u(y,null,s(e.message.attachments,e=>(c(),u(`div`,{key:e.id,class:E([`msg-attachment`,{image:d(e.type)}])},[d(e.type)&&e.url?(c(),u(`img`,{key:0,src:e.url,alt:e.name,class:`msg-attachment-thumb`},null,8,un)):(c(),u(`div`,dn,[m[3]||=p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[p(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),p(`polyline`,{points:`14 2 14 8 20 8`})],-1),p(`span`,fn,v(e.name),1),p(`span`,pn,v(f(e.size)),1)]))],2))),128))])):n(``,!0),e.message.content?(c(),r(Le,{key:1,content:e.message.content},null,8,[`content`])):n(``,!0),e.message.isStreaming&&!e.message.content?(c(),u(`span`,mn,[...m[4]||=[p(`span`,null,null,-1),p(`span`,null,null,-1),p(`span`,null,null,-1)]])):n(``,!0)],2),p(`div`,hn,v(l.value),1)],2)]))],10,Jt))}}),[[`__scopeId`,`data-v-7ea3d568`]]),_n=`/assets/thinking-light-BjeGd2gJ.mp4`,vn=`/assets/thinking-dark-yYkYRZLs.mp4`,yn={key:0,class:`empty-state`},bn={key:0,class:`streaming-indicator`},xn=[`src`],Sn={key:0,class:`tool-calls-panel`},Cn={class:`tool-call-name`},wn={key:0,class:`tool-call-preview`},Tn={key:1,class:`tool-call-spinner`},En={key:2,class:`tool-call-error`},Dn=L(l({__name:`MessageList`,setup(t){let i=we(),{t:a}=I(),{isDark:o}=Oe(),l=O(),d=P(()=>i.messages.filter(e=>e.role!==`tool`)),f=P(()=>{let e=i.messages,t=-1;for(let n=e.length-1;n>=0;n--)if(e[n].role===`user`){t=n;break}return[...e.filter((e,n)=>e.role===`tool`&&n>t)].reverse()});function m(e=200){let t=l.value;return t?t.scrollHeight-t.scrollTop-t.clientHeight<e:!0}function h(){F(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})}function _(e){F(()=>{let t=document.getElementById(`message-${e}`);t&&t.scrollIntoView({block:`center`})})}return g(()=>i.activeSessionId,e=>{if(e){if(i.focusMessageId){_(i.focusMessageId);return}h()}},{immediate:!0}),g(()=>i.focusMessageId,e=>{e&&_(e)}),g(()=>i.isRunActive,e=>{e&&h()}),g(()=>i.messages[i.messages.length-1]?.content,()=>{if(i.focusMessageId){_(i.focusMessageId);return}if(!i.isStreaming){h();return}m()&&h()}),g(f,()=>{if(i.focusMessageId){_(i.focusMessageId);return}if(!i.isStreaming){h();return}m()&&h()}),(t,m)=>(c(),u(`div`,{ref_key:`listRef`,ref:l,class:`message-list`},[k(i).messages.length===0?(c(),u(`div`,yn,[m[0]||=p(`img`,{src:`/logo.png`,alt:`Hermes`,class:`empty-logo`},null,-1),p(`p`,null,v(k(a)(`chat.emptyState`)),1)])):n(``,!0),(c(!0),u(y,null,s(d.value,e=>(c(),r(gn,{key:e.id,message:e,highlight:k(i).focusMessageId===e.id},null,8,[`message`,`highlight`]))),128)),D(S,{name:`fade`},{default:e(()=>[k(i).isRunActive?(c(),u(`div`,bn,[p(`video`,{src:k(o)?k(vn):k(_n),autoplay:``,loop:``,muted:``,playsinline:``,class:`thinking-video`},null,8,xn),f.value.length>0?(c(),u(`div`,Sn,[(c(!0),u(y,null,s(f.value,e=>(c(),u(`div`,{key:e.id,class:`tool-call-item`},[m[1]||=p(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,class:`tool-call-icon`},[p(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`})],-1),p(`span`,Cn,v(e.toolName),1),e.toolPreview?(c(),u(`span`,wn,v(e.toolPreview),1)):n(``,!0),e.toolStatus===`running`?(c(),u(`span`,Tn)):n(``,!0),e.toolStatus===`error`?(c(),u(`span`,En,v(k(a)(`chat.error`)),1)):n(``,!0)]))),128))])):n(``,!0)])):n(``,!0)]),_:1})],512))}}),[[`__scopeId`,`data-v-aa66438c`]]),On=[`aria-current`],kn={class:`session-item-content`},An={class:`session-item-title-row`},jn={key:0,class:`session-item-active-indicator`,"aria-hidden":`true`},Mn={key:1,class:`session-item-pin`,"aria-hidden":`true`},Nn={class:`session-item-title`},Pn={class:`session-item-meta`},Fn={key:0,class:`session-item-model`},In={class:`session-item-time`},Ln=l({__name:`SessionListItem`,props:{session:{},active:{type:Boolean},live:{type:Boolean},pinned:{type:Boolean},canDelete:{type:Boolean}},emits:[`select`,`contextmenu`,`delete`],setup(i,{emit:a}){let o=a,{t:s}=I();return(a,l)=>(c(),u(`button`,{class:E([`session-item`,{active:i.active,live:i.live}]),"aria-current":i.active?`page`:void 0,onClick:l[2]||=e=>o(`select`),onContextmenu:l[3]||=e=>o(`contextmenu`,e)},[p(`div`,kn,[p(`span`,An,[i.live?(c(),u(`span`,jn,[...l[4]||=[p(`svg`,{class:`session-item-active-spinner`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[p(`circle`,{cx:`12`,cy:`12`,r:`8`,opacity:`0.2`}),p(`path`,{d:`M20 12a8 8 0 0 0-8-8`})],-1)]])):n(``,!0),i.pinned?(c(),u(`span`,Mn,[...l[5]||=[p(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{d:`M12 17v5`}),p(`path`,{d:`M5 8l14 0`}),p(`path`,{d:`M8 3l8 0 0 5 3 5-14 0 3-5z`})],-1)]])):n(``,!0),p(`span`,Nn,v(i.session.title),1)]),p(`span`,Pn,[i.session.model?(c(),u(`span`,Fn,v(i.session.model),1)):n(``,!0),p(`span`,In,v(k(lt)(i.session.createdAt)),1)])]),i.canDelete?(c(),r(k(De),{key:0,onPositiveClick:l[1]||=e=>o(`delete`)},{trigger:e(()=>[p(`button`,{class:`session-item-delete`,onClick:l[0]||=N(()=>{},[`stop`])},[...l[6]||=[p(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),p(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])]),default:e(()=>[t(` `+v(k(s)(`chat.deleteSession`)),1)]),_:1})):n(``,!0)],42,On))}}),Rn={class:`chat-panel`},zn={class:`session-list-header`},Bn={key:0,class:`session-list-title`},Vn={class:`session-list-actions`},Hn={key:0,class:`session-items`},Un={key:0,class:`session-loading`},Wn={key:1,class:`session-empty`},Gn={class:`session-group-header session-group-header--static`},Kn={class:`session-group-label`},qn={class:`session-group-count`},Jn=[`onClick`],Yn={class:`session-group-label`},Xn={class:`session-group-count`},Zn={class:`chat-main`},Qn={class:`chat-header`},$n={class:`header-left`},er={class:`header-session-title`},tr={key:1,class:`source-badge`},nr={class:`header-actions`},rr={class:`chat-mode-toggle`},ir=L(l({__name:`ChatPanel`,setup(a){let o=we(),l=Ne(),d=Ee(),{t:f}=I(),m=O(`chat`),b=O(typeof window>`u`||!window.matchMedia(`(max-width: 768px)`).matches),x=O(b.value),S=null,C=O(!1);function w(e){o.switchSession(e),S?.matches&&(b.value=!1)}function T(e){e!==m.value&&(e===`live`?(x.value=b.value,b.value=!1):b.value=S?.matches?!1:x.value,m.value=e)}function A(e){C.value=e.matches,e.matches&&b.value&&(b.value=!1)}h(()=>{S=window.matchMedia(`(max-width: 768px)`),A(S),S.addEventListener(`change`,A)}),i(()=>{S?.removeEventListener(`change`,A)});let j=O(!1),M=O(``),N=O(null),L=O(null),R=O(new Set(JSON.parse(localStorage.getItem(`hermes_collapsed_groups`)||`[]`)));function z(e){return e===`api_server`?-1:e===`cron`?999:0}function B(e){return[...e].sort((e,t)=>{let n=o.isSessionLive(e.id);return n===o.isSessionLive(t.id)?(t.updatedAt||0)-(e.updatedAt||0):n?-1:1})}let V=P(()=>B(o.sessions.filter(e=>l.isPinned(e.id)))),H=P(()=>{let e=new Map;for(let t of o.sessions){if(l.isPinned(t.id))continue;let n=t.source||``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return[...e.keys()].sort((t,n)=>{let r=e.get(t)?.some(e=>o.isSessionLive(e.id))||!1;if(r!==(e.get(n)?.some(e=>o.isSessionLive(e.id))||!1))return r?-1:1;let i=z(t),a=z(n);return i===a?t.localeCompare(n):i-a}).map(t=>({source:t,label:t?ct(t):f(`chat.other`),sessions:B(e.get(t))}))});function U(e){if(!R.value.has(e))R.value=new Set([...R.value,e]);else{R.value=new Set(H.value.map(e=>e.source).filter(t=>t!==e));let t=H.value.find(t=>t.source===e);t?.sessions.length&&o.switchSession(t.sessions[0].id)}localStorage.setItem(`hermes_collapsed_groups`,JSON.stringify([...R.value]))}g(H,e=>{if(localStorage.getItem(`hermes_collapsed_groups`)!==null){let e=o.activeSession?.source;e&&R.value.has(e)&&(R.value=new Set([...R.value].filter(t=>t!==e)),localStorage.setItem(`hermes_collapsed_groups`,JSON.stringify([...R.value])));return}R.value=new Set(e.slice(1).map(e=>e.source)),localStorage.setItem(`hermes_collapsed_groups`,JSON.stringify([...R.value]))},{once:!0}),g(()=>[o.sessionsLoaded,...o.sessions.map(e=>e.id)],e=>{let t=e.slice(1);!e[0]||t.length===0||l.pruneMissingSessions(t)},{immediate:!0});let W=P(()=>o.activeSession?.title||f(`chat.newChat`)),ee=P(()=>m.value===`live`?f(`chat.liveSessions`):W.value),G=P(()=>m.value===`chat`&&o.activeSession?.source||``);function K(){o.newChat()}function q(e){let t=e||o.activeSessionId;t&&(navigator.clipboard.writeText(t),d.success(f(`common.copied`)))}function J(e){l.removePinned(e),o.deleteSession(e),d.success(f(`chat.sessionDeleted`))}let Y=O(null),te=P(()=>Y.value?l.isPinned(Y.value):!1),ne=P(()=>[{label:f(te.value?`chat.unpin`:`chat.pin`),key:`pin`},{label:f(`chat.rename`),key:`rename`},{label:f(`chat.copySessionId`),key:`copy-id`}]);function re(e,t){e.preventDefault(),Y.value=t,X.value=!0,ie.value=e.clientX,ae.value=e.clientY}let X=O(!1),ie=O(0),ae=O(0);function Z(e){if(X.value=!1,Y.value){if(e===`pin`){l.togglePinned(Y.value);return}if(e===`copy-id`)q(Y.value);else if(e===`rename`){let e=o.sessions.find(e=>e.id===Y.value);N.value=Y.value,M.value=e?.title||``,j.value=!0,F(()=>{L.value?.focus()})}}}function oe(){X.value=!1}async function se(){if(!(!N.value||!M.value.trim())){if(await Me(N.value,M.value.trim())){let e=o.sessions.find(e=>e.id===N.value);e&&(e.title=M.value.trim()),o.activeSession?.id===N.value&&(o.activeSession.title=M.value.trim()),d.success(f(`chat.renamed`))}else d.error(f(`chat.renameFailed`));j.value=!1}}return(i,a)=>(c(),u(`div`,Rn,[m.value===`chat`?(c(),u(`div`,{key:0,class:E([`session-backdrop`,{active:b.value}]),onClick:a[0]||=e=>b.value=!1},null,2)):n(``,!0),m.value===`chat`?(c(),u(`aside`,{key:1,class:E([`session-list`,{collapsed:!b.value}])},[p(`div`,zn,[b.value?(c(),u(`span`,Bn,v(k(f)(`chat.sessions`)),1)):n(``,!0),p(`div`,Vn,[p(`button`,{class:`session-close-btn`,onClick:a[1]||=e=>b.value=!1},[...a[8]||=[p(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),p(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]]),D(k(Q),{quaternary:``,size:`tiny`,onClick:K,circle:``},{icon:e(()=>[...a[9]||=[p(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),p(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),_:1})])]),b.value?(c(),u(`div`,Hn,[k(o).isLoadingSessions&&k(o).sessions.length===0?(c(),u(`div`,Un,v(k(f)(`common.loading`)),1)):k(o).sessions.length===0?(c(),u(`div`,Wn,v(k(f)(`chat.noSessions`)),1)):n(``,!0),V.value.length>0?(c(),u(y,{key:2},[p(`div`,Gn,[p(`span`,Kn,v(k(f)(`chat.pinned`)),1),p(`span`,qn,v(V.value.length),1)]),(c(!0),u(y,null,s(V.value,e=>(c(),r(Ln,{key:`pinned-${e.id}`,session:e,active:e.id===k(o).activeSessionId,live:k(o).isSessionLive(e.id),pinned:!0,"can-delete":e.id!==k(o).activeSessionId||k(o).sessions.length>1,onSelect:t=>w(e.id),onContextmenu:t=>re(t,e.id),onDelete:t=>J(e.id)},null,8,[`session`,`active`,`live`,`can-delete`,`onSelect`,`onContextmenu`,`onDelete`]))),128))],64)):n(``,!0),(c(!0),u(y,null,s(H.value,e=>(c(),u(y,{key:e.source},[p(`div`,{class:`session-group-header`,onClick:t=>U(e.source)},[(c(),u(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:E([`group-chevron`,{collapsed:R.value.has(e.source)}])},[...a[10]||=[p(`polyline`,{points:`9 18 15 12 9 6`},null,-1)]],2)),p(`span`,Yn,v(e.label),1),p(`span`,Xn,v(e.sessions.length),1)],8,Jn),R.value.has(e.source)?n(``,!0):(c(!0),u(y,{key:0},s(e.sessions,e=>(c(),r(Ln,{key:e.id,session:e,active:e.id===k(o).activeSessionId,live:k(o).isSessionLive(e.id),pinned:!1,"can-delete":e.id!==k(o).activeSessionId||k(o).sessions.length>1,onSelect:t=>w(e.id),onContextmenu:t=>re(t,e.id),onDelete:t=>J(e.id)},null,8,[`session`,`active`,`live`,`can-delete`,`onSelect`,`onContextmenu`,`onDelete`]))),128))],64))),128))])):n(``,!0)],2)):n(``,!0),D(k(ot),{placement:`bottom-start`,trigger:`manual`,x:ie.value,y:ae.value,options:ne.value,show:X.value,onSelect:Z,onClickoutside:oe},null,8,[`x`,`y`,`options`,`show`]),D(k(be),{show:j.value,"onUpdate:show":a[3]||=e=>j.value=e,preset:`dialog`,title:k(f)(`chat.renameSession`),"positive-text":k(f)(`common.ok`),"negative-text":k(f)(`common.cancel`),onPositiveClick:se},{default:e(()=>[D(k(xe),{ref_key:`renameInputRef`,ref:L,value:M.value,"onUpdate:value":a[2]||=e=>M.value=e,placeholder:k(f)(`chat.enterNewTitle`),onKeydown:_(se,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`show`,`title`,`positive-text`,`negative-text`]),p(`div`,Zn,[p(`header`,Qn,[p(`div`,$n,[m.value===`chat`?(c(),r(k(Q),{key:0,quaternary:``,size:`small`,onClick:a[4]||=e=>b.value=!b.value,circle:``},{icon:e(()=>[...a[11]||=[p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[p(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`}),p(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`}),p(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`}),p(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`})],-1)]]),_:1})):n(``,!0),p(`span`,er,v(ee.value),1),G.value?(c(),u(`span`,tr,v(k(ct)(G.value)),1)):n(``,!0)]),p(`div`,nr,[p(`div`,rr,[D(k(Q),{size:`small`,type:m.value===`chat`?`primary`:`default`,"aria-pressed":m.value===`chat`,onClick:a[5]||=e=>T(`chat`)},{default:e(()=>[t(v(k(f)(`chat.chatMode`)),1)]),_:1},8,[`type`,`aria-pressed`]),D(k(Q),{size:`small`,type:m.value===`live`?`primary`:`default`,"aria-pressed":m.value===`live`,onClick:a[6]||=e=>T(`live`)},{default:e(()=>[t(v(k(f)(`chat.liveMode`)),1)]),_:1},8,[`type`,`aria-pressed`])]),m.value===`chat`?(c(),u(y,{key:0},[D(k(Te),{trigger:`hover`},{trigger:e(()=>[D(k(Q),{quaternary:``,size:`small`,onClick:a[7]||=e=>q(),circle:``},{icon:e(()=>[...a[12]||=[p(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[p(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),p(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1)]]),_:1})]),default:e(()=>[t(` `+v(k(f)(`chat.copySessionId`)),1)]),_:1}),D(k(Q),{size:`small`,circle:C.value,onClick:K},{icon:e(()=>[...a[13]||=[p(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[p(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),p(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:e(()=>[C.value?n(``,!0):(c(),u(y,{key:0},[t(v(k(f)(`chat.newChat`)),1)],64))]),_:1},8,[`circle`])],64)):n(``,!0)])]),m.value===`chat`?(c(),u(y,{key:0},[D(Dn),D(Ct)],64)):(c(),r(qt,{key:1,"human-only":k(l).humanOnly},null,8,[`human-only`]))])]))}}),[[`__scopeId`,`data-v-a80a58ac`]]),ar={class:`chat-view`},or=L(l({__name:`ChatView`,setup(e){let t=ke(),n=we(),r=Ae();return h(async()=>{t.loadModels(),await r.fetchProfiles(),n.loadSessions()}),(e,t)=>(c(),u(`div`,ar,[D(ir)]))}}),[[`__scopeId`,`data-v-6dae3628`]]);export{or as default};