coding-tool-x 3.8.7 → 3.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +2 -2
  2. package/dist/web/assets/{AgentsDrawer-C7ePByZx.js → AgentsDrawer-Cj5CJ4d9.js} +1 -1
  3. package/dist/web/assets/Analytics-1doS-8uC.js +1 -0
  4. package/dist/web/assets/AssetPathField-C9TOPl7o.js +1 -0
  5. package/dist/web/assets/{ChatHistoryDrawer-Ccl4rhdz.js → ChatHistoryDrawer-BTmQ1aQr.js} +1 -1
  6. package/dist/web/assets/{CollapseItem-MxG_UD4o.js → CollapseItem-CwqJk3bE.js} +1 -1
  7. package/dist/web/assets/{CommandsDrawer-DWbaxHRZ.js → CommandsDrawer-CaZWDI_G.js} +1 -1
  8. package/dist/web/assets/ConfigExportDrawer-C3vSZEsS.js +1 -0
  9. package/dist/web/assets/{ConfigTemplates-AiRPv2cd.js → ConfigTemplates-gyERg9iC.js} +1 -1
  10. package/dist/web/assets/{ConfigTemplatesDrawer-CKMFsfEF.js → ConfigTemplatesDrawer-B17RqFi4.js} +1 -1
  11. package/dist/web/assets/{ConfigTemplatesPanel-Cvbnkvpt.js → ConfigTemplatesPanel-DKIC_FqG.js} +1 -1
  12. package/dist/web/assets/{Divider-D28g1gwj.js → Divider-DsdbkHrG.js} +1 -1
  13. package/dist/web/assets/{FavoritesDrawer-DA-dR_vP.js → FavoritesDrawer-DaziQmBp.js} +1 -1
  14. package/dist/web/assets/Forward-DLCL7aMY.js +1 -0
  15. package/dist/web/assets/{GatewayConvertDrawer-402_raGb.js → GatewayConvertDrawer-OMgWUUSc.js} +1 -1
  16. package/dist/web/assets/Home-DOSUTfrE.js +1 -0
  17. package/dist/web/assets/{MarkdownEditor-BvkDECwH.js → MarkdownEditor-9TTwTS-U.js} +1 -1
  18. package/dist/web/assets/McpDrawer-I8rl8lGH.js +1 -0
  19. package/dist/web/assets/{McpFormDrawer-DPMnyt5L.js → McpFormDrawer-DEP3C7ut.js} +1 -1
  20. package/dist/web/assets/{PluginManager-FKVeugr4.js → PluginManager-BuRcWuBj.js} +1 -1
  21. package/dist/web/assets/{PluginsDrawer-MvM1R55d.js → PluginsDrawer-_zZENaQn.js} +1 -1
  22. package/dist/web/assets/PluginsPanel-Bs5qZ-TK.js +1 -0
  23. package/dist/web/assets/PluginsPanel-CzGMK-Ap.css +1 -0
  24. package/dist/web/assets/ProjectList-BSxuL2td.js +1 -0
  25. package/dist/web/assets/{ProjectList-677RLZ8O.css → ProjectList-VbIYSHbH.css} +1 -1
  26. package/dist/web/assets/PromptsDrawer-CoZ-ZtsY.js +1 -0
  27. package/dist/web/assets/RecentSessionsDrawer-B_17aJBG.js +1 -0
  28. package/dist/web/assets/RecentSessionsDrawer-yrAD4p1A.css +1 -0
  29. package/dist/web/assets/SessionCard-BL_x0d3t.js +1 -0
  30. package/dist/web/assets/SessionList-DhRYZ6vl.js +1 -0
  31. package/dist/web/assets/SessionList-qG_XpPBJ.css +1 -0
  32. package/dist/web/assets/{SettingsDrawer-lMjttbkD.js → SettingsDrawer-fYb0DU7X.js} +1 -1
  33. package/dist/web/assets/SkillManager-S698Hns8.js +1 -0
  34. package/dist/web/assets/{SkillsDrawer-DF6JsSyj.js → SkillsDrawer-Ms4lPCow.js} +1 -1
  35. package/dist/web/assets/{SkillsPanel-B3Nm5j32.css → SkillsPanel-C4ke56nF.css} +1 -1
  36. package/dist/web/assets/SkillsPanel-rqnqAOGL.js +1 -0
  37. package/dist/web/assets/{SpeedTestDrawer-BaZkZqPP.js → SpeedTestDrawer-Bbn38SfV.js} +1 -1
  38. package/dist/web/assets/Upload-CdyVHxCI.js +1 -0
  39. package/dist/web/assets/{WorkspaceDrawer-BFSwZ5yU.js → WorkspaceDrawer-L7HJRc6u.js} +1 -1
  40. package/dist/web/assets/{WorkspaceManager-BHL1uYct.js → WorkspaceManager-DsoNg2z8.js} +1 -1
  41. package/dist/web/assets/{WorkspacePanel-B5PooBtg.js → WorkspacePanel-Be8PVZah.js} +1 -1
  42. package/dist/web/assets/{headers-cf-QapUq.js → headers-B5JWGn3v.js} +1 -1
  43. package/dist/web/assets/{icons-B2Vg-IOC.js → icons-DmFe4b5j.js} +1 -1
  44. package/dist/web/assets/{index-BohDDAy_.css → index-3Lp6z8TQ.css} +1 -1
  45. package/dist/web/assets/index-BKlAWTH-.js +2 -0
  46. package/dist/web/assets/{light-Cp0t7v32.js → light-0eavxNvt.js} +1 -1
  47. package/dist/web/assets/platforms-BmzzwnSw.js +1 -0
  48. package/dist/web/assets/platforms-DWXgmy2w.js +1 -0
  49. package/dist/web/assets/session-visibility-BAmxh3cK.js +1 -0
  50. package/dist/web/assets/sessions-CC0j-KH_.js +1 -0
  51. package/dist/web/assets/sessions-D4yQtfKb.js +1 -0
  52. package/dist/web/assets/use-message-DqCwefG6.js +1 -0
  53. package/dist/web/assets/{useResponsiveDrawer-D-DDpbnI.js → useResponsiveDrawer-V_onl9NV.js} +1 -1
  54. package/dist/web/index.html +7 -7
  55. package/package.json +1 -1
  56. package/src/commands/daemon.js +27 -4
  57. package/src/commands/search.js +17 -2
  58. package/src/config/paths.js +2 -0
  59. package/src/platforms/channel-auth-registry.js +36 -6
  60. package/src/platforms/channel-auth-service.js +12 -2
  61. package/src/platforms/driver-registry.js +9 -1
  62. package/src/platforms/drivers/claude/session-history-adapter.js +72 -1
  63. package/src/platforms/drivers/claude/sessions-implementation.js +49 -7
  64. package/src/platforms/drivers/claude/sessions.js +30 -6
  65. package/src/platforms/drivers/codex/parser.js +57 -1
  66. package/src/platforms/drivers/codex/session-history-adapter.js +8 -2
  67. package/src/platforms/drivers/codex/sessions-implementation.js +25 -3
  68. package/src/platforms/drivers/codex/sessions.js +18 -1
  69. package/src/platforms/drivers/dsh/api-operations.js +396 -0
  70. package/src/platforms/drivers/dsh/channels-implementation.js +458 -0
  71. package/src/platforms/drivers/dsh/channels.js +191 -0
  72. package/src/platforms/drivers/dsh/common.js +571 -0
  73. package/src/platforms/drivers/dsh/native-config.js +93 -0
  74. package/src/platforms/drivers/dsh/native-logs.js +116 -0
  75. package/src/platforms/drivers/dsh/plugin-manager.js +117 -0
  76. package/src/platforms/drivers/dsh/projects.js +23 -0
  77. package/src/platforms/drivers/dsh/proxy-implementation.js +260 -0
  78. package/src/platforms/drivers/dsh/proxy.js +23 -0
  79. package/src/platforms/drivers/dsh/resources.js +346 -0
  80. package/src/platforms/drivers/dsh/sessions.js +587 -0
  81. package/src/platforms/drivers/dsh/statistics-implementation.js +238 -0
  82. package/src/platforms/drivers/dsh/statistics.js +24 -0
  83. package/src/platforms/drivers/gemini/session-history-adapter.js +49 -1
  84. package/src/platforms/drivers/gemini/sessions-implementation.js +46 -1
  85. package/src/platforms/drivers/gemini/sessions.js +2 -1
  86. package/src/platforms/drivers/omp/prompts.js +58 -2
  87. package/src/platforms/drivers/omp/proxy-implementation.js +25 -1
  88. package/src/platforms/drivers/omp/session-history-adapter.js +42 -1
  89. package/src/platforms/drivers/omp/sessions-implementation.js +51 -3
  90. package/src/platforms/drivers/omp/sessions.js +33 -2
  91. package/src/platforms/drivers/opencode/channels-implementation.js +25 -22
  92. package/src/platforms/drivers/opencode/channels.js +6 -1
  93. package/src/platforms/drivers/opencode/sessions-implementation.js +89 -9
  94. package/src/platforms/drivers/opencode/sessions.js +37 -1
  95. package/src/platforms/manifest-schema.js +43 -3
  96. package/src/platforms/manifests/dsh.json +542 -0
  97. package/src/platforms/manifests/omp.json +2 -1
  98. package/src/platforms/manifests/opencode.json +28 -0
  99. package/src/platforms/native-oauth-adapters.js +318 -18
  100. package/src/platforms/oauth-credentials-service.js +344 -13
  101. package/src/platforms/path-resolver.js +2 -0
  102. package/src/platforms/platform-path-context.js +12 -2
  103. package/src/platforms/registry.js +16 -1
  104. package/src/platforms/runtime.js +5 -0
  105. package/src/platforms/session-history-adapters.js +1 -0
  106. package/src/server/api/platform-api-config.js +23 -2
  107. package/src/server/api/platform-route-factory.js +9 -2
  108. package/src/server/api/platforms.js +19 -1
  109. package/src/server/api/plugins.js +108 -13
  110. package/src/server/index.js +35 -1
  111. package/src/server/services/config-registry-service.js +10 -1
  112. package/src/server/services/config-templates-service.js +1 -0
  113. package/src/server/services/plugins-service.js +474 -103
  114. package/src/server/services/session-history-index.js +900 -140
  115. package/src/server/services/session-history-worker.js +3 -1
  116. package/src/server/services/skill-service.js +214 -7
  117. package/src/server/services/usage-log-utils.js +1 -0
  118. package/src/server/services/workspace-service.js +39 -10
  119. package/src/shared/driver-factories/api.js +22 -6
  120. package/src/shared/driver-factories/projects.js +8 -0
  121. package/dist/web/assets/Analytics-BVG6ehFv.js +0 -1
  122. package/dist/web/assets/AssetPathField-BZI9NvEr.js +0 -1
  123. package/dist/web/assets/ConfigExportDrawer-DrawKwxE.js +0 -1
  124. package/dist/web/assets/Home-CTF8ZWKW.js +0 -1
  125. package/dist/web/assets/McpDrawer-DZGHkuDm.js +0 -1
  126. package/dist/web/assets/PluginsPanel-CKuBs38B.js +0 -1
  127. package/dist/web/assets/PluginsPanel-D6ZqITcR.css +0 -1
  128. package/dist/web/assets/ProjectList-tsjwjXV1.js +0 -1
  129. package/dist/web/assets/PromptsDrawer-B-X9ci8n.js +0 -1
  130. package/dist/web/assets/RecentSessionsDrawer-CKFsOYDM.css +0 -1
  131. package/dist/web/assets/RecentSessionsDrawer-wLktMF_c.js +0 -1
  132. package/dist/web/assets/SessionCard-DkJPy0TY.js +0 -1
  133. package/dist/web/assets/SessionList-BpYRz1cX.css +0 -1
  134. package/dist/web/assets/SessionList-Gzhh4FOZ.js +0 -1
  135. package/dist/web/assets/SkillManager-CzFxWxx-.js +0 -1
  136. package/dist/web/assets/SkillsPanel--lLEts9y.js +0 -1
  137. package/dist/web/assets/Upload-BEQ-3Kqq.js +0 -1
  138. package/dist/web/assets/index-BFInlZGI.js +0 -2
  139. package/dist/web/assets/platforms-CBkB45JP.js +0 -1
  140. package/dist/web/assets/platforms-FTpjxAT6.js +0 -1
  141. package/dist/web/assets/sessions-Cmy31slD.js +0 -1
  142. package/dist/web/assets/sessions-yC_oVVh8.js +0 -1
  143. package/dist/web/assets/use-message-DoLM8C1C.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-DOSUTfrE.js","assets/_plugin-vue_export-helper-BeLZJZij.js","assets/vue-vendor-BqZbbXHA.js","assets/vendors-D0c_0KLP.js","assets/platforms-DWXgmy2w.js","assets/client-UDwXBP9i.js","assets/icons-DmFe4b5j.js","assets/platforms-BmzzwnSw.js","assets/use-message-DqCwefG6.js","assets/RecentSessionsDrawer-B_17aJBG.js","assets/useResponsiveDrawer-V_onl9NV.js","assets/use-lock-html-scroll-DXIqmUW4.js","assets/DrawerContent-ChXgZ1Xm.js","assets/sessions-D4yQtfKb.js","assets/clipboard-B46yyoz_.js","assets/SessionCard-BL_x0d3t.js","assets/SessionCard-aM2NHu6i.css","assets/session-visibility-BAmxh3cK.js","assets/RecentSessionsDrawer-yrAD4p1A.css","assets/Home-CSuFuJ9Y.css","assets/ProjectList-BSxuL2td.js","assets/light-0eavxNvt.js","assets/headers-B5JWGn3v.js","assets/sessions-CC0j-KH_.js","assets/ProjectList-VbIYSHbH.css","assets/SessionList-DhRYZ6vl.js","assets/AssetPathField-C9TOPl7o.js","assets/McpFormDrawer-DEP3C7ut.js","assets/CollapseItem-CwqJk3bE.js","assets/project-config-B2baPzYL.js","assets/McpFormDrawer-BRbDcawn.css","assets/Forward-DLCL7aMY.js","assets/SkillsPanel-rqnqAOGL.js","assets/Upload-CdyVHxCI.js","assets/markdown-u082bbtj.js","assets/MarkdownEditor-9TTwTS-U.js","assets/xml-CgY3RMlX.js","assets/MarkdownEditor-qfVgSre_.css","assets/skill-repo-input-B_fkGlUK.js","assets/SkillsPanel-C4ke56nF.css","assets/ChatHistoryDrawer-BTmQ1aQr.js","assets/ChatHistoryDrawer-B2qBQs9L.css","assets/SessionList-qG_XpPBJ.css","assets/WorkspaceManager-DsoNg2z8.js","assets/WorkspacePanel-Be8PVZah.js","assets/Divider-DsdbkHrG.js","assets/workspaces-mjyPVGS8.js","assets/WorkspacePanel-D0-zHTHP.css","assets/WorkspaceManager-CrwgQgmP.css","assets/ConfigTemplates-gyERg9iC.js","assets/ConfigTemplatesPanel-DKIC_FqG.js","assets/ConfigTemplatesPanel-CWyPtk67.css","assets/ConfigTemplates-Bidwfdf2.css","assets/SkillManager-S698Hns8.js","assets/SkillManager-C0GCT2Kb.css","assets/PluginManager-BuRcWuBj.js","assets/PluginsPanel-Bs5qZ-TK.js","assets/PluginsPanel-CzGMK-Ap.css","assets/PluginManager-ROyoZ-6m.css","assets/Analytics-1doS-8uC.js","assets/Analytics-CyHhR126.css","assets/FavoritesDrawer-DaziQmBp.js","assets/FavoritesDrawer-CG9eI9Ay.css","assets/SettingsDrawer-fYb0DU7X.js","assets/SettingsDrawer-Dw5NUgHC.css","assets/McpDrawer-I8rl8lGH.js","assets/McpDrawer-C0dnsZhQ.css","assets/PromptsDrawer-CoZ-ZtsY.js","assets/PromptsDrawer-BIgiYCEQ.css","assets/SpeedTestDrawer-Bbn38SfV.js","assets/SpeedTestDrawer-Dc0WToJ_.css","assets/GatewayConvertDrawer-OMgWUUSc.js","assets/GatewayConvertDrawer-CuNlf7AC.css","assets/SkillsDrawer-Ms4lPCow.js","assets/SkillsDrawer-BCNme-aJ.css","assets/CommandsDrawer-CaZWDI_G.js","assets/CommandsDrawer-BZJxlPvV.css","assets/AgentsDrawer-Cj5CJ4d9.js","assets/AgentsDrawer-Pw2k-ZAa.css","assets/PluginsDrawer-_zZENaQn.js","assets/PluginsDrawer-DM3QjprE.css","assets/WorkspaceDrawer-L7HJRc6u.js","assets/WorkspaceDrawer-CGnMu9p1.css","assets/ConfigTemplatesDrawer-B17RqFi4.js","assets/ConfigTemplatesDrawer-BfDi8yO3.css","assets/ConfigExportDrawer-C3vSZEsS.js","assets/ConfigExportDrawer-dwruRKWr.css"])))=>i.map(i=>d[i]);
2
+ import{$t as e,A as o,At as n,C as t,Cn as r,Ct as a,D as l,Dt as i,E as s,F as d,Ft as c,Ht as u,I as p,L as h,Lt as f,M as m,Mt as v,N as g,O as b,Ot as y,P as x,Pt as C,Qt as w,R as S,S as k,Sn as P,St as T,T as I,Tn as A,Tt as z,Ut as R,Wt as M,Xt as F,Yt as O,Zt as $,_ as B,_t as E,a as _,an as D,b as L,bn as H,bt as j,c as U,cn as W,dn as N,f as K,fn as V,g as q,gn as G,gt as J,h as Y,hn as Z,ht as X,i as Q,j as ee,jt as oe,k as ne,l as te,ln as re,mt as ae,n as le,nn as ie,o as se,on as de,pn as ce,pt as ue,qt as pe,r as he,rn as fe,s as me,sn as ve,t as ge,tn as be,u as ye,un as xe,v as Ce,vn as we,vt as Se,w as ke,x as Pe,xn as Te,xt as Ie,y as Ae,yn as ze,zt as Re}from"./_plugin-vue_export-helper-BeLZJZij.js";import{A as Me,B as Fe,C as Oe,D as $e,F as Be,G as Ee,H as _e,I as De,J as Le,K as He,L as je,M as Ue,N as We,O as Ne,Q as Ke,R as Ve,S as qe,T as Ge,V as Je,W as Ye,Y as Ze,Z as Xe,_ as Qe,_t as eo,a as oo,at as no,b as to,c as ro,d as ao,dt as lo,et as io,f as so,g as co,gt as uo,h as po,ht as ho,i as fo,j as mo,k as vo,l as go,m as bo,mt as yo,n as xo,o as Co,ot as wo,p as So,q as ko,r as Po,rt as To,st as Io,t as Ao,tt as zo,w as Ro,x as Mo,z as Fo}from"./vue-vendor-BqZbbXHA.js";import{n as Oo}from"./vendors-D0c_0KLP.js";import{c as $o,i as Bo,n as Eo,o as _o,s as Do,t as Lo}from"./client-UDwXBP9i.js";import{a as Ho,c as jo,d as Uo,i as Wo,n as No,r as Ko,t as Vo,u as qo}from"./platforms-DWXgmy2w.js";import{F as Go,N as Jo,Ot as Yo,Pt as Zo,Q as Xo,St as Qo,Tt as en,V as on,X as nn,a as tn,bt as rn,c as an,d as ln,ft as sn,g as dn,h as cn,k as un,kt as pn,mt as hn,nt as fn,o as mn,pt as vn,q as gn,r as bn,s as yn,t as xn,xt as Cn,yt as wn,z as Sn}from"./icons-DmFe4b5j.js";import{A as kn,C as Pn,D as Tn,E as In,M as An,O as zn,P as Rn,S as Mn,T as Fn,_ as On,a as $n,b as Bn,c as En,d as _n,f as Dn,g as Ln,h as Hn,i as jn,k as Un,l as Wn,m as Nn,n as Kn,o as Vn,p as qn,r as Gn,s as Jn,t as Yn,u as Zn,v as Xn,w as Qn,x as et,y as ot}from"./use-message-DqCwefG6.js";import{A as nt,C as tt,D as rt,E as at,F as lt,I as it,L as st,M as dt,N as ct,P as ut,S as pt,T as ht,_ as ft,a as mt,b as vt,c as gt,d as bt,f as yt,g as xt,h as Ct,i as wt,j as St,k as kt,l as Pt,m as Tt,n as It,o as At,p as zt,r as Rt,s as Mt,t as Ft,u as Ot,v as $t,w as Bt,x as Et,y as _t}from"./light-0eavxNvt.js";function Dt({platformStore:e,configRef:o}={}){const n=e||Vo(),{uiConfig:t}=Ho(),r=o||t,a=to(()=>n.all||n.platforms||[]),l=to(()=>Wo({catalog:a.value,enabledCliPlatforms:r.value?.enabledCliPlatforms})),i=to(()=>new Map(a.value.map(e=>[e.key,e]))),s=to(()=>l.value.map(e=>i.value.get(e)).filter(Boolean));return{catalog:a,enabledPlatforms:s,enabledKeys:l,byCapability:function(e){return s.value.filter(o=>!0===o.capabilities?.[e]||!0===o.resourceTypes?.[e])},getPlatform:function(e){const o=String(e||"").trim().toLowerCase();return i.value.get(o)||null}}}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&o(e)}).observe(document,{childList:!0,subtree:!0})}function o(e){if(e.ep)return;e.ep=!0;const o=function(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?o.credentials="include":"anonymous"===e.crossOrigin?o.credentials="omit":o.credentials="same-origin",o}(e);fetch(e.href,o)}}();var Lt={},Ht=function(e,o,n){let t=Promise.resolve();if(o&&o.length>0){const e=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),a=n?.nonce||n?.getAttribute("nonce");r=o.map(o=>{var n;if(o=function(e){return"/"+e}(o),n=o,(o=import.meta.resolve?import.meta.resolve(n):new URL(n,import.meta.url).href)in Lt)return;Lt[o]=!0;const t=o.endsWith(".css");for(let a=e.length-1;a>=0;a--){const n=e[a];if(n.href===o&&(!t||"stylesheet"===n.rel))return}const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=o,a&&r.setAttribute("nonce",a),document.head.appendChild(r),t?new Promise((e,n)=>{r.addEventListener("load",e),r.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${o}`)))}):void 0}),t=Promise.all(r.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}var r;function a(e){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=e,window.dispatchEvent(o),!o.defaultPrevented)throw e}return t.then(o=>{for(const e of o||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})};var jt=[{path:"/",name:"home",component:()=>Ht(()=>import("./Home-DOSUTfrE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))},{path:"/cli/:platform",name:"cli-projects",component:()=>Ht(()=>import("./ProjectList-BSxuL2td.js"),__vite__mapDeps([20,1,2,4,5,3,6,7,21,8,11,22,14,13,23,17,24])),meta:{requiresCli:!0}},{path:"/cli/:platform/sessions/:projectName",name:"cli-sessions",component:()=>Ht(()=>import("./SessionList-DhRYZ6vl.js"),__vite__mapDeps([25,1,2,4,5,3,6,7,8,21,11,26,14,27,28,10,12,29,30,31,22,32,33,34,35,36,37,38,39,13,40,41,23,17,42])),props:!0,meta:{requiresCli:!0}},...["claude","codex","gemini","opencode","omp"].flatMap(e=>[{path:`/${e}`,name:`${e}-projects-legacy`,redirect:{name:"cli-projects",params:{platform:e}}},{path:`/${e}/sessions/:projectName`,name:`${e}-sessions-legacy`,redirect:o=>({name:"cli-sessions",params:{platform:e,projectName:o.params.projectName}})}]),{path:"/workspaces",name:"workspaces",component:()=>Ht(()=>import("./WorkspaceManager-DsoNg2z8.js"),__vite__mapDeps([43,1,2,21,8,11,44,6,45,14,46,5,3,47,48]))},{path:"/config-templates",name:"config-templates",component:()=>Ht(()=>import("./ConfigTemplates-gyERg9iC.js"),__vite__mapDeps([49,1,2,21,8,11,50,6,28,45,34,36,35,37,46,5,3,51,52]))},{path:"/skills",name:"skills",component:()=>Ht(()=>import("./SkillManager-S698Hns8.js"),__vite__mapDeps([53,1,2,21,8,11,32,4,5,3,6,7,26,14,33,10,12,34,35,36,37,29,38,39,54]))},{path:"/plugins",name:"plugins",component:()=>Ht(()=>import("./PluginManager-BuRcWuBj.js"),__vite__mapDeps([55,1,2,21,8,11,56,5,3,4,6,7,26,14,10,12,34,38,57,58]))},{path:"/analytics",name:"analytics",component:()=>Ht(()=>import("./Analytics-1doS-8uC.js"),__vite__mapDeps([59,1,2,6,8,31,60]))},{path:"/:pathMatch(.*)*",redirect:"/"}],Ut=Ao({history:xo(),routes:jt});function Wt(e,o){let{target:n}=e;for(;n;){if(n.dataset&&void 0!==n.dataset[o])return!0;n=n.parentElement}return!1}function Nt(e={},o){const n=no({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:t,keyup:r}=e,a=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}void 0!==t&&Object.keys(t).forEach(o=>{if(o!==e.key)return;const n=t[o];if("function"==typeof n)n(e);else{const{stop:o=!1,prevent:t=!1}=n;o&&e.stopPropagation(),t&&e.preventDefault(),n.handler(e)}})},l=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}void 0!==r&&Object.keys(r).forEach(o=>{if(o!==e.key)return;const n=r[o];if("function"==typeof n)n(e);else{const{stop:o=!1,prevent:t=!1}=n;o&&e.stopPropagation(),t&&e.preventDefault(),n.handler(e)}})},i=()=>{(void 0===o||o.value)&&(ie("keydown",document,a),ie("keyup",document,l)),void 0!==o&&Xe(o,e=>{e?(ie("keydown",document,a),ie("keyup",document,l)):(be("keydown",document,a),be("keyup",document,l))})};return An()?(Ve(i),Fo(()=>{(void 0===o||o.value)&&(be("keydown",document,a),be("keyup",document,l))})):i(),wo(n)}function Kt(e,o,n){var t;const r=We(e,null);if(null===r)return;const a=null===(t=mo())||void 0===t?void 0:t.proxy;function l(e,n){if(!r)return;const t=r[o];void 0!==n&&function(e,o){e[o]||(e[o]=[]);e[o].splice(e[o].findIndex(e=>e===a),1)}(t,n),void 0!==e&&function(e,o){e[o]||(e[o]=[]);~e[o].findIndex(e=>e===a)||e[o].push(a)}(t,e)}Xe(n,l),l(n.value),Fo(()=>{l(void 0,n.value)})}function Vt(e){return e&-e}Ut.beforeEach(async e=>{if(!0!==e.meta.requiresCli)return!0;const o=Ko(e);if(!o)return{name:"home"};try{const e=Vo(),{uiConfig:n,loadUIConfig:t}=Ho();await Promise.all([e.load(),t()]);const{enabledKeys:r}=Dt({platformStore:e,configRef:n});return!!r.value.includes(o)||{name:"home"}}catch{return{name:"home"}}});var qt,Gt,Jt=class{constructor(e,o){this.l=e,this.min=o;const n=new Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,o){if(0===o)return;const{l:n,ft:t}=this;for(e+=1;e<=n;)t[e]+=o,e+=Vt(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(void 0===e&&(e=this.l),e<=0)return 0;const{ft:o,min:n,l:t}=this;if(e>t)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let r=e*n;for(;e>0;)r+=o[e],e-=Vt(e);return r}getBound(e){let o=0,n=this.l;for(;n>o;){const t=Math.floor((o+n)/2),r=this.sum(t);if(r>e)n=t;else{if(!(r<e))return t;if(o===t)return this.sum(o+1)<=e?o+1:t;o=t}}return o}};function Yt(){return"undefined"==typeof document?1:(void 0===Gt&&(Gt="chrome"in window?window.devicePixelRatio:1),Gt)}var Zt="VVirtualListXScroll";var Xt=Me({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:o,columnsRef:n,getLeft:t,renderColRef:r,renderItemWithColsRef:a}=We(Zt);return{startIndex:e,endIndex:o,columns:n,renderCol:r,renderItemWithCols:a,getLeft:t}},render(){const{startIndex:e,endIndex:o,columns:n,renderCol:t,renderItemWithCols:r,getLeft:a,item:l}=this;if(null!=r)return r({itemIndex:this.index,startColIndex:e,endColIndex:o,allColumns:n,item:l,getLeft:a});if(null!=t){const r=[];for(let i=e;i<=o;++i){const e=n[i];r.push(t({column:e,left:a(i),item:l}))}return r}return null}}),Qt=Qn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Qn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Qn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),er=Me({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(o){const n=f();Qt.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Fn,ssr:n}),Je(()=>{const{defaultScrollIndex:e,defaultScrollKey:n}=o;null!=e?b({index:e}):null!=n&&b({key:n})});let t=!1,r=!1;je(()=>{t=!1,r?b({top:m.value,left:i.value}):r=!0}),Fe(()=>{t=!0,r||(r=!0)});const a=e(()=>{if(null==o.renderCol&&null==o.renderItemWithCols)return;if(0===o.columns.length)return;let e=0;return o.columns.forEach(o=>{e+=o.width}),e}),l=to(()=>{const e=new Map,{keyField:n}=o;return o.items.forEach((o,t)=>{e.set(o[n],t)}),e}),{scrollLeftRef:i,listWidthRef:s}=function({columnsRef:o,renderColRef:n,renderItemWithColsRef:t}){const r=Io(0),a=Io(0),l=to(()=>{const e=o.value;if(0===e.length)return null;const n=new Jt(e.length,0);return e.forEach((e,o)=>{n.add(o,e.width)}),n}),i=e(()=>{const e=l.value;return null!==e?Math.max(e.getBound(a.value)-1,0):0}),s=e(()=>{const e=l.value;return null!==e?Math.min(e.getBound(a.value+r.value)+1,o.value.length-1):0});return Ee(Zt,{startIndexRef:i,endIndexRef:s,columnsRef:o,renderColRef:n,renderItemWithColsRef:t,getLeft:e=>{const o=l.value;return null!==o?o.sum(e):0}}),{listWidthRef:r,scrollLeftRef:a}}({columnsRef:lo(o,"columns"),renderColRef:lo(o,"renderCol"),renderItemWithColsRef:lo(o,"renderItemWithCols")}),d=Io(null),c=Io(void 0),u=new Map,p=to(()=>{const{items:e,itemSize:n,keyField:t}=o,r=new Jt(e.length,n);return e.forEach((e,o)=>{const n=e[t],a=u.get(n);void 0!==a&&r.add(o,a)}),r}),h=Io(0),m=Io(0),v=e(()=>Math.max(p.value.getBound(m.value-re(o.paddingTop))-1,0)),g=to(()=>{const{value:e}=c;if(void 0===e)return[];const{items:n,itemSize:t}=o,r=v.value,a=Math.min(r+Math.ceil(e/t+1),n.length-1),l=[];for(let o=r;o<=a;++o)l.push(n[o]);return l}),b=(e,o)=>{if("number"==typeof e)return void w(e,o,"auto");const{left:n,top:t,index:r,key:a,position:i,behavior:s,debounce:d=!0}=e;if(void 0!==n||void 0!==t)w(n,t,s);else if(void 0!==r)C(r,s,d);else if(void 0!==a){const e=l.value.get(a);void 0!==e&&C(e,s,d)}else"bottom"===i?w(0,Number.MAX_SAFE_INTEGER,s):"top"===i&&w(0,0,s)};let y,x=null;function C(e,n,t){const{value:r}=p,a=r.sum(e)+re(o.paddingTop);if(t){y=e,null!==x&&window.clearTimeout(x),x=window.setTimeout(()=>{y=void 0,x=null},16);const{scrollTop:o,offsetHeight:t}=d.value;if(a>o){const l=r.get(e);a+l<=o+t||d.value.scrollTo({left:0,top:a+l-t,behavior:n})}else d.value.scrollTo({left:0,top:a,behavior:n})}else d.value.scrollTo({left:0,top:a,behavior:n})}function w(e,o,n){d.value.scrollTo({left:e,top:o,behavior:n})}const S=!("undefined"!=typeof document&&(void 0===qt&&(qt="matchMedia"in window&&window.matchMedia("(pointer:coarse)").matches),qt));let k=!1;function P(){const{value:e}=d;null!=e&&(m.value=e.scrollTop,i.value=e.scrollLeft)}function T(e){let o=e;for(;null!==o;){if("none"===o.style.display)return!0;o=o.parentElement}return!1}return{listHeight:c,listStyle:{overflow:"auto"},keyToIndex:l,itemsStyle:to(()=>{const{itemResizable:e}=o,n=V(p.value.sum());return h.value,[o.itemsStyle,{boxSizing:"content-box",width:V(a.value),height:e?"":n,minHeight:e?n:"",paddingTop:V(o.paddingTop),paddingBottom:V(o.paddingBottom)}]}),visibleItemsStyle:to(()=>(h.value,{transform:`translateY(${V(p.value.sum(v.value))})`})),viewportItems:g,listElRef:d,itemsElRef:Io(null),scrollTo:b,handleListResize:function(e){if(t)return;if(T(e.target))return;if(null==o.renderCol&&null==o.renderItemWithCols){if(e.contentRect.height===c.value)return}else if(e.contentRect.height===c.value&&e.contentRect.width===s.value)return;c.value=e.contentRect.height,s.value=e.contentRect.width;const{onResize:n}=o;void 0!==n&&n(e)},handleListScroll:function(e){var n;null===(n=o.onScroll)||void 0===n||n.call(o,e),S&&k||P()},handleListWheel:function(e){var n;if(null===(n=o.onWheel)||void 0===n||n.call(o,e),S){const o=d.value;if(null!=o){if(0===e.deltaX){if(0===o.scrollTop&&e.deltaY<=0)return;if(o.scrollTop+o.offsetHeight>=o.scrollHeight&&e.deltaY>=0)return}e.preventDefault(),o.scrollTop+=e.deltaY/Yt(),o.scrollLeft+=e.deltaX/Yt(),P(),k=!0,Rn(()=>{k=!1})}}},handleItemResize:function(e,n){var r,a,i;if(t)return;if(o.ignoreItemResize)return;if(T(n.target))return;const{value:s}=p,c=l.value.get(e),f=s.get(c),m=null!==(i=null===(a=null===(r=n.borderBoxSize)||void 0===r?void 0:r[0])||void 0===a?void 0:a.blockSize)&&void 0!==i?i:n.contentRect.height;if(m===f)return;m-o.itemSize===0?u.delete(e):u.set(e,m-o.itemSize);const v=m-f;if(0===v)return;s.add(c,v);const g=d.value;if(null!=g){if(void 0===y){const e=s.sum(c);g.scrollTop>e&&g.scrollBy(0,v)}else(c<y||c===y&&m+s.sum(c)>g.scrollTop+g.offsetHeight)&&g.scrollBy(0,v);P()}h.value++}}},render(){const{itemResizable:e,keyField:o,keyToIndex:n,visibleItemsTag:t}=this;return Ue(C,{onResize:this.handleListResize},{default:()=>{var r,a;return Ue("div",Be(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[0!==this.items.length?Ue("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[Ue(t,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:t,renderItemWithCols:r}=this;return this.viewportItems.map(a=>{const l=a[o],i=n.get(l),s=null!=t?Ue(Xt,{index:i,item:a}):void 0,d=null!=r?Ue(Xt,{index:i,item:a}):void 0,c=this.$slots.default({item:a,renderedCols:s,renderedItemWithCols:d,index:i})[0];return e?Ue(C,{key:l,onResize:e=>this.handleItemResize(l,e)},{default:()=>c}):(c.key=l,c)})}})]):null===(a=(r=this.$slots).empty)||void 0===a?void 0:a.call(r)])}})}}),or="v-hidden",nr=Qn("[v-hidden]",{display:"none!important"}),tr=Me({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:o}){const n=Io(null),t=Io(null);function r(r){const{value:a}=n,{getCounter:l,getTail:i}=e;let s;if(s=void 0!==l?l():t.value,!a||!s)return;s.hasAttribute(or)&&s.removeAttribute(or);const{children:d}=a;if(r.showAllItemsBeforeCalculate)for(const e of d)e.hasAttribute(or)&&e.removeAttribute(or);const c=a.offsetWidth,u=[],p=o.tail?null==i?void 0:i():null;let h=p?p.offsetWidth:0,f=!1;const m=a.children.length-(o.tail?1:0);for(let o=0;o<m-1;++o){if(o<0)continue;const n=d[o];if(f){n.hasAttribute(or)||n.setAttribute(or,"");continue}n.hasAttribute(or)&&n.removeAttribute(or);const t=n.offsetWidth;if(h+=t,u[o]=t,h>c){const{updateCounter:n}=e;for(let t=o;t>=0;--t){const r=m-1-t;void 0!==n?n(r):s.textContent=`${r}`;const a=s.offsetWidth;if(h-=u[t],h+a<=c||0===t){f=!0,o=t-1,p&&(-1===o?(p.style.maxWidth=c-a+"px",p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:n}=e;n&&n(r);break}}}}const{onUpdateOverflow:v}=e;f?void 0!==v&&v(!0):(void 0!==v&&v(!1),s.setAttribute(or,""))}const a=f();return nr.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Fn,ssr:a}),Je(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:t,sync:r}},render(){const{$slots:e}=this;return De(()=>this.sync({showAllItemsBeforeCalculate:!1})),Ue("div",{class:"v-overflow",ref:"selfRef"},[ko(e,"default"),e.counter?e.counter():Ue("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function rr(e,o){o&&(Je(()=>{const{value:n}=e;n&&c.registerHandler(n,o)}),Xe(e,(e,o)=>{o&&c.unregisterHandler(o)},{deep:!1}),Fo(()=>{const{value:o}=e;o&&c.unregisterHandler(o)}))}function ar(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function lr(e){return o=>{e.value=o?o.$el:null}}function ir(e,o="default",n=[]){const t=e.$slots[o];return void 0===t?n:t()}function sr(e){const o=e.filter(e=>void 0!==e);if(0!==o.length)return 1===o.length?o[0]:o=>{e.forEach(e=>{e&&e(o)})}}function dr(e,o=[],n){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{o.includes(n)||(t[n]=e[n])}),Object.assign(t,n)}var cr=Me({name:"Add",render:()=>Ue("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}),ur=Me({name:"Checkmark",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Ue("g",{fill:"none"},Ue("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}),pr=Me({name:"ChevronDown",render:()=>Ue("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}),hr=Me({name:"ChevronRight",render:()=>Ue("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("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"}))}),fr=ne("clear",()=>Ue("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Ue("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Ue("g",{fill:"currentColor","fill-rule":"nonzero"},Ue("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),mr=Me({name:"Empty",render:()=>Ue("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),Ue("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}),vr=Me({name:"Eye",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ue("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),Ue("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}),gr=Me({name:"EyeOff",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ue("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),Ue("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),Ue("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),Ue("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),Ue("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}),br=Me({name:"Remove",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ue("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:"\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 32px;\n "}))}),yr=G("base-clear","\n flex-shrink: 0;\n height: 1em;\n width: 1em;\n position: relative;\n",[Z(">",[we("clear","\n font-size: var(--n-clear-size);\n height: 1em;\n width: 1em;\n cursor: pointer;\n color: var(--n-clear-color);\n transition: color .3s var(--n-bezier);\n display: flex;\n ",[Z("&:hover","\n color: var(--n-clear-color-hover)!important;\n "),Z("&:active","\n color: var(--n-clear-color-pressed)!important;\n ")]),we("placeholder","\n display: flex;\n "),we("clear, placeholder","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[b({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),xr=Me({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup:e=>(x("-base-clear",yr,lo(e,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}),render(){const{clsPrefix:e}=this;return Ue("div",{class:`${e}-base-clear`},Ue(o,null,{default:()=>{var o,n;return this.show?Ue("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Ie(this.$slots.icon,()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(fr,null)})])):Ue("div",{key:"icon",class:`${e}-base-clear__placeholder`},null===(n=(o=this.$slots).placeholder)||void 0===n?void 0:n.call(o))}}))}}),Cr=Me({props:{onFocus:Function,onBlur:Function},setup:e=>()=>Ue("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}),wr="#000",Sr="#fff",kr="#fff",Pr="rgb(72, 72, 78)",Tr="rgb(24, 24, 28)",Ir="rgb(44, 44, 50)",Ar="rgb(16, 16, 20)",zr="0.9",Rr="0.82",Mr="0.52",Fr="0.38",Or="0.28",$r="0.52",Br="0.38",Er="0.06",_r="0.09",Dr="0.06",Lr="0.05",Hr="0.05",jr="0.18",Ur="0.2",Wr="0.12",Nr="0.24",Kr="0.09",Vr="0.1",qr="0.06",Gr="0.04",Jr="0.2",Yr="0.3",Zr="0.12",Xr="0.2",Qr="#7fe7c4",ea="#63e2b7",oa="#5acea7",na="rgb(42, 148, 125)",ta="#8acbec",ra="#70c0e8",aa="#66afd3",la="rgb(56, 137, 197)",ia="#e98b8b",sa="#e88080",da="#e57272",ca="rgb(208, 58, 82)",ua="#f5d599",pa="#f2c97d",ha="#e6c260",fa="rgb(240, 138, 0)",ma="#7fe7c4",va="#63e2b7",ga="#5acea7",ba="rgb(42, 148, 125)",ya=ve(wr),xa=ve(Sr),Ca=`rgba(${xa.slice(0,3).join(", ")}, `;function wa(e){return`${Ca+String(e)})`}var Sa=Object.assign(Object.assign({name:"common"},d),{baseColor:wr,primaryColor:ea,primaryColorHover:Qr,primaryColorPressed:oa,primaryColorSuppl:na,infoColor:ra,infoColorHover:ta,infoColorPressed:aa,infoColorSuppl:la,successColor:va,successColorHover:ma,successColorPressed:ga,successColorSuppl:ba,warningColor:pa,warningColorHover:ua,warningColorPressed:ha,warningColorSuppl:fa,errorColor:sa,errorColorHover:ia,errorColorPressed:da,errorColorSuppl:ca,textColorBase:kr,textColor1:wa(zr),textColor2:wa(Rr),textColor3:wa(Mr),textColorDisabled:wa(Fr),placeholderColor:wa(Fr),placeholderColorDisabled:wa(Or),iconColor:wa(Fr),iconColorDisabled:wa(Or),iconColorHover:wa(1.25*Number(Fr)),iconColorPressed:wa(.8*Number(Fr)),opacity1:zr,opacity2:Rr,opacity3:Mr,opacity4:Fr,opacity5:Or,dividerColor:wa(Kr),borderColor:wa(Nr),closeIconColorHover:wa(Number($r)),closeIconColor:wa(Number($r)),closeIconColorPressed:wa(Number($r)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:wa(Fr),clearColorHover:W(wa(Fr),{alpha:1.25}),clearColorPressed:W(wa(Fr),{alpha:.8}),scrollbarColor:wa(Jr),scrollbarColorHover:wa(Yr),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:wa(Wr),railColor:wa(Ur),popoverColor:Pr,tableColor:Tr,cardColor:Tr,modalColor:Ir,bodyColor:Ar,tagColor:function(e){const o=Array.from(xa);return o[3]=Number(e),de(ya,o)}(Xr),avatarColor:wa(jr),invertedColor:wr,inputColor:wa(Vr),codeColor:wa(Zr),tabColor:wa(Gr),actionColor:wa(qr),tableHeaderColor:wa(qr),hoverColor:wa(_r),tableColorHover:wa(Dr),tableColorStriped:wa(Lr),pressedColor:wa(Hr),opacityDisabled:Br,inputColorDisabled:wa(Er),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),ka={name:"Scrollbar",common:Sa,self:k};function Pa(e){return Array.isArray(e)?e:[e]}var Ta="STOP";function Ia(e,o){const n=o(e);void 0!==e.children&&n!==Ta&&e.children.forEach(e=>Ia(e,o))}function Aa(e){return e.children}function za(e){return e.key}function Ra(){return!1}function Ma(e){return!0===e.disabled}function Fa(e){var o;return null==e?[]:Array.isArray(e)?e:null!==(o=e.checkedKeys)&&void 0!==o?o:[]}function Oa(e){var o;return null==e||Array.isArray(e)?[]:null!==(o=e.indeterminateKeys)&&void 0!==o?o:[]}function $a(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function Ba(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function Ea(e){return"group"===(null==e?void 0:e.type)}var _a=class extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}};function Da(e,o,n,t){const r=Ha(o,n,t,!1),a=Ha(e,n,t,!0),l=function(e,o){const n=new Set;return e.forEach(e=>{const t=o.treeNodeMap.get(e);if(void 0!==t){let e=t.parent;for(;null!==e&&!e.disabled&&!n.has(e.key);)n.add(e.key),e=e.parent}}),n}(e,n),i=[];return r.forEach(e=>{(a.has(e)||l.has(e))&&i.push(e)}),i.forEach(e=>r.delete(e)),r}function La(e,o){const{checkedKeys:n,keysToCheck:t,keysToUncheck:r,indeterminateKeys:a,cascade:l,leafOnly:i,checkStrategy:s,allowNotLoaded:d}=e;if(!l)return void 0!==t?{checkedKeys:$a(n,t),indeterminateKeys:Array.from(a)}:void 0!==r?{checkedKeys:Ba(n,r),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:c}=o;let u;u=void 0!==r?Da(r,n,o,d):void 0!==t?function(e,o,n,t){return Ha(o.concat(e),n,t,!1)}(t,n,o,d):Ha(n,o,d,!1);const p="parent"===s,h="child"===s||i,f=u,m=new Set;for(let v=Math.max.apply(null,Array.from(c.keys()));v>=0;v-=1){const e=0===v,o=c.get(v);for(const n of o){if(n.isLeaf)continue;const{key:o,shallowLoaded:t}=n;if(h&&t&&n.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&f.has(e.key)&&f.delete(e.key)}),n.disabled||!t)continue;let r=!0,a=!1,l=!0;for(const e of n.children){const o=e.key;if(!e.disabled)if(l&&(l=!1),f.has(o))a=!0;else{if(m.has(o)){a=!0,r=!1;break}if(r=!1,a)break}}r&&!l?(p&&n.children.forEach(e=>{!e.disabled&&f.has(e.key)&&f.delete(e.key)}),f.add(o)):a&&m.add(o),e&&h&&f.has(o)&&f.delete(o)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(m)}}function Ha(e,o,n,t){const{treeNodeMap:r,getChildren:a}=o,l=new Set,i=new Set(e);return e.forEach(e=>{const o=r.get(e);void 0!==o&&Ia(o,e=>{if(e.disabled)return Ta;const{key:o}=e;if(!l.has(o)&&(l.add(o),i.add(o),function(e,o){return!1===e.isLeaf&&!Array.isArray(o(e))}(e.rawNode,a))){if(t)return Ta;if(!n)throw new _a}})}),i}function ja(e,o){const n=e.siblings,t=n.length,{index:r}=e;return o?n[(r+1)%t]:r===n.length-1?null:n[r+1]}function Ua(e,o,{loop:n=!1,includeDisabled:t=!1}={}){const r="prev"===o?Wa:ja,a={reverse:"prev"===o};let l=!1,i=null;return function o(s){if(null!==s){if(s===e)if(l){if(!e.disabled&&!e.isGroup)return void(i=e)}else l=!0;else if((!s.disabled||t)&&!s.ignored&&!s.isGroup)return void(i=s);if(s.isGroup){const e=Na(s,a);null!==e?i=e:o(r(s,n))}else{const e=r(s,!1);if(null!==e)o(e);else{const e=function(e){return e.parent}(s);(null==e?void 0:e.isGroup)?o(r(e,n)):n&&o(r(s,!0))}}}}(e),i}function Wa(e,o){const n=e.siblings,t=n.length,{index:r}=e;return o?n[(r-1+t)%t]:0===r?null:n[r-1]}function Na(e,o={}){const{reverse:n=!1}=o,{children:t}=e;if(t){const{length:e}=t,r=n?-1:e,a=n?-1:1;for(let l=n?e-1:0;l!==r;l+=a){const e=t[l];if(!e.disabled&&!e.ignored){if(!e.isGroup)return e;{const n=Na(e,o);if(null!==n)return n}}}}return null}var Ka={getChild(){return this.ignored?null:Na(this)},getParent(){const{parent:e}=this;return(null==e?void 0:e.isGroup)?e.getParent():e},getNext(e={}){return Ua(this,"next",e)},getPrev(e={}){return Ua(this,"prev",e)}};function Va(e,o,n,t,r,a=null,l=0){const i=[];return e.forEach((s,d)=>{var c;const u=Object.create(t);if(u.rawNode=s,u.siblings=i,u.level=l,u.index=d,u.isFirstChild=0===d,u.isLastChild=d+1===e.length,u.parent=a,!u.ignored){const e=r(s);Array.isArray(e)&&(u.children=Va(e,o,n,t,r,u,l+1))}i.push(u),o.set(u.key,u),n.has(l)||n.set(l,[]),null===(c=n.get(l))||void 0===c||c.push(u)}),i}function qa(e,o={}){var n;const t=new Map,r=new Map,{getDisabled:a=Ma,getIgnored:l=Ra,getIsGroup:i=Ea,getKey:s=za}=o,d=null!==(n=o.getChildren)&&void 0!==n?n:Aa,c=o.ignoreEmptyChildren?e=>{const o=d(e);return Array.isArray(o)?o.length?o:null:o}:d,u=Va(e,t,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return i(this.rawNode)},get isLeaf(){return function(e,o){const{isLeaf:n}=e;return void 0!==n?n:!o(e)}(this.rawNode,c)},get shallowLoaded(){return function(e,o){const{isLeaf:n}=e;return!(!1===n&&!Array.isArray(o(e)))}(this.rawNode,c)},get ignored(){return l(this.rawNode)},contains(e){return function(e,o){const n=e.key;for(;o;){if(o.key===n)return!0;o=o.parent}return!1}(this,e)}},Ka),c);function p(e){if(null==e)return null;const o=t.get(e);return o&&!o.ignored?o:null}const h={treeNodes:u,treeNodeMap:t,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:c,getFlattenedNodes:e=>function(e,o){const n=o?new Set(o):void 0,t=[];return function e(o){o.forEach(o=>{t.push(o),o.isLeaf||!o.children||o.ignored||(o.isGroup||void 0===n||n.has(o.key))&&e(o.children)})}(e),t}(u,e),getNode:function(e){if(null==e)return null;const o=t.get(e);return!o||o.isGroup||o.ignored?null:o},getPrev:function(e,o){const n=p(e);return n?n.getPrev(o):null},getNext:function(e,o){const n=p(e);return n?n.getNext(o):null},getParent:function(e){const o=p(e);return o?o.getParent():null},getChild:function(e){const o=p(e);return o?o.getChild():null},getFirstAvailableNode:()=>function(e){if(0===e.length)return null;const o=e[0];return o.isGroup||o.ignored||o.disabled?o.getNext():o}(u),getPath:(e,o={})=>function(e,{includeGroup:o=!1,includeSelf:n=!0},t){var r;const a=t.treeNodeMap;let l=null==e?null:null!==(r=a.get(e))&&void 0!==r?r:null;const i={keyPath:[],treeNodePath:[],treeNode:l};if(null==l?void 0:l.ignored)return i.treeNode=null,i;for(;l;)l.ignored||!o&&l.isGroup||i.treeNodePath.push(l),l=l.parent;return i.treeNodePath.reverse(),n||i.treeNodePath.pop(),i.keyPath=i.treeNodePath.map(e=>e.key),i}(e,o,h),getCheckedKeys(e,o={}){const{cascade:n=!0,leafOnly:t=!1,checkStrategy:r="all",allowNotLoaded:a=!1}=o;return La({checkedKeys:Fa(e),indeterminateKeys:Oa(e),cascade:n,leafOnly:t,checkStrategy:r,allowNotLoaded:a},h)},check(e,o,n={}){const{cascade:t=!0,leafOnly:r=!1,checkStrategy:a="all",allowNotLoaded:l=!1}=n;return La({checkedKeys:Fa(o),indeterminateKeys:Oa(o),keysToCheck:null==e?[]:Pa(e),cascade:t,leafOnly:r,checkStrategy:a,allowNotLoaded:l},h)},uncheck(e,o,n={}){const{cascade:t=!0,leafOnly:r=!1,checkStrategy:a="all",allowNotLoaded:l=!1}=n;return La({checkedKeys:Fa(o),indeterminateKeys:Oa(o),keysToUncheck:null==e?[]:Pa(e),cascade:t,leafOnly:r,checkStrategy:a,allowNotLoaded:l},h)},getNonLeafKeys:(e={})=>function(e,o={}){const{preserveGroup:n=!1}=o,t=[],r=n?e=>{e.isLeaf||(t.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||t.push(e.key),a(e.children))};function a(e){e.forEach(r)}return a(e),t}(u,e)};return h}var Ga={name:"Empty",common:Sa,self:Ce},Ja=G("empty","\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: var(--n-font-size);\n",[we("icon","\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n line-height: var(--n-icon-size);\n color: var(--n-icon-color);\n transition:\n color .3s var(--n-bezier);\n ",[Z("+",[we("description","\n margin-top: 8px;\n ")])]),we("description","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n "),we("extra","\n text-align: center;\n transition: color .3s var(--n-bezier);\n margin-top: 12px;\n color: var(--n-extra-text-color);\n ")]),Ya=Me({name:"Empty",props:Object.assign(Object.assign({},g.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),slots:Object,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n,mergedComponentPropsRef:t}=J(e),r=g("Empty","-empty",Ja,B,e,o),{localeRef:a}=h("Empty"),l=to(()=>{var o,n,r;return null!==(o=e.description)&&void 0!==o?o:null===(r=null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.Empty)||void 0===r?void 0:r.description}),i=to(()=>{var e,o;return(null===(o=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.Empty)||void 0===o?void 0:o.renderIcon)||(()=>Ue(mr,null))}),s=to(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{[Te("iconSize",o)]:t,[Te("fontSize",o)]:a,textColor:l,iconColor:i,extraTextColor:s}}=r.value;return{"--n-icon-size":t,"--n-font-size":a,"--n-bezier":n,"--n-text-color":l,"--n-icon-color":i,"--n-extra-text-color":s}}),d=n?X("empty",to(()=>{let o="";const{size:n}=e;return o+=n[0],o}),s,e):void 0;return{mergedClsPrefix:o,mergedRenderIcon:i,localizedDescription:to(()=>l.value||a.value.description),cssVars:n?void 0:s,themeClass:null==d?void 0:d.themeClass,onRender:null==d?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:o,onRender:n}=this;return null==n||n(),Ue("div",{class:[`${o}-empty`,this.themeClass],style:this.cssVars},this.showIcon?Ue("div",{class:`${o}-empty__icon`},e.icon?e.icon():Ue(ee,{clsPrefix:o},{default:this.mergedRenderIcon})):null,this.showDescription?Ue("div",{class:`${o}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?Ue("div",{class:`${o}-empty__extra`},e.extra()):null)}}),Za={name:"InternalSelectMenu",common:Sa,peers:{Scrollbar:ka,Empty:Ga},self:On},Xa=Me({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:o,labelFieldRef:n,nodePropsRef:t}=We(kn);return{labelField:n,nodeProps:t,renderLabel:e,renderOption:o}},render(){const{clsPrefix:e,renderLabel:o,renderOption:n,nodeProps:t,tmNode:{rawNode:r}}=this,a=null==t?void 0:t(r),l=o?o(r,!1):ot(r[this.labelField],r,!1),i=Ue("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,null==a?void 0:a.class]}),l);return r.render?r.render({node:i,option:r}):n?n({node:i,option:r,selected:!1}):i}});var Qa=Me({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(o){const{valueRef:n,pendingTmNodeRef:t,multipleRef:r,valueSetRef:a,renderLabelRef:l,renderOptionRef:i,labelFieldRef:s,valueFieldRef:d,showCheckmarkRef:c,nodePropsRef:u,handleOptionClick:p,handleOptionMouseEnter:h}=We(kn),f=e(()=>{const{value:e}=t;return!!e&&o.tmNode.key===e.key});return{multiple:r,isGrouped:e(()=>{const{tmNode:e}=o,{parent:n}=e;return n&&"group"===n.rawNode.type}),showCheckmark:c,nodeProps:u,isPending:f,isSelected:e(()=>{const{value:e}=n,{value:t}=r;if(null===e)return!1;const l=o.tmNode.rawNode[d.value];if(t){const{value:e}=a;return e.has(l)}return e===l}),labelField:s,renderLabel:l,renderOption:i,handleMouseMove:function(e){const{tmNode:n}=o,{value:t}=f;n.disabled||t||h(e,n)},handleMouseEnter:function(e){const{tmNode:n}=o;n.disabled||h(e,n)},handleClick:function(e){const{tmNode:n}=o;n.disabled||p(e,n)}}},render(){const{clsPrefix:e,tmNode:{rawNode:o},isSelected:n,isPending:t,isGrouped:r,showCheckmark:a,nodeProps:l,renderOption:i,renderLabel:s,handleClick:d,handleMouseEnter:c,handleMouseMove:u}=this,p=function(e,o){return Ue(go,{name:"fade-in-scale-up-transition"},{default:()=>e?Ue(ee,{clsPrefix:o,class:`${o}-base-select-option__check`},{default:()=>Ue(ur)}):null})}(n,e),h=s?[s(o,n),a&&p]:[ot(o[this.labelField],o,n),a&&p],f=null==l?void 0:l(o),m=Ue("div",Object.assign({},f,{class:[`${e}-base-select-option`,o.class,null==f?void 0:f.class,{[`${e}-base-select-option--disabled`]:o.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:r,[`${e}-base-select-option--pending`]:t,[`${e}-base-select-option--show-checkmark`]:a}],style:[(null==f?void 0:f.style)||"",o.style||""],onClick:sr([d,null==f?void 0:f.onClick]),onMouseenter:sr([c,null==f?void 0:f.onMouseenter]),onMousemove:sr([u,null==f?void 0:f.onMousemove])}),Ue("div",{class:`${e}-base-select-option__content`},h));return o.render?o.render({node:m,option:o,selected:n}):i?i({node:m,option:o,selected:n}):m}}),el=G("base-select-menu","\n line-height: 1.5;\n outline: none;\n z-index: 0;\n position: relative;\n border-radius: var(--n-border-radius);\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n background-color: var(--n-color);\n",[G("scrollbar","\n max-height: var(--n-height);\n "),G("virtual-list","\n max-height: var(--n-height);\n "),G("base-select-option","\n min-height: var(--n-option-height);\n font-size: var(--n-option-font-size);\n display: flex;\n align-items: center;\n ",[we("content","\n z-index: 1;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n ")]),G("base-select-group-header","\n min-height: var(--n-option-height);\n font-size: .93em;\n display: flex;\n align-items: center;\n "),G("base-select-menu-option-wrapper","\n position: relative;\n width: 100%;\n "),we("loading, empty","\n display: flex;\n padding: 12px 32px;\n flex: 1;\n justify-content: center;\n "),we("loading","\n color: var(--n-loading-color);\n font-size: var(--n-loading-size);\n "),we("header","\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-bottom: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n "),we("action","\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-top: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n "),G("base-select-group-header","\n position: relative;\n cursor: default;\n padding: var(--n-option-padding);\n color: var(--n-group-header-text-color);\n "),G("base-select-option","\n cursor: pointer;\n position: relative;\n padding: var(--n-option-padding);\n transition:\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n box-sizing: border-box;\n color: var(--n-option-text-color);\n opacity: 1;\n ",[ze("show-checkmark","\n padding-right: calc(var(--n-option-padding-right) + 20px);\n "),Z("&::before",'\n content: "";\n position: absolute;\n left: 4px;\n right: 4px;\n top: 0;\n bottom: 0;\n border-radius: var(--n-border-radius);\n transition: background-color .3s var(--n-bezier);\n '),Z("&:active","\n color: var(--n-option-text-color-pressed);\n "),ze("grouped","\n padding-left: calc(var(--n-option-padding-left) * 1.5);\n "),ze("pending",[Z("&::before","\n background-color: var(--n-option-color-pending);\n ")]),ze("selected","\n color: var(--n-option-text-color-active);\n ",[Z("&::before","\n background-color: var(--n-option-color-active);\n "),ze("pending",[Z("&::before","\n background-color: var(--n-option-color-active-pending);\n ")])]),ze("disabled","\n cursor: not-allowed;\n ",[H("selected","\n color: var(--n-option-text-color-disabled);\n "),ze("selected","\n opacity: var(--n-option-opacity-disabled);\n ")]),we("check","\n font-size: 16px;\n position: absolute;\n right: calc(var(--n-option-padding-right) - 4px);\n top: calc(50% - 7px);\n color: var(--n-option-check-color);\n transition: color .3s var(--n-bezier);\n ",[Hn({enterScale:"0.5"})])])]),ol=Me({name:"InternalSelectMenu",props:Object.assign(Object.assign({},g.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=J(e),t=p("InternalSelectMenu",n,o),r=g("InternalSelectMenu","-internal-select-menu",el,Ln,e,lo(e,"clsPrefix")),a=Io(null),l=Io(null),i=Io(null),s=to(()=>e.treeMate.getFlattenedNodes()),d=to(()=>function(e){const o=new Map;return e.forEach((e,n)=>{o.set(e.key,n)}),e=>{var n;return null!==(n=o.get(e))&&void 0!==n?n:null}}(s.value)),c=Io(null);function u(){const{value:o}=c;o&&!e.treeMate.getNode(o.key)&&(c.value=null)}let h;Xe(()=>e.show,o=>{o?h=Xe(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?function(){const{treeMate:o}=e;let n=null;const{value:t}=e;null===t?n=o.getFirstAvailableNode():(n=e.multiple?o.getNode((t||[])[(t||[]).length-1]):o.getNode(t),n&&!n.disabled||(n=o.getFirstAvailableNode())),x(n||null)}():u(),De(C)):u()},{immediate:!0}):null==h||h()},{immediate:!0}),Fo(()=>{null==h||h()});const f=to(()=>re(r.value.self[Te("optionHeight",e.size)])),m=to(()=>N(r.value.self[Te("padding",e.size)])),v=to(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),b=to(()=>{const e=s.value;return e&&0===e.length});function y(o){const{onScroll:n}=e;n&&n(o)}function x(e,o=!1){c.value=e,o&&C()}function C(){var o,n;const t=c.value;if(!t)return;const r=d.value(t.key);null!==r&&(e.virtualScroll?null===(o=l.value)||void 0===o||o.scrollTo({index:r}):null===(n=i.value)||void 0===n||n.scrollTo({index:r,elSize:f.value}))}Ee(kn,{handleOptionMouseEnter:function(e,o){o.disabled||x(o,!1)},handleOptionClick:function(o,n){n.disabled||function(o){const{onToggle:n}=e;n&&n(o)}(n)},valueSetRef:v,pendingTmNodeRef:c,nodePropsRef:lo(e,"nodeProps"),showCheckmarkRef:lo(e,"showCheckmark"),multipleRef:lo(e,"multiple"),valueRef:lo(e,"value"),renderLabelRef:lo(e,"renderLabel"),renderOptionRef:lo(e,"renderOption"),labelFieldRef:lo(e,"labelField"),valueFieldRef:lo(e,"valueField")}),Ee(Un,a),Je(()=>{const{value:e}=i;e&&e.sync()});const w=to(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{height:t,borderRadius:a,color:l,groupHeaderTextColor:i,actionDividerColor:s,optionTextColorPressed:d,optionTextColor:c,optionTextColorDisabled:u,optionTextColorActive:p,optionOpacityDisabled:h,optionCheckColor:f,actionTextColor:m,optionColorPending:v,optionColorActive:g,loadingColor:b,loadingSize:y,optionColorActivePending:x,[Te("optionFontSize",o)]:C,[Te("optionHeight",o)]:w,[Te("optionPadding",o)]:S}}=r.value;return{"--n-height":t,"--n-action-divider-color":s,"--n-action-text-color":m,"--n-bezier":n,"--n-border-radius":a,"--n-color":l,"--n-option-font-size":C,"--n-group-header-text-color":i,"--n-option-check-color":f,"--n-option-color-pending":v,"--n-option-color-active":g,"--n-option-color-active-pending":x,"--n-option-height":w,"--n-option-opacity-disabled":h,"--n-option-text-color":c,"--n-option-text-color-active":p,"--n-option-text-color-disabled":u,"--n-option-text-color-pressed":d,"--n-option-padding":S,"--n-option-padding-left":N(S,"left"),"--n-option-padding-right":N(S,"right"),"--n-loading-color":b,"--n-loading-size":y}}),{inlineThemeDisabled:S}=e,k=S?X("internal-select-menu",to(()=>e.size[0]),w,e):void 0,P={selfRef:a,next:function(){const{value:e}=c;e&&x(e.getNext({loop:!0}),!0)},prev:function(){const{value:e}=c;e&&x(e.getPrev({loop:!0}),!0)},getPendingTmNode:function(){const{value:e}=c;return e||null}};return rr(a,e.onResize),Object.assign({mergedTheme:r,mergedClsPrefix:o,rtlEnabled:t,virtualListRef:l,scrollbarRef:i,itemSize:f,padding:m,flattenedNodes:s,empty:b,virtualListContainer(){const{value:e}=l;return null==e?void 0:e.listElRef},virtualListContent(){const{value:e}=l;return null==e?void 0:e.itemsElRef},doScroll:y,handleFocusin:function(o){var n,t;(null===(n=a.value)||void 0===n?void 0:n.contains(o.target))&&(null===(t=e.onFocus)||void 0===t||t.call(e,o))},handleFocusout:function(o){var n,t;(null===(n=a.value)||void 0===n?void 0:n.contains(o.relatedTarget))||null===(t=e.onBlur)||void 0===t||t.call(e,o)},handleKeyUp:function(o){var n;Wt(o,"action")||null===(n=e.onKeyup)||void 0===n||n.call(e,o)},handleKeyDown:function(o){var n;Wt(o,"action")||null===(n=e.onKeydown)||void 0===n||n.call(e,o)},handleMouseDown:function(o){var n;null===(n=e.onMousedown)||void 0===n||n.call(e,o),e.focusable||o.preventDefault()},handleVirtualListResize:function(){var e;null===(e=i.value)||void 0===e||e.sync()},handleVirtualListScroll:function(e){var o;null===(o=i.value)||void 0===o||o.sync(),y(e)},cssVars:S?void 0:w,themeClass:null==k?void 0:k.themeClass,onRender:null==k?void 0:k.onRender},P)},render(){const{$slots:e,virtualScroll:o,clsPrefix:n,mergedTheme:t,themeClass:r,onRender:l}=this;return null==l||l(),Ue("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,r,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},a(e.header,e=>e&&Ue("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},e)),this.loading?Ue("div",{class:`${n}-base-select-menu__loading`},Ue(I,{clsPrefix:n,strokeWidth:20})):this.empty?Ue("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Ie(e.empty,()=>[Ue(Ya,{theme:t.peers.Empty,themeOverrides:t.peerOverrides.Empty,size:this.size})])):Ue(Ae,{ref:"scrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?Ue(er,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?Ue(Xa,{key:e.key,clsPrefix:n,tmNode:e}):e.ignored?null:Ue(Qa,{clsPrefix:n,key:e.key,tmNode:e})}):Ue("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(e=>e.isGroup?Ue(Xa,{key:e.key,clsPrefix:n,tmNode:e}):Ue(Qa,{clsPrefix:n,key:e.key,tmNode:e})))}),a(e.action,e=>e&&[Ue("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},e),Ue(Cr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),nl={name:"Popover",common:Sa,peers:{Scrollbar:ka},self:Nn},tl={name:"Tag",common:Sa,self(e){const{textColor2:o,primaryColorHover:n,primaryColorPressed:t,primaryColor:r,infoColor:a,successColor:l,warningColor:i,errorColor:s,baseColor:d,borderColor:c,tagColor:u,opacityDisabled:p,closeIconColor:h,closeIconColorHover:f,closeIconColorPressed:m,closeColorHover:v,closeColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:w,heightMini:S,heightTiny:k,heightSmall:P,heightMedium:T,buttonColor2Hover:I,buttonColor2Pressed:A,fontWeightStrong:z}=e;return Object.assign(Object.assign({},q),{closeBorderRadius:b,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:T,borderRadius:b,opacityDisabled:p,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,fontWeightStrong:z,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:I,colorPressedCheckable:A,colorChecked:r,colorCheckedHover:n,colorCheckedPressed:t,border:`1px solid ${c}`,textColor:o,color:u,colorBordered:"#0000",closeIconColor:h,closeIconColorHover:f,closeIconColorPressed:m,closeColorHover:v,closeColorPressed:g,borderPrimary:`1px solid ${D(r,{alpha:.3})}`,textColorPrimary:r,colorPrimary:D(r,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:W(r,{lightness:.7}),closeIconColorHoverPrimary:W(r,{lightness:.7}),closeIconColorPressedPrimary:W(r,{lightness:.7}),closeColorHoverPrimary:D(r,{alpha:.16}),closeColorPressedPrimary:D(r,{alpha:.12}),borderInfo:`1px solid ${D(a,{alpha:.3})}`,textColorInfo:a,colorInfo:D(a,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:W(a,{alpha:.7}),closeIconColorHoverInfo:W(a,{alpha:.7}),closeIconColorPressedInfo:W(a,{alpha:.7}),closeColorHoverInfo:D(a,{alpha:.16}),closeColorPressedInfo:D(a,{alpha:.12}),borderSuccess:`1px solid ${D(l,{alpha:.3})}`,textColorSuccess:l,colorSuccess:D(l,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:W(l,{alpha:.7}),closeIconColorHoverSuccess:W(l,{alpha:.7}),closeIconColorPressedSuccess:W(l,{alpha:.7}),closeColorHoverSuccess:D(l,{alpha:.16}),closeColorPressedSuccess:D(l,{alpha:.12}),borderWarning:`1px solid ${D(i,{alpha:.3})}`,textColorWarning:i,colorWarning:D(i,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:W(i,{alpha:.7}),closeIconColorHoverWarning:W(i,{alpha:.7}),closeIconColorPressedWarning:W(i,{alpha:.7}),closeColorHoverWarning:D(i,{alpha:.16}),closeColorPressedWarning:D(i,{alpha:.11}),borderError:`1px solid ${D(s,{alpha:.3})}`,textColorError:s,colorError:D(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:W(s,{alpha:.7}),closeIconColorHoverError:W(s,{alpha:.7}),closeIconColorPressedError:W(s,{alpha:.7}),closeColorHoverError:D(s,{alpha:.16}),closeColorPressedError:D(s,{alpha:.12})})}},rl={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},al=G("tag","\n --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);\n white-space: nowrap;\n position: relative;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n color: var(--n-text-color);\n background-color: var(--n-color);\n transition: \n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n line-height: 1;\n height: var(--n-height);\n font-size: var(--n-font-size);\n",[ze("strong","\n font-weight: var(--n-font-weight-strong);\n "),we("border","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-border);\n transition: border-color .3s var(--n-bezier);\n "),we("icon","\n display: flex;\n margin: 0 4px 0 0;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n font-size: var(--n-avatar-size-override);\n "),we("avatar","\n display: flex;\n margin: 0 6px 0 0;\n "),we("close","\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n "),ze("round","\n padding: 0 calc(var(--n-height) / 3);\n border-radius: calc(var(--n-height) / 2);\n ",[we("icon","\n margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);\n "),we("avatar","\n margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);\n "),ze("closable","\n padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);\n ")]),ze("icon, avatar",[ze("round","\n padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);\n ")]),ze("disabled","\n cursor: not-allowed !important;\n opacity: var(--n-opacity-disabled);\n "),ze("checkable","\n cursor: pointer;\n box-shadow: none;\n color: var(--n-text-color-checkable);\n background-color: var(--n-color-checkable);\n ",[H("disabled",[Z("&:hover","background-color: var(--n-color-hover-checkable);",[H("checked","color: var(--n-text-color-hover-checkable);")]),Z("&:active","background-color: var(--n-color-pressed-checkable);",[H("checked","color: var(--n-text-color-pressed-checkable);")])]),ze("checked","\n color: var(--n-text-color-checked);\n background-color: var(--n-color-checked);\n ",[H("disabled",[Z("&:hover","background-color: var(--n-color-checked-hover);"),Z("&:active","background-color: var(--n-color-checked-pressed);")])])])]),ll=Object.assign(Object.assign(Object.assign({},g.props),rl),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),il=O("n-tag"),sl=Me({name:"Tag",props:ll,slots:Object,setup(e){const o=Io(null),{mergedBorderedRef:n,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:a}=J(e),l=g("Tag","-tag",al,Y,e,t);Ee(il,{roundRef:lo(e,"round")});const i={setTextContent(e){const{value:n}=o;n&&(n.textContent=e)}},s=p("Tag",a,t),d=to(()=>{const{type:o,size:t,color:{color:r,textColor:a}={}}=e,{common:{cubicBezierEaseInOut:i},self:{padding:s,closeMargin:d,borderRadius:c,opacityDisabled:u,textColorCheckable:p,textColorHoverCheckable:h,textColorPressedCheckable:f,textColorChecked:m,colorCheckable:v,colorHoverCheckable:g,colorPressedCheckable:b,colorChecked:y,colorCheckedHover:x,colorCheckedPressed:C,closeBorderRadius:w,fontWeightStrong:S,[Te("colorBordered",o)]:k,[Te("closeSize",t)]:P,[Te("closeIconSize",t)]:T,[Te("fontSize",t)]:I,[Te("height",t)]:A,[Te("color",o)]:z,[Te("textColor",o)]:R,[Te("border",o)]:M,[Te("closeIconColor",o)]:F,[Te("closeIconColorHover",o)]:O,[Te("closeIconColorPressed",o)]:$,[Te("closeColorHover",o)]:B,[Te("closeColorPressed",o)]:E}}=l.value,_=N(d);return{"--n-font-weight-strong":S,"--n-avatar-size-override":`calc(${A} - 8px)`,"--n-bezier":i,"--n-border-radius":c,"--n-border":M,"--n-close-icon-size":T,"--n-close-color-pressed":E,"--n-close-color-hover":B,"--n-close-border-radius":w,"--n-close-icon-color":F,"--n-close-icon-color-hover":O,"--n-close-icon-color-pressed":$,"--n-close-icon-color-disabled":F,"--n-close-margin-top":_.top,"--n-close-margin-right":_.right,"--n-close-margin-bottom":_.bottom,"--n-close-margin-left":_.left,"--n-close-size":P,"--n-color":r||(n.value?k:z),"--n-color-checkable":v,"--n-color-checked":y,"--n-color-checked-hover":x,"--n-color-checked-pressed":C,"--n-color-hover-checkable":g,"--n-color-pressed-checkable":b,"--n-font-size":I,"--n-height":A,"--n-opacity-disabled":u,"--n-padding":s,"--n-text-color":a||R,"--n-text-color-checkable":p,"--n-text-color-checked":m,"--n-text-color-hover-checkable":h,"--n-text-color-pressed-checkable":f}}),c=r?X("tag",to(()=>{let o="";const{type:t,size:r,color:{color:a,textColor:l}={}}=e;return o+=t[0],o+=r[0],a&&(o+=`a${v(a)}`),l&&(o+=`b${v(l)}`),n.value&&(o+="c"),o}),d,e):void 0;return Object.assign(Object.assign({},i),{rtlEnabled:s,mergedClsPrefix:t,contentRef:o,mergedBordered:n,handleClick:function(){if(!e.disabled&&e.checkable){const{checked:o,onCheckedChange:n,onUpdateChecked:t,"onUpdate:checked":r}=e;t&&t(!o),r&&r(!o),n&&n(!o)}},handleCloseClick:function(o){if(e.triggerClickOnClose||o.stopPropagation(),!e.disabled){const{onClose:n}=e;n&&z(n,o)}},cssVars:r?void 0:d,themeClass:null==c?void 0:c.themeClass,onRender:null==c?void 0:c.onRender})},render(){var e,o;const{mergedClsPrefix:n,rtlEnabled:t,closable:r,color:{borderColor:i}={},round:s,onRender:d,$slots:c}=this;null==d||d();const u=a(c.avatar,e=>e&&Ue("div",{class:`${n}-tag__avatar`},e)),p=a(c.icon,e=>e&&Ue("div",{class:`${n}-tag__icon`},e));return Ue("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:t,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:s,[`${n}-tag--avatar`]:u,[`${n}-tag--icon`]:p,[`${n}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},p||u,Ue("span",{class:`${n}-tag__content`,ref:"contentRef"},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)),!this.checkable&&r?Ue(l,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:s,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?Ue("div",{class:`${n}-tag__border`,style:{borderColor:i}}):null)}}),dl=Me({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup:(e,{slots:o})=>()=>{const{clsPrefix:n}=e;return Ue(I,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?Ue(xr,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>Ue(ee,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Ie(o.default,()=>[Ue(pr,null)])})}):null})}}),cl={name:"InternalSelection",common:Sa,peers:{Popover:nl},self(e){const{borderRadius:o,textColor2:n,textColorDisabled:t,inputColor:r,inputColorDisabled:a,primaryColor:l,primaryColorHover:i,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,iconColor:p,iconColorDisabled:h,clearColor:f,clearColorHover:m,clearColorPressed:v,placeholderColor:g,placeholderColorDisabled:b,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:T,fontWeight:I}=e;return Object.assign(Object.assign({},Wn),{fontWeight:I,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:T,borderRadius:o,textColor:n,textColorDisabled:t,placeholderColor:g,placeholderColorDisabled:b,color:r,colorDisabled:a,colorActive:D(l,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${i}`,borderActive:`1px solid ${l}`,borderFocus:`1px solid ${i}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${D(l,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${D(l,{alpha:.4})}`,caretColor:l,arrowColor:p,arrowColorDisabled:h,loadingColor:l,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${D(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${D(s,{alpha:.4})}`,colorActiveWarning:D(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${c}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${D(c,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${D(c,{alpha:.4})}`,colorActiveError:D(c,{alpha:.1}),caretColorError:c,clearColor:f,clearColorHover:m,clearColorPressed:v})}},ul=Z([G("base-selection","\n --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);\n --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);\n position: relative;\n z-index: auto;\n box-shadow: none;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n vertical-align: bottom;\n border-radius: var(--n-border-radius);\n min-height: var(--n-height);\n line-height: 1.5;\n font-size: var(--n-font-size);\n ",[G("base-loading","\n color: var(--n-loading-color);\n "),G("base-selection-tags","min-height: var(--n-height);"),we("border, state-border","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border: var(--n-border);\n border-radius: inherit;\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n "),we("state-border","\n z-index: 1;\n border-color: #0000;\n "),G("base-suffix","\n cursor: pointer;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 10px;\n ",[we("arrow","\n font-size: var(--n-arrow-size);\n color: var(--n-arrow-color);\n transition: color .3s var(--n-bezier);\n ")]),G("base-selection-overlay","\n display: flex;\n align-items: center;\n white-space: nowrap;\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: var(--n-padding-single);\n transition: color .3s var(--n-bezier);\n ",[we("wrapper","\n flex-basis: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n ")]),G("base-selection-placeholder","\n color: var(--n-placeholder-color);\n ",[we("inner","\n max-width: 100%;\n overflow: hidden;\n ")]),G("base-selection-tags","\n cursor: pointer;\n outline: none;\n box-sizing: border-box;\n position: relative;\n z-index: auto;\n display: flex;\n padding: var(--n-padding-multiple);\n flex-wrap: wrap;\n align-items: center;\n width: 100%;\n vertical-align: bottom;\n background-color: var(--n-color);\n border-radius: inherit;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n "),G("base-selection-label","\n height: var(--n-height);\n display: inline-flex;\n width: 100%;\n vertical-align: bottom;\n cursor: pointer;\n outline: none;\n z-index: auto;\n box-sizing: border-box;\n position: relative;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n border-radius: inherit;\n background-color: var(--n-color);\n align-items: center;\n ",[G("base-selection-input","\n font-size: inherit;\n line-height: inherit;\n outline: none;\n cursor: pointer;\n box-sizing: border-box;\n border:none;\n width: 100%;\n padding: var(--n-padding-single);\n background-color: #0000;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n caret-color: var(--n-caret-color);\n ",[we("content","\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap; \n ")]),we("render-label","\n color: var(--n-text-color);\n ")]),H("disabled",[Z("&:hover",[we("state-border","\n box-shadow: var(--n-box-shadow-hover);\n border: var(--n-border-hover);\n ")]),ze("focus",[we("state-border","\n box-shadow: var(--n-box-shadow-focus);\n border: var(--n-border-focus);\n ")]),ze("active",[we("state-border","\n box-shadow: var(--n-box-shadow-active);\n border: var(--n-border-active);\n "),G("base-selection-label","background-color: var(--n-color-active);"),G("base-selection-tags","background-color: var(--n-color-active);")])]),ze("disabled","cursor: not-allowed;",[we("arrow","\n color: var(--n-arrow-color-disabled);\n "),G("base-selection-label","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[G("base-selection-input","\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n "),we("render-label","\n color: var(--n-text-color-disabled);\n ")]),G("base-selection-tags","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n "),G("base-selection-placeholder","\n cursor: not-allowed;\n color: var(--n-placeholder-color-disabled);\n ")]),G("base-selection-input-tag","\n height: calc(var(--n-height) - 6px);\n line-height: calc(var(--n-height) - 6px);\n outline: none;\n display: none;\n position: relative;\n margin-bottom: 3px;\n max-width: 100%;\n vertical-align: bottom;\n ",[we("input","\n font-size: inherit;\n font-family: inherit;\n min-width: 1px;\n padding: 0;\n background-color: #0000;\n outline: none;\n border: none;\n max-width: 100%;\n overflow: hidden;\n width: 1em;\n line-height: inherit;\n cursor: pointer;\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n "),we("mirror","\n position: absolute;\n left: 0;\n top: 0;\n white-space: pre;\n visibility: hidden;\n user-select: none;\n -webkit-user-select: none;\n opacity: 0;\n ")]),["warning","error"].map(e=>ze(`${e}-status`,[we("state-border",`border: var(--n-border-${e});`),H("disabled",[Z("&:hover",[we("state-border",`\n box-shadow: var(--n-box-shadow-hover-${e});\n border: var(--n-border-hover-${e});\n `)]),ze("active",[we("state-border",`\n box-shadow: var(--n-box-shadow-active-${e});\n border: var(--n-border-active-${e});\n `),G("base-selection-label",`background-color: var(--n-color-active-${e});`),G("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),ze("focus",[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),G("base-selection-popover","\n margin-bottom: -3px;\n display: flex;\n flex-wrap: wrap;\n margin-right: -8px;\n "),G("base-selection-tag-wrapper","\n max-width: 100%;\n display: inline-flex;\n padding: 0 7px 3px 0;\n ",[Z("&:last-child","padding-right: 0;"),G("tag","\n font-size: 14px;\n max-width: 100%;\n ",[we("content","\n line-height: 1.25;\n text-overflow: ellipsis;\n overflow: hidden;\n ")])])]),pl=Me({name:"InternalSelection",props:Object.assign(Object.assign({},g.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=J(e),t=p("InternalSelection",n,o),r=Io(null),a=Io(null),l=Io(null),i=Io(null),s=Io(null),d=Io(null),c=Io(null),u=Io(null),h=Io(null),f=Io(null),m=Io(!1),v=Io(!1),b=Io(!1),y=g("InternalSelection","-internal-selection",ul,En,e,lo(e,"clsPrefix")),x=to(()=>e.clearable&&!e.disabled&&(b.value||e.active)),C=to(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):ot(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),w=to(()=>{const o=e.selectedOption;if(o)return o[e.labelField]}),S=to(()=>e.multiple?!(!Array.isArray(e.selectedOptions)||!e.selectedOptions.length):null!==e.selectedOption);function k(){var o;const{value:n}=r;if(n){const{value:t}=a;t&&(t.style.width=`${n.offsetWidth}px`,"responsive"!==e.maxTagCount&&(null===(o=h.value)||void 0===o||o.sync({showAllItemsBeforeCalculate:!1})))}}function P(o){const{onPatternInput:n}=e;n&&n(o)}function T(o){!function(o){const{onDeleteOption:n}=e;n&&n(o)}(o)}Xe(lo(e,"active"),e=>{e||function(){const{value:e}=f;e&&(e.style.display="none")}()}),Xe(lo(e,"pattern"),()=>{e.multiple&&De(k)});const I=Io(!1);let A=null;let z=null;function R(){null!==z&&window.clearTimeout(z)}Xe(S,e=>{e||(m.value=!1)}),Je(()=>{Ke(()=>{const o=d.value;o&&(e.disabled?o.removeAttribute("tabindex"):o.tabIndex=v.value?-1:0)})}),rr(l,e.onResize);const{inlineThemeDisabled:M}=e,F=to(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{fontWeight:t,borderRadius:r,color:a,placeholderColor:l,textColor:i,paddingSingle:s,paddingMultiple:d,caretColor:c,colorDisabled:u,textColorDisabled:p,placeholderColorDisabled:h,colorActive:f,boxShadowFocus:m,boxShadowActive:v,boxShadowHover:g,border:b,borderFocus:x,borderHover:C,borderActive:w,arrowColor:S,arrowColorDisabled:k,loadingColor:P,colorActiveWarning:T,boxShadowFocusWarning:I,boxShadowActiveWarning:A,boxShadowHoverWarning:z,borderWarning:R,borderFocusWarning:M,borderHoverWarning:F,borderActiveWarning:O,colorActiveError:$,boxShadowFocusError:B,boxShadowActiveError:E,boxShadowHoverError:_,borderError:D,borderFocusError:L,borderHoverError:H,borderActiveError:j,clearColor:U,clearColorHover:W,clearColorPressed:K,clearSize:V,arrowSize:q,[Te("height",o)]:G,[Te("fontSize",o)]:J}}=y.value,Y=N(s),Z=N(d);return{"--n-bezier":n,"--n-border":b,"--n-border-active":w,"--n-border-focus":x,"--n-border-hover":C,"--n-border-radius":r,"--n-box-shadow-active":v,"--n-box-shadow-focus":m,"--n-box-shadow-hover":g,"--n-caret-color":c,"--n-color":a,"--n-color-active":f,"--n-color-disabled":u,"--n-font-size":J,"--n-height":G,"--n-padding-single-top":Y.top,"--n-padding-multiple-top":Z.top,"--n-padding-single-right":Y.right,"--n-padding-multiple-right":Z.right,"--n-padding-single-left":Y.left,"--n-padding-multiple-left":Z.left,"--n-padding-single-bottom":Y.bottom,"--n-padding-multiple-bottom":Z.bottom,"--n-placeholder-color":l,"--n-placeholder-color-disabled":h,"--n-text-color":i,"--n-text-color-disabled":p,"--n-arrow-color":S,"--n-arrow-color-disabled":k,"--n-loading-color":P,"--n-color-active-warning":T,"--n-box-shadow-focus-warning":I,"--n-box-shadow-active-warning":A,"--n-box-shadow-hover-warning":z,"--n-border-warning":R,"--n-border-focus-warning":M,"--n-border-hover-warning":F,"--n-border-active-warning":O,"--n-color-active-error":$,"--n-box-shadow-focus-error":B,"--n-box-shadow-active-error":E,"--n-box-shadow-hover-error":_,"--n-border-error":D,"--n-border-focus-error":L,"--n-border-hover-error":H,"--n-border-active-error":j,"--n-clear-size":V,"--n-clear-color":U,"--n-clear-color-hover":W,"--n-clear-color-pressed":K,"--n-arrow-size":q,"--n-font-weight":t}}),O=M?X("internal-selection",to(()=>e.size[0]),F,e):void 0;return{mergedTheme:y,mergedClearable:x,mergedClsPrefix:o,rtlEnabled:t,patternInputFocused:v,filterablePlaceholder:C,label:w,selected:S,showTagsPanel:m,isComposing:I,counterRef:c,counterWrapperRef:u,patternInputMirrorRef:r,patternInputRef:a,selfRef:l,multipleElRef:i,singleElRef:s,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:f,handleMouseDown:function(o){e.active&&e.filterable&&o.target!==a.value&&o.preventDefault()},handleFocusin:function(o){var n;o.relatedTarget&&(null===(n=l.value)||void 0===n?void 0:n.contains(o.relatedTarget))||function(o){const{onFocus:n}=e;n&&n(o)}(o)},handleClear:function(o){!function(o){const{onClear:n}=e;n&&n(o)}(o)},handleMouseEnter:function(){b.value=!0},handleMouseLeave:function(){b.value=!1},handleDeleteOption:T,handlePatternKeyDown:function(o){if("Backspace"===o.key&&!I.value&&!e.pattern.length){const{selectedOptions:o}=e;(null==o?void 0:o.length)&&T(o[o.length-1])}},handlePatternInputInput:function(o){const{value:n}=r;n&&(n.textContent=o.target.value,k()),e.ignoreComposition&&I.value?A=o:P(o)},handlePatternInputBlur:function(o){var n;v.value=!1,null===(n=e.onPatternBlur)||void 0===n||n.call(e,o)},handlePatternInputFocus:function(o){var n;v.value=!0,null===(n=e.onPatternFocus)||void 0===n||n.call(e,o)},handleMouseEnterCounter:function(){e.active||(R(),z=window.setTimeout(()=>{S.value&&(m.value=!0)},100))},handleMouseLeaveCounter:function(){R()},handleFocusout:function(o){var n;(null===(n=l.value)||void 0===n?void 0:n.contains(o.relatedTarget))||function(o){const{onBlur:n}=e;n&&n(o)}(o)},handleCompositionEnd:function(){I.value=!1,e.ignoreComposition&&P(A),A=null},handleCompositionStart:function(){I.value=!0},onPopoverUpdateShow:function(e){e||(R(),m.value=!1)},focus:function(){var o,n,t;e.filterable?(v.value=!1,null===(o=d.value)||void 0===o||o.focus()):e.multiple?null===(n=i.value)||void 0===n||n.focus():null===(t=s.value)||void 0===t||t.focus()},focusInput:function(){const{value:e}=a;e&&(!function(){const{value:e}=f;e&&(e.style.display="inline-block")}(),e.focus())},blur:function(){var o,n;if(e.filterable)v.value=!1,null===(o=d.value)||void 0===o||o.blur(),null===(n=a.value)||void 0===n||n.blur();else if(e.multiple){const{value:e}=i;null==e||e.blur()}else{const{value:e}=s;null==e||e.blur()}},blurInput:function(){const{value:e}=a;e&&e.blur()},updateCounter:function(e){const{value:o}=c;o&&o.setTextContent(`+${e}`)},getCounter:function(){const{value:e}=u;return e},getTail:function(){return a.value},renderLabel:e.renderLabel,cssVars:M?void 0:F,themeClass:null==O?void 0:O.themeClass,onRender:null==O?void 0:O.onRender}},render(){const{status:e,multiple:o,size:n,disabled:t,filterable:r,maxTagCount:a,bordered:l,clsPrefix:i,ellipsisTagPopoverProps:s,onRender:d,renderTag:c,renderLabel:u}=this;null==d||d();const p="responsive"===a,h="number"==typeof a,f=p||h,m=Ue(Se,null,{default:()=>Ue(dl,{clsPrefix:i,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var e,o;return null===(o=(e=this.$slots).arrow)||void 0===o?void 0:o.call(e)}})});let v;if(o){const{labelField:e}=this,o=o=>Ue("div",{class:`${i}-base-selection-tag-wrapper`,key:o.value},c?c({option:o,handleClose:()=>{this.handleDeleteOption(o)}}):Ue(sl,{size:n,closable:!o.disabled,disabled:t,onClose:()=>{this.handleDeleteOption(o)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(o,!0):ot(o[e],o,!0)})),l=()=>(h?this.selectedOptions.slice(0,a):this.selectedOptions).map(o),d=r?Ue("div",{class:`${i}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},Ue("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:t,value:this.pattern,autofocus:this.autofocus,class:`${i}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),Ue("span",{ref:"patternInputMirrorRef",class:`${i}-base-selection-input-tag__mirror`},this.pattern)):null,g=p?()=>Ue("div",{class:`${i}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},Ue(sl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:t})):void 0;let b;if(h){const e=this.selectedOptions.length-a;e>0&&(b=Ue("div",{class:`${i}-base-selection-tag-wrapper`,key:"__counter__"},Ue(sl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:t},{default:()=>`+${e}`})))}const y=p?r?Ue(tr,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:g,tail:()=>d}):Ue(tr,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:g}):h&&b?l().concat(b):l(),x=f?()=>Ue("div",{class:`${i}-base-selection-popover`},p?l():this.selectedOptions.map(o)):void 0,C=f?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},s):null,w=this.selected||this.active&&(this.pattern||this.isComposing)?null:Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`},Ue("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),S=r?Ue("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-tags`},y,p?null:d,m):Ue("div",{ref:"multipleElRef",class:`${i}-base-selection-tags`,tabindex:t?void 0:0},y,m);v=Ue(co,null,f?Ue(Zn,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>S,default:x}):S,w)}else if(r){const e=this.pattern||this.isComposing,o=this.active?!e:!this.selected,n=!this.active&&this.selected;v=Ue("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-label`,title:this.patternInputFocused?void 0:ar(this.label)},Ue("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${i}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:t,disabled:t,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n?Ue("div",{class:`${i}-base-selection-label__render-label ${i}-base-selection-overlay`,key:"input"},Ue("div",{class:`${i}-base-selection-overlay__wrapper`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):ot(this.label,this.selectedOption,!0))):null,o?Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},Ue("div",{class:`${i}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else v=Ue("div",{ref:"singleElRef",class:`${i}-base-selection-label`,tabindex:this.disabled?void 0:0},void 0!==this.label?Ue("div",{class:`${i}-base-selection-input`,title:ar(this.label),key:"input"},Ue("div",{class:`${i}-base-selection-input__content`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):ot(this.label,this.selectedOption,!0))):Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},Ue("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),m);return Ue("div",{ref:"selfRef",class:[`${i}-base-selection`,this.rtlEnabled&&`${i}-base-selection--rtl`,this.themeClass,e&&`${i}-base-selection--${e}-status`,{[`${i}-base-selection--active`]:this.active,[`${i}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${i}-base-selection--disabled`]:this.disabled,[`${i}-base-selection--multiple`]:this.multiple,[`${i}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},v,l?Ue("div",{class:`${i}-base-selection__border`}):null,l?Ue("div",{class:`${i}-base-selection__state-border`}):null)}}),hl={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},fl={name:"Alert",common:Sa,self(e){const{lineHeight:o,borderRadius:n,fontWeightStrong:t,dividerColor:r,inputColor:a,textColor1:l,textColor2:i,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:h,successColorSuppl:f,warningColorSuppl:m,errorColorSuppl:v,fontSize:g}=e;return Object.assign(Object.assign({},hl),{fontSize:g,lineHeight:o,titleFontWeight:t,borderRadius:n,border:`1px solid ${r}`,color:a,titleTextColor:l,iconColor:i,contentTextColor:i,closeBorderRadius:n,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${D(h,{alpha:.35})}`,colorInfo:D(h,{alpha:.25}),titleTextColorInfo:l,iconColorInfo:h,contentTextColorInfo:i,closeColorHoverInfo:s,closeColorPressedInfo:d,closeIconColorInfo:c,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${D(f,{alpha:.35})}`,colorSuccess:D(f,{alpha:.25}),titleTextColorSuccess:l,iconColorSuccess:f,contentTextColorSuccess:i,closeColorHoverSuccess:s,closeColorPressedSuccess:d,closeIconColorSuccess:c,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${D(m,{alpha:.35})}`,colorWarning:D(m,{alpha:.25}),titleTextColorWarning:l,iconColorWarning:m,contentTextColorWarning:i,closeColorHoverWarning:s,closeColorPressedWarning:d,closeIconColorWarning:c,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${D(v,{alpha:.35})}`,colorError:D(v,{alpha:.25}),titleTextColorError:l,iconColorError:v,contentTextColorError:i,closeColorHoverError:s,closeColorPressedError:d,closeIconColorError:c,closeIconColorHoverError:u,closeIconColorPressedError:p})}};var ml={name:"Alert",common:t,self:function(e){const{lineHeight:o,borderRadius:n,fontWeightStrong:t,baseColor:r,dividerColor:a,actionColor:l,textColor1:i,textColor2:s,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:p,closeIconColorPressed:h,infoColor:f,successColor:m,warningColor:v,errorColor:g,fontSize:b}=e;return Object.assign(Object.assign({},hl),{fontSize:b,lineHeight:o,titleFontWeight:t,borderRadius:n,border:`1px solid ${a}`,color:l,titleTextColor:i,iconColor:s,contentTextColor:s,closeBorderRadius:n,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:p,closeIconColorPressed:h,borderInfo:`1px solid ${de(r,D(f,{alpha:.25}))}`,colorInfo:de(r,D(f,{alpha:.08})),titleTextColorInfo:i,iconColorInfo:f,contentTextColorInfo:s,closeColorHoverInfo:d,closeColorPressedInfo:c,closeIconColorInfo:u,closeIconColorHoverInfo:p,closeIconColorPressedInfo:h,borderSuccess:`1px solid ${de(r,D(m,{alpha:.25}))}`,colorSuccess:de(r,D(m,{alpha:.08})),titleTextColorSuccess:i,iconColorSuccess:m,contentTextColorSuccess:s,closeColorHoverSuccess:d,closeColorPressedSuccess:c,closeIconColorSuccess:u,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:h,borderWarning:`1px solid ${de(r,D(v,{alpha:.33}))}`,colorWarning:de(r,D(v,{alpha:.08})),titleTextColorWarning:i,iconColorWarning:v,contentTextColorWarning:s,closeColorHoverWarning:d,closeColorPressedWarning:c,closeIconColorWarning:u,closeIconColorHoverWarning:p,closeIconColorPressedWarning:h,borderError:`1px solid ${de(r,D(g,{alpha:.25}))}`,colorError:de(r,D(g,{alpha:.08})),titleTextColorError:i,iconColorError:g,contentTextColorError:s,closeColorHoverError:d,closeColorPressedError:c,closeIconColorError:u,closeIconColorHoverError:p,closeIconColorPressedError:h})}},{cubicBezierEaseInOut:vl,cubicBezierEaseOut:gl,cubicBezierEaseIn:bl}=d;function yl({overflow:e="hidden",duration:o=".3s",originalTransition:n="",leavingDelay:t="0s",foldPadding:r=!1,enterToProps:a,leaveToProps:l,reverse:i=!1}={}){const s=i?"leave":"enter",d=i?"enter":"leave";return[Z(`&.fade-in-height-expand-transition-${d}-from,\n &.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},a),{opacity:1})),Z(`&.fade-in-height-expand-transition-${d}-to,\n &.fade-in-height-expand-transition-${s}-from`,Object.assign(Object.assign({},l),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:r?"0 !important":void 0,paddingBottom:r?"0 !important":void 0})),Z(`&.fade-in-height-expand-transition-${d}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${vl} ${t},\n opacity ${o} ${gl} ${t},\n margin-top ${o} ${vl} ${t},\n margin-bottom ${o} ${vl} ${t},\n padding-top ${o} ${vl} ${t},\n padding-bottom ${o} ${vl} ${t}\n ${n?`,${n}`:""}\n `),Z(`&.fade-in-height-expand-transition-${s}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${vl},\n opacity ${o} ${bl},\n margin-top ${o} ${vl},\n margin-bottom ${o} ${vl},\n padding-top ${o} ${vl},\n padding-bottom ${o} ${vl}\n ${n?`,${n}`:""}\n `)]}var xl=G("alert","\n line-height: var(--n-line-height);\n border-radius: var(--n-border-radius);\n position: relative;\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-color);\n text-align: start;\n word-break: break-word;\n",[we("border","\n border-radius: inherit;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n transition: border-color .3s var(--n-bezier);\n border: var(--n-border);\n pointer-events: none;\n "),ze("closable",[G("alert-body",[we("title","\n padding-right: 24px;\n ")])]),we("icon",{color:"var(--n-icon-color)"}),G("alert-body",{padding:"var(--n-padding)"},[we("title",{color:"var(--n-title-text-color)"}),we("content",{color:"var(--n-content-text-color)"})]),yl({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),we("icon","\n position: absolute;\n left: 0;\n top: 0;\n align-items: center;\n justify-content: center;\n display: flex;\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n margin: var(--n-icon-margin);\n "),we("close","\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n position: absolute;\n right: 0;\n top: 0;\n margin: var(--n-close-margin);\n "),ze("show-icon",[G("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),ze("right-adjust",[G("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),G("alert-body","\n border-radius: var(--n-border-radius);\n transition: border-color .3s var(--n-bezier);\n ",[we("title","\n transition: color .3s var(--n-bezier);\n font-size: 16px;\n line-height: 19px;\n font-weight: var(--n-title-font-weight);\n ",[Z("& +",[we("content",{marginTop:"9px"})])]),we("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),we("icon",{transition:"color .3s var(--n-bezier)"})]),Cl=Me({name:"Alert",inheritAttrs:!1,props:Object.assign(Object.assign({},g.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:n,inlineThemeDisabled:t,mergedRtlRef:r}=J(e),a=g("Alert","-alert",xl,ml,e,o),l=p("Alert",r,o),i=to(()=>{const{common:{cubicBezierEaseInOut:o},self:n}=a.value,{fontSize:t,borderRadius:r,titleFontWeight:l,lineHeight:i,iconSize:s,iconMargin:d,iconMarginRtl:c,closeIconSize:u,closeBorderRadius:p,closeSize:h,closeMargin:f,closeMarginRtl:m,padding:v}=n,{type:g}=e,{left:b,right:y}=N(d);return{"--n-bezier":o,"--n-color":n[Te("color",g)],"--n-close-icon-size":u,"--n-close-border-radius":p,"--n-close-color-hover":n[Te("closeColorHover",g)],"--n-close-color-pressed":n[Te("closeColorPressed",g)],"--n-close-icon-color":n[Te("closeIconColor",g)],"--n-close-icon-color-hover":n[Te("closeIconColorHover",g)],"--n-close-icon-color-pressed":n[Te("closeIconColorPressed",g)],"--n-icon-color":n[Te("iconColor",g)],"--n-border":n[Te("border",g)],"--n-title-text-color":n[Te("titleTextColor",g)],"--n-content-text-color":n[Te("contentTextColor",g)],"--n-line-height":i,"--n-border-radius":r,"--n-font-size":t,"--n-title-font-weight":l,"--n-icon-size":s,"--n-icon-margin":d,"--n-icon-margin-rtl":c,"--n-close-size":h,"--n-close-margin":f,"--n-close-margin-rtl":m,"--n-padding":v,"--n-icon-margin-left":b,"--n-icon-margin-right":y}}),s=t?X("alert",to(()=>e.type[0]),i,e):void 0,d=Io(!0);return{rtlEnabled:l,mergedClsPrefix:o,mergedBordered:n,visible:d,handleCloseClick:()=>{var o;Promise.resolve(null===(o=e.onClose)||void 0===o?void 0:o.call(e)).then(e=>{!1!==e&&(d.value=!1)})},handleAfterLeave:()=>{(()=>{const{onAfterLeave:o,onAfterHide:n}=e;o&&o(),n&&n()})()},mergedTheme:a,cssVars:t?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender}},render(){var e;return null===(e=this.onRender)||void 0===e||e.call(this),Ue(s,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:e,$slots:o}=this,n={class:[`${e}-alert`,this.themeClass,this.closable&&`${e}-alert--closable`,this.showIcon&&`${e}-alert--show-icon`,!this.title&&this.closable&&`${e}-alert--right-adjust`,this.rtlEnabled&&`${e}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?Ue("div",Object.assign({},Be(this.$attrs,n)),this.closable&&Ue(l,{clsPrefix:e,class:`${e}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&Ue("div",{class:`${e}-alert__border`}),this.showIcon&&Ue("div",{class:`${e}-alert__icon`,"aria-hidden":"true"},Ie(o.icon,()=>[Ue(ee,{clsPrefix:e},{default:()=>{switch(this.type){case"success":return Ue(dt,null);case"info":return Ue(ct,null);case"warning":return Ue(St,null);case"error":return Ue(ut,null);default:return null}}})])),Ue("div",{class:[`${e}-alert-body`,this.mergedBordered&&`${e}-alert-body--bordered`]},a(o.header,o=>{const n=o||this.title;return n?Ue("div",{class:`${e}-alert-body__title`},n):null}),o.default&&Ue("div",{class:`${e}-alert-body__content`},o))):null}})}}),wl={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Sl(e){const{borderRadius:o,railColor:n,primaryColor:t,primaryColorHover:r,primaryColorPressed:a,textColor2:l}=e;return Object.assign(Object.assign({},wl),{borderRadius:o,railColor:n,railColorActive:t,linkColor:D(t,{alpha:.15}),linkTextColor:l,linkTextColorHover:r,linkTextColorPressed:a,linkTextColorActive:t})}var kl={name:"Anchor",common:t,self:Sl},Pl={name:"Anchor",common:Sa,self:Sl};var Tl=m({name:"Input",common:Sa,peers:{Scrollbar:ka},self:function(e){const{textColor2:o,textColor3:n,textColorDisabled:t,primaryColor:r,primaryColorHover:a,inputColor:l,inputColorDisabled:i,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,borderRadius:p,lineHeight:h,fontSizeTiny:f,fontSizeSmall:m,fontSizeMedium:v,fontSizeLarge:g,heightTiny:b,heightSmall:y,heightMedium:x,heightLarge:C,clearColor:w,clearColorHover:S,clearColorPressed:k,placeholderColor:P,placeholderColorDisabled:T,iconColor:I,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,fontWeight:M}=e;return Object.assign(Object.assign({},Jn),{fontWeight:M,countTextColorDisabled:t,countTextColor:n,heightTiny:b,heightSmall:y,heightMedium:x,heightLarge:C,fontSizeTiny:f,fontSizeSmall:m,fontSizeMedium:v,fontSizeLarge:g,lineHeight:h,lineHeightTextarea:h,borderRadius:p,iconSize:"16px",groupLabelColor:l,textColor:o,textColorDisabled:t,textDecorationColor:o,groupLabelTextColor:o,caretColor:r,placeholderColor:P,placeholderColorDisabled:T,color:l,colorDisabled:i,colorFocus:D(r,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${a}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 8px 0 ${D(r,{alpha:.3})}`,loadingColor:r,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:D(s,{alpha:.1}),borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 8px 0 ${D(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:c,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,colorFocusError:D(c,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${D(c,{alpha:.3})}`,caretColorError:c,clearColor:w,clearColorHover:S,clearColorPressed:k,iconColor:I,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,suffixTextColor:o})}}),Il=O("n-input"),Al=G("input","\n max-width: 100%;\n cursor: text;\n line-height: 1.5;\n z-index: auto;\n outline: none;\n box-sizing: border-box;\n position: relative;\n display: inline-flex;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n transition: background-color .3s var(--n-bezier);\n font-size: var(--n-font-size);\n font-weight: var(--n-font-weight);\n --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);\n",[we("input, textarea","\n overflow: hidden;\n flex-grow: 1;\n position: relative;\n "),we("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder","\n box-sizing: border-box;\n font-size: inherit;\n line-height: 1.5;\n font-family: inherit;\n border: none;\n outline: none;\n background-color: #0000;\n text-align: inherit;\n transition:\n -webkit-text-fill-color .3s var(--n-bezier),\n caret-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n text-decoration-color .3s var(--n-bezier);\n "),we("input-el, textarea-el","\n -webkit-appearance: none;\n scrollbar-width: none;\n width: 100%;\n min-width: 0;\n text-decoration-color: var(--n-text-decoration-color);\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n background-color: transparent;\n ",[Z("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb","\n width: 0;\n height: 0;\n display: none;\n "),Z("&::placeholder","\n color: #0000;\n -webkit-text-fill-color: transparent !important;\n "),Z("&:-webkit-autofill ~",[we("placeholder","display: none;")])]),ze("round",[H("textarea","border-radius: calc(var(--n-height) / 2);")]),we("placeholder","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n color: var(--n-placeholder-color);\n ",[Z("span","\n width: 100%;\n display: inline-block;\n ")]),ze("textarea",[we("placeholder","overflow: visible;")]),H("autosize","width: 100%;"),ze("autosize",[we("textarea-el, input-el","\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n ")]),G("input-wrapper","\n overflow: hidden;\n display: inline-flex;\n flex-grow: 1;\n position: relative;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n "),we("input-mirror","\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre;\n pointer-events: none;\n "),we("input-el","\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[Z("&[type=password]::-ms-reveal","display: none;"),Z("+",[we("placeholder","\n display: flex;\n align-items: center; \n ")])]),H("textarea",[we("placeholder","white-space: nowrap;")]),we("eye","\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color .3s var(--n-bezier);\n "),ze("textarea","width: 100%;",[G("input-word-count","\n position: absolute;\n right: var(--n-padding-right);\n bottom: var(--n-padding-vertical);\n "),ze("resizable",[G("input-wrapper","\n resize: vertical;\n min-height: var(--n-height);\n ")]),we("textarea-el, textarea-mirror, placeholder","\n height: 100%;\n padding-left: 0;\n padding-right: 0;\n padding-top: var(--n-padding-vertical);\n padding-bottom: var(--n-padding-vertical);\n word-break: break-word;\n display: inline-block;\n vertical-align: bottom;\n box-sizing: border-box;\n line-height: var(--n-line-height-textarea);\n margin: 0;\n resize: none;\n white-space: pre-wrap;\n scroll-padding-block-end: var(--n-padding-vertical);\n "),we("textarea-mirror","\n width: 100%;\n pointer-events: none;\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n ")]),ze("pair",[we("input-el, placeholder","text-align: center;"),we("separator","\n display: flex;\n align-items: center;\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n white-space: nowrap;\n ",[G("icon","\n color: var(--n-icon-color);\n "),G("base-icon","\n color: var(--n-icon-color);\n ")])]),ze("disabled","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[we("border","border: var(--n-border-disabled);"),we("input-el, textarea-el","\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n text-decoration-color: var(--n-text-color-disabled);\n "),we("placeholder","color: var(--n-placeholder-color-disabled);"),we("separator","color: var(--n-text-color-disabled);",[G("icon","\n color: var(--n-icon-color-disabled);\n "),G("base-icon","\n color: var(--n-icon-color-disabled);\n ")]),G("input-word-count","\n color: var(--n-count-text-color-disabled);\n "),we("suffix, prefix","color: var(--n-text-color-disabled);",[G("icon","\n color: var(--n-icon-color-disabled);\n "),G("internal-icon","\n color: var(--n-icon-color-disabled);\n ")])]),H("disabled",[we("eye","\n color: var(--n-icon-color);\n cursor: pointer;\n ",[Z("&:hover","\n color: var(--n-icon-color-hover);\n "),Z("&:active","\n color: var(--n-icon-color-pressed);\n ")]),Z("&:hover",[we("state-border","border: var(--n-border-hover);")]),ze("focus","background-color: var(--n-color-focus);",[we("state-border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),we("border, state-border","\n box-sizing: border-box;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border-radius: inherit;\n border: var(--n-border);\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n "),we("state-border","\n border-color: #0000;\n z-index: 1;\n "),we("prefix","margin-right: 4px;"),we("suffix","\n margin-left: 4px;\n "),we("suffix, prefix","\n transition: color .3s var(--n-bezier);\n flex-wrap: nowrap;\n flex-shrink: 0;\n line-height: var(--n-height);\n white-space: nowrap;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--n-suffix-text-color);\n ",[G("base-loading","\n font-size: var(--n-icon-size);\n margin: 0 2px;\n color: var(--n-loading-color);\n "),G("base-clear","\n font-size: var(--n-icon-size);\n ",[we("placeholder",[G("base-icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")])]),Z(">",[G("icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")]),G("base-icon","\n font-size: var(--n-icon-size);\n ")]),G("input-word-count","\n pointer-events: none;\n line-height: 1.5;\n font-size: .85em;\n color: var(--n-count-text-color);\n transition: color .3s var(--n-bezier);\n margin-left: 4px;\n font-variant: tabular-nums;\n "),["warning","error"].map(e=>ze(`${e}-status`,[H("disabled",[G("base-loading",`\n color: var(--n-loading-color-${e})\n `),we("input-el, textarea-el",`\n caret-color: var(--n-caret-color-${e});\n `),we("state-border",`\n border: var(--n-border-${e});\n `),Z("&:hover",[we("state-border",`\n border: var(--n-border-hover-${e});\n `)]),Z("&:focus",`\n background-color: var(--n-color-focus-${e});\n `,[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)]),ze("focus",`\n background-color: var(--n-color-focus-${e});\n `,[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),zl=G("input",[ze("disabled",[we("input-el, textarea-el","\n -webkit-text-fill-color: var(--n-text-color-disabled);\n ")])]);function Rl(e){let o=0;for(const n of e)o++;return o}function Ml(e){return""===e||null==e}var Fl=Me({name:"InputWordCount",setup(e,{slots:o}){const{mergedValueRef:n,maxlengthRef:t,mergedClsPrefixRef:r,countGraphemesRef:a}=We(Il),l=to(()=>{const{value:e}=n;return null===e||Array.isArray(e)?0:(a.value||Rl)(e)});return()=>{const{value:e}=t,{value:a}=n;return Ue("span",{class:`${r.value}-input-word-count`},T(o.default,{value:null===a||Array.isArray(a)?"":a},()=>[void 0===e?l.value:`${l.value} / ${e}`]))}}}),Ol=Me({name:"Input",props:Object.assign(Object.assign({},g.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(o){const{mergedClsPrefixRef:n,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:a}=J(o),l=g("Input","-input",Al,Vn,o,n);K&&x("-input-safari",zl,n);const i=Io(null),s=Io(null),d=Io(null),c=Io(null),u=Io(null),f=Io(null),m=Io(null),v=function(e){const o=Io(null);function n(){o.value=null}return Xe(e,n),{recordCursor:function(){const{value:t}=e;if(!(null==t?void 0:t.focus))return void n();const{selectionStart:r,selectionEnd:a,value:l}=t;null!=r&&null!=a?o.value={start:r,end:a,beforeText:l.slice(0,r),afterText:l.slice(a)}:n()},restoreCursor:function(){var n;const{value:t}=o,{value:r}=e;if(!t||!r)return;const{value:a}=r,{start:l,beforeText:i,afterText:s}=t;let d=a.length;if(a.endsWith(s))d=a.length-s.length;else if(a.startsWith(i))d=i.length;else{const e=i[l-1],o=a.indexOf(e,l-1);-1!==o&&(d=o+1)}null===(n=r.setSelectionRange)||void 0===n||n.call(r,d,d)}}}(m),b=Io(null),{localeRef:y}=h("Input"),C=Io(o.defaultValue),S=lo(o,"value"),k=w(S,C),P=ae(o),{mergedSizeRef:T,mergedDisabledRef:I,mergedStatusRef:A}=P,R=Io(!1),M=Io(!1),F=Io(!1),O=Io(!1);let $=null;const B=to(()=>{const{placeholder:e,pair:n}=o;return n?Array.isArray(e)?e:void 0===e?["",""]:[e,e]:void 0===e?[y.value.placeholder]:[e]}),E=to(()=>{const{value:e}=F,{value:o}=k,{value:n}=B;return!e&&(Ml(o)||Array.isArray(o)&&Ml(o[0]))&&n[0]}),_=to(()=>{const{value:e}=F,{value:o}=k,{value:n}=B;return!e&&n[1]&&(Ml(o)||Array.isArray(o)&&Ml(o[1]))}),D=e(()=>o.internalForceFocus||R.value),L=e(()=>{if(I.value||o.readonly||!o.clearable||!D.value&&!M.value)return!1;const{value:e}=k,{value:n}=D;return o.pair?!(!Array.isArray(e)||!e[0]&&!e[1])&&(M.value||n):!!e&&(M.value||n)}),H=to(()=>{const{showPasswordOn:e}=o;return e||(o.showPasswordToggle?"click":void 0)}),j=Io(!1),U=to(()=>{const{textDecoration:e}=o;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:["",""]}),W=Io(void 0),V=to(()=>{const{maxlength:e}=o;return void 0===e?void 0:Number(e)});Je(()=>{const{value:e}=k;Array.isArray(e)||te(e)});const q=mo().proxy;function G(e,n){const{onUpdateValue:t,"onUpdate:value":r,onInput:a}=o,{nTriggerFormInput:l}=P;t&&z(t,e,n),r&&z(r,e,n),a&&z(a,e,n),C.value=e,l()}function Y(e,n){const{onChange:t}=o,{nTriggerFormChange:r}=P;t&&z(t,e,n),C.value=e,r()}function Z(e,n=0,t="input"){const r=e.target.value;if(te(r),e instanceof InputEvent&&!e.isComposing&&(F.value=!1),"textarea"===o.type){const{value:e}=b;e&&e.syncUnifiedContainer()}if($=r,F.value)return;v.recordCursor();const a=function(e){const{countGraphemes:n,maxlength:t,minlength:r}=o;if(n){let o;if(void 0!==t&&(void 0===o&&(o=n(e)),o>Number(t)))return!1;if(void 0!==r&&(void 0===o&&(o=n(e)),o<Number(t)))return!1}const{allowInput:a}=o;return"function"!=typeof a||a(e)}(r);if(a)if(o.pair){let{value:e}=k;e=Array.isArray(e)?[e[0],e[1]]:["",""],e[n]=r,"input"===t?G(e,{source:n}):Y(e,{source:n})}else"input"===t?G(r,{source:n}):Y(r,{source:n});q.$forceUpdate(),a||De(v.restoreCursor)}function Q(e,n){(null===e.relatedTarget||e.relatedTarget!==u.value&&e.relatedTarget!==f.value&&e.relatedTarget!==s.value&&e.relatedTarget!==i.value)&&("focus"===n?(!function(e){const{onFocus:n}=o,{nTriggerFormFocus:t}=P;n&&z(n,e),t()}(e),R.value=!0):"blur"===n&&(!function(e){const{onBlur:n}=o,{nTriggerFormBlur:t}=P;n&&z(n,e),t()}(e),R.value=!1))}function ee(){o.pair?(G(["",""],{source:"clear"}),Y(["",""],{source:"clear"})):(G("",{source:"clear"}),Y("",{source:"clear"}))}function oe(){o.passivelyActivated&&(O.value=!1,De(()=>{var e;null===(e=i.value)||void 0===e||e.focus()}))}function ne(){var e,n,t;I.value||(o.passivelyActivated?null===(e=i.value)||void 0===e||e.focus():(null===(n=s.value)||void 0===n||n.focus(),null===(t=u.value)||void 0===t||t.focus()))}function te(e){const{type:n,pair:t,autosize:r}=o;if(!t&&r)if("textarea"===n){const{value:o}=d;o&&(o.textContent=`${null!=e?e:""}\r\n`)}else{const{value:o}=c;o&&(e?o.textContent=e:o.innerHTML="&nbsp;")}}const re=Io({top:"0"});let le=null;Ke(()=>{const{autosize:e,type:n}=o;e&&"textarea"===n?le=Xe(k,e=>{Array.isArray(e)||e===$||te(e)}):null==le||le()});let se=null;Ke(()=>{"textarea"===o.type?se=Xe(k,e=>{var o;Array.isArray(e)||e===$||null===(o=b.value)||void 0===o||o.syncUnifiedContainer()}):null==se||se()}),Ee(Il,{mergedValueRef:k,maxlengthRef:V,mergedClsPrefixRef:n,countGraphemesRef:lo(o,"countGraphemes")});const de={wrapperElRef:i,inputElRef:u,textareaElRef:s,isCompositing:F,clear:ee,focus:ne,blur:function(){var e;(null===(e=i.value)||void 0===e?void 0:e.contains(document.activeElement))&&document.activeElement.blur()},select:function(){var e,o;null===(e=s.value)||void 0===e||e.select(),null===(o=u.value)||void 0===o||o.select()},deactivate:function(){const{value:e}=i;(null==e?void 0:e.contains(document.activeElement))&&e!==document.activeElement&&oe()},activate:function(){I.value||(s.value?s.value.focus():u.value&&u.value.focus())},scrollTo:function(e){if("textarea"===o.type){const{value:o}=s;null==o||o.scrollTo(e)}else{const{value:o}=u;null==o||o.scrollTo(e)}}},ce=p("Input",a,n),ue=to(()=>{const{value:e}=T,{common:{cubicBezierEaseInOut:o},self:{color:n,borderRadius:t,textColor:r,caretColor:a,caretColorError:i,caretColorWarning:s,textDecorationColor:d,border:c,borderDisabled:u,borderHover:p,borderFocus:h,placeholderColor:f,placeholderColorDisabled:m,lineHeightTextarea:v,colorDisabled:g,colorFocus:b,textColorDisabled:y,boxShadowFocus:x,iconSize:C,colorFocusWarning:w,boxShadowFocusWarning:S,borderWarning:k,borderFocusWarning:P,borderHoverWarning:I,colorFocusError:A,boxShadowFocusError:z,borderError:R,borderFocusError:M,borderHoverError:F,clearSize:O,clearColor:$,clearColorHover:B,clearColorPressed:E,iconColor:_,iconColorDisabled:D,suffixTextColor:L,countTextColor:H,countTextColorDisabled:j,iconColorHover:U,iconColorPressed:W,loadingColor:K,loadingColorError:V,loadingColorWarning:q,fontWeight:G,[Te("padding",e)]:J,[Te("fontSize",e)]:Y,[Te("height",e)]:Z}}=l.value,{left:X,right:Q}=N(J);return{"--n-bezier":o,"--n-count-text-color":H,"--n-count-text-color-disabled":j,"--n-color":n,"--n-font-size":Y,"--n-font-weight":G,"--n-border-radius":t,"--n-height":Z,"--n-padding-left":X,"--n-padding-right":Q,"--n-text-color":r,"--n-caret-color":a,"--n-text-decoration-color":d,"--n-border":c,"--n-border-disabled":u,"--n-border-hover":p,"--n-border-focus":h,"--n-placeholder-color":f,"--n-placeholder-color-disabled":m,"--n-icon-size":C,"--n-line-height-textarea":v,"--n-color-disabled":g,"--n-color-focus":b,"--n-text-color-disabled":y,"--n-box-shadow-focus":x,"--n-loading-color":K,"--n-caret-color-warning":s,"--n-color-focus-warning":w,"--n-box-shadow-focus-warning":S,"--n-border-warning":k,"--n-border-focus-warning":P,"--n-border-hover-warning":I,"--n-loading-color-warning":q,"--n-caret-color-error":i,"--n-color-focus-error":A,"--n-box-shadow-focus-error":z,"--n-border-error":R,"--n-border-focus-error":M,"--n-border-hover-error":F,"--n-loading-color-error":V,"--n-clear-color":$,"--n-clear-size":O,"--n-clear-color-hover":B,"--n-clear-color-pressed":E,"--n-icon-color":_,"--n-icon-color-hover":U,"--n-icon-color-pressed":W,"--n-icon-color-disabled":D,"--n-suffix-text-color":L}}),pe=r?X("input",to(()=>{const{value:e}=T;return e[0]}),ue,o):void 0;return Object.assign(Object.assign({},de),{wrapperElRef:i,inputElRef:u,inputMirrorElRef:c,inputEl2Ref:f,textareaElRef:s,textareaMirrorElRef:d,textareaScrollbarInstRef:b,rtlEnabled:ce,uncontrolledValue:C,mergedValue:k,passwordVisible:j,mergedPlaceholder:B,showPlaceholder1:E,showPlaceholder2:_,mergedFocus:D,isComposing:F,activated:O,showClearButton:L,mergedSize:T,mergedDisabled:I,textDecorationStyle:U,mergedClsPrefix:n,mergedBordered:t,mergedShowPasswordOn:H,placeholderStyle:re,mergedStatus:A,textAreaScrollContainerWidth:W,handleTextAreaScroll:function(e){var o;const{scrollTop:n}=e.target;re.value.top=-n+"px",null===(o=b.value)||void 0===o||o.syncUnifiedContainer()},handleCompositionStart:function(){F.value=!0},handleCompositionEnd:function(e){F.value=!1,e.target===f.value?Z(e,1):Z(e,0)},handleInput:Z,handleInputBlur:function(e){!function(e){const{onInputBlur:n}=o;n&&z(n,e)}(e),e.relatedTarget===i.value&&function(){const{onDeactivate:e}=o;e&&z(e)}(),(null===e.relatedTarget||e.relatedTarget!==u.value&&e.relatedTarget!==f.value&&e.relatedTarget!==s.value)&&(O.value=!1),Q(e,"blur"),m.value=null},handleInputFocus:function(e,n){!function(e){const{onInputFocus:n}=o;n&&z(n,e)}(e),R.value=!0,O.value=!0,function(){const{onActivate:e}=o;e&&z(e)}(),Q(e,"focus"),0===n?m.value=u.value:1===n?m.value=f.value:2===n&&(m.value=s.value)},handleWrapperBlur:function(e){o.passivelyActivated&&(!function(e){const{onWrapperBlur:n}=o;n&&z(n,e)}(e),Q(e,"blur"))},handleWrapperFocus:function(e){o.passivelyActivated&&(R.value=!0,function(e){const{onWrapperFocus:n}=o;n&&z(n,e)}(e),Q(e,"focus"))},handleMouseEnter:function(){var e;M.value=!0,"textarea"===o.type&&(null===(e=b.value)||void 0===e||e.handleMouseEnterWrapper())},handleMouseLeave:function(){var e;M.value=!1,"textarea"===o.type&&(null===(e=b.value)||void 0===e||e.handleMouseLeaveWrapper())},handleMouseDown:function(e){const{onMousedown:n}=o;n&&n(e);const{tagName:t}=e.target;if("INPUT"!==t&&"TEXTAREA"!==t){if(o.resizable){const{value:o}=i;if(o){const{left:n,top:t,width:r,height:a}=o.getBoundingClientRect(),l=14;if(n+r-l<e.clientX&&e.clientX<n+r&&t+a-l<e.clientY&&e.clientY<t+a)return}}e.preventDefault(),R.value||ne()}},handleChange:function(e,o){Z(e,o,"change")},handleClick:function(e){!function(e){const{onClick:n}=o;n&&z(n,e)}(e)},handleClear:function(e){!function(e){const{onClear:n}=o;n&&z(n,e)}(e),ee()},handlePasswordToggleClick:function(){I.value||"click"===H.value&&(j.value=!j.value)},handlePasswordToggleMousedown:function(e){if(I.value)return;e.preventDefault();const o=e=>{e.preventDefault(),be("mouseup",document,o)};if(ie("mouseup",document,o),"mousedown"!==H.value)return;j.value=!0;const n=()=>{j.value=!1,be("mouseup",document,n)};ie("mouseup",document,n)},handleWrapperKeydown:function(e){switch(o.onKeydown&&z(o.onKeydown,e),e.key){case"Escape":oe();break;case"Enter":!function(e){var n,t;if(o.passivelyActivated){const{value:r}=O;if(r)return void(o.internalDeactivateOnEnter&&oe());e.preventDefault(),"textarea"===o.type?null===(n=s.value)||void 0===n||n.focus():null===(t=u.value)||void 0===t||t.focus()}}(e)}},handleWrapperKeyup:function(e){o.onKeyup&&z(o.onKeyup,e)},handleTextAreaMirrorResize:function(){(()=>{var e,n;if("textarea"===o.type){const{autosize:t}=o;if(t&&(W.value=null===(n=null===(e=b.value)||void 0===e?void 0:e.$el)||void 0===n?void 0:n.offsetWidth),!s.value)return;if("boolean"==typeof t)return;const{paddingTop:r,paddingBottom:a,lineHeight:l}=window.getComputedStyle(s.value),i=Number(r.slice(0,-2)),c=Number(a.slice(0,-2)),u=Number(l.slice(0,-2)),{value:p}=d;if(!p)return;if(t.minRows){const e=`${i+c+u*Math.max(t.minRows,1)}px`;p.style.minHeight=e}if(t.maxRows){const e=`${i+c+u*t.maxRows}px`;p.style.maxHeight=e}}})()},getTextareaScrollContainer:()=>s.value,mergedTheme:l,cssVars:r?void 0:ue,themeClass:null==pe?void 0:pe.themeClass,onRender:null==pe?void 0:pe.onRender})},render(){var e,o,n,t,r,l,i;const{mergedClsPrefix:s,mergedStatus:d,themeClass:c,type:u,countGraphemes:p,onRender:h}=this,f=this.$slots;return null==h||h(),Ue("div",{ref:"wrapperElRef",class:[`${s}-input`,c,d&&`${s}-input--${d}-status`,{[`${s}-input--rtl`]:this.rtlEnabled,[`${s}-input--disabled`]:this.mergedDisabled,[`${s}-input--textarea`]:"textarea"===u,[`${s}-input--resizable`]:this.resizable&&!this.autosize,[`${s}-input--autosize`]:this.autosize,[`${s}-input--round`]:this.round&&!("textarea"===u),[`${s}-input--pair`]:this.pair,[`${s}-input--focus`]:this.mergedFocus,[`${s}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:this.mergedDisabled||!this.passivelyActivated||this.activated?void 0:0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},Ue("div",{class:`${s}-input-wrapper`},a(f.prefix,e=>e&&Ue("div",{class:`${s}-input__prefix`},e)),"textarea"===u?Ue(Ae,{ref:"textareaScrollbarInstRef",class:`${s}-input__textarea`,container:this.getTextareaScrollContainer,theme:null===(o=null===(e=this.theme)||void 0===e?void 0:e.peers)||void 0===o?void 0:o.Scrollbar,themeOverrides:null===(t=null===(n=this.themeOverrides)||void 0===n?void 0:n.peers)||void 0===t?void 0:t.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var e,o;const{textAreaScrollContainerWidth:n}=this,t={width:this.autosize&&n&&`${n}px`};return Ue(co,null,Ue("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${s}-input__textarea-el`,null===(e=this.inputProps)||void 0===e?void 0:e.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],null===(o=this.inputProps)||void 0===o?void 0:o.style,t],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?Ue("div",{class:`${s}-input__placeholder`,style:[this.placeholderStyle,t],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?Ue(C,{onResize:this.handleTextAreaMirrorResize},{default:()=>Ue("div",{ref:"textareaMirrorElRef",class:`${s}-input__textarea-mirror`,key:"mirror"})}):null)}}):Ue("div",{class:`${s}-input__input`},Ue("input",Object.assign({type:"password"===u&&this.mergedShowPasswordOn&&this.passwordVisible?"text":u},this.inputProps,{ref:"inputElRef",class:[`${s}-input__input-el`,null===(r=this.inputProps)||void 0===r?void 0:r.class],style:[this.textDecorationStyle[0],null===(l=this.inputProps)||void 0===l?void 0:l.style],tabindex:this.passivelyActivated&&!this.activated?-1:null===(i=this.inputProps)||void 0===i?void 0:i.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?Ue("div",{class:`${s}-input__placeholder`},Ue("span",null,this.mergedPlaceholder[0])):null,this.autosize?Ue("div",{class:`${s}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&a(f.suffix,e=>e||this.clearable||this.showCount||this.mergedShowPasswordOn||void 0!==this.loading?Ue("div",{class:`${s}-input__suffix`},[a(f["clear-icon-placeholder"],e=>(this.clearable||e)&&Ue(xr,{clsPrefix:s,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>e,icon:()=>{var e,o;return null===(o=(e=this.$slots)["clear-icon"])||void 0===o?void 0:o.call(e)}})),this.internalLoadingBeforeSuffix?null:e,void 0!==this.loading?Ue(dl,{clsPrefix:s,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?e:null,this.showCount&&"textarea"!==this.type?Ue(Fl,null,{default:e=>{var o;const{renderCount:n}=this;return n?n(e):null===(o=f.count)||void 0===o?void 0:o.call(f,e)}}):null,this.mergedShowPasswordOn&&"password"===this.type?Ue("div",{class:`${s}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Ie(f["password-visible-icon"],()=>[Ue(ee,{clsPrefix:s},{default:()=>Ue(vr,null)})]):Ie(f["password-invisible-icon"],()=>[Ue(ee,{clsPrefix:s},{default:()=>Ue(gr,null)})])):null]):null)),this.pair?Ue("span",{class:`${s}-input__separator`},Ie(f.separator,()=>[this.separator])):null,this.pair?Ue("div",{class:`${s}-input-wrapper`},Ue("div",{class:`${s}-input__input`},Ue("input",{ref:"inputEl2Ref",type:this.type,class:`${s}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?Ue("div",{class:`${s}-input__placeholder`},Ue("span",null,this.mergedPlaceholder[1])):null),a(f.suffix,e=>(this.clearable||e)&&Ue("div",{class:`${s}-input__suffix`},[this.clearable&&Ue(xr,{clsPrefix:s,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var e;return null===(e=f["clear-icon"])||void 0===e?void 0:e.call(f)},placeholder:()=>{var e;return null===(e=f["clear-icon-placeholder"])||void 0===e?void 0:e.call(f)}}),e]))):null,this.mergedBordered?Ue("div",{class:`${s}-input__border`}):null,this.mergedBordered?Ue("div",{class:`${s}-input__state-border`}):null,this.showCount&&"textarea"===u?Ue(Fl,null,{default:e=>{var o;const{renderCount:n}=this;return n?n(e):null===(o=f.count)||void 0===o?void 0:o.call(f,e)}}):null)}});function $l(e){return"group"===e.type}function Bl(e){return"ignored"===e.type}function El(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch(n){return!1}}function _l(e,o){return{getIsGroup:$l,getIgnored:Bl,getKey:o=>$l(o)?o.name||o.key||"key-required":o[e],getChildren:e=>e[o]}}function Dl(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}var Ll=m({name:"AutoComplete",common:t,peers:{InternalSelectMenu:Ln,Input:Vn},self:Dl}),Hl={name:"AutoComplete",common:Sa,peers:{InternalSelectMenu:Za,Input:Tl},self:Dl},jl=Z([G("auto-complete","\n z-index: auto;\n position: relative;\n display: inline-flex;\n width: 100%;\n "),G("auto-complete-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[Hn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Ul(e){var o,n;return"string"==typeof e?{label:e,value:e}:"group"===e.type?{type:"group",label:null!==(o=e.label)&&void 0!==o?o:e.name,value:null!==(n=e.value)&&void 0!==n?n:e.name,key:e.key||e.name,children:e.children.map(e=>Ul(e))}:e}var Wl=Me({name:"AutoComplete",props:Object.assign(Object.assign({},g.props),{to:zn.propTo,menuProps:Object,append:Boolean,bordered:{type:Boolean,default:void 0},clearable:{type:Boolean,default:void 0},defaultValue:{type:String,default:null},loading:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},placeholder:String,placement:{type:String,default:"bottom-start"},value:String,blurAfterSelect:Boolean,clearAfterSelect:Boolean,getShow:Function,showEmpty:Boolean,inputProps:Object,renderOption:Function,renderLabel:Function,size:String,options:{type:Array,default:()=>[]},zIndex:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onSelect:[Function,Array],onBlur:[Function,Array],onFocus:[Function,Array],onInput:[Function,Array]}),slots:Object,setup(e){const{mergedBorderedRef:o,namespaceRef:n,mergedClsPrefixRef:t,inlineThemeDisabled:r}=J(e),a=ae(e),{mergedSizeRef:l,mergedDisabledRef:i,mergedStatusRef:s}=a,d=Io(null),c=Io(null),u=Io(e.defaultValue),p=lo(e,"value"),h=w(p,u),f=Io(!1),m=Io(!1),v=g("AutoComplete","-auto-complete",jl,Ll,e,t),b=to(()=>e.options.map(Ul)),y=to(()=>{const{getShow:o}=e;return o?o(h.value||""):!!h.value}),x=to(()=>y.value&&f.value&&(!!e.showEmpty||!!b.value.length)),C=to(()=>qa(b.value,_l("value","children")));function S(o){const{"onUpdate:value":n,onUpdateValue:t,onInput:r}=e,{nTriggerFormInput:l,nTriggerFormChange:i}=a;t&&z(t,o),n&&z(n,o),r&&z(r,o),u.value=o,l(),i()}function k(o){var n,t;void 0!==(null==o?void 0:o.value)&&(!function(o){const{onSelect:n}=e,{nTriggerFormInput:t,nTriggerFormChange:r}=a;n&&z(n,o),t(),r()}(o.value),e.clearAfterSelect?S(null):void 0!==o.label&&S(e.append?`${h.value}${o.label}`:o.label),f.value=!1,e.blurAfterSelect&&(null===(n=d.value)||void 0===n?void 0:n.contains(document.activeElement))&&(null===(t=document.activeElement)||void 0===t||t.blur()))}const P=to(()=>{const{common:{cubicBezierEaseInOut:e},self:{menuBoxShadow:o}}=v.value;return{"--n-menu-box-shadow":o,"--n-bezier":e}}),T=r?X("auto-complete",void 0,P,e):void 0,I=Io(null),A={focus:()=>{var e;null===(e=I.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=I.value)||void 0===e||e.blur()}};return{focus:A.focus,blur:A.blur,inputInstRef:I,uncontrolledValue:u,mergedValue:h,isMounted:$(),adjustedTo:zn(e),menuInstRef:c,triggerElRef:d,treeMate:C,mergedSize:l,mergedDisabled:i,active:x,mergedStatus:s,handleClear:function(){S(null)},handleFocus:function(o){f.value=!0,function(o){const{onFocus:n}=e,{nTriggerFormFocus:t}=a;n&&z(n,o),t()}(o)},handleBlur:function(o){f.value=!1,function(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=a;n&&z(n,o),t()}(o)},handleInput:function(e){f.value=!0,S(e)},handleToggle:function(e){k(e.rawNode)},handleClickOutsideMenu:function(e){var o;(null===(o=d.value)||void 0===o?void 0:o.contains(ce(e)))||(f.value=!1)},handleCompositionStart:function(){m.value=!0},handleCompositionEnd:function(){window.setTimeout(()=>{m.value=!1},0)},handleKeyDown:function(e){var o,n,t;switch(e.key){case"Enter":if(!m.value){const n=null===(o=c.value)||void 0===o?void 0:o.getPendingTmNode();n&&(k(n.rawNode),e.preventDefault())}break;case"ArrowDown":null===(n=c.value)||void 0===n||n.next();break;case"ArrowUp":null===(t=c.value)||void 0===t||t.prev()}},mergedTheme:v,cssVars:r?void 0:P,themeClass:null==T?void 0:T.themeClass,onRender:null==T?void 0:T.onRender,mergedBordered:o,namespace:n,mergedClsPrefix:t}},render(){const{mergedClsPrefix:e}=this;return Ue("div",{class:`${e}-auto-complete`,ref:"triggerElRef",onKeydown:this.handleKeyDown,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd},Ue(Tn,null,{default:()=>[Ue(In,null,{default:()=>{const e=this.$slots.default;if(e)return et("default",e,{handleInput:this.handleInput,handleFocus:this.handleFocus,handleBlur:this.handleBlur,value:this.mergedValue});const{mergedTheme:o}=this;return Ue(Ol,{ref:"inputInstRef",status:this.mergedStatus,theme:o.peers.Input,themeOverrides:o.peerOverrides.Input,bordered:this.mergedBordered,value:this.mergedValue,placeholder:this.placeholder,size:this.mergedSize,disabled:this.mergedDisabled,clearable:this.clearable,loading:this.loading,inputProps:this.inputProps,onClear:this.handleClear,onFocus:this.handleFocus,onUpdateValue:this.handleInput,onBlur:this.handleBlur},{suffix:()=>{var e,o;return null===(o=(e=this.$slots).suffix)||void 0===o?void 0:o.call(e)},prefix:()=>{var e,o;return null===(o=(e=this.$slots).prefix)||void 0===o?void 0:o.call(e)}})}}),Ue(Pn,{show:this.active,to:this.adjustedTo,containerClass:this.namespace,zIndex:this.zIndex,teleportDisabled:this.adjustedTo===zn.tdkey,placement:this.placement,width:"target"},{default:()=>Ue(go,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var o;if(null===(o=this.onRender)||void 0===o||o.call(this),!this.active)return null;const{menuProps:n}=this;return zo(Ue(ol,Object.assign({},n,{clsPrefix:e,ref:"menuInstRef",theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,"auto-pending":!0,class:[`${e}-auto-complete-menu`,this.themeClass,null==n?void 0:n.class],style:[null==n?void 0:n.style,this.cssVars],treeMate:this.treeMate,multiple:!1,renderLabel:this.renderLabel,renderOption:this.renderOption,size:"medium",onToggle:this.handleToggle}),{empty:()=>{var e,o;return null===(o=(e=this.$slots).empty)||void 0===o?void 0:o.call(e)}}),[[Re,this.handleClickOutsideMenu,void 0,{capture:!0}]])}})})]}))}});function Nl(e){const{borderRadius:o,avatarColor:n,cardColor:t,fontSize:r,heightTiny:a,heightSmall:l,heightMedium:i,heightLarge:s,heightHuge:d,modalColor:c,popoverColor:u}=e;return{borderRadius:o,fontSize:r,border:`2px solid ${t}`,heightTiny:a,heightSmall:l,heightMedium:i,heightLarge:s,heightHuge:d,color:de(t,n),colorModal:de(c,n),colorPopover:de(u,n)}}var Kl={name:"Avatar",common:t,self:Nl},Vl={name:"Avatar",common:Sa,self:Nl};function ql(){return{gap:"-12px"}}var Gl=m({name:"AvatarGroup",common:t,peers:{Avatar:Kl},self:ql}),Jl={name:"AvatarGroup",common:Sa,peers:{Avatar:Vl},self:ql},Yl={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},Zl={name:"BackTop",common:Sa,self(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Yl),{color:o,textColor:n,iconColor:n,iconColorHover:t,iconColorPressed:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}};var Xl={name:"BackTop",common:t,self:function(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Yl),{color:o,textColor:n,iconColor:n,iconColorHover:t,iconColorPressed:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},Ql={name:"Badge",common:Sa,self(e){const{errorColorSuppl:o,infoColorSuppl:n,successColorSuppl:t,warningColorSuppl:r,fontFamily:a}=e;return{color:o,colorInfo:n,colorSuccess:t,colorError:o,colorWarning:r,fontSize:"12px",fontFamily:a}}};var ei={name:"Badge",common:t,self:function(e){const{errorColor:o,infoColor:n,successColor:t,warningColor:r,fontFamily:a}=e;return{color:o,colorInfo:n,colorSuccess:t,colorError:o,colorWarning:r,fontSize:"12px",fontFamily:a}}},oi={fontWeightActive:"400"};function ni(e){const{fontSize:o,textColor3:n,textColor2:t,borderRadius:r,buttonColor2Hover:a,buttonColor2Pressed:l}=e;return Object.assign(Object.assign({},oi),{fontSize:o,itemLineHeight:"1.25",itemTextColor:n,itemTextColorHover:t,itemTextColorPressed:t,itemTextColorActive:t,itemBorderRadius:r,itemColorHover:a,itemColorPressed:l,separatorColor:n})}var ti={name:"Breadcrumb",common:t,self:ni},ri={name:"Breadcrumb",common:Sa,self:ni},ai={name:"Button",common:Sa,self(e){const o=ye(e);return o.waveOpacity="0.8",o.colorOpacitySecondary="0.16",o.colorOpacitySecondaryHover="0.2",o.colorOpacitySecondaryPressed="0.12",o}},li={titleFontSize:"22px"};function ii(e){const{borderRadius:o,fontSize:n,lineHeight:t,textColor2:r,textColor1:a,textColorDisabled:l,dividerColor:i,fontWeightStrong:s,primaryColor:d,baseColor:c,hoverColor:u,cardColor:p,modalColor:h,popoverColor:f}=e;return Object.assign(Object.assign({},li),{borderRadius:o,borderColor:de(p,i),borderColorModal:de(h,i),borderColorPopover:de(f,i),textColor:r,titleFontWeight:s,titleTextColor:a,dayTextColor:l,fontSize:n,lineHeight:t,dateColorCurrent:d,dateTextColorCurrent:c,cellColorHover:de(p,u),cellColorHoverModal:de(h,u),cellColorHoverPopover:de(f,u),cellColor:p,cellColorModal:h,cellColorPopover:f,barColor:d})}var si=m({name:"Calendar",common:t,peers:{Button:te},self:ii}),di={name:"Calendar",common:Sa,peers:{Button:ai},self:ii},ci={name:"Card",common:Sa,self(e){const o=nt(e),{cardColor:n,modalColor:t,popoverColor:r}=e;return o.colorEmbedded=n,o.colorEmbeddedModal=t,o.colorEmbeddedPopover=r,o}};function ui(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}var pi={name:"Carousel",common:t,self:ui},hi={name:"Carousel",common:Sa,self:ui},fi={name:"Checkbox",common:Sa,self(e){const{cardColor:o}=e,n=rt(e);return n.color="#0000",n.checkMarkColor=o,n}};function mi(e){const{borderRadius:o,boxShadow2:n,popoverColor:t,textColor2:r,textColor3:a,primaryColor:l,textColorDisabled:i,dividerColor:s,hoverColor:d,fontSizeMedium:c,heightMedium:u}=e;return{menuBorderRadius:o,menuColor:t,menuBoxShadow:n,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:a,optionHeight:u,optionFontSize:c,optionColorHover:d,optionTextColor:r,optionTextColorActive:l,optionTextColorDisabled:i,optionCheckMarkColor:l,loadingColor:l,columnWidth:"180px"}}var vi=m({name:"Cascader",common:t,peers:{InternalSelectMenu:Ln,InternalSelection:En,Scrollbar:Pe,Checkbox:at,Empty:B},self:mi}),gi={name:"Cascader",common:Sa,peers:{InternalSelectMenu:Za,InternalSelection:cl,Scrollbar:ka,Checkbox:fi,Empty:B},self:mi},bi=O("n-checkbox-group"),yi=Me({name:"CheckboxGroup",props:{min:Number,max:Number,size:String,value:Array,defaultValue:{type:Array,default:null},disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onChange:[Function,Array]},setup(e){const{mergedClsPrefixRef:o}=J(e),n=ae(e),{mergedSizeRef:t,mergedDisabledRef:r}=n,a=Io(e.defaultValue),l=to(()=>e.value),i=w(l,a),s=to(()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.length)||0}),d=to(()=>Array.isArray(i.value)?new Set(i.value):new Set);return Ee(bi,{checkedCountRef:s,maxRef:lo(e,"max"),minRef:lo(e,"min"),valueSetRef:d,disabledRef:r,mergedSizeRef:t,toggleCheckbox:function(o,t){const{nTriggerFormInput:r,nTriggerFormChange:l}=n,{onChange:s,"onUpdate:value":d,onUpdateValue:c}=e;if(Array.isArray(i.value)){const e=Array.from(i.value),n=e.findIndex(e=>e===t);o?~n||(e.push(t),c&&z(c,e,{actionType:"check",value:t}),d&&z(d,e,{actionType:"check",value:t}),r(),l(),a.value=e,s&&z(s,e)):~n&&(e.splice(n,1),c&&z(c,e,{actionType:"uncheck",value:t}),d&&z(d,e,{actionType:"uncheck",value:t}),s&&z(s,e),a.value=e,r(),l())}else o?(c&&z(c,[t],{actionType:"check",value:t}),d&&z(d,[t],{actionType:"check",value:t}),s&&z(s,[t]),a.value=[t],r(),l()):(c&&z(c,[],{actionType:"uncheck",value:t}),d&&z(d,[],{actionType:"uncheck",value:t}),s&&z(s,[]),a.value=[],r(),l())}}),{mergedClsPrefix:o}},render(){return Ue("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),xi=Z([G("checkbox","\n font-size: var(--n-font-size);\n outline: none;\n cursor: pointer;\n display: inline-flex;\n flex-wrap: nowrap;\n align-items: flex-start;\n word-break: break-word;\n line-height: var(--n-size);\n --n-merged-color-table: var(--n-color-table);\n ",[ze("show-label","line-height: var(--n-label-line-height);"),Z("&:hover",[G("checkbox-box",[we("border","border: var(--n-border-checked);")])]),Z("&:focus:not(:active)",[G("checkbox-box",[we("border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),ze("inside-table",[G("checkbox-box","\n background-color: var(--n-merged-color-table);\n ")]),ze("checked",[G("checkbox-box","\n background-color: var(--n-color-checked);\n ",[G("checkbox-icon",[Z(".check-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),ze("indeterminate",[G("checkbox-box",[G("checkbox-icon",[Z(".check-icon","\n opacity: 0;\n transform: scale(.5);\n "),Z(".line-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),ze("checked, indeterminate",[Z("&:focus:not(:active)",[G("checkbox-box",[we("border","\n border: var(--n-border-checked);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),G("checkbox-box","\n background-color: var(--n-color-checked);\n border-left: 0;\n border-top: 0;\n ",[we("border",{border:"var(--n-border-checked)"})])]),ze("disabled",{cursor:"not-allowed"},[ze("checked",[G("checkbox-box","\n background-color: var(--n-color-disabled-checked);\n ",[we("border",{border:"var(--n-border-disabled-checked)"}),G("checkbox-icon",[Z(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),G("checkbox-box","\n background-color: var(--n-color-disabled);\n ",[we("border","\n border: var(--n-border-disabled);\n "),G("checkbox-icon",[Z(".check-icon, .line-icon","\n fill: var(--n-check-mark-color-disabled);\n ")])]),we("label","\n color: var(--n-text-color-disabled);\n ")]),G("checkbox-box-wrapper","\n position: relative;\n width: var(--n-size);\n flex-shrink: 0;\n flex-grow: 0;\n user-select: none;\n -webkit-user-select: none;\n "),G("checkbox-box","\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: var(--n-size);\n width: var(--n-size);\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n transition: background-color 0.3s var(--n-bezier);\n ",[we("border","\n transition:\n border-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n border-radius: inherit;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border: var(--n-border);\n "),G("checkbox-icon","\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n left: 1px;\n right: 1px;\n top: 1px;\n bottom: 1px;\n ",[Z(".check-icon, .line-icon","\n width: 100%;\n fill: var(--n-check-mark-color);\n opacity: 0;\n transform: scale(0.5);\n transform-origin: center;\n transition:\n fill 0.3s var(--n-bezier),\n transform 0.3s var(--n-bezier),\n opacity 0.3s var(--n-bezier),\n border-color 0.3s var(--n-bezier);\n "),b({left:"1px",top:"1px"})])]),we("label","\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n user-select: none;\n -webkit-user-select: none;\n padding: var(--n-label-padding);\n font-weight: var(--n-label-font-weight);\n ",[Z("&:empty",{display:"none"})])]),P(G("checkbox","\n --n-merged-color-table: var(--n-color-table-modal);\n ")),r(G("checkbox","\n --n-merged-color-table: var(--n-color-table-popover);\n "))]),Ci=Me({name:"Checkbox",props:Object.assign(Object.assign({},g.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),setup(o){const n=We(bi,null),t=Io(null),{mergedClsPrefixRef:r,inlineThemeDisabled:a,mergedRtlRef:l}=J(o),i=Io(o.defaultChecked),s=lo(o,"checked"),d=w(s,i),c=e(()=>{if(n){const e=n.valueSetRef.value;return!(!e||void 0===o.value)&&e.has(o.value)}return d.value===o.checkedValue}),u=ae(o,{mergedSize(e){const{size:t}=o;if(void 0!==t)return t;if(n){const{value:e}=n.mergedSizeRef;if(void 0!==e)return e}if(e){const{mergedSize:o}=e;if(void 0!==o)return o.value}return"medium"},mergedDisabled(e){const{disabled:t}=o;if(void 0!==t)return t;if(n){if(n.disabledRef.value)return!0;const{maxRef:{value:e},checkedCountRef:o}=n;if(void 0!==e&&o.value>=e&&!c.value)return!0;const{minRef:{value:t}}=n;if(void 0!==t&&o.value<=t&&c.value)return!0}return!!e&&e.disabled.value}}),{mergedDisabledRef:h,mergedSizeRef:f}=u,m=g("Checkbox","-checkbox",xi,at,o,r);function v(e){if(n&&void 0!==o.value)n.toggleCheckbox(!c.value,o.value);else{const{onChange:n,"onUpdate:checked":t,onUpdateChecked:r}=o,{nTriggerFormInput:a,nTriggerFormChange:l}=u,s=c.value?o.uncheckedValue:o.checkedValue;t&&z(t,s,e),r&&z(r,s,e),n&&z(n,s,e),a(),l(),i.value=s}}const b={focus:()=>{var e;null===(e=t.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=t.value)||void 0===e||e.blur()}},y=p("Checkbox",l,r),x=to(()=>{const{value:e}=f,{common:{cubicBezierEaseInOut:o},self:{borderRadius:n,color:t,colorChecked:r,colorDisabled:a,colorTableHeader:l,colorTableHeaderModal:i,colorTableHeaderPopover:s,checkMarkColor:d,checkMarkColorDisabled:c,border:u,borderFocus:p,borderDisabled:h,borderChecked:v,boxShadowFocus:g,textColor:b,textColorDisabled:y,checkMarkColorDisabledChecked:x,colorDisabledChecked:C,borderDisabledChecked:w,labelPadding:S,labelLineHeight:k,labelFontWeight:P,[Te("fontSize",e)]:T,[Te("size",e)]:I}}=m.value;return{"--n-label-line-height":k,"--n-label-font-weight":P,"--n-size":I,"--n-bezier":o,"--n-border-radius":n,"--n-border":u,"--n-border-checked":v,"--n-border-focus":p,"--n-border-disabled":h,"--n-border-disabled-checked":w,"--n-box-shadow-focus":g,"--n-color":t,"--n-color-checked":r,"--n-color-table":l,"--n-color-table-modal":i,"--n-color-table-popover":s,"--n-color-disabled":a,"--n-color-disabled-checked":C,"--n-text-color":b,"--n-text-color-disabled":y,"--n-check-mark-color":d,"--n-check-mark-color-disabled":c,"--n-check-mark-color-disabled-checked":x,"--n-font-size":T,"--n-label-padding":S}}),C=a?X("checkbox",to(()=>f.value[0]),x,o):void 0;return Object.assign(u,b,{rtlEnabled:y,selfRef:t,mergedClsPrefix:r,mergedDisabled:h,renderedChecked:c,mergedTheme:m,labelId:fe(),handleClick:function(e){h.value||v(e)},handleKeyUp:function(e){if(!h.value)switch(e.key){case" ":case"Enter":v(e)}},handleKeyDown:function(e){if(" "===e.key)e.preventDefault()},cssVars:a?void 0:x,themeClass:null==C?void 0:C.themeClass,onRender:null==C?void 0:C.onRender})},render(){var e;const{$slots:n,renderedChecked:t,mergedDisabled:r,indeterminate:l,privateInsideTable:i,cssVars:s,labelId:d,label:c,mergedClsPrefix:u,focusable:p,handleKeyUp:h,handleKeyDown:f,handleClick:m}=this;null===(e=this.onRender)||void 0===e||e.call(this);const v=a(n.default,e=>c||e?Ue("span",{class:`${u}-checkbox__label`,id:d},c||e):null);return Ue("div",{ref:"selfRef",class:[`${u}-checkbox`,this.themeClass,this.rtlEnabled&&`${u}-checkbox--rtl`,t&&`${u}-checkbox--checked`,r&&`${u}-checkbox--disabled`,l&&`${u}-checkbox--indeterminate`,i&&`${u}-checkbox--inside-table`,v&&`${u}-checkbox--show-label`],tabindex:r||!p?void 0:0,role:"checkbox","aria-checked":l?"mixed":t,"aria-labelledby":d,style:s,onKeyup:h,onKeydown:f,onClick:m,onMousedown:()=>{ie("selectstart",window,e=>{e.preventDefault()},{once:!0})}},Ue("div",{class:`${u}-checkbox-box-wrapper`}," ",Ue("div",{class:`${u}-checkbox-box`},Ue(o,null,{default:()=>this.indeterminate?Ue("div",{key:"indeterminate",class:`${u}-checkbox-icon`},Ue("svg",{viewBox:"0 0 100 100",class:"line-icon"},Ue("path",{d:"M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z"}))):Ue("div",{key:"check",class:`${u}-checkbox-icon`},Ue("svg",{viewBox:"0 0 64 64",class:"check-icon"},Ue("path",{d:"M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"})))}),Ue("div",{class:`${u}-checkbox-box__border`}))),v)}}),wi={name:"Code",common:Sa,self(e){const{textColor2:o,fontSize:n,fontWeightStrong:t,textColor3:r}=e;return{textColor:o,fontSize:n,fontWeightStrong:t,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:r}}};var Si={name:"Code",common:t,self:function(e){const{textColor2:o,fontSize:n,fontWeightStrong:t,textColor3:r}=e;return{textColor:o,fontSize:n,fontWeightStrong:t,"mono-3":"#a0a1a7","hue-1":"#0184bb","hue-2":"#4078f2","hue-3":"#a626a4","hue-4":"#50a14f","hue-5":"#e45649","hue-5-2":"#c91243","hue-6":"#986801","hue-6-2":"#c18401",lineNumberTextColor:r}}};function ki(e){const{fontWeight:o,textColor1:n,textColor2:t,textColorDisabled:r,dividerColor:a,fontSize:l}=e;return{titleFontSize:l,titleFontWeight:o,dividerColor:a,titleTextColor:n,titleTextColorDisabled:r,fontSize:l,textColor:t,arrowColor:t,arrowColorDisabled:r,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}var Pi={name:"Collapse",common:t,self:ki},Ti={name:"Collapse",common:Sa,self:ki};function Ii(e){const{cubicBezierEaseInOut:o}=e;return{bezier:o}}var Ai={name:"CollapseTransition",common:t,self:Ii},zi={name:"CollapseTransition",common:Sa,self:Ii};function Ri(e){const{fontSize:o,boxShadow2:n,popoverColor:t,textColor2:r,borderRadius:a,borderColor:l,heightSmall:i,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:p,dividerColor:h}=e;return{panelFontSize:o,boxShadow:n,color:t,textColor:r,borderRadius:a,border:`1px solid ${l}`,heightSmall:i,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:p,dividerColor:h}}var Mi=m({name:"ColorPicker",common:t,peers:{Input:Vn,Button:te},self:Ri}),Fi={name:"ColorPicker",common:Sa,peers:{Input:Tl,Button:ai},self:Ri},Oi=Me({name:"ConfigProvider",alias:["App"],props:{abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(y("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},setup(o){const n=We(E,null),t=to(()=>{const{theme:e}=o;if(null===e)return;const t=null==n?void 0:n.mergedThemeRef.value;return void 0===e?t:void 0===t?e:Object.assign({},t,e)}),r=to(()=>{const{themeOverrides:e}=o;if(null!==e){if(void 0===e)return null==n?void 0:n.mergedThemeOverridesRef.value;{const o=null==n?void 0:n.mergedThemeOverridesRef.value;return void 0===o?e:S({},o,e)}}}),a=e(()=>{const{namespace:e}=o;return void 0===e?null==n?void 0:n.mergedNamespaceRef.value:e}),l=e(()=>{const{bordered:e}=o;return void 0===e?null==n?void 0:n.mergedBorderedRef.value:e}),i=to(()=>{const{icons:e}=o;return void 0===e?null==n?void 0:n.mergedIconsRef.value:e}),s=to(()=>{const{componentOptions:e}=o;return void 0!==e?e:null==n?void 0:n.mergedComponentPropsRef.value}),d=to(()=>{const{clsPrefix:e}=o;return void 0!==e?e:n?n.mergedClsPrefixRef.value:"n"}),c=to(()=>{var e;const{rtl:t}=o;if(void 0===t)return null==n?void 0:n.mergedRtlRef.value;const r={};for(const o of t)r[o.name]=To(o),null===(e=o.peers)||void 0===e||e.forEach(e=>{e.name in r||(r[e.name]=To(e))});return r}),u=to(()=>o.breakpoints||(null==n?void 0:n.mergedBreakpointsRef.value)),p=o.inlineThemeDisabled||(null==n?void 0:n.inlineThemeDisabled),h=o.preflightStyleDisabled||(null==n?void 0:n.preflightStyleDisabled),f=o.styleMountTarget||(null==n?void 0:n.styleMountTarget),m=to(()=>{const{value:e}=t,{value:o}=r,n=o&&0!==Object.keys(o).length,a=null==e?void 0:e.name;return a?n?`${a}-${A(JSON.stringify(r.value))}`:a:n?A(JSON.stringify(r.value)):""});return Ee(E,{mergedThemeHashRef:m,mergedBreakpointsRef:u,mergedRtlRef:c,mergedIconsRef:i,mergedComponentPropsRef:s,mergedBorderedRef:l,mergedNamespaceRef:a,mergedClsPrefixRef:d,mergedLocaleRef:to(()=>{const{locale:e}=o;if(null!==e)return void 0===e?null==n?void 0:n.mergedLocaleRef.value:e}),mergedDateLocaleRef:to(()=>{const{dateLocale:e}=o;if(null!==e)return void 0===e?null==n?void 0:n.mergedDateLocaleRef.value:e}),mergedHljsRef:to(()=>{const{hljs:e}=o;return void 0===e?null==n?void 0:n.mergedHljsRef.value:e}),mergedKatexRef:to(()=>{const{katex:e}=o;return void 0===e?null==n?void 0:n.mergedKatexRef.value:e}),mergedThemeRef:t,mergedThemeOverridesRef:r,inlineThemeDisabled:p||!1,preflightStyleDisabled:h||!1,styleMountTarget:f}),{mergedClsPrefix:d,mergedBordered:l,mergedNamespace:a,mergedTheme:t,mergedThemeOverrides:r}},render(){var e,o,n,t;return this.abstract?null===(t=(n=this.$slots).default)||void 0===t?void 0:t.call(n):Ue(this.as||this.tag,{class:`${this.mergedClsPrefix||"n"}-config-provider`},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}}),$i={name:"Popselect",common:Sa,peers:{Popover:nl,InternalSelectMenu:Za}};var Bi=m({name:"Popselect",common:t,peers:{Popover:qn,InternalSelectMenu:Ln},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}}),Ei={name:"Select",common:Sa,peers:{InternalSelection:cl,InternalSelectMenu:Za},self:$n},_i=Z([G("select","\n z-index: auto;\n outline: none;\n width: 100%;\n position: relative;\n font-weight: var(--n-font-weight);\n "),G("select-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[Hn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Di=Me({name:"Select",props:Object.assign(Object.assign({},g.props),{to:zn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:a}=J(e),l=g("Select","-select",_i,jn,e,o),i=Io(e.defaultValue),s=lo(e,"value"),d=w(s,i),c=Io(!1),u=Io(""),p=F(e,["items","options"]),f=Io([]),m=Io([]),v=to(()=>m.value.concat(f.value).concat(p.value)),b=to(()=>{const{filter:o}=e;if(o)return o;const{labelField:n,valueField:t}=e;return(e,o)=>{if(!o)return!1;const r=o[n];if("string"==typeof r)return El(e,r);const a=o[t];return"string"==typeof a?El(e,a):"number"==typeof a&&El(e,String(a))}}),y=to(()=>{if(e.remote)return p.value;{const{value:o}=v,{value:n}=u;return n.length&&e.filterable?function(e,o,n,t){return o?function e(r){if(!Array.isArray(r))return[];const a=[];for(const l of r)if($l(l)){const o=e(l[t]);o.length&&a.push(Object.assign({},l,{[t]:o}))}else{if(Bl(l))continue;o(n,l)&&a.push(l)}return a}(e):e}(o,b.value,n,e.childrenField):o}}),x=to(()=>{const{valueField:o,childrenField:n}=e,t=_l(o,n);return qa(y.value,t)}),C=to(()=>function(e,o,n){const t=new Map;return e.forEach(e=>{$l(e)?e[n].forEach(e=>{t.set(e[o],e)}):t.set(e[o],e)}),t}(v.value,e.valueField,e.childrenField)),S=Io(!1),k=w(lo(e,"show"),S),P=Io(null),T=Io(null),I=Io(null),{localeRef:A}=h("Select"),R=to(()=>{var o;return null!==(o=e.placeholder)&&void 0!==o?o:A.value.placeholder}),M=[],O=Io(new Map),B=to(()=>{const{fallbackOption:o}=e;if(void 0===o){const{labelField:o,valueField:n}=e;return e=>({[o]:String(e),[n]:e})}return!1!==o&&(e=>Object.assign(o(e),{value:e}))});function E(o){const n=e.remote,{value:t}=O,{value:r}=C,{value:a}=B,l=[];return o.forEach(e=>{if(r.has(e))l.push(r.get(e));else if(n&&t.has(e))l.push(t.get(e));else if(a){const o=a(e);o&&l.push(o)}}),l}const _=to(()=>{if(e.multiple){const{value:e}=d;return Array.isArray(e)?E(e):[]}return null}),D=to(()=>{const{value:o}=d;return e.multiple||Array.isArray(o)||null===o?null:E([o])[0]||null}),L=ae(e),{mergedSizeRef:H,mergedDisabledRef:j,mergedStatusRef:U}=L;function W(o,n){const{onChange:t,"onUpdate:value":r,onUpdateValue:a}=e,{nTriggerFormChange:l,nTriggerFormInput:s}=L;t&&z(t,o,n),a&&z(a,o,n),r&&z(r,o,n),i.value=o,l(),s()}function N(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=L;n&&z(n,o),t()}function K(){var o;const{remote:n,multiple:t}=e;if(n){const{value:n}=O;if(t){const{valueField:t}=e;null===(o=_.value)||void 0===o||o.forEach(e=>{n.set(e[t],e)})}else{const o=D.value;o&&n.set(o[e.valueField],o)}}}function V(o){const{onUpdateShow:n,"onUpdate:show":t}=e;n&&z(n,o),t&&z(t,o),S.value=o}function q(){j.value||(V(!0),S.value=!0,e.filterable&&re())}function G(){V(!1)}function Y(){u.value="",m.value=M}const Z=Io(!1);function Q(e){ee(e.rawNode)}function ee(o){if(j.value)return;const{tag:n,remote:t,clearFilterAfterSelect:r,valueField:a}=e;if(n&&!t){const{value:e}=m,o=e[0]||null;if(o){const e=f.value;e.length?e.push(o):f.value=[o],m.value=M}}if(t&&O.value.set(o[a],o),e.multiple){const l=function(o){if(!Array.isArray(o))return[];if(B.value)return Array.from(o);{const{remote:n}=e,{value:t}=C;if(n){const{value:e}=O;return o.filter(o=>t.has(o)||e.has(o))}return o.filter(e=>t.has(e))}}(d.value),i=l.findIndex(e=>e===o[a]);if(~i){if(l.splice(i,1),n&&!t){const e=oe(o[a]);~e&&(f.value.splice(e,1),r&&(u.value=""))}}else l.push(o[a]),r&&(u.value="");W(l,E(l))}else{if(n&&!t){const e=oe(o[a]);f.value=~e?[f.value[e]]:M}te(),G(),W(o[a],o)}}function oe(o){return f.value.findIndex(n=>n[e.valueField]===o)}function ne(o){var t,r,a,l,i;if(e.keyboard)switch(o.key){case" ":if(e.filterable)break;o.preventDefault();case"Enter":if(!(null===(t=P.value)||void 0===t?void 0:t.isComposing))if(k.value){const o=null===(r=I.value)||void 0===r?void 0:r.getPendingTmNode();o?Q(o):e.filterable||(G(),te())}else if(q(),e.tag&&Z.value){const o=m.value[0];if(o){const n=o[e.valueField],{value:t}=d;e.multiple&&Array.isArray(t)&&t.includes(n)||ee(o)}}o.preventDefault();break;case"ArrowUp":if(o.preventDefault(),e.loading)return;k.value&&(null===(a=I.value)||void 0===a||a.prev());break;case"ArrowDown":if(o.preventDefault(),e.loading)return;k.value?null===(l=I.value)||void 0===l||l.next():q();break;case"Escape":k.value&&(n(o),G()),null===(i=P.value)||void 0===i||i.focus()}else o.preventDefault()}function te(){var e;null===(e=P.value)||void 0===e||e.focus()}function re(){var e;null===(e=P.value)||void 0===e||e.focusInput()}K(),Xe(lo(e,"options"),K);const le={focus:()=>{var e;null===(e=P.value)||void 0===e||e.focus()},focusInput:()=>{var e;null===(e=P.value)||void 0===e||e.focusInput()},blur:()=>{var e;null===(e=P.value)||void 0===e||e.blur()},blurInput:()=>{var e;null===(e=P.value)||void 0===e||e.blurInput()}},ie=to(()=>{const{self:{menuBoxShadow:e}}=l.value;return{"--n-menu-box-shadow":e}}),se=a?X("select",void 0,ie,e):void 0;return Object.assign(Object.assign({},le),{mergedStatus:U,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:x,isMounted:$(),triggerRef:P,menuRef:I,pattern:u,uncontrolledShow:S,mergedShow:k,adjustedTo:zn(e),uncontrolledValue:i,mergedValue:d,followerRef:T,localizedPlaceholder:R,selectedOption:D,selectedOptions:_,mergedSize:H,mergedDisabled:j,focused:c,activeWithoutMenuOpen:Z,inlineThemeDisabled:a,onTriggerInputFocus:function(){e.filterable&&(Z.value=!0)},onTriggerInputBlur:function(){e.filterable&&(Z.value=!1,k.value||Y())},handleTriggerOrMenuResize:function(){var e;k.value&&(null===(e=T.value)||void 0===e||e.syncPosition())},handleMenuFocus:function(){c.value=!0},handleMenuBlur:function(e){var o;(null===(o=P.value)||void 0===o?void 0:o.$el.contains(e.relatedTarget))||(c.value=!1,N(e),G())},handleMenuTabOut:function(){var e;null===(e=P.value)||void 0===e||e.focus(),G()},handleTriggerClick:function(){j.value||(k.value?e.filterable?re():G():q())},handleToggle:Q,handleDeleteOption:ee,handlePatternInput:function(o){k.value||q();const{value:n}=o.target;u.value=n;const{tag:t,remote:r}=e;if(function(o){const{onSearch:n}=e;n&&z(n,o)}(n),t&&!r){if(!n)return void(m.value=M);const{onCreate:o}=e,t=o?o(n):{[e.labelField]:n,[e.valueField]:n},{valueField:r,labelField:a}=e;p.value.some(e=>e[r]===t[r]||e[a]===t[a])||f.value.some(e=>e[r]===t[r]||e[a]===t[a])?m.value=M:m.value=[t]}},handleClear:function(o){o.stopPropagation();const{multiple:n}=e;!n&&e.filterable&&G(),function(){const{onClear:o}=e;o&&z(o)}(),n?W([],[]):W(null,null)},handleTriggerBlur:function(e){var o,n;(null===(n=null===(o=I.value)||void 0===o?void 0:o.selfRef)||void 0===n?void 0:n.contains(e.relatedTarget))||(c.value=!1,N(e),G())},handleTriggerFocus:function(o){!function(o){const{onFocus:n,showOnFocus:t}=e,{nTriggerFormFocus:r}=L;n&&z(n,o),r(),t&&q()}(o),c.value=!0},handleKeydown:ne,handleMenuAfterLeave:Y,handleMenuClickOutside:function(e){var o;k.value&&((null===(o=P.value)||void 0===o?void 0:o.$el.contains(ce(e)))||G())},handleMenuScroll:function(o){!function(o){const{onScroll:n}=e;n&&z(n,o)}(o)},handleMenuKeydown:ne,handleMenuMousedown:function(e){Wt(e,"action")||Wt(e,"empty")||Wt(e,"header")||e.preventDefault()},mergedTheme:l,cssVars:a?void 0:ie,themeClass:null==se?void 0:se.themeClass,onRender:null==se?void 0:se.onRender})},render(){return Ue("div",{class:`${this.mergedClsPrefix}-select`},Ue(Tn,null,{default:()=>[Ue(In,null,{default:()=>Ue(pl,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[null===(o=(e=this.$slots).arrow)||void 0===o?void 0:o.call(e)]}})}),Ue(Pn,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===zn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>Ue(go,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,n;return this.mergedShow||"show"===this.displayDirective?(null===(e=this.onRender)||void 0===e||e.call(this),zo(Ue(ol,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,null===(o=this.menuProps)||void 0===o?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[null===(n=this.menuProps)||void 0===n?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var e,o;return[null===(o=(e=this.$slots).empty)||void 0===o?void 0:o.call(e)]},header:()=>{var e,o;return[null===(o=(e=this.$slots).header)||void 0===o?void 0:o.call(e)]},action:()=>{var e,o;return[null===(o=(e=this.$slots).action)||void 0===o?void 0:o.call(e)]}}),"show"===this.displayDirective?[[so,this.mergedShow],[Re,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Re,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Li={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function Hi(e){const{textColor2:o,primaryColor:n,primaryColorHover:t,primaryColorPressed:r,inputColorDisabled:a,textColorDisabled:l,borderColor:i,borderRadius:s,fontSizeTiny:d,fontSizeSmall:c,fontSizeMedium:u,heightTiny:p,heightSmall:h,heightMedium:f}=e;return Object.assign(Object.assign({},Li),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${i}`,buttonBorderHover:`1px solid ${i}`,buttonBorderPressed:`1px solid ${i}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:t,itemTextColorPressed:r,itemTextColorActive:n,itemTextColorDisabled:l,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:a,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${n}`,itemBorderDisabled:`1px solid ${i}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:h,itemSizeLarge:f,itemFontSizeSmall:d,itemFontSizeMedium:c,itemFontSizeLarge:u,jumperFontSizeSmall:d,jumperFontSizeMedium:c,jumperFontSizeLarge:u,jumperTextColor:o,jumperTextColorDisabled:l})}var ji=m({name:"Pagination",common:t,peers:{Select:jn,Input:Vn,Popselect:Bi},self:Hi}),Ui={name:"Pagination",common:Sa,peers:{Select:Ei,Input:Tl,Popselect:$i},self(e){const{primaryColor:o,opacity3:n}=e,t=D(o,{alpha:Number(n)}),r=Hi(e);return r.itemBorderActive=`1px solid ${t}`,r.itemBorderDisabled="1px solid #0000",r}},Wi={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function Ni(e){const{primaryColor:o,textColor2:n,dividerColor:t,hoverColor:r,popoverColor:a,invertedColor:l,borderRadius:i,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,heightSmall:p,heightMedium:h,heightLarge:f,heightHuge:m,textColor3:v,opacityDisabled:g}=e;return Object.assign(Object.assign({},Wi),{optionHeightSmall:p,optionHeightMedium:h,optionHeightLarge:f,optionHeightHuge:m,borderRadius:i,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:o,optionTextColorChildActive:o,color:a,dividerColor:t,suffixColor:n,prefixColor:n,optionColorHover:r,optionColorActive:D(o,{alpha:.1}),groupHeaderTextColor:v,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:l,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:o,optionColorActiveInverted:o,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:g})}var Ki=m({name:"Dropdown",common:t,peers:{Popover:qn},self:Ni}),Vi={name:"Dropdown",common:Sa,peers:{Popover:nl},self(e){const{primaryColorSuppl:o,primaryColor:n,popoverColor:t}=e,r=Ni(e);return r.colorInverted=t,r.optionColorActive=D(n,{alpha:.15}),r.optionColorActiveInverted=o,r.optionColorHoverInverted=o,r}},qi={padding:"8px 14px"},Gi={name:"Tooltip",common:Sa,peers:{Popover:nl},self(e){const{borderRadius:o,boxShadow2:n,popoverColor:t,textColor2:r}=e;return Object.assign(Object.assign({},qi),{borderRadius:o,boxShadow:n,color:t,textColor:r})}};var Ji=m({name:"Tooltip",common:t,peers:{Popover:qn},self:function(e){const{borderRadius:o,boxShadow2:n,baseColor:t}=e;return Object.assign(Object.assign({},qi),{borderRadius:o,boxShadow:n,color:de(t,"rgba(0, 0, 0, .85)"),textColor:t})}}),Yi={name:"Ellipsis",common:Sa,peers:{Tooltip:Gi}},Zi=m({name:"Ellipsis",common:t,peers:{Tooltip:Ji}}),Xi={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},Qi={name:"Radio",common:Sa,self(e){const{borderColor:o,primaryColor:n,baseColor:t,textColorDisabled:r,inputColorDisabled:a,textColor2:l,opacityDisabled:i,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,heightSmall:p,heightMedium:h,heightLarge:f,lineHeight:m}=e;return Object.assign(Object.assign({},Xi),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:h,buttonHeightLarge:f,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${n}`,boxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${D(n,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${n}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:"#0000",colorDisabled:a,colorActive:"#0000",textColor:l,textColorDisabled:r,dotColorActive:n,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:n,buttonBorderColorHover:n,buttonColor:"#0000",buttonColorActive:n,buttonTextColor:l,buttonTextColorActive:t,buttonTextColorHover:n,opacityDisabled:i,buttonBoxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${D(n,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${n}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};var es={name:"Radio",common:t,self:function(e){const{borderColor:o,primaryColor:n,baseColor:t,textColorDisabled:r,inputColorDisabled:a,textColor2:l,opacityDisabled:i,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,heightSmall:p,heightMedium:h,heightLarge:f,lineHeight:m}=e;return Object.assign(Object.assign({},Xi),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:h,buttonHeightLarge:f,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${n}`,boxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${D(n,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${n}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:t,colorDisabled:a,colorActive:"#0000",textColor:l,textColorDisabled:r,dotColorActive:n,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:n,buttonBorderColorHover:o,buttonColor:t,buttonColorActive:t,buttonTextColor:l,buttonTextColorActive:n,buttonTextColorHover:n,opacityDisabled:i,buttonBoxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${D(n,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}},os={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function ns(e){const{cardColor:o,modalColor:n,popoverColor:t,textColor2:r,textColor1:a,tableHeaderColor:l,tableColorHover:i,iconColor:s,primaryColor:d,fontWeightStrong:c,borderRadius:u,lineHeight:p,fontSizeSmall:h,fontSizeMedium:f,fontSizeLarge:m,dividerColor:v,heightSmall:g,opacityDisabled:b,tableColorStriped:y}=e;return Object.assign(Object.assign({},os),{actionDividerColor:v,lineHeight:p,borderRadius:u,fontSizeSmall:h,fontSizeMedium:f,fontSizeLarge:m,borderColor:de(o,v),tdColorHover:de(o,i),tdColorSorting:de(o,i),tdColorStriped:de(o,y),thColor:de(o,l),thColorHover:de(de(o,l),i),thColorSorting:de(de(o,l),i),tdColor:o,tdTextColor:r,thTextColor:a,thFontWeight:c,thButtonColorHover:i,thIconColor:s,thIconColorActive:d,borderColorModal:de(n,v),tdColorHoverModal:de(n,i),tdColorSortingModal:de(n,i),tdColorStripedModal:de(n,y),thColorModal:de(n,l),thColorHoverModal:de(de(n,l),i),thColorSortingModal:de(de(n,l),i),tdColorModal:n,borderColorPopover:de(t,v),tdColorHoverPopover:de(t,i),tdColorSortingPopover:de(t,i),tdColorStripedPopover:de(t,y),thColorPopover:de(t,l),thColorHoverPopover:de(de(t,l),i),thColorSortingPopover:de(de(t,l),i),tdColorPopover:t,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:d,loadingSize:g,opacityLoading:b})}var ts=m({name:"DataTable",common:t,peers:{Button:te,Checkbox:at,Radio:es,Pagination:ji,Scrollbar:Pe,Empty:B,Popover:qn,Ellipsis:Zi,Dropdown:Ki},self:ns}),rs={name:"DataTable",common:Sa,peers:{Button:ai,Checkbox:fi,Radio:Qi,Pagination:Ui,Scrollbar:ka,Empty:Ga,Popover:nl,Ellipsis:Yi,Dropdown:Vi},self(e){const o=ns(e);return o.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",o.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",o}},as=G("radio","\n line-height: var(--n-label-line-height);\n outline: none;\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n display: inline-flex;\n align-items: flex-start;\n flex-wrap: nowrap;\n font-size: var(--n-font-size);\n word-break: break-word;\n",[ze("checked",[we("dot","\n background-color: var(--n-color-active);\n ")]),we("dot-wrapper","\n position: relative;\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--n-radio-size);\n "),G("radio-input","\n position: absolute;\n border: 0;\n width: 0;\n height: 0;\n opacity: 0;\n margin: 0;\n "),we("dot","\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: var(--n-radio-size);\n width: var(--n-radio-size);\n background: var(--n-color);\n box-shadow: var(--n-box-shadow);\n border-radius: 50%;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ",[Z("&::before",'\n content: "";\n opacity: 0;\n position: absolute;\n left: 4px;\n top: 4px;\n height: calc(100% - 8px);\n width: calc(100% - 8px);\n border-radius: 50%;\n transform: scale(.8);\n background: var(--n-dot-color-active);\n transition: \n opacity .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n transform .3s var(--n-bezier);\n '),ze("checked",{boxShadow:"var(--n-box-shadow-active)"},[Z("&::before","\n opacity: 1;\n transform: scale(1);\n ")])]),we("label","\n color: var(--n-text-color);\n padding: var(--n-label-padding);\n font-weight: var(--n-label-font-weight);\n display: inline-block;\n transition: color .3s var(--n-bezier);\n "),H("disabled","\n cursor: pointer;\n ",[Z("&:hover",[we("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),ze("focus",[Z("&:not(:active)",[we("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),ze("disabled","\n cursor: not-allowed;\n ",[we("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[Z("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),ze("checked","\n opacity: 1;\n ")]),we("label",{color:"var(--n-text-color-disabled)"}),G("radio-input","\n cursor: not-allowed;\n ")])]),ls={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},is=O("n-radio-group");function ss(o){const n=We(is,null),t=ae(o,{mergedSize(e){const{size:t}=o;if(void 0!==t)return t;if(n){const{mergedSizeRef:{value:e}}=n;if(void 0!==e)return e}return e?e.mergedSize.value:"medium"},mergedDisabled:e=>!!o.disabled||(!!(null==n?void 0:n.disabledRef.value)||!!(null==e?void 0:e.disabled.value))}),{mergedSizeRef:r,mergedDisabledRef:a}=t,l=Io(null),i=Io(null),s=Io(o.defaultChecked),d=lo(o,"checked"),c=w(d,s),u=e(()=>n?n.valueRef.value===o.value:c.value),p=e(()=>{const{name:e}=o;return void 0!==e?e:n?n.nameRef.value:void 0}),h=Io(!1);function f(){a.value||u.value||function(){if(n){const{doUpdateValue:e}=n,{value:t}=o;z(e,t)}else{const{onUpdateChecked:e,"onUpdate:checked":n}=o,{nTriggerFormInput:r,nTriggerFormChange:a}=t;e&&z(e,!0),n&&z(n,!0),r(),a(),s.value=!0}}()}return{mergedClsPrefix:n?n.mergedClsPrefixRef:J(o).mergedClsPrefixRef,inputRef:l,labelRef:i,mergedName:p,mergedDisabled:a,renderSafeChecked:u,focus:h,mergedSize:r,handleRadioInputChange:function(){f(),l.value&&(l.value.checked=u.value)},handleRadioInputBlur:function(){h.value=!1},handleRadioInputFocus:function(){h.value=!0}}}var ds=Me({name:"Radio",props:Object.assign(Object.assign({},g.props),ls),setup(e){const o=ss(e),n=g("Radio","-radio",as,es,e,o.mergedClsPrefix),t=to(()=>{const{mergedSize:{value:e}}=o,{common:{cubicBezierEaseInOut:t},self:{boxShadow:r,boxShadowActive:a,boxShadowDisabled:l,boxShadowFocus:i,boxShadowHover:s,color:d,colorDisabled:c,colorActive:u,textColor:p,textColorDisabled:h,dotColorActive:f,dotColorDisabled:m,labelPadding:v,labelLineHeight:g,labelFontWeight:b,[Te("fontSize",e)]:y,[Te("radioSize",e)]:x}}=n.value;return{"--n-bezier":t,"--n-label-line-height":g,"--n-label-font-weight":b,"--n-box-shadow":r,"--n-box-shadow-active":a,"--n-box-shadow-disabled":l,"--n-box-shadow-focus":i,"--n-box-shadow-hover":s,"--n-color":d,"--n-color-active":u,"--n-color-disabled":c,"--n-dot-color-active":f,"--n-dot-color-disabled":m,"--n-font-size":y,"--n-radio-size":x,"--n-text-color":p,"--n-text-color-disabled":h,"--n-label-padding":v}}),{inlineThemeDisabled:r,mergedClsPrefixRef:a,mergedRtlRef:l}=J(e),i=p("Radio",l,a),s=r?X("radio",to(()=>o.mergedSize.value[0]),t,e):void 0;return Object.assign(o,{rtlEnabled:i,cssVars:r?void 0:t,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender})},render(){const{$slots:e,mergedClsPrefix:o,onRender:n,label:t}=this;return null==n||n(),Ue("label",{class:[`${o}-radio`,this.themeClass,this.rtlEnabled&&`${o}-radio--rtl`,this.mergedDisabled&&`${o}-radio--disabled`,this.renderSafeChecked&&`${o}-radio--checked`,this.focus&&`${o}-radio--focus`],style:this.cssVars},Ue("div",{class:`${o}-radio__dot-wrapper`}," ",Ue("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]}),Ue("input",{ref:"inputRef",type:"radio",class:`${o}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur})),a(e.default,e=>e||t?Ue("div",{ref:"labelRef",class:`${o}-radio__label`},e||t):null))}}),cs=G("radio-group","\n display: inline-block;\n font-size: var(--n-font-size);\n",[we("splitor","\n display: inline-block;\n vertical-align: bottom;\n width: 1px;\n transition:\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n background: var(--n-button-border-color);\n ",[ze("checked",{backgroundColor:"var(--n-button-border-color-active)"}),ze("disabled",{opacity:"var(--n-opacity-disabled)"})]),ze("button-group","\n white-space: nowrap;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[G("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),we("splitor",{height:"var(--n-height)"})]),G("radio-button","\n vertical-align: bottom;\n outline: none;\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n display: inline-block;\n box-sizing: border-box;\n padding-left: 14px;\n padding-right: 14px;\n white-space: nowrap;\n transition:\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n background: var(--n-button-color);\n color: var(--n-button-text-color);\n border-top: 1px solid var(--n-button-border-color);\n border-bottom: 1px solid var(--n-button-border-color);\n ",[G("radio-input","\n pointer-events: none;\n position: absolute;\n border: 0;\n border-radius: inherit;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0;\n z-index: 1;\n "),we("state-border","\n z-index: 1;\n pointer-events: none;\n position: absolute;\n box-shadow: var(--n-button-box-shadow);\n transition: box-shadow .3s var(--n-bezier);\n left: -1px;\n bottom: -1px;\n right: -1px;\n top: -1px;\n "),Z("&:first-child","\n border-top-left-radius: var(--n-button-border-radius);\n border-bottom-left-radius: var(--n-button-border-radius);\n border-left: 1px solid var(--n-button-border-color);\n ",[we("state-border","\n border-top-left-radius: var(--n-button-border-radius);\n border-bottom-left-radius: var(--n-button-border-radius);\n ")]),Z("&:last-child","\n border-top-right-radius: var(--n-button-border-radius);\n border-bottom-right-radius: var(--n-button-border-radius);\n border-right: 1px solid var(--n-button-border-color);\n ",[we("state-border","\n border-top-right-radius: var(--n-button-border-radius);\n border-bottom-right-radius: var(--n-button-border-radius);\n ")]),H("disabled","\n cursor: pointer;\n ",[Z("&:hover",[we("state-border","\n transition: box-shadow .3s var(--n-bezier);\n box-shadow: var(--n-button-box-shadow-hover);\n "),H("checked",{color:"var(--n-button-text-color-hover)"})]),ze("focus",[Z("&:not(:active)",[we("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),ze("checked","\n background: var(--n-button-color-active);\n color: var(--n-button-text-color-active);\n border-color: var(--n-button-border-color-active);\n "),ze("disabled","\n cursor: not-allowed;\n opacity: var(--n-opacity-disabled);\n ")])]);var us=Me({name:"RadioGroup",props:Object.assign(Object.assign({},g.props),{name:String,value:[String,Number,Boolean],defaultValue:{type:[String,Number,Boolean],default:null},size:String,disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),setup(e){const o=Io(null),{mergedSizeRef:n,mergedDisabledRef:t,nTriggerFormChange:r,nTriggerFormInput:a,nTriggerFormBlur:l,nTriggerFormFocus:i}=ae(e),{mergedClsPrefixRef:s,inlineThemeDisabled:d,mergedRtlRef:c}=J(e),u=g("Radio","-radio-group",cs,es,e,s),h=Io(e.defaultValue),f=lo(e,"value"),m=w(f,h);Ee(is,{mergedClsPrefixRef:s,nameRef:lo(e,"name"),valueRef:m,disabledRef:t,mergedSizeRef:n,doUpdateValue:function(o){const{onUpdateValue:n,"onUpdate:value":t}=e;n&&z(n,o),t&&z(t,o),h.value=o,r(),a()}});const v=p("Radio",c,s),b=to(()=>{const{value:e}=n,{common:{cubicBezierEaseInOut:o},self:{buttonBorderColor:t,buttonBorderColorActive:r,buttonBorderRadius:a,buttonBoxShadow:l,buttonBoxShadowFocus:i,buttonBoxShadowHover:s,buttonColor:d,buttonColorActive:c,buttonTextColor:p,buttonTextColorActive:h,buttonTextColorHover:f,opacityDisabled:m,[Te("buttonHeight",e)]:v,[Te("fontSize",e)]:g}}=u.value;return{"--n-font-size":g,"--n-bezier":o,"--n-button-border-color":t,"--n-button-border-color-active":r,"--n-button-border-radius":a,"--n-button-box-shadow":l,"--n-button-box-shadow-focus":i,"--n-button-box-shadow-hover":s,"--n-button-color":d,"--n-button-color-active":c,"--n-button-text-color":p,"--n-button-text-color-hover":f,"--n-button-text-color-active":h,"--n-height":v,"--n-opacity-disabled":m}}),y=d?X("radio-group",to(()=>n.value[0]),b,e):void 0;return{selfElRef:o,rtlEnabled:v,mergedClsPrefix:s,mergedValue:m,handleFocusout:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||l())},handleFocusin:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||i())},cssVars:d?void 0:b,themeClass:null==y?void 0:y.themeClass,onRender:null==y?void 0:y.onRender}},render(){var e;const{mergedValue:o,mergedClsPrefix:n,handleFocusin:t,handleFocusout:r}=this,{children:a,isButtonGroup:l}=function(e,o,n){var t;const r=[];let a=!1;for(let l=0;l<e.length;++l){const i=e[l],s=null===(t=i.type)||void 0===t?void 0:t.name;"RadioButton"===s&&(a=!0);const d=i.props;if("RadioButton"===s)if(0===l)r.push(i);else{const e=r[r.length-1].props,t=o===e.value,a=e.disabled,l=o===d.value,s=d.disabled,c=(t?2:0)+(a?0:1),u=(l?2:0)+(s?0:1),p={[`${n}-radio-group__splitor--disabled`]:a,[`${n}-radio-group__splitor--checked`]:t},h=c<u?{[`${n}-radio-group__splitor--disabled`]:s,[`${n}-radio-group__splitor--checked`]:l}:p;r.push(Ue("div",{class:[`${n}-radio-group__splitor`,h]}),i)}else r.push(i)}return{children:r,isButtonGroup:a}}(Mn(ir(this)),o,n);return null===(e=this.onRender)||void 0===e||e.call(this),Ue("div",{onFocusin:t,onFocusout:r,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,l&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),ps=Me({name:"Tooltip",props:Object.assign(Object.assign({},_n),g.props),slots:Object,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=J(e),n=g("Tooltip","-tooltip",void 0,Ji,e,o),t=Io(null);return Object.assign(Object.assign({},{syncPosition(){t.value.syncPosition()},setShow(e){t.value.setShow(e)}}),{popoverRef:t,mergedTheme:n,popoverThemeOverrides:to(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:o}=this;return Ue(Zn,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:o.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),hs=O("n-dropdown-menu"),fs=O("n-dropdown"),ms=O("n-dropdown-option"),vs=Me({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return Ue("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),gs=Me({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=We(hs),{renderLabelRef:n,labelFieldRef:t,nodePropsRef:r,renderOptionRef:a}=We(fs);return{labelField:t,showIcon:e,hasSubmenu:o,renderLabel:n,nodeProps:r,renderOption:a}},render(){var e;const{clsPrefix:o,hasSubmenu:n,showIcon:t,nodeProps:r,renderLabel:a,renderOption:l}=this,{rawNode:i}=this.tmNode,s=Ue("div",Object.assign({class:`${o}-dropdown-option`},null==r?void 0:r(i)),Ue("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},Ue("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,t&&`${o}-dropdown-option-body__prefix--show-icon`]},ot(i.icon)),Ue("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(i):ot(null!==(e=i.title)&&void 0!==e?e:i[this.labelField])),Ue("div",{class:[`${o}-dropdown-option-body__suffix`,n&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return l?l({node:s,option:i}):s}}),bs={name:"Icon",common:Sa,self:se};function ys(e,o){return"submenu"===e.type||void 0===e.type&&void 0!==e[o]}function xs(e){return"divider"===e.type}var Cs=Me({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(o){const n=We(fs),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:a,pendingKeyPathRef:l,activeKeyPathRef:i,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:p,childrenFieldRef:h,renderOptionRef:f,nodePropsRef:m,menuPropsRef:v}=n,g=We(ms,null),b=We(hs),y=We(R),x=to(()=>o.tmNode.rawNode),C=to(()=>{const{value:e}=h;return ys(o.tmNode.rawNode,e)}),w=to(()=>{const{disabled:e}=o.tmNode;return e}),S=function(e,o,n){if(!o)return e;const t=Io(e.value);let r=null;return Xe(e,e=>{null!==r&&window.clearTimeout(r),!0===e?n&&!n.value?t.value=!0:r=window.setTimeout(()=>{t.value=!0},o):t.value=!1}),t}(to(()=>{if(!C.value)return!1;const{key:e,disabled:n}=o.tmNode;if(n)return!1;const{value:i}=t,{value:s}=r,{value:d}=a,{value:c}=l;return null!==i?c.includes(e):null!==s?c.includes(e)&&c[c.length-1]!==e:null!==d&&c.includes(e)}),300,to(()=>null===r.value&&!s.value)),k=to(()=>!!(null==g?void 0:g.enteringSubmenuRef.value)),P=Io(!1);function T(){const{parentKey:e,tmNode:n}=o;n.disabled||d.value&&(a.value=e,r.value=null,t.value=n.key)}return Ee(ms,{enteringSubmenuRef:P}),{labelField:p,renderLabel:c,renderIcon:u,siblingHasIcon:b.showIconRef,siblingHasSubmenu:b.hasSubmenuRef,menuProps:v,popoverBody:y,animated:s,mergedShowSubmenu:to(()=>S.value&&!k.value),rawNode:x,hasSubmenu:C,pending:e(()=>{const{value:e}=l,{key:n}=o.tmNode;return e.includes(n)}),childActive:e(()=>{const{value:e}=i,{key:n}=o.tmNode,t=e.findIndex(e=>n===e);return-1!==t&&t<e.length-1}),active:e(()=>{const{value:e}=i,{key:n}=o.tmNode,t=e.findIndex(e=>n===e);return-1!==t&&t===e.length-1}),mergedDisabled:w,renderOption:f,nodeProps:m,handleClick:function(){const{value:e}=C,{tmNode:t}=o;d.value&&(e||t.disabled||(n.doSelect(t.key,t.rawNode),n.doUpdateShow(!1)))},handleMouseMove:function(){const{tmNode:e}=o;e.disabled||d.value&&t.value!==e.key&&T()},handleMouseEnter:T,handleMouseLeave:function(e){if(o.tmNode.disabled)return;if(!d.value)return;const{relatedTarget:n}=e;!n||Wt({target:n},"dropdownOption")||Wt({target:n},"scrollbarRail")||(t.value=null)},handleSubmenuBeforeEnter:function(){P.value=!0},handleSubmenuAfterEnter:function(){P.value=!1}}},render(){var e,o;const{animated:n,rawNode:t,mergedShowSubmenu:r,clsPrefix:a,siblingHasIcon:l,siblingHasSubmenu:i,renderLabel:s,renderIcon:d,renderOption:c,nodeProps:u,props:p,scrollable:h}=this;let f=null;if(r){const o=null===(e=this.menuProps)||void 0===e?void 0:e.call(this,t,t.children);f=Ue(ks,Object.assign({},o,{clsPrefix:a,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${a}-dropdown-option-body`,this.pending&&`${a}-dropdown-option-body--pending`,this.active&&`${a}-dropdown-option-body--active`,this.childActive&&`${a}-dropdown-option-body--child-active`,this.mergedDisabled&&`${a}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},v=null==u?void 0:u(t),g=Ue("div",Object.assign({class:[`${a}-dropdown-option`,null==v?void 0:v.class],"data-dropdown-option":!0},v),Ue("div",Be(m,p),[Ue("div",{class:[`${a}-dropdown-option-body__prefix`,l&&`${a}-dropdown-option-body__prefix--show-icon`]},[d?d(t):ot(t.icon)]),Ue("div",{"data-dropdown-option":!0,class:`${a}-dropdown-option-body__label`},s?s(t):ot(null!==(o=t[this.labelField])&&void 0!==o?o:t.title)),Ue("div",{"data-dropdown-option":!0,class:[`${a}-dropdown-option-body__suffix`,i&&`${a}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?Ue(Q,null,{default:()=>Ue(hr,null)}):null)]),this.hasSubmenu?Ue(Tn,null,{default:()=>[Ue(In,null,{default:()=>Ue("div",{class:`${a}-dropdown-offset-container`},Ue(Pn,{show:this.mergedShowSubmenu,placement:this.placement,to:h&&this.popoverBody||void 0,teleportDisabled:!h},{default:()=>Ue("div",{class:`${a}-dropdown-menu-wrapper`},n?Ue(go,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>f}):f)}))})]}):null);return c?c({node:g,option:t}):g}}),ws=Me({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:n}=this,{children:t}=e;return Ue(co,null,Ue(gs,{clsPrefix:n,tmNode:e,key:e.key}),null==t?void 0:t.map(e=>{const{rawNode:t}=e;return!1===t.show?null:xs(t)?Ue(vs,{clsPrefix:n,key:e.key}):e.isGroup?(y("dropdown","`group` node is not allowed to be put in `group` node."),null):Ue(Cs,{clsPrefix:n,tmNode:e,parentKey:o,key:e.key})}))}}),Ss=Me({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return Ue("div",o,[null==e?void 0:e()])}}),ks=Me({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){const{renderIconRef:o,childrenFieldRef:n}=We(fs);Ee(hs,{showIconRef:to(()=>{const n=o.value;return e.tmNodes.some(e=>{var o;if(e.isGroup)return null===(o=e.children)||void 0===o?void 0:o.some(({rawNode:e})=>n?n(e):e.icon);const{rawNode:t}=e;return n?n(t):t.icon})}),hasSubmenuRef:to(()=>{const{value:o}=n;return e.tmNodes.some(e=>{var n;if(e.isGroup)return null===(n=e.children)||void 0===n?void 0:n.some(({rawNode:e})=>ys(e,o));const{rawNode:t}=e;return ys(t,o)})})});const t=Io(null);return Ee(M,null),Ee(pe,null),Ee(R,t),{bodyRef:t}},render(){const{parentKey:e,clsPrefix:o,scrollable:n}=this,t=this.tmNodes.map(t=>{const{rawNode:r}=t;return!1===r.show?null:function(e){return"render"===e.type}(r)?Ue(Ss,{tmNode:t,key:t.key}):xs(r)?Ue(vs,{clsPrefix:o,key:t.key}):function(e){return"group"===e.type}(r)?Ue(ws,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key}):Ue(Cs,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key,props:r.props,scrollable:n})});return Ue("div",{class:[`${o}-dropdown-menu`,n&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},n?Ue(L,{contentClass:`${o}-dropdown-menu__content`},{default:()=>t}):t,this.showArrow?Dn({clsPrefix:o,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Ps=G("dropdown-menu","\n transform-origin: var(--v-transform-origin);\n background-color: var(--n-color);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n position: relative;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n",[Hn(),G("dropdown-option","\n position: relative;\n ",[Z("a","\n text-decoration: none;\n color: inherit;\n outline: none;\n ",[Z("&::before",'\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n ')]),G("dropdown-option-body","\n display: flex;\n cursor: pointer;\n position: relative;\n height: var(--n-option-height);\n line-height: var(--n-option-height);\n font-size: var(--n-font-size);\n color: var(--n-option-text-color);\n transition: color .3s var(--n-bezier);\n ",[Z("&::before",'\n content: "";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 4px;\n right: 4px;\n transition: background-color .3s var(--n-bezier);\n border-radius: var(--n-border-radius);\n '),H("disabled",[ze("pending","\n color: var(--n-option-text-color-hover);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-hover);\n "),Z("&::before","background-color: var(--n-option-color-hover);")]),ze("active","\n color: var(--n-option-text-color-active);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-active);\n "),Z("&::before","background-color: var(--n-option-color-active);")]),ze("child-active","\n color: var(--n-option-text-color-child-active);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-child-active);\n ")])]),ze("disabled","\n cursor: not-allowed;\n opacity: var(--n-option-opacity-disabled);\n "),ze("group","\n font-size: calc(var(--n-font-size) - 1px);\n color: var(--n-group-header-text-color);\n ",[we("prefix","\n width: calc(var(--n-option-prefix-width) / 2);\n ",[ze("show-icon","\n width: calc(var(--n-option-icon-prefix-width) / 2);\n ")])]),we("prefix","\n width: var(--n-option-prefix-width);\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--n-prefix-color);\n transition: color .3s var(--n-bezier);\n z-index: 1;\n ",[ze("show-icon","\n width: var(--n-option-icon-prefix-width);\n "),G("icon","\n font-size: var(--n-option-icon-size);\n ")]),we("label","\n white-space: nowrap;\n flex: 1;\n z-index: 1;\n "),we("suffix","\n box-sizing: border-box;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n min-width: var(--n-option-suffix-width);\n padding: 0 8px;\n transition: color .3s var(--n-bezier);\n color: var(--n-suffix-color);\n z-index: 1;\n ",[ze("has-submenu","\n width: var(--n-option-icon-suffix-width);\n "),G("icon","\n font-size: var(--n-option-icon-size);\n ")]),G("dropdown-menu","pointer-events: all;")]),G("dropdown-offset-container","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: -4px;\n bottom: -4px;\n ")]),G("dropdown-divider","\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-divider-color);\n height: 1px;\n margin: 4px 0;\n "),G("dropdown-menu-wrapper","\n transform-origin: var(--v-transform-origin);\n width: fit-content;\n "),Z(">",[G("scrollbar","\n height: inherit;\n max-height: inherit;\n ")]),H("scrollable","\n padding: var(--n-padding);\n "),ze("scrollable",[we("content","\n padding: var(--n-padding);\n ")])]),Ts={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},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]},Is=Object.keys(_n),As=Me({name:"Dropdown",inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},_n),Ts),g.props),setup(o){const n=Io(!1),t=w(lo(o,"show"),n),r=to(()=>{const{keyField:e,childrenField:n}=o;return qa(o.options,{getKey:o=>o[e],getDisabled:e=>!0===e.disabled,getIgnored:e=>"divider"===e.type||"render"===e.type,getChildren:e=>e[n]})}),a=to(()=>r.value.treeNodes),l=Io(null),i=Io(null),s=Io(null),d=to(()=>{var e,o,n;return null!==(n=null!==(o=null!==(e=l.value)&&void 0!==e?e:i.value)&&void 0!==o?o:s.value)&&void 0!==n?n:null}),c=to(()=>r.value.getPath(d.value).keyPath),u=to(()=>r.value.getPath(o.value).keyPath);Nt({keydown:{ArrowUp:{prevent:!0,handler:function(){x("up")}},ArrowRight:{prevent:!0,handler:function(){x("right")}},ArrowDown:{prevent:!0,handler:function(){x("down")}},ArrowLeft:{prevent:!0,handler:function(){x("left")}},Enter:{prevent:!0,handler:function(){const e=y();(null==e?void 0:e.isLeaf)&&t.value&&(m(e.key,e.rawNode),v(!1))}},Escape:function(){v(!1)}}},e(()=>o.keyboard&&t.value));const{mergedClsPrefixRef:p,inlineThemeDisabled:h}=J(o),f=g("Dropdown","-dropdown",Ps,Ki,o,p);function m(e,n){const{onSelect:t}=o;t&&z(t,e,n)}function v(e){const{"onUpdate:show":t,onUpdateShow:r}=o;t&&z(t,e),r&&z(r,e),n.value=e}function b(){l.value=null,i.value=null,s.value=null}function y(){var e;const{value:o}=r,{value:n}=d;return o&&null!==n&&null!==(e=o.getNode(n))&&void 0!==e?e:null}function x(e){const{value:o}=d,{value:{getFirstAvailableNode:n}}=r;let t=null;if(null===o){const e=n();null!==e&&(t=e.key)}else{const o=y();if(o){let n;switch(e){case"down":n=o.getNext();break;case"up":n=o.getPrev();break;case"right":n=o.getChild();break;case"left":n=o.getParent()}n&&(t=n.key)}}null!==t&&(l.value=null,i.value=t)}Ee(fs,{labelFieldRef:lo(o,"labelField"),childrenFieldRef:lo(o,"childrenField"),renderLabelRef:lo(o,"renderLabel"),renderIconRef:lo(o,"renderIcon"),hoverKeyRef:l,keyboardKeyRef:i,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:lo(o,"animated"),mergedShowRef:t,nodePropsRef:lo(o,"nodeProps"),renderOptionRef:lo(o,"renderOption"),menuPropsRef:lo(o,"menuProps"),doSelect:m,doUpdateShow:v}),Xe(t,e=>{o.animated||e||b()});const C=to(()=>{const{size:e,inverted:n}=o,{common:{cubicBezierEaseInOut:t},self:r}=f.value,{padding:a,dividerColor:l,borderRadius:i,optionOpacityDisabled:s,[Te("optionIconSuffixWidth",e)]:d,[Te("optionSuffixWidth",e)]:c,[Te("optionIconPrefixWidth",e)]:u,[Te("optionPrefixWidth",e)]:p,[Te("fontSize",e)]:h,[Te("optionHeight",e)]:m,[Te("optionIconSize",e)]:v}=r,g={"--n-bezier":t,"--n-font-size":h,"--n-padding":a,"--n-border-radius":i,"--n-option-height":m,"--n-option-prefix-width":p,"--n-option-icon-prefix-width":u,"--n-option-suffix-width":c,"--n-option-icon-suffix-width":d,"--n-option-icon-size":v,"--n-divider-color":l,"--n-option-opacity-disabled":s};return n?(g["--n-color"]=r.colorInverted,g["--n-option-color-hover"]=r.optionColorHoverInverted,g["--n-option-color-active"]=r.optionColorActiveInverted,g["--n-option-text-color"]=r.optionTextColorInverted,g["--n-option-text-color-hover"]=r.optionTextColorHoverInverted,g["--n-option-text-color-active"]=r.optionTextColorActiveInverted,g["--n-option-text-color-child-active"]=r.optionTextColorChildActiveInverted,g["--n-prefix-color"]=r.prefixColorInverted,g["--n-suffix-color"]=r.suffixColorInverted,g["--n-group-header-text-color"]=r.groupHeaderTextColorInverted):(g["--n-color"]=r.color,g["--n-option-color-hover"]=r.optionColorHover,g["--n-option-color-active"]=r.optionColorActive,g["--n-option-text-color"]=r.optionTextColor,g["--n-option-text-color-hover"]=r.optionTextColorHover,g["--n-option-text-color-active"]=r.optionTextColorActive,g["--n-option-text-color-child-active"]=r.optionTextColorChildActive,g["--n-prefix-color"]=r.prefixColor,g["--n-suffix-color"]=r.suffixColor,g["--n-group-header-text-color"]=r.groupHeaderTextColor),g}),S=h?X("dropdown",to(()=>`${o.size[0]}${o.inverted?"i":""}`),C,o):void 0;return{mergedClsPrefix:p,mergedTheme:f,tmNodes:a,mergedShow:t,handleAfterLeave:()=>{o.animated&&b()},doUpdateShow:v,cssVars:h?void 0:C,themeClass:null==S?void 0:S.themeClass,onRender:null==S?void 0:S.onRender}},render(){const{mergedTheme:e}=this,o={show:this.mergedShow,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:(e,o,n,t,r)=>{var a;const{mergedClsPrefix:l,menuProps:i}=this;null===(a=this.onRender)||void 0===a||a.call(this);const s=(null==i?void 0:i(void 0,this.tmNodes.map(e=>e.rawNode)))||{},d={ref:lr(o),class:[e,`${l}-dropdown`,this.themeClass],clsPrefix:l,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:t,onMouseleave:r};return Ue(ks,Be(this.$attrs,d,s))},onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return Ue(Zn,Object.assign({},Bn(this.$props,Is),o),{trigger:()=>{var e,o;return null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)}})}}),zs={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function Rs(e){const{popoverColor:o,textColor2:n,primaryColor:t,hoverColor:r,dividerColor:a,opacityDisabled:l,boxShadow2:i,borderRadius:s,iconColor:d,iconColorDisabled:c}=e;return Object.assign(Object.assign({},zs),{panelColor:o,panelBoxShadow:i,panelDividerColor:a,itemTextColor:n,itemTextColorActive:t,itemColorHover:r,itemOpacityDisabled:l,itemBorderRadius:s,borderRadius:s,iconColor:d,iconColorDisabled:c})}var Ms=m({name:"TimePicker",common:t,peers:{Scrollbar:Pe,Button:te,Input:Vn},self:Rs}),Fs={name:"TimePicker",common:Sa,peers:{Scrollbar:ka,Button:ai,Input:Tl},self:Rs},Os={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function $s(e){const{hoverColor:o,fontSize:n,textColor2:t,textColorDisabled:r,popoverColor:a,primaryColor:l,borderRadiusSmall:i,iconColor:s,iconColorDisabled:d,textColor1:c,dividerColor:u,boxShadow2:p,borderRadius:h,fontWeightStrong:f}=e;return Object.assign(Object.assign({},Os),{itemFontSize:n,calendarDaysFontSize:n,calendarTitleFontSize:n,itemTextColor:t,itemTextColorDisabled:r,itemTextColorActive:a,itemTextColorCurrent:l,itemColorIncluded:D(l,{alpha:.1}),itemColorHover:o,itemColorDisabled:o,itemColorActive:l,itemBorderRadius:i,panelColor:a,panelTextColor:t,arrowColor:s,calendarTitleTextColor:c,calendarTitleColorHover:o,calendarDaysTextColor:t,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:h,calendarTitleFontWeight:f,scrollItemBorderRadius:h,iconColor:s,iconColorDisabled:d})}var Bs=m({name:"DatePicker",common:t,peers:{Input:Vn,Button:te,TimePicker:Ms,Scrollbar:Pe},self:$s}),Es={name:"DatePicker",common:Sa,peers:{Input:Tl,Button:ai,TimePicker:Fs,Scrollbar:ka},self(e){const{popoverColor:o,hoverColor:n,primaryColor:t}=e,r=$s(e);return r.itemColorDisabled=de(o,n),r.itemColorIncluded=D(t,{alpha:.15}),r.itemColorHover=de(o,n),r}},_s={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function Ds(e){const{tableHeaderColor:o,textColor2:n,textColor1:t,cardColor:r,modalColor:a,popoverColor:l,dividerColor:i,borderRadius:s,fontWeightStrong:d,lineHeight:c,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:h}=e;return Object.assign(Object.assign({},_s),{lineHeight:c,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:h,titleTextColor:t,thColor:de(r,o),thColorModal:de(a,o),thColorPopover:de(l,o),thTextColor:t,thFontWeight:d,tdTextColor:n,tdColor:r,tdColorModal:a,tdColorPopover:l,borderColor:de(r,i),borderColorModal:de(a,i),borderColorPopover:de(l,i),borderRadius:s})}var Ls={name:"Descriptions",common:t,self:Ds},Hs={name:"Descriptions",common:Sa,self:Ds},js={name:"Dialog",common:Sa,peers:{Button:ai},self:Et},Us={name:"Modal",common:Sa,peers:{Scrollbar:ka,Dialog:js,Card:ci},self:xt},Ws=Object.assign(Object.assign({},_t),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},zIndex:Number,onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function,draggable:[Boolean,Object]}),Ns=Me({name:"DialogEnvironment",props:Object.assign(Object.assign({},Ws),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=Io(!0);function n(){o.value=!1}return{show:o,hide:n,handleUpdateShow:function(e){o.value=e},handleAfterLeave:function(){const{onInternalAfterLeave:o,internalKey:n,onAfterLeave:t}=e;o&&o(n),t&&t()},handleCloseClick:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleNegativeClick:function(o){const{onNegativeClick:t}=e;t?Promise.resolve(t(o)).then(e=>{!1!==e&&n()}):n()},handlePositiveClick:function(o){const{onPositiveClick:t}=e;t?Promise.resolve(t(o)).then(e=>{!1!==e&&n()}):n()},handleMaskClick:function(o){const{onMaskClick:t,maskClosable:r}=e;t&&(t(o),r&&n())},handleEsc:function(){const{onEsc:o}=e;o&&o()}}},render(){const{handlePositiveClick:e,handleUpdateShow:o,handleNegativeClick:n,handleCloseClick:t,handleAfterLeave:r,handleMaskClick:a,handleEsc:l,to:i,zIndex:s,maskClosable:d,show:c}=this;return Ue(Pt,{show:c,onUpdateShow:o,onMaskClick:a,onEsc:l,to:i,zIndex:s,maskClosable:d,onAfterEnter:this.onAfterEnter,onAfterLeave:r,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,draggable:this.draggable,internalAppear:!0,internalDialog:!0},{default:({draggableClass:o})=>Ue(ft,Object.assign({},Bn(this.$props,$t),{titleClass:ho([this.titleClass,o]),style:this.internalStyle,onClose:t,onNegativeClick:n,onPositiveClick:e}))})}}),Ks=Me({name:"DialogProvider",props:{injectionKey:String,to:[String,Object]},setup(){const e=Io([]),o={};function n(n={}){const t=fe(),r=no(Object.assign(Object.assign({},n),{key:t,destroy:()=>{var e;null===(e=o[`n-dialog-${t}`])||void 0===e||e.hide()}}));return e.value.push(r),r}const t=["info","success","warning","error"].map(e=>o=>n(Object.assign(Object.assign({},o),{type:e})));const r={create:n,destroyAll:function(){Object.values(o).forEach(e=>{null==e||e.hide()})},info:t[0],success:t[1],warning:t[2],error:t[3]};return Ee(tt,r),Ee(Bt,{clickedRef:it(64),clickedPositionRef:st()}),Ee(ht,e),Object.assign(Object.assign({},r),{dialogList:e,dialogInstRefs:o,handleAfterLeave:function(o){const{value:n}=e;n.splice(n.findIndex(e=>e.key===o),1)}})},render(){var e,o;return Ue(co,null,[this.dialogList.map(e=>Ue(Ns,dr(e,["destroy","style"],{internalStyle:e.style,to:this.to,ref:o=>{null===o?delete this.dialogInstRefs[`n-dialog-${e.key}`]:this.dialogInstRefs[`n-dialog-${e.key}`]=o},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave}))),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)])}}),Vs=O("n-loading-bar"),qs=O("n-loading-bar-api"),Gs={name:"LoadingBar",common:Sa,self(e){const{primaryColor:o}=e;return{colorError:"red",colorLoading:o,height:"2px"}}};var Js={name:"LoadingBar",common:t,self:function(e){const{primaryColor:o,errorColor:n}=e;return{colorError:n,colorLoading:o,height:"2px"}}},Ys=G("loading-bar-container","\n z-index: 5999;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n",[ke({enterDuration:"0.3s",leaveDuration:"0.8s"}),G("loading-bar","\n width: 100%;\n transition:\n max-width 4s linear,\n background .2s linear;\n height: var(--n-height);\n ",[ze("starting","\n background: var(--n-color-loading);\n "),ze("finishing","\n background: var(--n-color-loading);\n transition:\n max-width .2s linear,\n background .2s linear;\n "),ze("error","\n background: var(--n-color-error);\n transition:\n max-width .2s linear,\n background .2s linear;\n ")])]),Zs=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})};function Xs(e,o){return`${o}-loading-bar ${o}-loading-bar--${e}`}var Qs=Me({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:e}=J(),{props:o,mergedClsPrefixRef:n}=We(Vs),t=Io(null),r=Io(!1),a=Io(!1),l=Io(!1),i=Io(!1);let s=!1;const d=Io(!1),c=to(()=>{const{loadingBarStyle:e}=o;return e?e[d.value?"error":"loading"]:""});function u(){return Zs(this,void 0,void 0,function*(){r.value=!1,l.value=!1,s=!1,d.value=!1,i.value=!0,yield De(),i.value=!1})}function p(){return Zs(this,arguments,void 0,function*(e=0,o=80,r="starting"){if(a.value=!0,yield u(),s)return;l.value=!0,yield De();const i=t.value;i&&(i.style.maxWidth=`${e}%`,i.style.transition="none",i.offsetWidth,i.className=Xs(r,n.value),i.style.transition="",i.style.maxWidth=`${o}%`)})}const h=g("LoadingBar","-loading-bar",Ys,Js,o,n),f=to(()=>{const{self:{height:e,colorError:o,colorLoading:n}}=h.value;return{"--n-height":e,"--n-color-loading":n,"--n-color-error":o}}),m=e?X("loading-bar",void 0,f,o):void 0;return{mergedClsPrefix:n,loadingBarRef:t,started:a,loading:l,entering:r,transitionDisabled:i,start:p,error:function(){if(!s&&!d.value)if(l.value){d.value=!0;const e=t.value;if(!e)return;e.className=Xs("error",n.value),e.style.maxWidth="100%",e.offsetWidth,l.value=!1}else p(100,100,"error").then(()=>{d.value=!0;const e=t.value;e&&(e.className=Xs("error",n.value),e.offsetWidth,l.value=!1)})},finish:function(){return Zs(this,void 0,void 0,function*(){if(s||d.value)return;a.value&&(yield De()),s=!0;const e=t.value;e&&(e.className=Xs("finishing",n.value),e.style.maxWidth="100%",e.offsetWidth,l.value=!1)})},handleEnter:function(){r.value=!0},handleAfterEnter:function(){r.value=!1},handleAfterLeave:function(){return Zs(this,void 0,void 0,function*(){yield u()})},mergedLoadingBarStyle:c,cssVars:e?void 0:f,themeClass:null==m?void 0:m.themeClass,onRender:null==m?void 0:m.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:e}=this;return Ue(go,{name:"fade-in-transition",appear:!0,onEnter:this.handleEnter,onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave,css:!this.transitionDisabled},{default:()=>{var o;return null===(o=this.onRender)||void 0===o||o.call(this),zo(Ue("div",{class:[`${e}-loading-bar-container`,this.themeClass,this.containerClass],style:this.containerStyle},Ue("div",{ref:"loadingBarRef",class:[`${e}-loading-bar`],style:[this.cssVars,this.mergedLoadingBarStyle]})),[[so,this.loading||!this.loading&&this.entering]])}})}}),ed=Me({name:"LoadingBarProvider",props:Object.assign(Object.assign({},g.props),{to:{type:[String,Object,Boolean],default:void 0},containerClass:String,containerStyle:[String,Object],loadingBarStyle:{type:Object}}),setup(e){const o=$(),n=Io(null),t={start(){var e;o.value?null===(e=n.value)||void 0===e||e.start():De(()=>{var e;null===(e=n.value)||void 0===e||e.start()})},error(){var e;o.value?null===(e=n.value)||void 0===e||e.error():De(()=>{var e;null===(e=n.value)||void 0===e||e.error()})},finish(){var e;o.value?null===(e=n.value)||void 0===e||e.finish():De(()=>{var e;null===(e=n.value)||void 0===e||e.finish()})}},{mergedClsPrefixRef:r}=J(e);return Ee(qs,t),Ee(Vs,{props:e,mergedClsPrefixRef:r}),Object.assign(t,{loadingBarRef:n})},render(){var e,o;return Ue(co,null,Ue(Qe,{disabled:!1===this.to,to:this.to||"body"},Ue(Qs,{ref:"loadingBarRef",containerStyle:this.containerStyle,containerClass:this.containerClass})),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}});var od={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function nd(e){const{textColor2:o,closeIconColor:n,closeIconColorHover:t,closeIconColorPressed:r,infoColor:a,successColor:l,errorColor:i,warningColor:s,popoverColor:d,boxShadow2:c,primaryColor:u,lineHeight:p,borderRadius:h,closeColorHover:f,closeColorPressed:m}=e;return Object.assign(Object.assign({},od),{closeBorderRadius:h,textColor:o,textColorInfo:o,textColorSuccess:o,textColorError:o,textColorWarning:o,textColorLoading:o,color:d,colorInfo:d,colorSuccess:d,colorError:d,colorWarning:d,colorLoading:d,boxShadow:c,boxShadowInfo:c,boxShadowSuccess:c,boxShadowError:c,boxShadowWarning:c,boxShadowLoading:c,iconColor:o,iconColorInfo:a,iconColorSuccess:l,iconColorWarning:s,iconColorError:i,iconColorLoading:u,closeColorHover:f,closeColorPressed:m,closeIconColor:n,closeIconColorHover:t,closeIconColorPressed:r,closeColorHoverInfo:f,closeColorPressedInfo:m,closeIconColorInfo:n,closeIconColorHoverInfo:t,closeIconColorPressedInfo:r,closeColorHoverSuccess:f,closeColorPressedSuccess:m,closeIconColorSuccess:n,closeIconColorHoverSuccess:t,closeIconColorPressedSuccess:r,closeColorHoverError:f,closeColorPressedError:m,closeIconColorError:n,closeIconColorHoverError:t,closeIconColorPressedError:r,closeColorHoverWarning:f,closeColorPressedWarning:m,closeIconColorWarning:n,closeIconColorHoverWarning:t,closeIconColorPressedWarning:r,closeColorHoverLoading:f,closeColorPressedLoading:m,closeIconColorLoading:n,closeIconColorHoverLoading:t,closeIconColorPressedLoading:r,loadingColor:u,lineHeight:p,borderRadius:h,border:"0"})}var td={name:"Message",common:t,self:nd},rd={name:"Message",common:Sa,self:nd},ad={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},ld=Z([G("message-wrapper","\n margin: var(--n-margin);\n z-index: 0;\n transform-origin: top center;\n display: flex;\n ",[yl({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),G("message","\n box-sizing: border-box;\n display: flex;\n align-items: center;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier),\n margin-bottom .3s var(--n-bezier);\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n border: var(--n-border);\n flex-wrap: nowrap;\n overflow: hidden;\n max-width: var(--n-max-width);\n color: var(--n-text-color);\n background-color: var(--n-color);\n box-shadow: var(--n-box-shadow);\n ",[we("content","\n display: inline-block;\n line-height: var(--n-line-height);\n font-size: var(--n-font-size);\n "),we("icon","\n position: relative;\n margin: var(--n-icon-margin);\n height: var(--n-icon-size);\n width: var(--n-icon-size);\n font-size: var(--n-icon-size);\n flex-shrink: 0;\n ",[["default","info","success","warning","error","loading"].map(e=>ze(`${e}-type`,[Z("> *",`\n color: var(--n-icon-color-${e});\n transition: color .3s var(--n-bezier);\n `)])),Z("> *","\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n ",[b()])]),we("close","\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n flex-shrink: 0;\n ",[Z("&:hover","\n color: var(--n-close-icon-color-hover);\n "),Z("&:active","\n color: var(--n-close-icon-color-pressed);\n ")])]),G("message-container","\n z-index: 6000;\n position: fixed;\n height: 0;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: center;\n ",[ze("top","\n top: 12px;\n left: 0;\n right: 0;\n "),ze("top-left","\n top: 12px;\n left: 12px;\n right: 0;\n align-items: flex-start;\n "),ze("top-right","\n top: 12px;\n left: 0;\n right: 12px;\n align-items: flex-end;\n "),ze("bottom","\n bottom: 4px;\n left: 0;\n right: 0;\n justify-content: flex-end;\n "),ze("bottom-left","\n bottom: 4px;\n left: 12px;\n right: 0;\n justify-content: flex-end;\n align-items: flex-start;\n "),ze("bottom-right","\n bottom: 4px;\n left: 0;\n right: 12px;\n justify-content: flex-end;\n align-items: flex-end;\n ")])]),id={info:()=>Ue(ct,null),success:()=>Ue(dt,null),warning:()=>Ue(St,null),error:()=>Ue(ut,null),default:()=>null},sd=Me({name:"Message",props:Object.assign(Object.assign({},ad),{render:Function}),setup(e){const{inlineThemeDisabled:o,mergedRtlRef:n}=J(e),{props:t,mergedClsPrefixRef:r}=We(Gn),a=p("Message",n,r),l=g("Message","-message",ld,td,t,r),i=to(()=>{const{type:o}=e,{common:{cubicBezierEaseInOut:n},self:{padding:t,margin:r,maxWidth:a,iconMargin:i,closeMargin:s,closeSize:d,iconSize:c,fontSize:u,lineHeight:p,borderRadius:h,border:f,iconColorInfo:m,iconColorSuccess:v,iconColorWarning:g,iconColorError:b,iconColorLoading:y,closeIconSize:x,closeBorderRadius:C,[Te("textColor",o)]:w,[Te("boxShadow",o)]:S,[Te("color",o)]:k,[Te("closeColorHover",o)]:P,[Te("closeColorPressed",o)]:T,[Te("closeIconColor",o)]:I,[Te("closeIconColorPressed",o)]:A,[Te("closeIconColorHover",o)]:z}}=l.value;return{"--n-bezier":n,"--n-margin":r,"--n-padding":t,"--n-max-width":a,"--n-font-size":u,"--n-icon-margin":i,"--n-icon-size":c,"--n-close-icon-size":x,"--n-close-border-radius":C,"--n-close-size":d,"--n-close-margin":s,"--n-text-color":w,"--n-color":k,"--n-box-shadow":S,"--n-icon-color-info":m,"--n-icon-color-success":v,"--n-icon-color-warning":g,"--n-icon-color-error":b,"--n-icon-color-loading":y,"--n-close-color-hover":P,"--n-close-color-pressed":T,"--n-close-icon-color":I,"--n-close-icon-color-pressed":A,"--n-close-icon-color-hover":z,"--n-line-height":p,"--n-border-radius":h,"--n-border":f}}),s=o?X("message",to(()=>e.type[0]),i,{}):void 0;return{mergedClsPrefix:r,rtlEnabled:a,messageProviderProps:t,handleClose(){var o;null===(o=e.onClose)||void 0===o||o.call(e)},cssVars:o?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender,placement:t.placement}},render(){const{render:e,type:n,closable:t,content:r,mergedClsPrefix:a,cssVars:i,themeClass:s,onRender:d,icon:c,handleClose:u,showIcon:p}=this;let h;return null==d||d(),Ue("div",{class:[`${a}-message-wrapper`,s],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):Ue("div",{class:[`${a}-message ${a}-message--${n}-type`,this.rtlEnabled&&`${a}-message--rtl`]},(h=function(e,o,n){if("function"==typeof e)return e();{const e="loading"===o?Ue(I,{clsPrefix:n,strokeWidth:24,scale:.85}):id[o]();return e?Ue(ee,{clsPrefix:n,key:o},{default:()=>e}):null}}(c,n,a))&&p?Ue("div",{class:`${a}-message__icon ${a}-message__icon--${n}-type`},Ue(o,null,{default:()=>h})):null,Ue("div",{class:`${a}-message__content`},ot(r)),t?Ue(l,{clsPrefix:a,class:`${a}-message__close`,onClick:u,absolute:!0}):null))}});var dd=Me({name:"MessageEnvironment",props:Object.assign(Object.assign({},ad),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let o=null;const n=Io(!0);function t(){const{duration:n}=e;n&&(o=window.setTimeout(r,n))}function r(){const{onHide:t}=e;n.value=!1,o&&(window.clearTimeout(o),o=null),t&&t()}return Je(()=>{t()}),{show:n,hide:r,handleClose:function(){const{onClose:o}=e;o&&o(),r()},handleAfterLeave:function(){const{onAfterLeave:o,onInternalAfterLeave:n,onAfterHide:t,internalKey:r}=e;o&&o(),n&&n(r),t&&t()},handleMouseleave:function(e){e.currentTarget===e.target&&t()},handleMouseenter:function(e){e.currentTarget===e.target&&null!==o&&(window.clearTimeout(o),o=null)},deactivate:function(){r()}}},render(){return Ue(s,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?Ue(sd,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),cd=Me({name:"MessageProvider",props:Object.assign(Object.assign({},g.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),setup(e){const{mergedClsPrefixRef:o}=J(e),n=Io([]),t=Io({}),r={create:(e,o)=>a(e,Object.assign({type:"default"},o)),info:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"info"})),success:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"success"})),warning:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"warning"})),error:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"error"})),loading:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"loading"})),destroyAll:function(){Object.values(t.value).forEach(e=>{e.hide()})}};function a(o,r){const a=fe(),l=no(Object.assign(Object.assign({},r),{content:o,key:a,destroy:()=>{var e;null===(e=t.value[a])||void 0===e||e.hide()}})),{max:i}=e;return i&&n.value.length>=i&&n.value.shift(),n.value.push(l),l}return Ee(Gn,{props:e,mergedClsPrefixRef:o}),Ee(Kn,r),Object.assign({mergedClsPrefix:o,messageRefs:t,messageList:n,handleAfterLeave:function(e){n.value.splice(n.value.findIndex(o=>o.key===e),1),delete t.value[e]}},r)},render(){var e,o,n;return Ue(co,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.messageList.length?Ue(Qe,{to:null!==(n=this.to)&&void 0!==n?n:"body"},Ue("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(e=>Ue(dd,Object.assign({ref:o=>{o&&(this.messageRefs[e.key]=o)},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave},dr(e,["destroy"],void 0),{duration:void 0===e.duration?this.duration:e.duration,keepAliveOnHover:void 0===e.keepAliveOnHover?this.keepAliveOnHover:e.keepAliveOnHover,closable:void 0===e.closable?this.closable:e.closable}))))):null)}}),ud=Me({name:"ModalEnvironment",props:Object.assign(Object.assign({},Ot),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=Io(!0);function n(){o.value=!1}return{show:o,hide:n,handleUpdateShow:function(e){o.value=e},handleAfterLeave:function(){const{onInternalAfterLeave:o,internalKey:n,onAfterLeave:t}=e;o&&o(n),t&&t()},handleCloseClick:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleNegativeClick:function(){const{onNegativeClick:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handlePositiveClick:function(){const{onPositiveClick:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleMaskClick:function(o){const{onMaskClick:t,maskClosable:r}=e;t&&(t(o),r&&n())},handleEsc:function(){const{onEsc:o}=e;o&&o()}}},render(){const{handleUpdateShow:e,handleAfterLeave:o,handleMaskClick:n,handleEsc:t,show:r}=this;return Ue(Pt,Object.assign({},this.$props,{show:r,onUpdateShow:e,onMaskClick:n,onEsc:t,onAfterLeave:o,internalAppear:!0,internalModal:!0}),this.$slots)}}),pd=Me({name:"ModalProvider",props:{to:[String,Object]},setup(){const e=Io([]),o={};const n={create:function(n={}){const t=fe(),r=no(Object.assign(Object.assign({},n),{key:t,destroy:()=>{var e;null===(e=o[`n-modal-${t}`])||void 0===e||e.hide()}}));return e.value.push(r),r},destroyAll:function(){Object.values(o).forEach(e=>{null==e||e.hide()})}};return Ee(yt,n),Ee(zt,{clickedRef:it(64),clickedPositionRef:st()}),Ee(Tt,e),Object.assign(Object.assign({},n),{modalList:e,modalInstRefs:o,handleAfterLeave:function(o){const{value:n}=e;n.splice(n.findIndex(e=>e.key===o),1)}})},render(){var e,o;return Ue(co,null,[this.modalList.map(e=>{var o;return Ue(ud,dr(e,["destroy","render"],{to:null!==(o=e.to)&&void 0!==o?o:this.to,ref:o=>{null===o?delete this.modalInstRefs[`n-modal-${e.key}`]:this.modalInstRefs[`n-modal-${e.key}`]=o},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave}),{default:e.render})}),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)])}}),hd={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function fd(e){const{textColor2:o,successColor:n,infoColor:t,warningColor:r,errorColor:a,popoverColor:l,closeIconColor:i,closeIconColorHover:s,closeIconColorPressed:d,closeColorHover:c,closeColorPressed:u,textColor1:p,textColor3:h,borderRadius:f,fontWeightStrong:m,boxShadow2:v,lineHeight:g,fontSize:b}=e;return Object.assign(Object.assign({},hd),{borderRadius:f,lineHeight:g,fontSize:b,headerFontWeight:m,iconColor:o,iconColorSuccess:n,iconColorInfo:t,iconColorWarning:r,iconColorError:a,color:l,textColor:o,closeIconColor:i,closeIconColorHover:s,closeIconColorPressed:d,closeBorderRadius:f,closeColorHover:c,closeColorPressed:u,headerTextColor:p,descriptionTextColor:h,actionTextColor:o,boxShadow:v})}var md=m({name:"Notification",common:t,peers:{Scrollbar:Pe},self:fd}),vd={name:"Notification",common:Sa,peers:{Scrollbar:ka},self:fd},gd=O("n-notification-provider"),bd=Me({name:"NotificationContainer",props:{scrollable:{type:Boolean,required:!0},placement:{type:String,required:!0}},setup(){const{mergedThemeRef:e,mergedClsPrefixRef:o,wipTransitionCountRef:n}=We(gd),t=Io(null);return Ke(()=>{var e,o;n.value>0?null===(e=null==t?void 0:t.value)||void 0===e||e.classList.add("transitioning"):null===(o=null==t?void 0:t.value)||void 0===o||o.classList.remove("transitioning")}),{selfRef:t,mergedTheme:e,mergedClsPrefix:o,transitioning:n}},render(){const{$slots:e,scrollable:o,mergedClsPrefix:n,mergedTheme:t,placement:r}=this;return Ue("div",{ref:"selfRef",class:[`${n}-notification-container`,o&&`${n}-notification-container--scrollable`,`${n}-notification-container--${r}`]},o?Ue(Ae,{theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,contentStyle:{overflow:"hidden"}},e):e)}}),yd={info:()=>Ue(ct,null),success:()=>Ue(dt,null),warning:()=>Ue(St,null),error:()=>Ue(ut,null),default:()=>null},xd={closable:{type:Boolean,default:!0},type:{type:String,default:"default"},avatar:Function,title:[String,Function],description:[String,Function],content:[String,Function],meta:[String,Function],action:[String,Function],onClose:{type:Function,required:!0},keepAliveOnHover:Boolean,onMouseenter:Function,onMouseleave:Function},Cd=lt(xd),wd=Me({name:"Notification",props:xd,setup(e){const{mergedClsPrefixRef:o,mergedThemeRef:n,props:t}=We(gd),{inlineThemeDisabled:r,mergedRtlRef:a}=J(),l=p("Notification",a,o),i=to(()=>{const{type:o}=e,{self:{color:t,textColor:r,closeIconColor:a,closeIconColorHover:l,closeIconColorPressed:i,headerTextColor:s,descriptionTextColor:d,actionTextColor:c,borderRadius:u,headerFontWeight:p,boxShadow:h,lineHeight:f,fontSize:m,closeMargin:v,closeSize:g,width:b,padding:y,closeIconSize:x,closeBorderRadius:C,closeColorHover:w,closeColorPressed:S,titleFontSize:k,metaFontSize:P,descriptionFontSize:T,[Te("iconColor",o)]:I},common:{cubicBezierEaseOut:A,cubicBezierEaseIn:z,cubicBezierEaseInOut:R}}=n.value,{left:M,right:F,top:O,bottom:$}=N(y);return{"--n-color":t,"--n-font-size":m,"--n-text-color":r,"--n-description-text-color":d,"--n-action-text-color":c,"--n-title-text-color":s,"--n-title-font-weight":p,"--n-bezier":R,"--n-bezier-ease-out":A,"--n-bezier-ease-in":z,"--n-border-radius":u,"--n-box-shadow":h,"--n-close-border-radius":C,"--n-close-color-hover":w,"--n-close-color-pressed":S,"--n-close-icon-color":a,"--n-close-icon-color-hover":l,"--n-close-icon-color-pressed":i,"--n-line-height":f,"--n-icon-color":I,"--n-close-margin":v,"--n-close-size":g,"--n-close-icon-size":x,"--n-width":b,"--n-padding-left":M,"--n-padding-right":F,"--n-padding-top":O,"--n-padding-bottom":$,"--n-title-font-size":k,"--n-meta-font-size":P,"--n-description-font-size":T}}),s=r?X("notification",to(()=>e.type[0]),i,t):void 0;return{mergedClsPrefix:o,showAvatar:to(()=>e.avatar||"default"!==e.type),handleCloseClick(){e.onClose()},rtlEnabled:l,cssVars:r?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender}},render(){var e;const{mergedClsPrefix:o}=this;return null===(e=this.onRender)||void 0===e||e.call(this),Ue("div",{class:[`${o}-notification-wrapper`,this.themeClass],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:this.cssVars},Ue("div",{class:[`${o}-notification`,this.rtlEnabled&&`${o}-notification--rtl`,this.themeClass,{[`${o}-notification--closable`]:this.closable,[`${o}-notification--show-avatar`]:this.showAvatar}],style:this.cssVars},this.showAvatar?Ue("div",{class:`${o}-notification__avatar`},this.avatar?ot(this.avatar):"default"!==this.type?Ue(ee,{clsPrefix:o},{default:()=>yd[this.type]()}):null):null,this.closable?Ue(l,{clsPrefix:o,class:`${o}-notification__close`,onClick:this.handleCloseClick}):null,Ue("div",{ref:"bodyRef",class:`${o}-notification-main`},this.title?Ue("div",{class:`${o}-notification-main__header`},ot(this.title)):null,this.description?Ue("div",{class:`${o}-notification-main__description`},ot(this.description)):null,this.content?Ue("pre",{class:`${o}-notification-main__content`},ot(this.content)):null,this.meta||this.action?Ue("div",{class:`${o}-notification-main-footer`},this.meta?Ue("div",{class:`${o}-notification-main-footer__meta`},ot(this.meta)):null,this.action?Ue("div",{class:`${o}-notification-main-footer__action`},ot(this.action)):null):null)))}}),Sd=Object.assign(Object.assign({},xd),{duration:Number,onClose:Function,onLeave:Function,onAfterEnter:Function,onAfterLeave:Function,onHide:Function,onAfterShow:Function,onAfterHide:Function}),kd=Me({name:"NotificationEnvironment",props:Object.assign(Object.assign({},Sd),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const{wipTransitionCountRef:o}=We(gd),n=Io(!0);let t=null;function r(){n.value=!1,t&&window.clearTimeout(t)}return Je(()=>{e.duration&&(t=window.setTimeout(r,e.duration))}),{show:n,hide:r,handleClose:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&r()}):r()},handleAfterLeave:function(){o.value--;const{onAfterLeave:n,onInternalAfterLeave:t,onAfterHide:r,internalKey:a}=e;n&&n(),t(a),r&&r()},handleLeave:function(o){const{onHide:n}=e;n&&n(),o.style.maxHeight="0",o.offsetHeight},handleBeforeLeave:function(e){o.value++,e.style.maxHeight=`${e.offsetHeight}px`,e.style.height=`${e.offsetHeight}px`,e.offsetHeight},handleAfterEnter:function(n){o.value--,n.style.height="",n.style.maxHeight="";const{onAfterEnter:t,onAfterShow:r}=e;t&&t(),r&&r()},handleBeforeEnter:function(e){o.value++,De(()=>{e.style.height=`${e.offsetHeight}px`,e.style.maxHeight="0",e.style.transition="none",e.offsetHeight,e.style.transition="",e.style.maxHeight=e.style.height})},handleMouseenter:function(e){e.currentTarget===e.target&&null!==t&&(window.clearTimeout(t),t=null)},handleMouseleave:function(o){o.currentTarget===o.target&&function(){const{duration:o}=e;o&&(t=window.setTimeout(r,o))}()}}},render(){return Ue(go,{name:"notification-transition",appear:!0,onBeforeEnter:this.handleBeforeEnter,onAfterEnter:this.handleAfterEnter,onBeforeLeave:this.handleBeforeLeave,onLeave:this.handleLeave,onAfterLeave:this.handleAfterLeave},{default:()=>this.show?Ue(wd,Object.assign({},Bn(this.$props,Cd),{onClose:this.handleClose,onMouseenter:this.duration&&this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.duration&&this.keepAliveOnHover?this.handleMouseleave:void 0})):null})}}),Pd=Z([G("notification-container","\n z-index: 4000;\n position: fixed;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n ",[Z(">",[G("scrollbar","\n width: initial;\n overflow: visible;\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[Z(">",[G("scrollbar-container","\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[G("scrollbar-content","\n padding-top: 12px;\n padding-bottom: 33px;\n ")])])])]),ze("top, top-right, top-left","\n top: 12px;\n ",[Z("&.transitioning >",[G("scrollbar",[Z(">",[G("scrollbar-container","\n min-height: 100vh !important;\n ")])])])]),ze("bottom, bottom-right, bottom-left","\n bottom: 12px;\n ",[Z(">",[G("scrollbar",[Z(">",[G("scrollbar-container",[G("scrollbar-content","\n padding-bottom: 12px;\n ")])])])]),G("notification-wrapper","\n display: flex;\n align-items: flex-end;\n margin-bottom: 0;\n margin-top: 12px;\n ")]),ze("top, bottom","\n left: 50%;\n transform: translateX(-50%);\n ",[G("notification-wrapper",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to","\n transform: scale(0.85);\n "),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: scale(1);\n ")])]),ze("top",[G("notification-wrapper","\n transform-origin: top center;\n ")]),ze("bottom",[G("notification-wrapper","\n transform-origin: bottom center;\n ")]),ze("top-right, bottom-right",[G("notification","\n margin-left: 28px;\n margin-right: 16px;\n ")]),ze("top-left, bottom-left",[G("notification","\n margin-left: 16px;\n margin-right: 28px;\n ")]),ze("top-right","\n right: 0;\n ",[Td("top-right")]),ze("top-left","\n left: 0;\n ",[Td("top-left")]),ze("bottom-right","\n right: 0;\n ",[Td("bottom-right")]),ze("bottom-left","\n left: 0;\n ",[Td("bottom-left")]),ze("scrollable",[ze("top-right","\n top: 0;\n "),ze("top-left","\n top: 0;\n "),ze("bottom-right","\n bottom: 0;\n "),ze("bottom-left","\n bottom: 0;\n ")]),G("notification-wrapper","\n margin-bottom: 12px;\n ",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to","\n opacity: 0;\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n "),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n opacity: 1;\n "),Z("&.notification-transition-leave-active","\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-in),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n "),Z("&.notification-transition-enter-active","\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-out),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n ")]),G("notification","\n background-color: var(--n-color);\n color: var(--n-text-color);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n font-family: inherit;\n font-size: var(--n-font-size);\n font-weight: 400;\n position: relative;\n display: flex;\n overflow: hidden;\n flex-shrink: 0;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n width: var(--n-width);\n max-width: calc(100vw - 16px - 16px);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n box-sizing: border-box;\n opacity: 1;\n ",[we("avatar",[G("icon","\n color: var(--n-icon-color);\n "),G("base-icon","\n color: var(--n-icon-color);\n ")]),ze("show-avatar",[G("notification-main","\n margin-left: 40px;\n width: calc(100% - 40px); \n ")]),ze("closable",[G("notification-main",[Z("> *:first-child","\n padding-right: 20px;\n ")]),we("close","\n position: absolute;\n top: 0;\n right: 0;\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n ")]),we("avatar","\n position: absolute;\n top: var(--n-padding-top);\n left: var(--n-padding-left);\n width: 28px;\n height: 28px;\n font-size: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n ",[G("icon","transition: color .3s var(--n-bezier);")]),G("notification-main","\n padding-top: var(--n-padding-top);\n padding-bottom: var(--n-padding-bottom);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n width: calc(100% - 8px);\n ",[G("notification-main-footer","\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 12px;\n ",[we("meta","\n font-size: var(--n-meta-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "),we("action","\n cursor: pointer;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-action-text-color);\n ")]),we("header","\n font-weight: var(--n-title-font-weight);\n font-size: var(--n-title-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-title-text-color);\n "),we("description","\n margin-top: 8px;\n font-size: var(--n-description-font-size);\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "),we("content","\n line-height: var(--n-line-height);\n margin: 12px 0 0 0;\n font-family: inherit;\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-text-color);\n ",[Z("&:first-child","margin: 0;")])])])])]);function Td(e){const o="left"===e.split("-")[1]?"calc(-100%)":"calc(100%)";return G("notification-wrapper",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to",`\n transform: translate(${o}, 0);\n `),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: translate(0, 0);\n ")])}var Id=O("n-notification-api"),Ad=Me({name:"NotificationProvider",props:Object.assign(Object.assign({},g.props),{containerClass:String,containerStyle:[String,Object],to:[String,Object],scrollable:{type:Boolean,default:!0},max:Number,placement:{type:String,default:"top-right"},keepAliveOnHover:Boolean}),setup(e){const{mergedClsPrefixRef:o}=J(e),n=Io([]),t={},r=new Set;function a(o){const a=fe(),l=()=>{r.add(a),t[a]&&t[a].hide()},i=no(Object.assign(Object.assign({},o),{key:a,destroy:l,hide:l,deactivate:l})),{max:s}=e;if(s&&n.value.length-r.size>=s){let e=!1,o=0;for(const a of n.value){if(!r.has(a.key)){t[a.key]&&(a.destroy(),e=!0);break}o++}e||n.value.splice(o,1)}return n.value.push(i),i}const l=["info","success","warning","error"].map(e=>o=>a(Object.assign(Object.assign({},o),{type:e})));const i=g("Notification","-notification",Pd,md,e,o),s={create:a,info:l[0],success:l[1],warning:l[2],error:l[3],open:function(e){return a(e)},destroyAll:function(){Object.values(n.value).forEach(e=>{e.hide()})}},d=Io(0);return Ee(Id,s),Ee(gd,{props:e,mergedClsPrefixRef:o,mergedThemeRef:i,wipTransitionCountRef:d}),Object.assign({mergedClsPrefix:o,notificationList:n,notificationRefs:t,handleAfterLeave:function(e){r.delete(e),n.value.splice(n.value.findIndex(o=>o.key===e),1)}},s)},render(){var e,o,n;const{placement:t}=this;return Ue(co,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.notificationList.length?Ue(Qe,{to:null!==(n=this.to)&&void 0!==n?n:"body"},Ue(bd,{class:this.containerClass,style:this.containerStyle,scrollable:this.scrollable&&"top"!==t&&"bottom"!==t,placement:t},{default:()=>this.notificationList.map(e=>Ue(kd,Object.assign({ref:o=>{const n=e.key;null===o?delete this.notificationRefs[n]:this.notificationRefs[n]=o}},dr(e,["destroy","hide","deactivate"]),{internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave,keepAliveOnHover:void 0===e.keepAliveOnHover?this.keepAliveOnHover:e.keepAliveOnHover})))})):null)}});var zd=Me({name:"InjectionExtractor",props:{onSetup:Function},setup(e,{slots:o}){var n;return null===(n=e.onSetup)||void 0===n||n.call(e),()=>{var e;return null===(e=o.default)||void 0===e?void 0:e.call(o)}}}),Rd={message:Yn,notification:function(){const e=We(Id,null);return null===e&&i("use-notification","No outer `n-notification-provider` found."),e},loadingBar:function(){const e=We(qs,null);return null===e&&i("use-loading-bar","No outer <n-loading-bar-provider /> founded."),e},dialog:pt,modal:bt};function Md(e,{configProviderProps:o,messageProviderProps:n,dialogProviderProps:t,notificationProviderProps:r,loadingBarProviderProps:a,modalProviderProps:l}={}){const i=[];return e.forEach(e=>{switch(e){case"message":i.push({type:e,Provider:cd,props:n});break;case"notification":i.push({type:e,Provider:Ad,props:r});break;case"dialog":i.push({type:e,Provider:Ks,props:t});break;case"loadingBar":i.push({type:e,Provider:ed,props:a});break;case"modal":i.push({type:e,Provider:pd,props:l})}}),function({providersAndProps:e,configProviderProps:o}){let n=ao(function(){return Ue(Oi,yo(o),{default:()=>e.map(({type:e,Provider:o,props:n})=>Ue(o,yo(n),{default:()=>Ue(zd,{onSetup:()=>t[e]=Rd[e]()})}))})});const t={app:n};let r;return u&&(r=document.createElement("div"),document.body.appendChild(r),n.mount(r)),Object.assign({unmount:()=>{var e;null!==n&&null!==r?(n.unmount(),null===(e=r.parentNode)||void 0===e||e.removeChild(r),r=null,n=null):y("discrete","unmount call no need because discrete app has been unmounted")}},t)}({providersAndProps:i,configProviderProps:o})}var Fd={name:"Divider",common:Sa,self:gt};function Od(e){const{modalColor:o,textColor1:n,textColor2:t,boxShadow3:r,lineHeight:a,fontWeightStrong:l,dividerColor:i,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:h,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:h,headerPadding:"16px 24px",footerPadding:"16px 24px",color:o,textColor:t,titleTextColor:n,titleFontSize:"18px",titleFontWeight:l,boxShadow:r,lineHeight:a,headerBorderBottom:`1px solid ${i}`,footerBorderTop:`1px solid ${i}`,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:d,closeBorderRadius:h,resizableTriggerColorHover:f}}var $d=m({name:"Drawer",common:t,peers:{Scrollbar:Pe},self:Od}),Bd={name:"Drawer",common:Sa,peers:{Scrollbar:ka},self:Od},Ed={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},_d={name:"DynamicInput",common:Sa,peers:{Input:Tl,Button:ai},self:()=>Ed};var Dd,Ld=m({name:"DynamicInput",common:t,peers:{Input:Vn,Button:te},self:function(){return Ed}}),Hd={name:"Space",self:()=>At};function jd(){if(!u)return!0;if(void 0===Dd){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=1===e.scrollHeight;return document.body.removeChild(e),Dd=o}return Dd}var Ud=Me({name:"Space",props:Object.assign(Object.assign({},g.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=J(e),t=g("Space","-space",void 0,mt,e,o),r=p("Space",n,o);return{useGap:jd(),rtlEnabled:r,mergedClsPrefix:o,margin:to(()=>{const{size:o}=e;if(Array.isArray(o))return{horizontal:o[0],vertical:o[1]};if("number"==typeof o)return{horizontal:o,vertical:o};const{self:{[Te("gap",o)]:n}}=t.value,{row:r,col:a}=xe(n);return{horizontal:re(a),vertical:re(r)}})}},render(){const{vertical:e,reverse:o,align:n,inline:t,justify:r,itemClass:a,itemStyle:l,margin:i,wrap:s,mergedClsPrefix:d,rtlEnabled:c,useGap:u,wrapItem:p,internalUseGap:h}=this,f=Mn(ir(this),!1);if(!f.length)return null;const m=`${i.horizontal}px`,v=i.horizontal/2+"px",g=`${i.vertical}px`,b=i.vertical/2+"px",y=f.length-1,x=r.startsWith("space-");return Ue("div",{role:"none",class:[`${d}-space`,c&&`${d}-space--rtl`],style:{display:t?"inline-flex":"flex",flexDirection:e&&!o?"column":e&&o?"column-reverse":!e&&o?"row-reverse":"row",justifyContent:["start","end"].includes(r)?`flex-${r}`:r,flexWrap:!s||e?"nowrap":"wrap",marginTop:u||e?"":`-${b}`,marginBottom:u||e?"":`-${b}`,alignItems:n,gap:u?`${i.vertical}px ${i.horizontal}px`:""}},p||!u&&!h?f.map((o,n)=>o.type===po?o:Ue("div",{role:"none",class:a,style:[l,{maxWidth:"100%"},u?"":e?{marginBottom:n!==y?g:""}:c?{marginLeft:x?"space-between"===r&&n===y?"":v:n!==y?m:"",marginRight:x?"space-between"===r&&0===n?"":v:"",paddingTop:b,paddingBottom:b}:{marginRight:x?"space-between"===r&&n===y?"":v:n!==y?m:"",marginLeft:x?"space-between"===r&&0===n?"":v:"",paddingTop:b,paddingBottom:b}]},o)):f)}}),Wd={name:"DynamicTags",common:Sa,peers:{Input:Tl,Button:ai,Tag:tl,Space:Hd},self:()=>({inputWidth:"64px"})},Nd=m({name:"DynamicTags",common:t,peers:{Input:Vn,Button:te,Tag:Y,Space:mt},self:()=>({inputWidth:"64px"})}),Kd={name:"Element",common:Sa},Vd={name:"Element",common:t},qd={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},Gd={name:"Flex",self:()=>qd};var Jd={name:"Flex",self:function(){return qd}},Yd={name:"ButtonGroup",common:Sa},Zd={name:"ButtonGroup",common:t},Xd={name:"Form",common:Sa,self:wt},Qd={name:"GradientText",common:Sa,self(e){const{primaryColor:o,successColor:n,warningColor:t,errorColor:r,infoColor:a,primaryColorSuppl:l,successColorSuppl:i,warningColorSuppl:s,errorColorSuppl:d,infoColorSuppl:c,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:o,colorEndPrimary:l,colorStartInfo:a,colorEndInfo:c,colorStartWarning:t,colorEndWarning:s,colorStartError:r,colorEndError:d,colorStartSuccess:n,colorEndSuccess:i}}};var ec={name:"GradientText",common:t,self:function(e){const{primaryColor:o,successColor:n,warningColor:t,errorColor:r,infoColor:a,fontWeightStrong:l}=e;return{fontWeight:l,rotate:"252deg",colorStartPrimary:D(o,{alpha:.6}),colorEndPrimary:o,colorStartInfo:D(a,{alpha:.6}),colorEndInfo:a,colorStartWarning:D(t,{alpha:.6}),colorEndWarning:t,colorStartError:D(r,{alpha:.6}),colorEndError:r,colorStartSuccess:D(n,{alpha:.6}),colorEndSuccess:n}}},oc={name:"InputNumber",common:Sa,peers:{Button:ai,Input:Tl},self(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}};var nc=m({name:"InputNumber",common:t,peers:{Button:te,Input:Vn},self:function(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}});function tc(){return{inputWidthSmall:"24px",inputWidthMedium:"30px",inputWidthLarge:"36px",gapSmall:"8px",gapMedium:"8px",gapLarge:"8px"}}var rc=m({name:"InputOtp",common:t,peers:{Input:Vn},self:tc}),ac={name:"InputOtp",common:Sa,peers:{Input:Tl},self:tc},lc={name:"Layout",common:Sa,peers:{Scrollbar:ka},self(e){const{textColor2:o,bodyColor:n,popoverColor:t,cardColor:r,dividerColor:a,scrollbarColor:l,scrollbarColorHover:i}=e;return{textColor:o,textColorInverted:o,color:n,colorEmbedded:n,headerColor:r,headerColorInverted:r,footerColor:r,footerColorInverted:r,headerBorderColor:a,headerBorderColorInverted:a,footerBorderColor:a,footerBorderColorInverted:a,siderBorderColor:a,siderBorderColorInverted:a,siderColor:r,siderColorInverted:r,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:t,siderToggleButtonIconColor:o,siderToggleButtonIconColorInverted:o,siderToggleBarColor:de(n,l),siderToggleBarColorHover:de(n,i),__invertScrollbar:"false"}}};var ic=m({name:"Layout",common:t,peers:{Scrollbar:Pe},self:function(e){const{baseColor:o,textColor2:n,bodyColor:t,cardColor:r,dividerColor:a,actionColor:l,scrollbarColor:i,scrollbarColorHover:s,invertedColor:d}=e;return{textColor:n,textColorInverted:"#FFF",color:t,colorEmbedded:l,headerColor:r,headerColorInverted:d,footerColor:l,footerColorInverted:d,headerBorderColor:a,headerBorderColorInverted:d,footerBorderColor:a,footerBorderColorInverted:d,siderBorderColor:a,siderBorderColorInverted:d,siderColor:r,siderColorInverted:d,siderToggleButtonBorder:`1px solid ${a}`,siderToggleButtonColor:o,siderToggleButtonIconColor:n,siderToggleButtonIconColorInverted:n,siderToggleBarColor:de(t,i),siderToggleBarColorHover:de(t,s),__invertScrollbar:"true"}}}),sc={name:"Row",common:Sa},dc={name:"Row",common:t};function cc(e){const{textColor2:o,cardColor:n,modalColor:t,popoverColor:r,dividerColor:a,borderRadius:l,fontSize:i,hoverColor:s}=e;return{textColor:o,color:n,colorHover:s,colorModal:t,colorHoverModal:de(t,s),colorPopover:r,colorHoverPopover:de(r,s),borderColor:a,borderColorModal:de(t,a),borderColorPopover:de(r,a),borderRadius:l,fontSize:i}}var uc={name:"List",common:t,self:cc},pc={name:"List",common:Sa,self:cc},hc={name:"Log",common:Sa,peers:{Scrollbar:ka,Code:wi},self(e){const{textColor2:o,inputColor:n,fontSize:t,primaryColor:r}=e;return{loaderFontSize:t,loaderTextColor:o,loaderColor:n,loaderBorder:"1px solid #0000",loadingColor:r}}};var fc=m({name:"Log",common:t,peers:{Scrollbar:Pe,Code:Si},self:function(e){const{textColor2:o,modalColor:n,borderColor:t,fontSize:r,primaryColor:a}=e;return{loaderFontSize:r,loaderTextColor:o,loaderColor:n,loaderBorder:`1px solid ${t}`,loadingColor:a}}}),mc={name:"Mention",common:Sa,peers:{InternalSelectMenu:Za,Input:Tl},self(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}};var vc=m({name:"Mention",common:t,peers:{InternalSelectMenu:Ln,Input:Vn},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}});function gc(e){const{borderRadius:o,textColor3:n,primaryColor:t,textColor2:r,textColor1:a,fontSize:l,dividerColor:i,hoverColor:s,primaryColorHover:d}=e;return Object.assign({borderRadius:o,color:"#0000",groupTextColor:n,itemColorHover:s,itemColorActive:D(t,{alpha:.1}),itemColorActiveHover:D(t,{alpha:.1}),itemColorActiveCollapsed:D(t,{alpha:.1}),itemTextColor:r,itemTextColorHover:r,itemTextColorActive:t,itemTextColorActiveHover:t,itemTextColorChildActive:t,itemTextColorChildActiveHover:t,itemTextColorHorizontal:r,itemTextColorHoverHorizontal:d,itemTextColorActiveHorizontal:t,itemTextColorActiveHoverHorizontal:t,itemTextColorChildActiveHorizontal:t,itemTextColorChildActiveHoverHorizontal:t,itemIconColor:a,itemIconColorHover:a,itemIconColorActive:t,itemIconColorActiveHover:t,itemIconColorChildActive:t,itemIconColorChildActiveHover:t,itemIconColorCollapsed:a,itemIconColorHorizontal:a,itemIconColorHoverHorizontal:d,itemIconColorActiveHorizontal:t,itemIconColorActiveHoverHorizontal:t,itemIconColorChildActiveHorizontal:t,itemIconColorChildActiveHoverHorizontal:t,itemHeight:"42px",arrowColor:r,arrowColorHover:r,arrowColorActive:t,arrowColorActiveHover:t,arrowColorChildActive:t,arrowColorChildActiveHover:t,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:l,dividerColor:i},{itemColorHoverInverted:"#0000",itemColorActiveInverted:u=t,itemColorActiveHoverInverted:u,itemColorActiveCollapsedInverted:u,itemTextColorInverted:c="#BBB",itemTextColorHoverInverted:p="#FFF",itemTextColorChildActiveInverted:p,itemTextColorChildActiveHoverInverted:p,itemTextColorActiveInverted:p,itemTextColorActiveHoverInverted:p,itemTextColorHorizontalInverted:c,itemTextColorHoverHorizontalInverted:p,itemTextColorChildActiveHorizontalInverted:p,itemTextColorChildActiveHoverHorizontalInverted:p,itemTextColorActiveHorizontalInverted:p,itemTextColorActiveHoverHorizontalInverted:p,itemIconColorInverted:c,itemIconColorHoverInverted:p,itemIconColorActiveInverted:p,itemIconColorActiveHoverInverted:p,itemIconColorChildActiveInverted:p,itemIconColorChildActiveHoverInverted:p,itemIconColorCollapsedInverted:c,itemIconColorHorizontalInverted:c,itemIconColorHoverHorizontalInverted:p,itemIconColorActiveHorizontalInverted:p,itemIconColorActiveHoverHorizontalInverted:p,itemIconColorChildActiveHorizontalInverted:p,itemIconColorChildActiveHoverHorizontalInverted:p,arrowColorInverted:c,arrowColorHoverInverted:p,arrowColorActiveInverted:p,arrowColorActiveHoverInverted:p,arrowColorChildActiveInverted:p,arrowColorChildActiveHoverInverted:p,groupTextColorInverted:"#AAA"});var c,u,p}var bc=m({name:"Menu",common:t,peers:{Tooltip:Ji,Dropdown:Ki},self:gc}),yc={name:"Menu",common:Sa,peers:{Tooltip:Gi,Dropdown:Vi},self(e){const{primaryColor:o,primaryColorSuppl:n}=e,t=gc(e);return t.itemColorActive=D(o,{alpha:.15}),t.itemColorActiveHover=D(o,{alpha:.15}),t.itemColorActiveCollapsed=D(o,{alpha:.15}),t.itemColorActiveInverted=n,t.itemColorActiveHoverInverted=n,t.itemColorActiveCollapsedInverted=n,t}},xc={titleFontSize:"18px",backSize:"22px"};function Cc(e){const{textColor1:o,textColor2:n,textColor3:t,fontSize:r,fontWeightStrong:a,primaryColorHover:l,primaryColorPressed:i}=e;return Object.assign(Object.assign({},xc),{titleFontWeight:a,fontSize:r,titleTextColor:o,backColor:n,backColorHover:l,backColorPressed:i,subtitleTextColor:t})}var wc=m({name:"PageHeader",common:t,self:Cc}),Sc={name:"PageHeader",common:Sa,self:Cc},kc={iconSize:"22px"};function Pc(e){const{fontSize:o,warningColor:n}=e;return Object.assign(Object.assign({},kc),{fontSize:o,iconColor:n})}var Tc=m({name:"Popconfirm",common:t,peers:{Button:te,Popover:qn},self:Pc}),Ic={name:"Popconfirm",common:Sa,peers:{Button:ai,Popover:nl},self:Pc};function Ac(e){const{infoColor:o,successColor:n,warningColor:t,errorColor:r,textColor2:a,progressRailColor:l,fontSize:i,fontWeight:s}=e;return{fontSize:i,fontSizeCircle:"28px",fontWeightCircle:s,railColor:l,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:o,iconColorInfo:o,iconColorSuccess:n,iconColorWarning:t,iconColorError:r,textColorCircle:a,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:a,fillColor:o,fillColorInfo:o,fillColorSuccess:n,fillColorWarning:t,fillColorError:r,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}var zc={name:"Progress",common:t,self:Ac},Rc={name:"Progress",common:Sa,self(e){const o=Ac(e);return o.textColorLineInner="rgb(0, 0, 0)",o.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",o}},Mc={name:"Rate",common:Sa,self(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}};var Fc={name:"Rate",common:t,self:function(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#FFCC33",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},Oc={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function $c(e){const{textColor2:o,textColor1:n,errorColor:t,successColor:r,infoColor:a,warningColor:l,lineHeight:i,fontWeightStrong:s}=e;return Object.assign(Object.assign({},Oc),{lineHeight:i,titleFontWeight:s,titleTextColor:n,textColor:o,iconColorError:t,iconColorSuccess:r,iconColorInfo:a,iconColorWarning:l})}var Bc={name:"Result",common:t,self:$c},Ec={name:"Result",common:Sa,self:$c},_c={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},Dc={name:"Slider",common:Sa,self(e){const{railColor:o,modalColor:n,primaryColorSuppl:t,popoverColor:r,textColor2:a,cardColor:l,borderRadius:i,fontSize:s,opacityDisabled:d}=e;return Object.assign(Object.assign({},_c),{fontSize:s,markFontSize:s,railColor:o,railColorHover:o,fillColor:t,fillColorHover:t,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:n,dotColorPopover:r,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:r,indicatorBoxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.12)",indicatorTextColor:a,indicatorBorderRadius:i,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${t}`,dotBoxShadow:""})}};var Lc={name:"Slider",common:t,self:function(e){const{railColor:o,primaryColor:n,baseColor:t,cardColor:r,modalColor:a,popoverColor:l,borderRadius:i,fontSize:s,opacityDisabled:d}=e;return Object.assign(Object.assign({},_c),{fontSize:s,markFontSize:s,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:r,dotColorModal:a,dotColorPopover:l,handleBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowHover:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowActive:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowFocus:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",indicatorColor:"rgba(0, 0, 0, .85)",indicatorBoxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.12)",indicatorTextColor:t,indicatorBorderRadius:i,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}},Hc={name:"Spin",common:Sa,self:le};function jc(e){const{textColor2:o,textColor3:n,fontSize:t,fontWeight:r}=e;return{labelFontSize:t,labelFontWeight:r,valueFontWeight:r,valueFontSize:"24px",labelTextColor:n,valuePrefixTextColor:o,valueSuffixTextColor:o,valueTextColor:o}}var Uc={name:"Statistic",common:t,self:jc},Wc={name:"Statistic",common:Sa,self:jc},Nc={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function Kc(e){const{fontWeightStrong:o,baseColor:n,textColorDisabled:t,primaryColor:r,errorColor:a,textColor1:l,textColor2:i}=e;return Object.assign(Object.assign({},Nc),{stepHeaderFontWeight:o,indicatorTextColorProcess:n,indicatorTextColorWait:t,indicatorTextColorFinish:r,indicatorTextColorError:a,indicatorBorderColorProcess:r,indicatorBorderColorWait:t,indicatorBorderColorFinish:r,indicatorBorderColorError:a,indicatorColorProcess:r,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:t,splitorColorWait:t,splitorColorFinish:r,splitorColorError:t,headerTextColorProcess:l,headerTextColorWait:t,headerTextColorFinish:t,headerTextColorError:a,descriptionTextColorProcess:i,descriptionTextColorWait:t,descriptionTextColorFinish:t,descriptionTextColorError:a})}var Vc={name:"Steps",common:t,self:Kc},qc={name:"Steps",common:Sa,self:Kc},Gc={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},Jc={name:"Switch",common:Sa,self(e){const{primaryColorSuppl:o,opacityDisabled:n,borderRadius:t,primaryColor:r,textColor2:a,baseColor:l}=e;return Object.assign(Object.assign({},Gc),{iconColor:l,textColor:a,loadingColor:o,opacityDisabled:n,railColor:"rgba(255, 255, 255, .20)",railColorActive:o,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 8px 0 ${D(r,{alpha:.3})}`})}};var Yc={name:"Switch",common:t,self:function(e){const{primaryColor:o,opacityDisabled:n,borderRadius:t,textColor3:r}=e;return Object.assign(Object.assign({},Gc),{iconColor:r,textColor:"white",loadingColor:o,opacityDisabled:n,railColor:"rgba(0, 0, 0, .14)",railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 0 2px ${D(o,{alpha:.2})}`})}},Zc={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function Xc(e){const{dividerColor:o,cardColor:n,modalColor:t,popoverColor:r,tableHeaderColor:a,tableColorStriped:l,textColor1:i,textColor2:s,borderRadius:d,fontWeightStrong:c,lineHeight:u,fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Zc),{fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:f,lineHeight:u,borderRadius:d,borderColor:de(n,o),borderColorModal:de(t,o),borderColorPopover:de(r,o),tdColor:n,tdColorModal:t,tdColorPopover:r,tdColorStriped:de(n,l),tdColorStripedModal:de(t,l),tdColorStripedPopover:de(r,l),thColor:de(n,a),thColorModal:de(t,a),thColorPopover:de(r,a),thTextColor:i,tdTextColor:s,thFontWeight:c})}var Qc={name:"Table",common:t,self:Xc},eu={name:"Table",common:Sa,self:Xc},ou={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function nu(e){const{textColor2:o,primaryColor:n,textColorDisabled:t,closeIconColor:r,closeIconColorHover:a,closeIconColorPressed:l,closeColorHover:i,closeColorPressed:s,tabColor:d,baseColor:c,dividerColor:u,fontWeight:p,textColor1:h,borderRadius:f,fontSize:m,fontWeightStrong:v}=e;return Object.assign(Object.assign({},ou),{colorSegment:d,tabFontSizeCard:m,tabTextColorLine:h,tabTextColorActiveLine:n,tabTextColorHoverLine:n,tabTextColorDisabledLine:t,tabTextColorSegment:h,tabTextColorActiveSegment:o,tabTextColorHoverSegment:o,tabTextColorDisabledSegment:t,tabTextColorBar:h,tabTextColorActiveBar:n,tabTextColorHoverBar:n,tabTextColorDisabledBar:t,tabTextColorCard:h,tabTextColorHoverCard:h,tabTextColorActiveCard:n,tabTextColorDisabledCard:t,barColor:n,closeIconColor:r,closeIconColorHover:a,closeIconColorPressed:l,closeColorHover:i,closeColorPressed:s,closeBorderRadius:f,tabColor:d,tabColorSegment:c,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:o,fontWeightStrong:v})}var tu={name:"Tabs",common:t,self:nu},ru={name:"Tabs",common:Sa,self(e){const o=nu(e),{inputColor:n}=e;return o.colorSegment=n,o.tabColorSegment=n,o}};function au(e){const{textColor1:o,textColor2:n,fontWeightStrong:t,fontSize:r}=e;return{fontSize:r,titleTextColor:o,textColor:n,titleFontWeight:t}}var lu={name:"Thing",common:t,self:au},iu={name:"Thing",common:Sa,self:au},su={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},du={name:"Timeline",common:Sa,self(e){const{textColor3:o,infoColorSuppl:n,errorColorSuppl:t,successColorSuppl:r,warningColorSuppl:a,textColor1:l,textColor2:i,railColor:s,fontWeightStrong:d,fontSize:c}=e;return Object.assign(Object.assign({},su),{contentFontSize:c,titleFontWeight:d,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${n}`,circleBorderError:`2px solid ${t}`,circleBorderSuccess:`2px solid ${r}`,circleBorderWarning:`2px solid ${a}`,iconColor:o,iconColorInfo:n,iconColorError:t,iconColorSuccess:r,iconColorWarning:a,titleTextColor:l,contentTextColor:i,metaTextColor:o,lineColor:s})}};var cu={name:"Timeline",common:t,self:function(e){const{textColor3:o,infoColor:n,errorColor:t,successColor:r,warningColor:a,textColor1:l,textColor2:i,railColor:s,fontWeightStrong:d,fontSize:c}=e;return Object.assign(Object.assign({},su),{contentFontSize:c,titleFontWeight:d,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${n}`,circleBorderError:`2px solid ${t}`,circleBorderSuccess:`2px solid ${r}`,circleBorderWarning:`2px solid ${a}`,iconColor:o,iconColorInfo:n,iconColorError:t,iconColorSuccess:r,iconColorWarning:a,titleTextColor:l,contentTextColor:i,metaTextColor:o,lineColor:s})}},uu={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},pu={name:"Transfer",common:Sa,peers:{Checkbox:fi,Scrollbar:ka,Input:Tl,Empty:Ga,Button:ai},self(e){const{fontWeight:o,fontSizeLarge:n,fontSizeMedium:t,fontSizeSmall:r,heightLarge:a,heightMedium:l,borderRadius:i,inputColor:s,tableHeaderColor:d,textColor1:c,textColorDisabled:u,textColor2:p,textColor3:h,hoverColor:f,closeColorHover:m,closeColorPressed:v,closeIconColor:g,closeIconColorHover:b,closeIconColorPressed:y,dividerColor:x}=e;return Object.assign(Object.assign({},uu),{itemHeightSmall:l,itemHeightMedium:l,itemHeightLarge:a,fontSizeSmall:r,fontSizeMedium:t,fontSizeLarge:n,borderRadius:i,dividerColor:x,borderColor:"#0000",listColor:s,headerColor:d,titleTextColor:c,titleTextColorDisabled:u,extraTextColor:h,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:o,closeColorHover:m,closeColorPressed:v,closeIconColor:g,closeIconColorHover:b,closeIconColorPressed:y})}};var hu=m({name:"Transfer",common:t,peers:{Checkbox:at,Scrollbar:Pe,Input:Vn,Empty:B,Button:te},self:function(e){const{fontWeight:o,fontSizeLarge:n,fontSizeMedium:t,fontSizeSmall:r,heightLarge:a,heightMedium:l,borderRadius:i,cardColor:s,tableHeaderColor:d,textColor1:c,textColorDisabled:u,textColor2:p,textColor3:h,borderColor:f,hoverColor:m,closeColorHover:v,closeColorPressed:g,closeIconColor:b,closeIconColorHover:y,closeIconColorPressed:x}=e;return Object.assign(Object.assign({},uu),{itemHeightSmall:l,itemHeightMedium:l,itemHeightLarge:a,fontSizeSmall:r,fontSizeMedium:t,fontSizeLarge:n,borderRadius:i,dividerColor:f,borderColor:f,listColor:s,headerColor:de(s,d),titleTextColor:c,titleTextColorDisabled:u,extraTextColor:h,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:m,titleFontWeight:o,closeColorHover:v,closeColorPressed:g,closeIconColor:b,closeIconColorHover:y,closeIconColorPressed:x})}});function fu(e){const{borderRadiusSmall:o,dividerColor:n,hoverColor:t,pressedColor:r,primaryColor:a,textColor3:l,textColor2:i,textColorDisabled:s,fontSize:d}=e;return{fontSize:d,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:o,nodeColorHover:t,nodeColorPressed:r,nodeColorActive:D(a,{alpha:.1}),arrowColor:l,nodeTextColor:i,nodeTextColorDisabled:s,loadingColor:a,dropMarkColor:a,lineColor:n}}var mu=m({name:"Tree",common:t,peers:{Checkbox:at,Scrollbar:Pe,Empty:B},self:fu}),vu={name:"Tree",common:Sa,peers:{Checkbox:fi,Scrollbar:ka,Empty:Ga},self(e){const{primaryColor:o}=e,n=fu(e);return n.nodeColorActive=D(o,{alpha:.15}),n}},gu={name:"TreeSelect",common:Sa,peers:{Tree:vu,Empty:Ga,InternalSelection:cl}};var bu=m({name:"TreeSelect",common:t,peers:{Tree:mu,Empty:B,InternalSelection:En},self:function(e){const{popoverColor:o,boxShadow2:n,borderRadius:t,heightMedium:r,dividerColor:a,textColor2:l}=e;return{menuPadding:"4px",menuColor:o,menuBoxShadow:n,menuBorderRadius:t,menuHeight:`calc(${r} * 7.6)`,actionDividerColor:a,actionTextColor:l,actionPadding:"8px 12px",headerDividerColor:a,headerTextColor:l,headerPadding:"8px 12px"}}}),yu={name:"Typography",common:Sa,self:Ft};function xu(e){const{iconColor:o,primaryColor:n,errorColor:t,textColor2:r,successColor:a,opacityDisabled:l,actionColor:i,borderColor:s,hoverColor:d,lineHeight:c,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:c,borderRadius:u,draggerColor:i,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${n}`,itemColorHover:d,itemColorHoverError:D(t,{alpha:.06}),itemTextColor:r,itemTextColorError:t,itemTextColorSuccess:a,itemIconColor:o,itemDisabledOpacity:l,itemBorderImageCardError:`1px solid ${t}`,itemBorderImageCard:`1px solid ${s}`}}var Cu=m({name:"Upload",common:t,peers:{Button:te,Progress:zc},self:xu}),wu={name:"Upload",common:Sa,peers:{Button:ai,Progress:Rc},self(e){const{errorColor:o}=e,n=xu(e);return n.itemColorHoverError=D(o,{alpha:.09}),n}},Su={name:"Watermark",common:Sa,self(e){const{fontFamily:o}=e;return{fontFamily:o}}},ku=m({name:"Watermark",common:t,self(e){const{fontFamily:o}=e;return{fontFamily:o}}});var Pu={name:"FloatButtonGroup",common:t,self:function(e){const{popoverColor:o,dividerColor:n,borderRadius:t}=e;return{color:o,buttonBorderColor:n,borderRadiusSquare:t,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},Tu={name:"FloatButton",common:Sa,self(e){const{popoverColor:o,textColor2:n,buttonColor2Hover:t,buttonColor2Pressed:r,primaryColor:a,primaryColorHover:l,primaryColorPressed:i,baseColor:s,borderRadius:d}=e;return{color:o,textColor:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:t,colorPressed:r,colorPrimary:a,colorPrimaryHover:l,colorPrimaryPressed:i,textColorPrimary:s,borderRadiusSquare:d}}};var Iu={name:"FloatButton",common:t,self:function(e){const{popoverColor:o,textColor2:n,buttonColor2Hover:t,buttonColor2Pressed:r,primaryColor:a,primaryColorHover:l,primaryColorPressed:i,borderRadius:s}=e;return{color:o,colorHover:t,colorPressed:r,colorPrimary:a,colorPrimaryHover:l,colorPrimaryPressed:i,textColor:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .16)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .24)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .24)",textColorPrimary:"#fff",borderRadiusSquare:s}}},Au=O("n-form"),zu=O("n-form-item-insts"),Ru=G("form",[ze("inline","\n width: 100%;\n display: inline-flex;\n align-items: flex-start;\n align-content: space-around;\n ",[G("form-item",{width:"auto",marginRight:"18px"},[Z("&:last-child",{marginRight:0})])])]),Mu=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})},Fu=Me({name:"Form",props:Object.assign(Object.assign({},g.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),setup(e){const{mergedClsPrefixRef:o}=J(e);g("Form","-form",Ru,Rt,e,o);const n={},t=Io(void 0);return Ee(Au,{props:e,maxChildLabelWidthRef:t,deriveMaxChildLabelWidth:e=>{const o=t.value;(void 0===o||e>=o)&&(t.value=e)}}),Ee(zu,{formItems:n}),Object.assign({validate:function(e){return Mu(this,arguments,void 0,function*(e,o=()=>!0){return yield new Promise((t,r)=>{const a=[];for(const e of lt(n)){const t=n[e];for(const e of t)e.path&&a.push(e.internalValidate(null,o))}Promise.all(a).then(o=>{const n=o.some(e=>!e.valid),a=[],l=[];o.forEach(e=>{var o,n;(null===(o=e.errors)||void 0===o?void 0:o.length)&&a.push(e.errors),(null===(n=e.warnings)||void 0===n?void 0:n.length)&&l.push(e.warnings)}),e&&e(a.length?a:void 0,{warnings:l.length?l:void 0}),n?r(a.length?a:void 0):t({warnings:l.length?l:void 0})})})})},restoreValidation:function(){for(const e of lt(n)){const o=n[e];for(const e of o)e.restoreValidation()}}},{mergedClsPrefix:o})},render(){const{mergedClsPrefix:e}=this;return Ue("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},Ou.apply(this,arguments)}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$u(e)}function Bu(e,o){return Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Bu(e,o)}function Eu(e,o,n){return Eu=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,o,n){var t=[null];t.push.apply(t,o);var r=new(Function.bind.apply(e,t));return n&&Bu(r,n.prototype),r},Eu.apply(null,arguments)}function _u(e){var o="function"==typeof Map?new Map:void 0;return _u=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(e))return o.get(e);o.set(e,t)}function t(){return Eu(e,arguments,$u(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Bu(t,e)},_u(e)}var Du=/%[sdj%]/g;function Lu(e){if(!e||!e.length)return null;var o={};return e.forEach(function(e){var n=e.field;o[n]=o[n]||[],o[n].push(e)}),o}function Hu(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),t=1;t<o;t++)n[t-1]=arguments[t];var r=0,a=n.length;return"function"==typeof e?e.apply(null,n):"string"==typeof e?e.replace(Du,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(o){return"[Circular]"}default:return e}}):e}function ju(e,o){return null==e||(!("array"!==o||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(o)||"string"!=typeof e||e))}function Uu(e,o,n){var t=0,r=e.length;!function a(l){if(l&&l.length)n(l);else{var i=t;t+=1,i<r?o(e[i],a):n([])}}([])}var Wu=function(e){var o,n;function t(o,n){var t=e.call(this,"Async Validation Error")||this;return t.errors=o,t.fields=n,t}return n=e,(o=t).prototype=Object.create(n.prototype),o.prototype.constructor=o,Bu(o,n),t}(_u(Error));function Nu(e,o,n,t,r){if(o.first){var a=new Promise(function(o,a){Uu(function(e){var o=[];return Object.keys(e).forEach(function(n){o.push.apply(o,e[n]||[])}),o}(e),n,function(e){return t(e),e.length?a(new Wu(e,Lu(e))):o(r)})});return a.catch(function(e){return e}),a}var l=!0===o.firstFields?Object.keys(e):o.firstFields||[],i=Object.keys(e),s=i.length,d=0,c=[],u=new Promise(function(o,a){var u=function(e){if(c.push.apply(c,e),++d===s)return t(c),c.length?a(new Wu(c,Lu(c))):o(r)};i.length||(t(c),o(r)),i.forEach(function(o){var t=e[o];-1!==l.indexOf(o)?Uu(t,n,u):function(e,o,n){var t=[],r=0,a=e.length;function l(e){t.push.apply(t,e||[]),++r===a&&n(t)}e.forEach(function(e){o(e,l)})}(t,n,u)})});return u.catch(function(e){return e}),u}function Ku(e,o){return function(n){var t,r;return t=e.fullFields?function(e,o){for(var n=e,t=0;t<o.length;t++){if(null==n)return n;n=n[o[t]]}return n}(o,e.fullFields):o[n.field||e.fullField],(r=n)&&void 0!==r.message?(n.field=n.field||e.fullField,n.fieldValue=t,n):{message:"function"==typeof n?n():n,fieldValue:t,field:n.field||e.fullField}}}function Vu(e,o){if(o)for(var n in o)if(o.hasOwnProperty(n)){var t=o[n];"object"==typeof t&&"object"==typeof e[n]?e[n]=Ou({},e[n],t):e[n]=t}return e}var qu,Gu=function(e,o,n,t,r,a){!e.required||n.hasOwnProperty(e.field)&&!ju(o,a||e.type)||t.push(Hu(r.messages.required,e.fullField))},Ju=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Yu=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Zu={integer:function(e){return Zu.number(e)&&parseInt(e,10)===e},float:function(e){return Zu.number(e)&&!Zu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(o){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!Zu.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Ju)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(qu)return qu;var e="[a-fA-F\\d:]",o=function(o){return o&&o.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",t="[a-fA-F\\d]{1,4}",r=("\n(?:\n(?:"+t+":){7}(?:"+t+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+t+":){6}(?:"+n+"|:"+t+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+t+":){5}(?::"+n+"|(?::"+t+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+t+":){4}(?:(?::"+t+"){0,1}:"+n+"|(?::"+t+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+t+":){3}(?:(?::"+t+"){0,2}:"+n+"|(?::"+t+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+t+":){2}(?:(?::"+t+"){0,3}:"+n+"|(?::"+t+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+t+":){1}(?:(?::"+t+"){0,4}:"+n+"|(?::"+t+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+t+"){0,5}:"+n+"|(?::"+t+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+n+"$)|(?:^"+r+"$)"),l=new RegExp("^"+n+"$"),i=new RegExp("^"+r+"$"),s=function(e){return e&&e.exact?a:new RegExp("(?:"+o(e)+n+o(e)+")|(?:"+o(e)+r+o(e)+")","g")};s.v4=function(e){return e&&e.exact?l:new RegExp(""+o(e)+n+o(e),"g")},s.v6=function(e){return e&&e.exact?i:new RegExp(""+o(e)+r+o(e),"g")};var d=s.v4().source,c=s.v6().source;return qu=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+d+"|"+c+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(e){return"string"==typeof e&&!!e.match(Yu)}},Xu="enum",Qu={required:Gu,whitespace:function(e,o,n,t,r){(/^\s+$/.test(o)||""===o)&&t.push(Hu(r.messages.whitespace,e.fullField))},type:function(e,o,n,t,r){if(e.required&&void 0===o)Gu(e,o,n,t,r);else{var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?Zu[a](o)||t.push(Hu(r.messages.types[a],e.fullField,e.type)):a&&typeof o!==e.type&&t.push(Hu(r.messages.types[a],e.fullField,e.type))}},range:function(e,o,n,t,r){var a="number"==typeof e.len,l="number"==typeof e.min,i="number"==typeof e.max,s=o,d=null,c="number"==typeof o,u="string"==typeof o,p=Array.isArray(o);if(c?d="number":u?d="string":p&&(d="array"),!d)return!1;p&&(s=o.length),u&&(s=o.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?s!==e.len&&t.push(Hu(r.messages[d].len,e.fullField,e.len)):l&&!i&&s<e.min?t.push(Hu(r.messages[d].min,e.fullField,e.min)):i&&!l&&s>e.max?t.push(Hu(r.messages[d].max,e.fullField,e.max)):l&&i&&(s<e.min||s>e.max)&&t.push(Hu(r.messages[d].range,e.fullField,e.min,e.max))},enum:function(e,o,n,t,r){e[Xu]=Array.isArray(e[Xu])?e[Xu]:[],-1===e[Xu].indexOf(o)&&t.push(Hu(r.messages[Xu],e.fullField,e[Xu].join(", ")))},pattern:function(e,o,n,t,r){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(o)||t.push(Hu(r.messages.pattern.mismatch,e.fullField,o,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(o)||t.push(Hu(r.messages.pattern.mismatch,e.fullField,o,e.pattern))))}},ep=function(e,o,n,t,r){var a=e.type,l=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o,a)&&!e.required)return n();Qu.required(e,o,t,l,r,a),ju(o,a)||Qu.type(e,o,t,l,r)}n(l)},op={string:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o,"string")&&!e.required)return n();Qu.required(e,o,t,a,r,"string"),ju(o,"string")||(Qu.type(e,o,t,a,r),Qu.range(e,o,t,a,r),Qu.pattern(e,o,t,a,r),!0===e.whitespace&&Qu.whitespace(e,o,t,a,r))}n(a)},method:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&Qu.type(e,o,t,a,r)}n(a)},number:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(""===o&&(o=void 0),ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&(Qu.type(e,o,t,a,r),Qu.range(e,o,t,a,r))}n(a)},boolean:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&Qu.type(e,o,t,a,r)}n(a)},regexp:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),ju(o)||Qu.type(e,o,t,a,r)}n(a)},integer:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&(Qu.type(e,o,t,a,r),Qu.range(e,o,t,a,r))}n(a)},float:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&(Qu.type(e,o,t,a,r),Qu.range(e,o,t,a,r))}n(a)},array:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(null==o&&!e.required)return n();Qu.required(e,o,t,a,r,"array"),null!=o&&(Qu.type(e,o,t,a,r),Qu.range(e,o,t,a,r))}n(a)},object:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&Qu.type(e,o,t,a,r)}n(a)},enum:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r),void 0!==o&&Qu.enum(e,o,t,a,r)}n(a)},pattern:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o,"string")&&!e.required)return n();Qu.required(e,o,t,a,r),ju(o,"string")||Qu.pattern(e,o,t,a,r)}n(a)},date:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o,"date")&&!e.required)return n();var l;if(Qu.required(e,o,t,a,r),!ju(o,"date"))l=o instanceof Date?o:new Date(o),Qu.type(e,l,t,a,r),l&&Qu.range(e,l.getTime(),t,a,r)}n(a)},url:ep,hex:ep,email:ep,required:function(e,o,n,t,r){var a=[],l=Array.isArray(o)?"array":typeof o;Qu.required(e,o,t,a,r,l),n(a)},any:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(ju(o)&&!e.required)return n();Qu.required(e,o,t,a,r)}n(a)}};function np(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var tp=np(),rp=function(){function e(e){this.rules=null,this._messages=tp,this.define(e)}var o=e.prototype;return o.define=function(e){var o=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var t=e[n];o.rules[n]=Array.isArray(t)?t:[t]})},o.messages=function(e){return e&&(this._messages=Vu(np(),e)),this._messages},o.validate=function(o,n,t){var r=this;void 0===n&&(n={}),void 0===t&&(t=function(){});var a=o,l=n,i=t;if("function"==typeof l&&(i=l,l={}),!this.rules||0===Object.keys(this.rules).length)return i&&i(null,a),Promise.resolve(a);if(l.messages){var s=this.messages();s===tp&&(s=np()),Vu(s,l.messages),l.messages=s}else l.messages=this.messages();var d={};(l.keys||Object.keys(this.rules)).forEach(function(e){var n=r.rules[e],t=a[e];n.forEach(function(n){var l=n;"function"==typeof l.transform&&(a===o&&(a=Ou({},a)),t=a[e]=l.transform(t)),(l="function"==typeof l?{validator:l}:Ou({},l)).validator=r.getValidationMethod(l),l.validator&&(l.field=e,l.fullField=l.fullField||e,l.type=r.getType(l),d[e]=d[e]||[],d[e].push({rule:l,value:t,source:a,field:e}))})});var c={};return Nu(d,l,function(o,n){var t,r=o.rule,i=!("object"!==r.type&&"array"!==r.type||"object"!=typeof r.fields&&"object"!=typeof r.defaultField);function s(e,o){return Ou({},o,{fullField:r.fullField+"."+e,fullFields:r.fullFields?[].concat(r.fullFields,[e]):[e]})}function d(t){void 0===t&&(t=[]);var d=Array.isArray(t)?t:[t];!l.suppressWarning&&d.length&&e.warning("async-validator:",d),d.length&&void 0!==r.message&&(d=[].concat(r.message));var u=d.map(Ku(r,a));if(l.first&&u.length)return c[r.field]=1,n(u);if(i){if(r.required&&!o.value)return void 0!==r.message?u=[].concat(r.message).map(Ku(r,a)):l.error&&(u=[l.error(r,Hu(l.messages.required,r.field))]),n(u);var p={};r.defaultField&&Object.keys(o.value).map(function(e){p[e]=r.defaultField}),p=Ou({},p,o.rule.fields);var h={};Object.keys(p).forEach(function(e){var o=p[e];h[e]=(Array.isArray(o)?o:[o]).map(s.bind(null,e))});var f=new e(h);f.messages(l.messages),o.rule.options&&(o.rule.options.messages=l.messages,o.rule.options.error=l.error),f.validate(o.value,o.rule.options||l,function(e){var o=[];u&&u.length&&o.push.apply(o,u),e&&e.length&&o.push.apply(o,e),n(o.length?o:null)})}else n(u)}if(i=i&&(r.required||!r.required&&o.value),r.field=o.field,r.asyncValidator)t=r.asyncValidator(r,o.value,d,o.source,l);else if(r.validator){try{t=r.validator(r,o.value,d,o.source,l)}catch(u){console.error,l.suppressValidatorError||setTimeout(function(){throw u},0),d(u.message)}!0===t?d():!1===t?d("function"==typeof r.message?r.message(r.fullField||r.field):r.message||(r.fullField||r.field)+" fails"):t instanceof Array?d(t):t instanceof Error&&d(t.message)}t&&t.then&&t.then(function(){return d()},function(e){return d(e)})},function(e){!function(e){var o=[],n={};function t(e){var n;Array.isArray(e)?o=(n=o).concat.apply(n,e):o.push(e)}for(var r=0;r<e.length;r++)t(e[r]);o.length?(n=Lu(o),i(o,n)):i(null,a)}(e)},a)},o.getType=function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!op.hasOwnProperty(e.type))throw new Error(Hu("Unknown rule type %s",e.type));return e.type||"string"},o.getValidationMethod=function(e){if("function"==typeof e.validator)return e.validator;var o=Object.keys(e),n=o.indexOf("message");return-1!==n&&o.splice(n,1),1===o.length&&"required"===o[0]?op.required:op[this.getType(e)]||void 0},e}();rp.register=function(e,o){if("function"!=typeof o)throw new Error("Cannot register a validator by type, validator is not a function");op[e]=o},rp.warning=function(){},rp.messages=tp,rp.validators=op;var{cubicBezierEaseInOut:ap}=d;var lp=G("form-item","\n display: grid;\n line-height: var(--n-line-height);\n",[G("form-item-label","\n grid-area: label;\n align-items: center;\n line-height: 1.25;\n text-align: var(--n-label-text-align);\n font-size: var(--n-label-font-size);\n min-height: var(--n-label-height);\n padding: var(--n-label-padding);\n color: var(--n-label-text-color);\n transition: color .3s var(--n-bezier);\n box-sizing: border-box;\n font-weight: var(--n-label-font-weight);\n ",[we("asterisk","\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n color: var(--n-asterisk-color);\n transition: color .3s var(--n-bezier);\n "),we("asterisk-placeholder","\n grid-area: mark;\n user-select: none;\n -webkit-user-select: none;\n visibility: hidden; \n ")]),G("form-item-blank","\n grid-area: blank;\n min-height: var(--n-blank-height);\n "),ze("auto-label-width",[G("form-item-label","white-space: nowrap;")]),ze("left-labelled",'\n grid-template-areas:\n "label blank"\n "label feedback";\n grid-template-columns: auto minmax(0, 1fr);\n grid-template-rows: auto 1fr;\n align-items: flex-start;\n ',[G("form-item-label","\n display: grid;\n grid-template-columns: 1fr auto;\n min-height: var(--n-blank-height);\n height: auto;\n box-sizing: border-box;\n flex-shrink: 0;\n flex-grow: 0;\n ",[ze("reverse-columns-space","\n grid-template-columns: auto 1fr;\n "),ze("left-mark",'\n grid-template-areas:\n "mark text"\n ". text";\n '),ze("right-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),ze("right-hanging-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),we("text","\n grid-area: text; \n "),we("asterisk","\n grid-area: mark; \n align-self: end;\n ")])]),ze("top-labelled",'\n grid-template-areas:\n "label"\n "blank"\n "feedback";\n grid-template-rows: minmax(var(--n-label-height), auto) 1fr;\n grid-template-columns: minmax(0, 100%);\n ',[ze("no-label",'\n grid-template-areas:\n "blank"\n "feedback";\n grid-template-rows: 1fr;\n '),G("form-item-label","\n display: flex;\n align-items: flex-start;\n justify-content: var(--n-label-text-align);\n ")]),G("form-item-blank","\n box-sizing: border-box;\n display: flex;\n align-items: center;\n position: relative;\n "),G("form-item-feedback-wrapper","\n grid-area: feedback;\n box-sizing: border-box;\n min-height: var(--n-feedback-height);\n font-size: var(--n-feedback-font-size);\n line-height: 1.25;\n transform-origin: top left;\n ",[Z("&:not(:empty)","\n padding: var(--n-feedback-padding);\n "),G("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[ze("warning",{color:"var(--n-feedback-text-color-warning)"}),ze("error",{color:"var(--n-feedback-text-color-error)"}),function({name:e="fade-down",fromOffset:o="-4px",enterDuration:n=".3s",leaveDuration:t=".3s",enterCubicBezier:r=ap,leaveCubicBezier:a=ap}={}){return[Z(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${o})`}),Z(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),Z(`&.${e}-transition-leave-active`,{transition:`opacity ${t} ${a}, transform ${t} ${a}`}),Z(`&.${e}-transition-enter-active`,{transition:`opacity ${n} ${r}, transform ${n} ${r}`})]}({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var ip=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})},sp=Object.assign(Object.assign({},g.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]});lt(sp);function dp(e,o){return(...n)=>{try{const t=e(...n);return!o&&("boolean"==typeof t||t instanceof Error||Array.isArray(t))||(null==t?void 0:t.then)?t:(void 0===t||y("form-item/validate",`You return a ${typeof t} typed value in the validator method, which is not recommended. Please use ${o?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(t){return void y("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation.")}}}var cp=Me({name:"FormItem",props:sp,setup(e){Kt(zu,"formItems",lo(e,"path"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=We(Au,null),r=function(e){const o=We(Au,null);return{mergedSize:to(()=>void 0!==e.size?e.size:void 0!==(null==o?void 0:o.props.size)?o.props.size:"medium")}}(e),a=function(e){const o=We(Au,null),n=to(()=>{const{labelPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.labelPlacement)?o.props.labelPlacement:"top"}),t=to(()=>"left"===n.value&&("auto"===e.labelWidth||"auto"===(null==o?void 0:o.props.labelWidth))),r=to(()=>{if("top"===n.value)return;const{labelWidth:r}=e;if(void 0!==r&&"auto"!==r)return oe(r);if(t.value){const e=null==o?void 0:o.maxChildLabelWidthRef.value;return void 0!==e?oe(e):void 0}return void 0!==(null==o?void 0:o.props.labelWidth)?oe(o.props.labelWidth):void 0}),a=to(()=>{const{labelAlign:n}=e;return n||((null==o?void 0:o.props.labelAlign)?o.props.labelAlign:void 0)}),l=to(()=>{var o;return[null===(o=e.labelProps)||void 0===o?void 0:o.style,e.labelStyle,{width:r.value}]}),i=to(()=>{const{showRequireMark:n}=e;return void 0!==n?n:null==o?void 0:o.props.showRequireMark}),s=to(()=>{const{requireMarkPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.requireMarkPlacement)||"right"}),d=Io(!1),c=Io(!1);return{validationErrored:d,validationWarned:c,mergedLabelStyle:l,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:i,mergedRequireMarkPlacement:s,mergedValidationStatus:to(()=>{const{validationStatus:o}=e;return void 0!==o?o:d.value?"error":c.value?"warning":void 0}),mergedShowFeedback:to(()=>{const{showFeedback:n}=e;return void 0!==n?n:void 0===(null==o?void 0:o.props.showFeedback)||o.props.showFeedback}),mergedShowLabel:to(()=>{const{showLabel:n}=e;return void 0!==n?n:void 0===(null==o?void 0:o.props.showLabel)||o.props.showLabel}),isAutoLabelWidth:t}}(e),{validationErrored:l,validationWarned:i}=a,{mergedRequired:s,mergedRules:d}=function(e){const o=We(Au,null),n=to(()=>{const{rulePath:o}=e;if(void 0!==o)return o;const{path:n}=e;return void 0!==n?n:void 0}),t=to(()=>{const t=[],{rule:r}=e;if(void 0!==r&&(Array.isArray(r)?t.push(...r):t.push(r)),o){const{rules:e}=o.props,{value:r}=n;if(void 0!==e&&void 0!==r){const o=Xn(e,r);void 0!==o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}),r=to(()=>t.value.some(e=>e.required));return{mergedRules:t,mergedRequired:to(()=>r.value||e.required)}}(e),{mergedSize:c}=r,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:h}=a,f=Io([]),m=Io(fe()),v=t?lo(t.props,"disabled"):Io(!1),b=g("Form","-form-item",lp,Rt,e,o);function y(){f.value=[],l.value=!1,i.value=!1,e.feedback&&(m.value=fe())}Xe(lo(e,"path"),()=>{e.ignorePathChange||y()});const x=(...o)=>ip(this,[...o],void 0,function*(o=null,n=()=>!0,r={suppressWarning:!0}){const{path:a}=e;r?r.first||(r.first=e.first):r={};const{value:s}=d,c=t?Xn(t.props.model,a||""):void 0,u={},p={},h=(o?s.filter(e=>Array.isArray(e.trigger)?e.trigger.includes(o):e.trigger===o):s).filter(n).map((e,o)=>{const n=Object.assign({},e);if(n.validator&&(n.validator=dp(n.validator,!1)),n.asyncValidator&&(n.asyncValidator=dp(n.asyncValidator,!0)),n.renderMessage){const e=`__renderMessage__${o}`;p[e]=n.message,n.message=e,u[e]=n.renderMessage}return n}),m=h.filter(e=>"warning"!==e.level),v=h.filter(e=>"warning"===e.level),g={valid:!0,errors:void 0,warnings:void 0};if(!h.length)return g;const b=null!=a?a:"__n_no_path__",x=new rp({[b]:m}),C=new rp({[b]:v}),{validateMessages:w}=(null==t?void 0:t.props)||{};w&&(x.messages(w),C.messages(w));const S=e=>{f.value=e.map(e=>{const o=(null==e?void 0:e.message)||"";return{key:o,render:()=>o.startsWith("__renderMessage__")?u[o]():o}}),e.forEach(e=>{var o;(null===(o=e.message)||void 0===o?void 0:o.startsWith("__renderMessage__"))&&(e.message=p[e.message])})};if(m.length){const e=yield new Promise(e=>{x.validate({[b]:c},r,e)});(null==e?void 0:e.length)&&(g.valid=!1,g.errors=e,S(e))}if(v.length&&!g.errors){const e=yield new Promise(e=>{C.validate({[b]:c},r,e)});(null==e?void 0:e.length)&&(S(e),g.warnings=e)}return g.errors||g.warnings?(l.value=!!g.errors,i.value=!!g.warnings):y(),g});Ee(ue,{path:lo(e,"path"),disabled:v,mergedSize:r.mergedSize,mergedValidationStatus:a.mergedValidationStatus,restoreValidation:y,handleContentBlur:function(){x("blur")},handleContentChange:function(){x("change")},handleContentFocus:function(){x("focus")},handleContentInput:function(){x("input")}});const C={validate:function(e,o){return ip(this,void 0,void 0,function*(){let n,t,r,a;return"string"==typeof e?(n=e,t=o):null!==e&&"object"==typeof e&&(n=e.trigger,t=e.callback,r=e.shouldRuleBeApplied,a=e.options),yield new Promise((e,o)=>{x(n,r,a).then(({valid:n,errors:r,warnings:a})=>{n?(t&&t(void 0,{warnings:a}),e({warnings:a})):(t&&t(r,{warnings:a}),o(r))})})})},restoreValidation:y,internalValidate:x},w=Io(null);Je(()=>{if(!a.isAutoLabelWidth.value)return;const e=w.value;if(null!==e){const o=e.style.whiteSpace;e.style.whiteSpace="nowrap",e.style.width="",null==t||t.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=o}});const S=to(()=>{var e;const{value:o}=c,{value:n}=u,t="top"===n?"vertical":"horizontal",{common:{cubicBezierEaseInOut:r},self:{labelTextColor:a,asteriskColor:l,lineHeight:i,feedbackTextColor:s,feedbackTextColorWarning:d,feedbackTextColorError:h,feedbackPadding:f,labelFontWeight:m,[Te("labelHeight",o)]:v,[Te("blankHeight",o)]:g,[Te("feedbackFontSize",o)]:y,[Te("feedbackHeight",o)]:x,[Te("labelPadding",t)]:C,[Te("labelTextAlign",t)]:w,[Te(Te("labelFontSize",n),o)]:S}}=b.value;let k=null!==(e=p.value)&&void 0!==e?e:w;return"top"===n&&(k="right"===k?"flex-end":"flex-start"),{"--n-bezier":r,"--n-line-height":i,"--n-blank-height":g,"--n-label-font-size":S,"--n-label-text-align":k,"--n-label-height":v,"--n-label-padding":C,"--n-label-font-weight":m,"--n-asterisk-color":l,"--n-label-text-color":a,"--n-feedback-padding":f,"--n-feedback-font-size":y,"--n-feedback-height":x,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":d,"--n-feedback-text-color-error":h}}),k=n?X("form-item",to(()=>{var e;return`${c.value[0]}${u.value[0]}${(null===(e=p.value)||void 0===e?void 0:e[0])||""}`}),S,e):void 0,P=to(()=>"left"===u.value&&"left"===h.value&&"left"===p.value);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:w,mergedClsPrefix:o,mergedRequired:s,feedbackId:m,renderExplains:f,reverseColSpace:P},a),r),C),{cssVars:n?void 0:S,themeClass:null==k?void 0:k.themeClass,onRender:null==k?void 0:k.onRender})},render(){const{$slots:e,mergedClsPrefix:o,mergedShowLabel:n,mergedShowRequireMark:t,mergedRequireMarkPlacement:r,onRender:l}=this,i=void 0!==t?t:this.mergedRequired;null==l||l();return Ue("div",{class:[`${o}-form-item`,this.themeClass,`${o}-form-item--${this.mergedSize}-size`,`${o}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${o}-form-item--auto-label-width`,!n&&`${o}-form-item--no-label`],style:this.cssVars},n&&(()=>{const e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;const n=Ue("span",{class:`${o}-form-item-label__text`},e),t=i?Ue("span",{class:`${o}-form-item-label__asterisk`},"left"!==r?" *":"* "):"right-hanging"===r&&Ue("span",{class:`${o}-form-item-label__asterisk-placeholder`}," *"),{labelProps:a}=this;return Ue("label",Object.assign({},a,{class:[null==a?void 0:a.class,`${o}-form-item-label`,`${o}-form-item-label--${r}-mark`,this.reverseColSpace&&`${o}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),"left"===r?[t,n]:[n,t])})(),Ue("div",{class:[`${o}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${o}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?Ue("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${o}-form-item-feedback-wrapper`,this.feedbackClass]},Ue(go,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:n}=this;return a(e.feedback,e=>{var t;const{feedback:r}=this,a=e||r?Ue("div",{key:"__feedback__",class:`${o}-form-item-feedback__line`},e||r):this.renderExplains.length?null===(t=this.renderExplains)||void 0===t?void 0:t.map(({key:e,render:n})=>Ue("div",{key:e,class:`${o}-form-item-feedback__line`},n())):null;return a?Ue("div","warning"===n?{key:"controlled-warning",class:`${o}-form-item-feedback ${o}-form-item-feedback--warning`}:"error"===n?{key:"controlled-error",class:`${o}-form-item-feedback ${o}-form-item-feedback--error`}:"success"===n?{key:"controlled-success",class:`${o}-form-item-feedback ${o}-form-item-feedback--success`}:{key:"controlled-default",class:`${o}-form-item-feedback`},a):null})}})):null)}});function up(e){const{borderRadius:o,fontSizeMini:n,fontSizeTiny:t,fontSizeSmall:r,fontWeight:a,textColor2:l,cardColor:i,buttonColor2Hover:s}=e;return{activeColors:["#9be9a8","#40c463","#30a14e","#216e39"],borderRadius:o,borderColor:i,textColor:l,mininumColor:s,fontWeight:a,loadingColorStart:"rgba(0, 0, 0, 0.06)",loadingColorEnd:"rgba(0, 0, 0, 0.12)",rectSizeSmall:"10px",rectSizeMedium:"11px",rectSizeLarge:"12px",borderRadiusSmall:"2px",borderRadiusMedium:"2px",borderRadiusLarge:"2px",xGapSmall:"2px",xGapMedium:"3px",xGapLarge:"3px",yGapSmall:"2px",yGapMedium:"3px",yGapLarge:"3px",fontSizeSmall:t,fontSizeMedium:n,fontSizeLarge:r}}var pp=m({name:"Heatmap",common:t,self:up}),hp={name:"Heatmap",common:Sa,self(e){const o=up(e);return Object.assign(Object.assign({},o),{activeColors:["#0d4429","#006d32","#26a641","#39d353"],mininumColor:"rgba(255, 255, 255, 0.1)",loadingColorStart:"rgba(255, 255, 255, 0.12)",loadingColorEnd:"rgba(255, 255, 255, 0.18)"})}};function fp(e){const{primaryColor:o,baseColor:n}=e;return{color:o,iconColor:n}}var mp={name:"IconWrapper",common:t,self:fp},vp={name:"IconWrapper",common:Sa,self:fp},gp={name:"Image",common:Sa,peers:{Tooltip:Gi},self:e=>{const{textColor2:o}=e;return{toolbarIconColor:o,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}};var bp=m({name:"Image",common:t,peers:{Tooltip:Ji},self:function(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}}),yp=Z([G("input-number-suffix","\n display: inline-block;\n margin-right: 10px;\n "),G("input-number-prefix","\n display: inline-block;\n margin-left: 10px;\n ")]);function xp(e){return null==e||"string"==typeof e&&""===e.trim()?null:Number(e)}function Cp(e){return null==e||!Number.isNaN(e)}function wp(e,o){return"number"!=typeof e?"":void 0===o?String(e):e.toFixed(o)}function Sp(e){if(null===e)return null;if("number"==typeof e)return e;{const o=Number(e);return Number.isNaN(o)?null:o}}var kp=Me({name:"InputNumber",props:Object.assign(Object.assign({},g.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(o){const{mergedBorderedRef:n,mergedClsPrefixRef:t,mergedRtlRef:r}=J(o),a=g("InputNumber","-input-number",yp,nc,o,t),{localeRef:l}=h("InputNumber"),i=ae(o),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:c}=i,u=Io(null),f=Io(null),m=Io(null),v=Io(o.defaultValue),b=lo(o,"value"),y=w(b,v),x=Io(""),C=e=>{const o=String(e).split(".")[1];return o?o.length:0},S=e(()=>{const{placeholder:e}=o;return void 0!==e?e:l.value.placeholder}),k=e(()=>{const e=Sp(o.step);return null!==e?0===e?1:Math.abs(e):1}),P=e(()=>{const e=Sp(o.min);return null!==e?e:null}),T=e(()=>{const e=Sp(o.max);return null!==e?e:null}),I=()=>{const{value:e}=y;if(Cp(e)){const{format:n,precision:t}=o;n?x.value=n(e):null===e||void 0===t||C(e)>t?x.value=wp(e,void 0):x.value=wp(e,t)}else x.value=String(e)};I();const A=e=>{const{value:n}=y;if(e===n)return void I();const{"onUpdate:value":t,onUpdateValue:r,onChange:a}=o,{nTriggerFormInput:l,nTriggerFormChange:s}=i;a&&z(a,e),r&&z(r,e),t&&z(t,e),v.value=e,l(),s()},R=({offset:e,doUpdateIfValid:n,fixPrecision:t,isInputing:r})=>{const{value:a}=x;if(r&&((l=a).includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(l)||/^-?\d*$/.test(l))||"-"===l||"-0"===l))return!1;var l;const i=(o.parse||xp)(a);if(null===i)return n&&A(null),null;if(Cp(i)){const a=C(i),{precision:l}=o;if(void 0!==l&&l<a&&!t)return!1;let s=Number.parseFloat((i+e).toFixed(null!=l?l:(e=>{const n=[o.min,o.max,o.step,e].map(e=>void 0===e?0:C(e));return Math.max(...n)})(i)));if(Cp(s)){const{value:e}=T,{value:t}=P;if(null!==e&&s>e){if(!n||r)return!1;s=e}if(null!==t&&s<t){if(!n||r)return!1;s=t}return!(o.validator&&!o.validator(s))&&(n&&A(s),s)}}return!1},M=e(()=>!1===R({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})),F=e(()=>{const{value:e}=y;if(o.validator&&null===e)return!1;const{value:n}=k;return!1!==R({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})}),O=e(()=>{const{value:e}=y;if(o.validator&&null===e)return!1;const{value:n}=k;return!1!==R({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})});function $(){const{value:e}=O;if(!e)return void N();const{value:n}=y;if(null===n)o.validator||A(D());else{const{value:e}=k;R({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function B(){const{value:e}=F;if(!e)return void U();const{value:n}=y;if(null===n)o.validator||A(D());else{const{value:e}=k;R({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const E=function(e){const{onFocus:n}=o,{nTriggerFormFocus:t}=i;n&&z(n,e),t()},_=function(e){var n,t;if(e.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;const r=R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(!1!==r){const e=null===(t=u.value)||void 0===t?void 0:t.inputElRef;e&&(e.value=String(r||"")),y.value===r&&I()}else I();const{onBlur:a}=o,{nTriggerFormBlur:l}=i;a&&z(a,e),l(),De(()=>{I()})};function D(){if(o.validator)return null;const{value:e}=P,{value:n}=T;return null!==e?Math.max(0,e):null!==n?Math.min(0,n):0}let L=null,H=null,j=null;function U(){j&&(window.clearTimeout(j),j=null),L&&(window.clearInterval(L),L=null)}let W=null;function N(){W&&(window.clearTimeout(W),W=null),H&&(window.clearInterval(H),H=null)}Xe(y,()=>{I()});const K={focus:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.focus()},blur:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.blur()},select:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.select()}},V=p("InputNumber",r,t);return Object.assign(Object.assign({},K),{rtlEnabled:V,inputInstRef:u,minusButtonInstRef:f,addButtonInstRef:m,mergedClsPrefix:t,mergedBordered:n,uncontrolledValue:v,mergedValue:y,mergedPlaceholder:S,displayedValueInvalid:M,mergedSize:s,mergedDisabled:d,displayedValue:x,addable:O,minusable:F,mergedStatus:c,handleFocus:E,handleBlur:_,handleClear:function(e){!function(e){const{onClear:n}=o;n&&z(n,e)}(e),A(null)},handleMouseDown:function(e){var o,n,t;(null===(o=m.value)||void 0===o?void 0:o.$el.contains(e.target))&&e.preventDefault(),(null===(n=f.value)||void 0===n?void 0:n.$el.contains(e.target))&&e.preventDefault(),null===(t=u.value)||void 0===t||t.activate()},handleAddClick:()=>{H||$()},handleMinusClick:()=>{L||B()},handleAddMousedown:function(){N(),W=window.setTimeout(()=>{H=window.setInterval(()=>{$()},100)},800),ie("mouseup",document,N,{once:!0})},handleMinusMousedown:function(){U(),j=window.setTimeout(()=>{L=window.setInterval(()=>{B()},100)},800),ie("mouseup",document,U,{once:!0})},handleKeyDown:function(e){var n,t;if("Enter"===e.key){if(e.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&(null===(t=u.value)||void 0===t||t.deactivate())}else if("ArrowUp"===e.key){if(!O.value)return;if(!1===o.keyboard.ArrowUp)return;e.preventDefault(),!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&$()}else if("ArrowDown"===e.key){if(!F.value)return;if(!1===o.keyboard.ArrowDown)return;e.preventDefault(),!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&B()}},handleUpdateDisplayedValue:function(e){x.value=e,!o.updateValueOnInput||o.format||o.parse||void 0!==o.precision||R({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})},mergedTheme:a,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:to(()=>{const{self:{iconColorDisabled:e}}=a.value,[o,n,t,r]=ve(e);return{textColorTextDisabled:`rgb(${o}, ${n}, ${t})`,opacityDisabled:`${r}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,n=()=>Ue(U,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Ie(o["minus-icon"],()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(br,null)})])}),t=()=>Ue(U,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Ie(o["add-icon"],()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(cr,null)})])});return Ue("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},Ue(Ol,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var t;return this.showButton&&"both"===this.buttonPlacement?[n(),a(o.prefix,o=>o?Ue("span",{class:`${e}-input-number-prefix`},o):null)]:null===(t=o.prefix)||void 0===t?void 0:t.call(o)},suffix:()=>{var r;return this.showButton?[a(o.suffix,o=>o?Ue("span",{class:`${e}-input-number-suffix`},o):null),"right"===this.buttonPlacement?n():null,t()]:null===(r=o.suffix)||void 0===r?void 0:r.call(o)}}))}}),Pp={extraFontSize:"12px",width:"440px"},Tp={name:"Transfer",common:Sa,peers:{Checkbox:fi,Scrollbar:ka,Input:Tl,Empty:Ga,Button:ai},self(e){const{iconColorDisabled:o,iconColor:n,fontWeight:t,fontSizeLarge:r,fontSizeMedium:a,fontSizeSmall:l,heightLarge:i,heightMedium:s,heightSmall:d,borderRadius:c,inputColor:u,tableHeaderColor:p,textColor1:h,textColorDisabled:f,textColor2:m,hoverColor:v}=e;return Object.assign(Object.assign({},Pp),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:i,fontSizeSmall:l,fontSizeMedium:a,fontSizeLarge:r,borderRadius:c,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:h,titleTextColorDisabled:f,extraTextColor:m,filterDividerColor:"#0000",itemTextColor:m,itemTextColorDisabled:f,itemColorPending:v,titleFontWeight:t,iconColor:n,iconColorDisabled:o})}};var Ip=m({name:"Transfer",common:t,peers:{Checkbox:at,Scrollbar:Pe,Input:Vn,Empty:B,Button:te},self:function(e){const{fontWeight:o,iconColorDisabled:n,iconColor:t,fontSizeLarge:r,fontSizeMedium:a,fontSizeSmall:l,heightLarge:i,heightMedium:s,heightSmall:d,borderRadius:c,cardColor:u,tableHeaderColor:p,textColor1:h,textColorDisabled:f,textColor2:m,borderColor:v,hoverColor:g}=e;return Object.assign(Object.assign({},Pp),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:i,fontSizeSmall:l,fontSizeMedium:a,fontSizeLarge:r,borderRadius:c,borderColor:v,listColor:u,headerColor:de(u,p),titleTextColor:h,titleTextColorDisabled:f,extraTextColor:m,filterDividerColor:v,itemTextColor:m,itemTextColorDisabled:f,itemColorPending:g,titleFontWeight:o,iconColor:t,iconColorDisabled:n})}});function Ap(){return{}}var zp={name:"Marquee",common:t,self:Ap},Rp={name:"Marquee",common:Sa,self:Ap},Mp={name:"QrCode",common:Sa,self:e=>({borderRadius:e.borderRadius})};var Fp={name:"QrCode",common:t,self:function(e){return{borderRadius:e.borderRadius}}},Op=Me({name:"Scrollbar",props:Object.assign(Object.assign({},g.props),{trigger:String,xScrollable:Boolean,onScroll:Function,contentClass:String,contentStyle:[Object,String],size:Number,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),setup(){const e=Io(null);return Object.assign(Object.assign({},{scrollTo:(...o)=>{var n;null===(n=e.value)||void 0===n||n.scrollTo(o[0],o[1])},scrollBy:(...o)=>{var n;null===(n=e.value)||void 0===n||n.scrollBy(o[0],o[1])}}),{scrollbarInstRef:e})},render(){return Ue(Ae,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),$p={name:"Skeleton",common:Sa,self(e){const{heightSmall:o,heightMedium:n,heightLarge:t,borderRadius:r}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:r,heightSmall:o,heightMedium:n,heightLarge:t}}};var Bp={name:"Skeleton",common:t,self:function(e){const{heightSmall:o,heightMedium:n,heightLarge:t,borderRadius:r}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:r,heightSmall:o,heightMedium:n,heightLarge:t}}},Ep=Z([Z("@keyframes spin-rotate","\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n "),G("spin-container","\n position: relative;\n ",[G("spin-body","\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[ke()])]),G("spin-body","\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n "),G("spin","\n display: inline-flex;\n height: var(--n-size);\n width: var(--n-size);\n font-size: var(--n-size);\n color: var(--n-color);\n ",[ze("rotate","\n animation: spin-rotate 2s linear infinite;\n ")]),G("spin-description","\n display: inline-block;\n font-size: var(--n-font-size);\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n margin-top: 8px;\n "),G("spin-content","\n opacity: 1;\n transition: opacity .3s var(--n-bezier);\n pointer-events: all;\n ",[ze("spinning","\n user-select: none;\n -webkit-user-select: none;\n pointer-events: none;\n opacity: var(--n-opacity-spinning);\n ")])]),_p={small:20,medium:18,large:16},Dp=Me({name:"Spin",props:Object.assign(Object.assign({},g.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),slots:Object,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=g("Spin","-spin",Ep,he,e,o),r=to(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:r}=t.value,{opacitySpinning:a,color:l,textColor:i}=r;return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":"number"==typeof o?V(o):r[Te("size",o)],"--n-color":l,"--n-text-color":i}}),a=n?X("spin",to(()=>{const{size:o}=e;return"number"==typeof o?String(o):o[0]}),r,e):void 0,l=F(e,["spinning","show"]),i=Io(!1);return Ke(o=>{let n;if(l.value){const{delay:t}=e;if(t)return n=window.setTimeout(()=>{i.value=!0},t),void o(()=>{clearTimeout(n)})}i.value=l.value}),{mergedClsPrefix:o,active:i,mergedStrokeWidth:to(()=>{const{strokeWidth:o}=e;if(void 0!==o)return o;const{size:n}=e;return _p["number"==typeof n?"medium":n]}),cssVars:n?void 0:r,themeClass:null==a?void 0:a.themeClass,onRender:null==a?void 0:a.onRender}},render(){var e,o;const{$slots:n,mergedClsPrefix:t,description:r}=this,a=n.icon&&this.rotate,l=(r||n.description)&&Ue("div",{class:`${t}-spin-description`},r||(null===(e=n.description)||void 0===e?void 0:e.call(n))),i=n.icon?Ue("div",{class:[`${t}-spin-body`,this.themeClass]},Ue("div",{class:[`${t}-spin`,a&&`${t}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),l):Ue("div",{class:[`${t}-spin-body`,this.themeClass]},Ue(I,{clsPrefix:t,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${t}-spin`}),l);return null===(o=this.onRender)||void 0===o||o.call(this),n.default?Ue("div",{class:[`${t}-spin-container`,this.themeClass],style:this.cssVars},Ue("div",{class:[`${t}-spin-content`,this.active&&`${t}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),Ue(go,{name:"fade-in-transition"},{default:()=>this.active?i:null})):i}}),Lp={name:"Split",common:Sa};var Hp,jp={name:"Split",common:t,self:function(e){const{primaryColorHover:o,borderColor:n}=e;return{resizableTriggerColorHover:o,resizableTriggerColor:n}}},Up=G("switch","\n height: var(--n-height);\n min-width: var(--n-width);\n vertical-align: middle;\n user-select: none;\n -webkit-user-select: none;\n display: inline-flex;\n outline: none;\n justify-content: center;\n align-items: center;\n",[we("children-placeholder","\n height: var(--n-rail-height);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: none;\n visibility: hidden;\n "),we("rail-placeholder","\n display: flex;\n flex-wrap: none;\n "),we("button-placeholder","\n width: calc(1.75 * var(--n-rail-height));\n height: var(--n-rail-height);\n "),G("base-loading","\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n font-size: calc(var(--n-button-width) - 4px);\n color: var(--n-loading-color);\n transition: color .3s var(--n-bezier);\n ",[b({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),we("checked, unchecked","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n box-sizing: border-box;\n position: absolute;\n white-space: nowrap;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n line-height: 1;\n "),we("checked","\n right: 0;\n padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),we("unchecked","\n left: 0;\n justify-content: flex-end;\n padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),Z("&:focus",[we("rail","\n box-shadow: var(--n-box-shadow-focus);\n ")]),ze("round",[we("rail","border-radius: calc(var(--n-rail-height) / 2);",[we("button","border-radius: calc(var(--n-button-height) / 2);")])]),H("disabled",[H("icon",[ze("rubber-band",[ze("pressed",[we("rail",[we("button","max-width: var(--n-button-width-pressed);")])]),we("rail",[Z("&:active",[we("button","max-width: var(--n-button-width-pressed);")])]),ze("active",[ze("pressed",[we("rail",[we("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),we("rail",[Z("&:active",[we("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),ze("active",[we("rail",[we("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),we("rail","\n overflow: hidden;\n height: var(--n-rail-height);\n min-width: var(--n-rail-width);\n border-radius: var(--n-rail-border-radius);\n cursor: pointer;\n position: relative;\n transition:\n opacity .3s var(--n-bezier),\n background .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n background-color: var(--n-rail-color);\n ",[we("button-icon","\n color: var(--n-icon-color);\n transition: color .3s var(--n-bezier);\n font-size: calc(var(--n-button-height) - 4px);\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: 1;\n ",[b()]),we("button",'\n align-items: center; \n top: var(--n-offset);\n left: var(--n-offset);\n height: var(--n-button-height);\n width: var(--n-button-width-pressed);\n max-width: var(--n-button-width);\n border-radius: var(--n-button-border-radius);\n background-color: var(--n-button-color);\n box-shadow: var(--n-button-box-shadow);\n box-sizing: border-box;\n cursor: inherit;\n content: "";\n position: absolute;\n transition:\n background-color .3s var(--n-bezier),\n left .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n max-width .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ')]),ze("active",[we("rail","background-color: var(--n-rail-color-active);")]),ze("loading",[we("rail","\n cursor: wait;\n ")]),ze("disabled",[we("rail","\n cursor: not-allowed;\n opacity: .5;\n ")])]),Wp=Me({name:"Switch",props:Object.assign(Object.assign({},g.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]}),slots:Object,setup(e){void 0===Hp&&(Hp="undefined"==typeof CSS||void 0!==CSS.supports&&CSS.supports("width","max(1px)"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=g("Switch","-switch",Up,Yc,e,o),r=ae(e),{mergedSizeRef:a,mergedDisabledRef:l}=r,i=Io(e.defaultValue),s=lo(e,"value"),d=w(s,i),c=to(()=>d.value===e.checkedValue),u=Io(!1),p=Io(!1),h=to(()=>{const{railStyle:o}=e;if(o)return o({focused:p.value,checked:c.value})});function f(o){const{"onUpdate:value":n,onChange:t,onUpdateValue:a}=e,{nTriggerFormInput:l,nTriggerFormChange:s}=r;n&&z(n,o),a&&z(a,o),t&&z(t,o),i.value=o,l(),s()}const m=to(()=>{const{value:e}=a,{self:{opacityDisabled:o,railColor:n,railColorActive:r,buttonBoxShadow:l,buttonColor:i,boxShadowFocus:s,loadingColor:d,textColor:c,iconColor:u,[Te("buttonHeight",e)]:p,[Te("buttonWidth",e)]:h,[Te("buttonWidthPressed",e)]:f,[Te("railHeight",e)]:m,[Te("railWidth",e)]:v,[Te("railBorderRadius",e)]:g,[Te("buttonBorderRadius",e)]:b},common:{cubicBezierEaseInOut:y}}=t.value;let x,C,w;return Hp?(x=`calc((${m} - ${p}) / 2)`,C=`max(${m}, ${p})`,w=`max(${v}, calc(${v} + ${p} - ${m}))`):(x=V((re(m)-re(p))/2),C=V(Math.max(re(m),re(p))),w=re(m)>re(p)?v:V(re(v)+re(p)-re(m))),{"--n-bezier":y,"--n-button-border-radius":b,"--n-button-box-shadow":l,"--n-button-color":i,"--n-button-width":h,"--n-button-width-pressed":f,"--n-button-height":p,"--n-height":C,"--n-offset":x,"--n-opacity-disabled":o,"--n-rail-border-radius":g,"--n-rail-color":n,"--n-rail-color-active":r,"--n-rail-height":m,"--n-rail-width":v,"--n-width":w,"--n-box-shadow-focus":s,"--n-loading-color":d,"--n-text-color":c,"--n-icon-color":u}}),v=n?X("switch",to(()=>a.value[0]),m,e):void 0;return{handleClick:function(){e.loading||l.value||(d.value!==e.checkedValue?f(e.checkedValue):f(e.uncheckedValue))},handleBlur:function(){p.value=!1,function(){const{nTriggerFormBlur:e}=r;e()}(),u.value=!1},handleFocus:function(){p.value=!0,function(){const{nTriggerFormFocus:e}=r;e()}()},handleKeyup:function(o){e.loading||l.value||" "===o.key&&(d.value!==e.checkedValue?f(e.checkedValue):f(e.uncheckedValue),u.value=!1)},handleKeydown:function(o){e.loading||l.value||" "===o.key&&(o.preventDefault(),u.value=!0)},mergedRailStyle:h,pressed:u,mergedClsPrefix:o,mergedValue:d,checked:c,mergedDisabled:l,cssVars:n?void 0:m,themeClass:null==v?void 0:v.themeClass,onRender:null==v?void 0:v.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:n,checked:t,mergedRailStyle:r,onRender:l,$slots:i}=this;null==l||l();const{checked:s,unchecked:d,icon:c,"checked-icon":u,"unchecked-icon":p}=i,h=!(j(c)&&j(u)&&j(p));return Ue("div",{role:"switch","aria-checked":t,class:[`${e}-switch`,this.themeClass,h&&`${e}-switch--icon`,t&&`${e}-switch--active`,n&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},Ue("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:r},a(s,o=>a(d,n=>o||n?Ue("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},Ue("div",{class:`${e}-switch__rail-placeholder`},Ue("div",{class:`${e}-switch__button-placeholder`}),o),Ue("div",{class:`${e}-switch__rail-placeholder`},Ue("div",{class:`${e}-switch__button-placeholder`}),n)):null)),Ue("div",{class:`${e}-switch__button`},a(c,n=>a(u,t=>a(p,r=>Ue(o,null,{default:()=>this.loading?Ue(I,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(t||n)?Ue("div",{class:`${e}-switch__button-icon`,key:t?"checked-icon":"icon"},t||n):this.checked||!r&&!n?null:Ue("div",{class:`${e}-switch__button-icon`,key:r?"unchecked-icon":"icon"},r||n)})))),a(s,o=>o&&Ue("div",{key:"checked",class:`${e}-switch__checked`},o)),a(d,o=>o&&Ue("div",{key:"unchecked",class:`${e}-switch__unchecked`},o)))))}}),Np=G("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[ze("strong","\n font-weight: var(--n-font-weight-strong);\n "),ze("italic",{fontStyle:"italic"}),ze("underline",{textDecoration:"underline"}),ze("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),Kp=Me({name:"Text",props:Object.assign(Object.assign({},g.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=g("Typography","-text",Np,It,e,o),r=to(()=>{const{depth:o,type:n}=e,r="default"===n?void 0===o?"textColor":`textColor${o}Depth`:Te("textColor",n),{common:{fontWeightStrong:a,fontFamilyMono:l,cubicBezierEaseInOut:i},self:{codeTextColor:s,codeBorderRadius:d,codeColor:c,codeBorder:u,[r]:p}}=t.value;return{"--n-bezier":i,"--n-text-color":p,"--n-font-weight-strong":a,"--n-font-famliy-mono":l,"--n-code-border-radius":d,"--n-code-text-color":s,"--n-code-color":c,"--n-code-border":u}}),a=n?X("text",to(()=>`${e.type[0]}${e.depth||""}`),r,e):void 0;return{mergedClsPrefix:o,compitableTag:F(e,["as","tag"]),cssVars:n?void 0:r,themeClass:null==a?void 0:a.themeClass,onRender:null==a?void 0:a.onRender}},render(){var e,o,n;const{mergedClsPrefix:t}=this;null===(e=this.onRender)||void 0===e||e.call(this);const r=[`${t}-text`,this.themeClass,{[`${t}-text--code`]:this.code,[`${t}-text--delete`]:this.delete,[`${t}-text--strong`]:this.strong,[`${t}-text--italic`]:this.italic,[`${t}-text--underline`]:this.underline}],a=null===(n=(o=this.$slots).default)||void 0===n?void 0:n.call(o);return this.code?Ue("code",{class:r,style:this.cssVars},this.delete?Ue("del",null,a):a):this.delete?Ue("del",{class:r,style:this.cssVars},a):Ue(this.compitableTag||"span",{class:r,style:this.cssVars},a)}}),Vp=()=>({}),qp={name:"light",common:t,Alert:ml,Anchor:kl,AutoComplete:Ll,Avatar:Kl,AvatarGroup:Gl,BackTop:Xl,Badge:ei,Breadcrumb:ti,Button:te,ButtonGroup:Zd,Calendar:si,Card:kt,Carousel:pi,Cascader:vi,Checkbox:at,Code:Si,Collapse:Pi,CollapseTransition:Ai,ColorPicker:Mi,DataTable:ts,DatePicker:Bs,Descriptions:Ls,Dialog:vt,Divider:Mt,Drawer:$d,Dropdown:Ki,DynamicInput:Ld,DynamicTags:Nd,Element:Vd,Empty:B,Equation:{name:"Equation",common:t,self:Vp},Ellipsis:Zi,Flex:Jd,Form:Rt,GradientText:ec,Heatmap:pp,Icon:_,IconWrapper:mp,Image:bp,Input:Vn,InputNumber:nc,InputOtp:rc,Layout:ic,LegacyTransfer:Ip,List:uc,LoadingBar:Js,Log:fc,Menu:bc,Mention:vc,Message:td,Modal:Ct,Notification:md,PageHeader:wc,Pagination:ji,Popconfirm:Tc,Popover:qn,Popselect:Bi,Progress:zc,QrCode:Fp,Radio:es,Rate:Fc,Row:dc,Result:Bc,Scrollbar:Pe,Skeleton:Bp,Select:jn,Slider:Lc,Space:mt,Spin:he,Statistic:Uc,Steps:Vc,Switch:Yc,Table:Qc,Tabs:tu,Tag:Y,Thing:lu,TimePicker:Ms,Timeline:cu,Tooltip:Ji,Transfer:hu,Tree:mu,TreeSelect:bu,Typography:It,Upload:Cu,Watermark:ku,Split:jp,FloatButton:Iu,FloatButtonGroup:Pu,Marquee:zp},Gp={name:"dark",common:Sa,Alert:fl,Anchor:Pl,AutoComplete:Hl,Avatar:Vl,AvatarGroup:Jl,BackTop:Zl,Badge:Ql,Breadcrumb:ri,Button:ai,ButtonGroup:Yd,Calendar:di,Card:ci,Carousel:hi,Cascader:gi,Checkbox:fi,Code:wi,Collapse:Ti,CollapseTransition:zi,ColorPicker:Fi,DataTable:rs,DatePicker:Es,Descriptions:Hs,Dialog:js,Divider:Fd,Drawer:Bd,Dropdown:Vi,DynamicInput:_d,DynamicTags:Wd,Element:Kd,Empty:Ga,Ellipsis:Yi,Equation:{name:"Equation",common:Sa,self:Vp},Flex:Gd,Form:Xd,GradientText:Qd,Heatmap:hp,Icon:bs,IconWrapper:vp,Image:gp,Input:Tl,InputNumber:oc,InputOtp:ac,LegacyTransfer:Tp,Layout:lc,List:pc,LoadingBar:Gs,Log:hc,Menu:yc,Mention:mc,Message:rd,Modal:Us,Notification:vd,PageHeader:Sc,Pagination:Ui,Popconfirm:Ic,Popover:nl,Popselect:$i,Progress:Rc,QrCode:Mp,Radio:Qi,Rate:Mc,Result:Ec,Row:sc,Scrollbar:ka,Select:Ei,Skeleton:$p,Slider:Dc,Space:Hd,Spin:Hc,Statistic:Wc,Steps:qc,Switch:Jc,Table:eu,Tabs:ru,Tag:tl,Thing:iu,TimePicker:Fs,Timeline:du,Tooltip:Gi,Transfer:pu,Tree:vu,TreeSelect:gu,Typography:yu,Upload:wu,Watermark:Su,Split:Lp,FloatButton:Tu,FloatButtonGroup:{name:"FloatButtonGroup",common:Sa,self(e){const{popoverColor:o,dividerColor:n,borderRadius:t}=e;return{color:o,buttonBorderColor:n,borderRadiusSquare:t,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},Marquee:Rp},Jp=["disabled"],Yp=ge({__name:"HeaderButton",props:{icon:{type:Object,required:!0},tooltip:{type:String,default:""},tooltipPlacement:{type:String,default:"bottom"},iconSize:{type:Number,default:18},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:o}){const n=e,t=o,r=to(()=>n.disabled?"#6b7280":n.active?"#18a058":void 0);function a(){n.disabled||t("click")}return(o,n)=>(Ye(),qe(yo(ps),{placement:e.tooltipPlacement},{trigger:io(()=>[Mo("button",{class:ho(["header-button",{active:e.active,disabled:e.disabled}]),disabled:e.disabled,onClick:a},[Ne(yo(Q),{size:e.iconSize,color:r.value},{default:io(()=>[(Ye(),qe(Ze(e.icon)))]),_:1},8,["size","color"])],10,Jp)]),default:io(()=>[ko(o.$slots,"default",{},()=>[$e(eo(e.tooltip),1)],!0)]),_:3},8,["placement"]))}},[["__scopeId","data-v-b515354d"]]);async function Zp(e=null){const o=e?{platform:e}:{};return(await Eo.get("/env/check",{params:o})).data}function Xp(){return Md(["message","dialog"],{configProviderProps:{theme:"dark"===document.documentElement.getAttribute("data-theme")?Gp:qp}})}var Qp=Xp();new MutationObserver(()=>{Qp=Xp()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var eh={success:(...e)=>Qp.message.success(...e),error:(...e)=>Qp.message.error(...e),warning:(...e)=>Qp.message.warning(...e),info:(...e)=>Qp.message.info(...e),loading:(...e)=>Qp.message.loading(...e)},oh={success:(...e)=>Qp.dialog.success(...e),error:(...e)=>Qp.dialog.error(...e),warning:(...e)=>Qp.dialog.warning(...e),info:(...e)=>Qp.dialog.info(...e),create:(...e)=>Qp.dialog.create(...e)},nh={class:"modal-header"},th={class:"modal-content"},rh={class:"desc-text"},ah={class:"conflict-list"},lh={class:"list-header"},ih={key:0,class:"selected-hint"},sh={class:"conflict-items"},dh=["onClick"],ch={class:"item-content"},uh={class:"item-header"},ph={class:"var-name"},hh={class:"var-value"},fh={class:"var-source"},mh={class:"modal-footer"},vh={__name:"EnvConflictModal",props:{visible:{type:Boolean,default:!1},conflicts:{type:Array,default:()=>[]}},emits:["update:visible","deleted","close","ignore","never-remind"],setup(e,{emit:o}){const n=e,t=o,r=to({get:()=>n.visible,set:e=>t("update:visible",e)}),a=Io(new Set),l=Io(!1),i=to(()=>a.value.size),s=to(()=>n.conflicts.length>0&&a.value.size===n.conflicts.length),d=to(()=>a.value.size>0&&a.value.size<n.conflicts.length),c=to(()=>n.conflicts.length>0&&n.conflicts.every(e=>"process"===e.sourceType));function u(e){return`${e.varName}:${e.sourcePath}`}function p(e){return"process"===e.sourceType?"进程环境变量":e.sourcePath}function h(e){a.value=e?new Set(n.conflicts.map(u)):new Set}function f(){t("close")}function m(){t("ignore")}function v(){t("never-remind")}async function g(){const e=n.conflicts.filter(e=>a.value.has(u(e)));e.every(e=>"process"===e.sourceType)?eh.warning("进程环境变量无法直接删除,请手动从 shell 配置文件中移除"):oh.warning({title:"确认删除",content:`确定要删除选中的 ${e.length} 个环境变量吗?删除前会自动备份。`,positiveText:"删除",negativeText:"取消",onPositiveClick:async()=>{l.value=!0;try{(await async function(e){return(await Eo.post("/env/delete",{conflicts:e})).data}(e)).success&&(eh.success("删除成功,备份已保存"),a.value=new Set,t("deleted"))}catch(o){eh.error("删除失败: "+o.message)}finally{l.value=!1}}})}return(o,n)=>(Ye(),qe(yo(Pt),{show:r.value,"onUpdate:show":n[1]||(n[1]=e=>r.value=e),preset:"card",title:null,bordered:!1,closable:!0,"mask-closable":!1,style:{width:"560px","max-width":"90vw"},onClose:f},{header:io(()=>[Mo("div",nh,[Ne(yo(Q),{class:"warning-icon",size:22},{default:io(()=>[Ne(yo(xn))]),_:1}),n[2]||(n[2]=Mo("span",{class:"header-title"},"检测到环境变量冲突",-1))])]),footer:io(()=>[Mo("div",mh,[Ne(yo(me),{tertiary:"",onClick:m},{default:io(()=>[...n[8]||(n[8]=[$e(" 暂时忽略 ",-1)])]),_:1}),Ne(yo(me),{tertiary:"",onClick:v},{default:io(()=>[...n[9]||(n[9]=[$e(" 不再提醒 ",-1)])]),_:1}),c.value?Oe("",!0):(Ye(),qe(yo(me),{key:0,type:"error",disabled:0===i.value,loading:l.value,onClick:g},{default:io(()=>[$e(" 删除选中 ("+eo(i.value)+") ",1)]),_:1},8,["disabled","loading"]))])]),default:io(()=>[Mo("div",th,[Mo("p",rh,[n[3]||(n[3]=$e(" 发现 ",-1)),Mo("strong",null,eo(e.conflicts.length),1),n[4]||(n[4]=$e(" 个环境变量可能影响代理配置,建议清理后再使用代理功能。 ",-1))]),c.value?(Ye(),qe(yo(Cl),{key:0,type:"info",bordered:!1,class:"process-env-alert"},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Sn))]),_:1})]),default:io(()=>[n[5]||(n[5]=Mo("div",{class:"alert-content"},[Mo("p",{class:"alert-title"},"这些环境变量来自当前进程,请按以下步骤处理:"),Mo("ol",{class:"alert-list"},[Mo("li",null,"检查对应 shell 配置文件(如 ~/.zshrc、~/.bashrc 或 PowerShell Profile)中是否有这些变量"),Mo("li",null,"如果有,删除或注释掉相关行"),Mo("li",null,[Mo("strong",null,"重启终端"),$e(",然后重新运行 "),Mo("code",null,"ct")])]),Mo("p",{class:"alert-hint"},"如果配置文件中没有,可能是终端临时设置的,直接重启终端即可")],-1))]),_:1})):Oe("",!0),Mo("div",ah,[Mo("div",lh,[Ne(yo(Ci),{checked:s.value,indeterminate:d.value,"onUpdate:checked":h},{default:io(()=>[...n[6]||(n[6]=[$e(" 全选 ",-1)])]),_:1},8,["checked","indeterminate"]),i.value>0?(Ye(),Ro("span",ih," 已选 "+eo(i.value)+" 项 ",1)):Oe("",!0)]),Ne(yo(Op),{style:{"max-height":"280px"}},{default:io(()=>[Mo("div",sh,[(Ye(!0),Ro(co,null,He(e.conflicts,e=>{return Ye(),Ro("div",{key:u(e),class:ho(["conflict-item",{selected:a.value.has(u(e))}]),onClick:o=>function(e){const o=u(e);a.value.has(o)?a.value.delete(o):a.value.add(o),a.value=new Set(a.value)}(e)},[Ne(yo(Ci),{checked:a.value.has(u(e)),onClick:n[0]||(n[0]=bo(()=>{},["stop"])),"onUpdate:checked":o=>function(e,o){const n=u(e);o?a.value.add(n):a.value.delete(n),a.value=new Set(a.value)}(e,o)},null,8,["checked","onUpdate:checked"]),Mo("div",ch,[Mo("div",uh,[Mo("code",ph,eo(e.varName),1),Ne(yo(sl),{type:(o=e.platform,{claude:"warning",codex:"success",gemini:"info"}[o]||"default"),size:"tiny",bordered:!1},{default:io(()=>[$e(eo(e.platform),1)]),_:2},1032,["type"])]),Mo("div",hh,eo(e.varValue),1),Mo("div",fh,[n[7]||(n[7]=Mo("span",{class:"source-label"},"来源:",-1)),$e(" "+eo(p(e)),1)])])],10,dh);var o}),128))])]),_:1})])])]),_:1},8,["show"]))}},gh=ge(vh,[["__scopeId","data-v-7ea71ef7"]]);async function bh(){return(await Eo.get("/security")).data}async function yh(e){return(await Eo.post("/security/password",e)).data}var xh=new Map;function Ch(e,o="",n="",t=""){return`${e}:${o}:${n}:${function(e=""){return e?String(e):""}(t)}`}function wh(e,o,n=e.split(":",1)[0],t=n){const r=xh.get(e);if(r)return r.promise;for(const[i,s]of xh)s.abortGroup===t&&i!==e&&s.abortController.abort();const a=new AbortController,l={promise:null,startedAt:Date.now(),abortController:a,resource:n,abortGroup:t};return l.promise=Promise.resolve().then(()=>o(a.signal)).finally(()=>{xh.get(e)===l&&xh.delete(e)}),xh.set(e,l),l.promise}var Sh="__ccAdvancedConfigBound__",kh=null,Ph=0,Th=!1,Ih=null,Ah=Object.create(null);function zh(e,o,n,t={},r){return wh(Ch(e,o,"",""),e=>Oo.get(n,{params:t,signal:e}),e,`${e}:${o}`).catch(()=>r)}function Rh(){const e=new Date;return e.setHours(0,0,0,0),{start:e.getTime(),end:e.getTime()+864e5}}function Mh(e,o){if(o.usageMissing)return null;if(void 0!==o.totalTokens&&null!==o.totalTokens)return Number(o.totalTokens)||0;const n=Number(o.inputTokens)||0,t=Number(o.outputTokens)||0,r=Number(o.cacheCreation)||0,a=Number(o.cacheRead)||0;return"claude"===e?n+t+r+a:n+t}function Fh(e={}){const o=[e.model,e.redirectedModel,e.modelFromUrl,e.originalModel];for(const n of o)if("string"==typeof n&&n.trim())return n.trim();return""}var Oh=Co("global",()=>{const{catalog:e,enabledKeys:o}=Dt(),n=no({}),t=no({}),r=no({}),a=no({}),l=new Map,i=new Map,s=new Set;function d(e){return String(e||"").trim().toLowerCase()}function c(o){const n=d(o);return Boolean(n)&&e.value.some(e=>e.key===n)}function u(e){const n=d(e);return o.value.includes(n)}function p(o,n){const t=d(o);return c(t)&&e.value.some(e=>e.key===t&&(!0===e.capabilities?.[n]||!0===e.resourceTypes?.[n]))}function h(e){const n=Array.isArray(e)?e:o.value,t=new Set(o.value),r=[],a=new Set;return n.forEach(e=>{const o=d(e);o&&!a.has(o)&&t.has(o)&&(a.add(o),r.push(o))}),r}function f(e){const o=d(e);return c(o)?(n[o]||(n[o]={running:!1,loading:!1,activeChannel:null,port:null,runtime:null,startTime:null,defaultPort:null}),t[o]||(t[o]=[]),r[o]||(r[o]={channels:[],pending:0}),a[o]||(a[o]=[]),o):null}function m(e){const o=f(e);return o?(l.has(o)||l.set(o,lo(n,o)),l.get(o)):null}function v(e){const o=f(e);return o?(i.has(o)||i.set(o,lo(t,o)),i.get(o)):null}function g(e){const o=f(e);return o?r[o]:null}function b(e){const o=f(e);return o?a[o]:[]}function y(){Object.keys(Ah).forEach(e=>{delete Ah[e]}),Object.entries(t).forEach(([e,o])=>{o.forEach(o=>{o?.name&&(Ah[o.name]=e)})})}o.value.forEach(f);const x=Io(!1),C=Io(!1);let w="",S="";const k=Io(100),P=Io(30);let T=null,I=100,A=Rh();function z(e){return function(){const e=Date.now();(e<A.start||e>=A.end)&&(A=Rh(),$())}(),e>=A.start&&e<A.end}function R(e){for(;e.length>I;)e.pop()}function M(e){I=e,k.value=e,Object.values(a).forEach(R)}function F(e){const o=parseInt(e,10);if(Number.isNaN(o))return;const n=Math.min(Math.max(o,10),300);P.value!==n&&(P.value=n)}function O(e){const o=function(e){if(e.source)return d(e.source);if(e.toolType){const o=d(e.toolType);return c(o)?o:""}if(e.channel)return Ah[e.channel]||"";if(e.model){const o=e.model.toLowerCase();if(o.includes("claude"))return"claude";if(o.includes("gpt")||o.includes("o1")||o.includes("o3"))return"codex";if(o.includes("gemini"))return"gemini";if(o.includes("opencode")||o.includes("deepseek")||o.includes("qwen"))return"opencode";if(o.includes("omp"))return"omp"}return e.action?.includes("opencode")?"opencode":e.action?.includes("omp")?"omp":e.action?.includes("codex")?"codex":e.action?.includes("gemini")?"gemini":e.action?.includes("claude")?"claude":""}(e);if(!c(o)||!u(o))return;const n=b(o);if(!n)return;const t=e.timestamp||Date.now();if(!z(t))return;const r=e.time||new Date(t).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),a={id:e.id||`${Date.now()}-${Math.random()}`,source:o,type:e.type||(e.action?"action":"log"),status:e.status||(e.error?"error":"success"),action:e.action||null,channel:e.channel||e.channelName||"Unknown",model:Fh(e),originalModel:e.originalModel||null,redirectedModel:e.redirectedModel||null,message:e.message,error:e.error||null,statusCode:e.statusCode||null,stage:e.stage||null,usageMissing:Boolean(e.usageMissing),timestamp:t,time:r,tokens:{input:e.inputTokens||0,output:e.outputTokens||0,cacheCreation:e.cacheCreation||0,cacheRead:e.cacheRead||0,cached:e.cachedTokens||0,reasoning:e.reasoningTokens||0,total:Mh(o,e)},cost:e.cost||0,isHistory:Th,isNew:!Th};n.unshift(a),R(n),a.isNew&&setTimeout(()=>{a.isNew=!1},4500)}function $(){Object.keys(a).forEach(e=>{a[e].splice(0,a[e].length)})}function B(e,o={},n){e.value={...e.value,...o,activeChannel:n||e.value.activeChannel}}function E(e,o){const n=v(e);if(!n)return;const t=(r=o,Array.isArray(r)?r:Array.isArray(r?.channels)?r.channels:[]);var r;n.value=function(e=[],o=[]){if(!Array.isArray(o))return e;const n=new Map(e.filter(e=>e?.id).map(e=>[e.id,e]));return o.map(e=>{const o=n.get(e?.id);return o?!Object.prototype.hasOwnProperty.call(e,"apiKey")&&o.apiKey?{...o,...e,apiKey:o.apiKey}:{...o,...e}:e})}(n.value,t)}function _(e){const o=d(e?.source);if(!o||!u(o))return;const n=m(o);n&&(B(n,e.proxy,e.activeChannel),e.channels&&(E(o,e.channels),y()))}async function D(e={}){const n=h(e.keys).filter(e=>p(e,"channels"));if(S===o.value.join(",")&&!e.force)return{success:!0,channels:Object.fromEntries(n.map(e=>[e,v(e)?.value||[]]))};const t=o.value.join(","),a=!Array.isArray(e.keys);return T||(T=async function(e){try{return(await Promise.all(e.map(async e=>{const o=_o(e),n=zh("channels",e,`/api${o}/channels`,{},{data:{channels:[]}}),t=Do(e)?zh("channel-pool",e,`/api${o}/channels/pool/status?source=${encodeURIComponent(e)}`,{},{data:null}):Promise.resolve({data:null});return{key:e,channelResponse:await n,poolResponse:await t}}))).forEach(({key:e,channelResponse:o,poolResponse:n})=>{const t=o?.data;E(e,Array.isArray(t)?t:t?.channels),n?.data?.scheduler&&(r[e]=n.data.scheduler)}),y(),{success:!0,channels:Object.fromEntries(e.map(e=>[e,v(e)?.value||[]]))}}catch(o){return{success:!1,channels:Object.fromEntries(e.map(e=>[e,v(e)?.value||[]]))}}}(n).then(e=>(a&&(S=t),e)).finally(()=>{T=null}),T)}return"undefined"==typeof window||window[Sh]||(window.addEventListener("advanced-config-change",e=>{e.detail?.maxLogs&&M(e.detail.maxLogs),e.detail?.statsInterval&&F(e.detail.statsInterval)}),window[Sh]=!0),{proxyStateByPlatform:n,channelsByPlatform:t,schedulerStateByPlatform:r,logsBySource:a,ensurePlatformState:f,connectWebSocket:function e(){if(kh&&kh.readyState===WebSocket.OPEN)return;const o=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/ws`;try{(kh=new WebSocket(o)).onopen=()=>{Ph=0,x.value=!0,Th=!0,clearTimeout(Ih),Ih=setTimeout(()=>{Th=!1},2e3)},kh.onmessage=e=>{try{const o=JSON.parse(e.data);"proxy-state"===o.type?_(o):"scheduler-state"===o.type?function(e){const o=d(e?.source);o&&u(o)&&e.scheduler&&g(o)&&(r[o]=e.scheduler)}(o):"browser-notification"===o.type?function(e){if("undefined"==typeof window||"undefined"==typeof Notification)return;if("granted"!==Notification.permission)return;const o=e.id||`${e.source||"claude"}-${e.timestamp||Date.now()}`;if(s.has(o))return;s.add(o),new Notification(e.title||"coding-tool-x",{body:e.message||"任务已完成",tag:o,icon:"/logo.png"}).onclick=()=>{try{window.focus(),e.url&&window.location.assign(e.url)}catch(o){}}}(o):O(o)}catch(o){}},kh.onclose=()=>{x.value=!1,kh=null,Th=!1,clearTimeout(Ih);const o=Math.min(1e3*Math.pow(2,Ph),1e4);Ph+=1,setTimeout(e,o)},kh.onerror=e=>{x.value=!1}}catch(n){x.value=!1}},initializeState:async function(){const e=o.value.join(",");if(C.value&&w===e)return;const n=h().filter(e=>p(e,"proxy"));try{(await Promise.all(n.map(e=>zh("proxy-status",e,`/api${_o(e)}/proxy/status`,{},{data:{}})))).forEach((e,o)=>{const t=e?.data||{},r=m(n[o]);r&&t.proxy&&B(r,t.proxy,t.activeChannel)}),w=e,C.value=!0}catch(t){}},loadChannels:D,getProxyState:m,getChannels:v,getSchedulerState:g,handleProxyStateUpdate:_,hydrateFromDashboard:function(e={}){const n=e.channels||{};Object.entries(n).forEach(([e,o])=>{u(e)&&E(e,o)}),y();const t=e.proxyStatus||{};Object.entries(t).forEach(([e,o])=>{if(!u(e)||!o||"object"!=typeof o)return;const n=m(e);n&&B(n,o,o.activeChannel)}),w=o.value.join(","),C.value=!0},startProxy:async function(e){const o=d(e);if(!u(o)||!p(o,"proxy"))throw Bo(o,"unsupported");const n=m(o);if(!n)throw Bo(o,"not_found");const t=await Oo.post(`/api${_o(o)}/proxy/start`);return t.data.success&&(n.value.running=!0,n.value.activeChannel=t.data.activeChannel,n.value.startTime=Date.now()),t.data},stopProxy:async function(e,o={}){const n=d(e);if(!u(n)||!p(n,"proxy"))throw Bo(n,"unsupported");const t=m(n);if(!t)throw Bo(n,"not_found");const r=await Oo.post(`/api${_o(n)}/proxy/stop`);return t.value.running=!1,t.value.activeChannel=null,t.value.startTime=null,t.value.runtime=null,!1!==r.data?.success&&await D({force:!0,keys:[n]}),o.refreshChannelsDrawer&&!1!==r.data?.success&&"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:n,reason:"proxy-stop"}})),r.data},getLogs:function(e){return to(()=>b(e))},wsConnected:x,dashboardHydrated:C,clearLogsState:$,clearLogsForSource:function(e){a[e]&&a[e].splice(0,a[e].length)},logLimit:k,statsInterval:P,loadAdvancedConfig:async function(){try{const e=await fetch("/api/config/advanced");if(e.ok){const o=await e.json();M(o.maxLogs||100),o.statsInterval&&F(o.statsInterval)}}catch(e){}}}}),$h=!1;function Bh(e){return`${_o(e)}/channels`}async function Eh(e){return(await Eo.get(Bh(e))).data}async function _h(e,o){return(await Eo.post(Bh(e),o)).data}async function Dh(e,o,n){return(await Eo.put(`${Bh(e)}/${encodeURIComponent(o)}`,n)).data}async function Lh(e,o){return(await Eo.delete(`${Bh(e)}/${encodeURIComponent(o)}`)).data}async function Hh(e,o){return Dh("dsh",e,o)}async function jh(e){return Lh("dsh",e)}async function Uh(){return(await Eo.post("/dsh/channels/sync")).data}async function Wh(e,o=2e4){return(await Eo.post(`/dsh/channels/${encodeURIComponent(e)}/speed-test`,{timeout:o})).data}async function Nh(){return(await Eo.post("/channels/sync-current")).data}async function Kh(e,o){return(await Eo.put(`/channels/${e}`,o)).data}async function Vh(e){return(await Eo.delete(`/channels/${e}`)).data}async function qh(){return(await Eo.post("/codex/channels/sync-current")).data}async function Gh(e,o){return(await Eo.put(`/codex/channels/${e}`,o)).data}async function Jh(e){return(await Eo.delete(`/codex/channels/${e}`)).data}async function Yh(){return(await Eo.post("/gemini/channels/sync-current")).data}async function Zh(e,o){return(await Eo.put(`/gemini/channels/${e}`,o)).data}async function Xh(e){return(await Eo.delete(`/gemini/channels/${e}`)).data}async function Qh(e,o=2e4){return(await Eo.post(`/channels/${e}/speed-test`,{timeout:o})).data}async function ef(e=2e4,{signal:o}={}){return(await Eo.post("/channels/speed-test-all",{timeout:e},{timeout:Lo,signal:o})).data}async function of(e,o=2e4){return(await Eo.post(`/codex/channels/${e}/speed-test`,{timeout:o})).data}async function nf(e=2e4,{signal:o}={}){return(await Eo.post("/codex/channels/speed-test-all",{timeout:e},{timeout:Lo,signal:o})).data}async function tf(e,o=2e4){return(await Eo.post(`/gemini/channels/${e}/speed-test`,{timeout:o})).data}async function rf(e=2e4,{signal:o}={}){return(await Eo.post("/gemini/channels/speed-test-all",{timeout:e},{timeout:Lo,signal:o})).data}async function af(){return(await Eo.post("/opencode/channels/sync-current")).data}async function lf(e,o){return(await Eo.put(`/opencode/channels/${e}`,o)).data}async function sf(e){return(await Eo.delete(`/opencode/channels/${e}`)).data}async function df(e,o=2e4){return(await Eo.post(`/opencode/channels/${e}/speed-test`,{timeout:o})).data}async function cf(e=2e4,{signal:o}={}){return(await Eo.post("/opencode/channels/speed-test-all",{timeout:e},{timeout:Lo,signal:o})).data}async function uf(){return(await Eo.post("/omp/channels/sync-current")).data}async function pf(e,o){return(await Eo.put(`/omp/channels/${e}`,o)).data}async function hf(e){return(await Eo.delete(`/omp/channels/${e}`)).data}async function ff(e,o,n){const t=$o(e),r={claude:Kh,codex:Gh,gemini:Zh,opencode:lf,omp:pf}[t];return r?r(o,n):Dh(t,o,n)}async function mf(e){const o=$o(e),n={claude:"/claude",codex:"/codex",gemini:"/gemini",opencode:"/opencode",omp:"/omp"}[o]||_o(o);return(await Eo.get(`${n}/statistics/today`)).data}async function vf(e){return(await Eo.get("/statistics/trend",{params:e})).data}async function gf(e){return(await Eo.get("/statistics/filters",{params:e})).data}function bf(e){return`/api/statistics/trend/export?${new URLSearchParams(e).toString()}`}function yf(e){return Array.isArray(e)?e:Array.isArray(e?.channels)?e.channels:[]}function xf(e={}){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,o={}])=>{const n="object"==typeof o.tokens?o.tokens?.total:o.tokens;return[e,{...o,requests:o.requests||0,tokens:n||0,cost:o.cost||0}]})):{}}function Cf(e={}){const o="object"==typeof e.tokens?e.tokens?.total:e.tokens;return{requests:e.requests||0,tokens:o||0,cost:e.cost||0,byModel:e.byModel||{},byChannel:xf(e.byChannel)}}var wf=Co("dashboard",()=>{const{enabledKeys:e,getPlatform:o}=Dt(),n=Io({uiConfig:null,favorites:null,channels:{},proxyStatus:{},todayStats:{},counts:{},meta:null}),t=Io(!1),r=Io(!1);let a=null,l="",i=null,s=0,d=null;function c(e){if(!e?.refreshing)return s=0,void(i&&(clearTimeout(i),i=null));if(s>=8||i)return;const o=s;s+=1,i=setTimeout(()=>{i=null,f(!0,{fresh:!1}).catch(()=>{})},Math.min(1200+1200*o,5e3))}function u(){return e.value}function p(e,o=e=>e){const n=e&&"object"==typeof e?e:{};return Object.fromEntries(u().map(e=>[e,o(n[e])]))}function h(e,n){const t=function(e){const o=String(e||"").trim().toLowerCase();return u().includes(o)?o:null}(e),r=t?o(t):null;return!t||!0!==r?.capabilities?.[n]&&!0!==r?.resourceTypes?.[n]?null:t}async function f(e=!1,o={}){const i=u().join(",");return r.value&&!e&&l===i?n.value:a||(t.value=!0,a=(async()=>{try{const t=await async function(e={}){return(await Eo.get("/dashboard/init",{params:e.fresh?{fresh:"1"}:void 0})).data}({fresh:!0===o.fresh});if(!t||!1===t.success)throw new Error(t?.message||"Failed to load dashboard");const a=t.data||{},s=u();n.value={uiConfig:a.uiConfig||null,favorites:a.favorites||null,channels:p(a.channels,yf),proxyStatus:p(a.proxyStatus,e=>e&&"object"==typeof e?e:{}),todayStats:p(a.todayStats,Cf),counts:p(a.counts,e=>e&&"object"==typeof e?e:{projectCount:0,sessionCount:0}),meta:a.meta||null},0===s.length&&(n.value.channels={},n.value.proxyStatus={},n.value.todayStats={},n.value.counts={});try{Oh().hydrateFromDashboard(n.value)}catch(e){}return c(n.value.meta),l=i,r.value=!0,n.value}finally{t.value=!1,a=null}})().catch(e=>{throw e}),a)}return{dashboardData:n,isLoading:t,isLoaded:r,loadDashboard:f,enableAutoRefresh:function(){d||(d=setInterval(()=>{f(!0,{fresh:!0}).catch(()=>{})},3e5))},disableAutoRefresh:function(){d&&(clearInterval(d),d=null)},refreshChannels:async function(e){const o=h(e,"channels");if(o)try{const e=await Eh(o);n.value.channels[o]=yf(e)}catch(t){}},refreshProxyStatus:async function(e){const o=h(e,"proxy");if(o)try{n.value.proxyStatus[o]=await async function(e){return(await Eo.get(`${_o(e)}/proxy/status`)).data}(o)}catch(t){}},refreshStats:async function(e){const o=h(e,"statistics");if(o)try{const e=await mf(o),t=e?.summary||{};n.value.todayStats[o]=Cf({requests:t.requests||0,tokens:t.tokens||0,cost:t.cost||0,byModel:e?.byModel||{},byChannel:e?.byChannel||{}})}catch(t){}}}}),Sf="cc-theme",kf=Io(!1),Pf=!1,Tf=null,If=null,Af=!1;function zf(){return Tf||(Tf=wf(),If=ro(Tf).dashboardData),Tf}function Rf(){Af||If&&(Xe(()=>If.value?.uiConfig?.theme,e=>{if(!e)return;const o="dark"===e;if(!Pf)return Pf=!0,kf.value=o,void Ff(o);kf.value!==o&&(kf.value=o,Ff(o))}),Af=!0)}async function Mf(){if(Pf)return;const e="undefined"!=typeof window?window.localStorage?.getItem(Sf):null;"dark"!==e&&"light"!==e||(kf.value="dark"===e,Ff(kf.value));try{const o=zf();Rf();let n=If?.value?.uiConfig?.theme;n||(n=(await o.loadDashboard().catch(()=>null))?.uiConfig?.theme),n||e?n&&(kf.value="dark"===n):kf.value=window.matchMedia("(prefers-color-scheme: dark)").matches}catch(o){e||(kf.value=window.matchMedia("(prefers-color-scheme: dark)").matches)}Ff(kf.value),Pf=!0}function Ff(e){e?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme")}function Of(){kf.value=!kf.value}function $f(){return{isDark:kf,toggleTheme:Of,loadTheme:Mf}}function Bf(){const e=Oh(),{proxyStateByPlatform:o,channelsByPlatform:n,schedulerStateByPlatform:t,logsBySource:r,wsConnected:a,logLimit:l,statsInterval:i}=ro(e);return{proxyStateByPlatform:o,channelsByPlatform:n,schedulerStateByPlatform:t,logsBySource:r,ensurePlatformState:e.ensurePlatformState,connectWebSocket:e.connectWebSocket,initializeState:e.initializeState,loadChannels:e.loadChannels,getProxyState:e.getProxyState,getChannels:e.getChannels,getSchedulerState:e.getSchedulerState,handleProxyStateUpdate:e.handleProxyStateUpdate,hydrateFromDashboard:e.hydrateFromDashboard,startProxy:e.startProxy,stopProxy:e.stopProxy,getLogs:e.getLogs,wsConnected:a,clearLogsState:e.clearLogsState,clearLogsForSource:e.clearLogsForSource,logLimit:l,statsInterval:i,loadAdvancedConfig:e.loadAdvancedConfig}}function Ef(){!function(){if($h)return;const e=Oh();e.connectWebSocket(),queueMicrotask(()=>{const o=()=>{e.loadAdvancedConfig()};"undefined"==typeof window||"function"!=typeof window.requestIdleCallback?setTimeout(o,0):window.requestIdleCallback(o,{timeout:1e3})}),$h=!0}()}Xe(kf,async e=>{Ff(e);try{window.localStorage?.setItem(Sf,e?"dark":"light")}catch(o){}try{await Uo("theme",e?"dark":"light"),zf(),Rf(),If.value&&(If.value={...If.value,uiConfig:{...If.value.uiConfig||{},theme:e?"dark":"light"}})}catch(o){}});var _f=Co("favorites",()=>{const e=Io({claude:[],codex:[],gemini:[]}),o=Io(!1),n=Io(!1);let t=null;return{favorites:e,totalFavorites:to(()=>(e.value.claude?.length||0)+(e.value.codex?.length||0)+(e.value.gemini?.length||0)),isLoaded:o,loading:n,loadFavorites:async function(r=!1){if(o.value&&!r)return e.value;if(t&&!r)return t;let a=null;return a=(async()=>{n.value=!0;try{const n=await async function(){return(await Eo.get("/favorites")).data}();return n.success&&n.favorites&&(e.value={claude:n.favorites.claude||[],codex:n.favorites.codex||[],gemini:n.favorites.gemini||[]}),o.value=!0,e.value}catch(r){throw r}finally{n.value=!1,t===a&&(t=null)}})(),t=a,a},addFavorite:async function(o,n){try{const t=await async function(e,o){return(await Eo.post("/favorites",{channel:e,sessionData:o})).data}(o,n);if(t.success&&t.favorites)return e.value=t.favorites,!0}catch(t){}return!1},removeFavorite:async function(o,n,t){try{const r=await async function(e,o,n){return(await Eo.delete(`/favorites/${e}/${encodeURIComponent(o)}/${n}`)).data}(o,n,t);if(r.success&&r.favorites)return e.value=r.favorites,!0}catch(r){}return!1},isFavorite:function(o,n,t){return!!e.value[o]&&e.value[o].some(e=>e.sessionId===t&&e.projectName===n)},getFavoritesByChannel:function(o){return e.value[o]||[]}}});function Df(){const e=_f(),{favorites:o,totalFavorites:n}=ro(e);return e.isLoaded||e.loadFavorites().catch(()=>{}),{favorites:o,addFavorite:e.addFavorite,removeFavorite:e.removeFavorite,isFavorite:e.isFavorite,getFavorites:function(o){return e.getFavoritesByChannel(o)},getAllFavorites:function(){return o.value},totalFavorites:n,loadFavorites:e.loadFavorites}}function Lf(){const e=wf(),{dashboardData:o,isLoading:n,isLoaded:t}=ro(e);return{dashboardData:o,isLoading:n,isLoaded:t,loadDashboard:e.loadDashboard,scheduleRefresh:e.scheduleRefresh,enableAutoRefresh:e.enableAutoRefresh,disableAutoRefresh:e.disableAutoRefresh,refreshChannels:e.refreshChannels,refreshProxyStatus:e.refreshProxyStatus,refreshStats:e.refreshStats}}var Hf={class:"channel-header"},jf={class:"channel-title"},Uf=["title"],Wf={class:"channel-actions"},Nf={class:"test-result-header"},Kf={class:"test-result-status"},Vf={class:"test-result-info"},qf={key:0,class:"latency"},Gf={key:1,class:"status-code"},Jf={key:0,class:"test-result-error"},Yf={class:"channel-info"},Zf={class:"info-main"},Xf={class:"info-footer"},Qf={class:"channel-meta"},em={class:"meta-item"},om={class:"meta-value"},nm={class:"meta-item"},tm={__name:"ChannelCard",props:{channel:{type:Object,required:!0},collapsed:{type:Boolean,default:!1},headerTags:{type:Array,default:()=>[]},infoRows:{type:Array,default:()=>[]},meta:{type:Object,default:()=>({weight:1,concurrencyText:"不限",concurrencyActive:!1})},balance:{type:Object,default:null},showApplyButton:{type:Boolean,default:!1},channelType:{type:String,default:"claude"},testFn:{type:Function,default:null},toggling:{type:Boolean,default:!1}},emits:["toggle-collapse","apply","edit","delete","toggle-enabled","open-website","refresh-balance"],setup(e,{emit:o}){const n=e,t=o,r=Io(!1),a=Io(null),l=to(()=>{if(!n.balance?.visible||"oauth-quota"!==n.balance.kind)return[];const e=Array.isArray(n.balance.windows)?n.balance.windows:[],o=e.filter(e=>"primary"===e?.id||"secondary"===e?.id);return o.length?o:e}),i=to(()=>l.value.length>0);function s(e){const o=Number(e);return Number.isFinite(o)?Number.isInteger(o)?String(o):o.toFixed(1).replace(/\.0$/,""):"—"}function d(e){const o=[];if(n.balance?.platform&&o.push(n.balance.platform),e?.label&&o.push(`${e.label} 剩余 ${s(e.remainingPercent)}%`),e?.resetsAt)try{o.push(`重置 ${new Date(e.resetsAt).toLocaleString()}`)}catch{}return o.join(" · ")}const c=to(()=>{if(!n.balance?.visible)return"";const e=[];if(n.balance.platform&&e.push(n.balance.platform),n.balance.stale&&e.push("缓存"),n.balance.updatedAt)try{e.push(new Date(n.balance.updatedAt).toLocaleString())}catch{}if(Array.isArray(n.balance.windows)&&n.balance.windows.length){const o=n.balance.windows.map(e=>{const o=null==e.remainingPercent?"":`剩余 ${e.remainingPercent}%`;let n="";if(e.resetsAt)try{n=`,重置 ${new Date(e.resetsAt).toLocaleString()}`}catch{}return`${e.label||e.id||"额度"} ${o}${n}`});e.push(o.join("\n"))}return e.join(" · ")});async function u(){if(n.testFn){r.value=!0,a.value=null;try{const e=await n.testFn(n.channel.id,2e4);a.value=e}catch(e){a.value={success:!1,error:e.message||"测试失败",latency:null,statusCode:null}}finally{r.value=!1}}}return(o,n)=>(Ye(),Ro("div",{class:ho(["channel-card",{collapsed:e.collapsed,disabled:!1===e.channel.enabled,"status-frozen":"frozen"===e.channel.health?.status,"status-checking":"checking"===e.channel.health?.status}])},[Mo("div",Hf,[Mo("div",jf,[Ne(yo(me),{text:"",size:"tiny",class:"collapse-btn",onClick:n[0]||(n[0]=bo(e=>o.$emit("toggle-collapse"),["stop"]))},{default:io(()=>[Ne(yo(Q),{size:"16",class:ho({collapsed:e.collapsed})},{default:io(()=>[Ne(yo(wn))]),_:1},8,["class"])]),_:1}),Mo("span",{class:"channel-name",title:e.channel.name},eo(e.channel.name),9,Uf),(Ye(!0),Ro(co,null,He(e.headerTags,e=>(Ye(),qe(yo(sl),{key:e.text,size:"tiny",type:e.type||"default",bordered:!1},{default:io(()=>[$e(eo(e.text),1)]),_:2},1032,["type"]))),128))]),Mo("div",Wf,[e.showApplyButton?(Ye(),qe(yo(me),{key:0,size:"tiny",type:"primary",class:"apply-btn",onClick:n[1]||(n[1]=e=>o.$emit("apply"))},{default:io(()=>[...n[9]||(n[9]=[$e(" 写入配置 ",-1)])]),_:1})):Oe("",!0),Ne(yo(me),{size:"tiny",loading:r.value,onClick:u},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(ln))]),_:1})]),default:io(()=>[n[10]||(n[10]=$e(" 测速 ",-1))]),_:1},8,["loading"]),Ne(yo(me),{size:"tiny",onClick:n[2]||(n[2]=e=>o.$emit("edit"))},{default:io(()=>[...n[11]||(n[11]=[$e(" 编辑 ",-1)])]),_:1}),Ne(yo(me),{size:"tiny",type:"error",onClick:n[3]||(n[3]=e=>o.$emit("delete"))},{default:io(()=>[...n[12]||(n[12]=[$e(" 删除 ",-1)])]),_:1}),Ne(yo(Wp),{size:"small",value:!1!==e.channel.enabled,loading:e.toggling,disabled:e.toggling,"onUpdate:value":n[4]||(n[4]=e=>o.$emit("toggle-enabled",e))},null,8,["value","loading","disabled"])])]),a.value?(Ye(),Ro("div",{key:0,class:ho(["test-result",a.value.success?"success":"failed"])},[Mo("div",Nf,[Mo("span",Kf,[a.value.success?(Ye(),qe(yo(Q),{key:0,color:"#18a058"},{default:io(()=>[Ne(yo(rn))]),_:1})):(Ye(),qe(yo(Q),{key:1,color:"#f56c6c"},{default:io(()=>[Ne(yo(vn))]),_:1})),$e(" "+eo(a.value.success?"测试成功":"测试失败"),1)]),Mo("div",Vf,[a.value.latency?(Ye(),Ro("span",qf,eo(a.value.latency)+"ms",1)):Oe("",!0),a.value.statusCode?(Ye(),Ro("span",Gf,"HTTP "+eo(a.value.statusCode),1)):Oe("",!0)]),Ne(yo(me),{text:"",size:"tiny",onClick:n[5]||(n[5]=e=>a.value=null)},{default:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(sn))]),_:1})]),_:1})]),a.value.error?(Ye(),Ro("div",Jf,eo(a.value.error),1)):Oe("",!0)],2)):Oe("",!0),zo(Mo("div",Yf,[Mo("div",Zf,[(Ye(!0),Ro(co,null,He(e.infoRows,e=>(Ye(),Ro("div",{key:e.label,class:"info-row"},[Ne(yo(Kp),{depth:"3",class:"label"},{default:io(()=>[$e(eo(e.label)+":",1)]),_:2},1024),Ne(yo(Kp),{depth:"2",class:ho(["value",{mono:e.mono}])},{default:io(()=>[$e(eo(e.value||"—"),1)]),_:2},1032,["class"]),"function"==typeof e.action?(Ye(),qe(yo(me),{key:0,size:"tiny",text:"",type:"primary",onClick:o=>e.action()},{default:io(()=>[$e(eo(e.actionLabel||"操作"),1)]),_:2},1032,["onClick"])):Oe("",!0)]))),128))]),Mo("div",Xf,[e.channel.websiteUrl?(Ye(),qe(yo(me),{key:0,text:"",size:"tiny",onClick:n[6]||(n[6]=n=>o.$emit("open-website",e.channel.websiteUrl))},{icon:io(()=>[Ne(yo(Q),{size:"14"},{default:io(()=>[Ne(yo(Jo))]),_:1})]),default:io(()=>[n[13]||(n[13]=$e(" 前往官网 ",-1))]),_:1})):Oe("",!0),n[16]||(n[16]=Mo("div",{class:"footer-spacer"},null,-1)),Mo("div",Qf,[i.value?(Ye(!0),Ro(co,{key:0},He(l.value,e=>(Ye(),qe(yo(sl),{key:e.id||e.label,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:d(e),onClick:n[7]||(n[7]=bo(e=>t("refresh-balance"),["stop"]))},{default:io(()=>[$e(eo(e.label)+" 剩余 "+eo(s(e.remainingPercent))+"% ",1)]),_:2},1032,["title"]))),128)):e.balance?.visible&&e.balance.label?(Ye(),qe(yo(sl),{key:1,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:c.value,onClick:n[8]||(n[8]=bo(e=>t("refresh-balance"),["stop"]))},{default:io(()=>[$e(eo(e.balance.label),1)]),_:1},8,["title"])):Oe("",!0),Mo("span",em,[n[14]||(n[14]=$e(" 权重: ",-1)),Mo("span",om,eo(e.meta.weight),1)]),Mo("span",nm,[n[15]||(n[15]=$e(" 并发: ",-1)),Mo("span",{class:ho(["meta-value",{"meta-active":e.meta.concurrencyActive}])},eo(e.meta.concurrencyText),3)])])])],512),[[so,!e.collapsed]])],2))}},rm=ge(tm,[["__scopeId","data-v-b3fb3d1a"]]),am=Io(null),lm=Io(null),im=Io(!1),sm={claude:["claude-opus-4-7","claude-opus-4-6","claude-sonnet-4-6","claude-opus-4-5-20251101","claude-sonnet-4-5-20250929","claude-haiku-4-5-20251001"],codex:["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5.3-codex","gpt-5.3-codex-spark","gpt-5.2-codex","gpt-5.1-codex-max","gpt-5.1-codex","gpt-5.1-codex-mini","gpt-5-codex","gpt-5.2","gpt-5.1","gpt-5"],gemini:["gemini-3.1-pro-preview","gemini-3.1-flash-preview","gemini-3-pro-preview","gemini-3-flash-preview","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite"],opencode:[],omp:[]},dm=Object.freeze(Object.keys(sm));function cm(e=[]){const o=new Set,n=[];return e.forEach(e=>{if("string"!=typeof e)return;const t=e.trim();if(!t)return;const r=t.toLowerCase();o.has(r)||(o.add(r),n.push(t))}),n}function um(e){const o=String(e||"").trim().toLowerCase();return o.startsWith("claude-")?"claude":o.startsWith("gemini-")?"gemini":o.startsWith("gpt-")||o.startsWith("o1")||o.startsWith("o3")||o.startsWith("o4")?"codex":""}function pm(){return Object.fromEntries(dm.map(e=>[e,[...sm[e]||[]]]))}var hm=null;async function fm(e={}){const o=!0===e.forceRefresh;return!o&&am.value&&lm.value?am.value:hm||(im.value=!0,hm=(async()=>{try{const n=new URLSearchParams;o&&n.set("forceRefresh","true");const t=n.toString(),r=t?`/api/config/default-models?${t}`:"/api/config/default-models",a=await fetch(r);if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const l=await a.json();am.value=l.defaultModels;try{const e=await fetch("/api/settings/model-settings");if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);const o=await e.json(),n=function(e,o={}){const n=Object.values(e||{}).flatMap(e=>Array.isArray(e?.toolTypes)?e.toolTypes:[]),t=[...new Set([...dm,...Object.keys(o||{}),...n])],r=Object.fromEntries(t.map(e=>[e,[]]));if(Object.keys(o||{}).length>0){for(const e of t)r[e]=cm(o[e]||[]);return r}for(const[a,l]of Object.entries(e||{})){if(!l||"object"!=typeof l||!l.limit||!l.pricing)continue;const e=Array.isArray(l.toolTypes)?l.toolTypes:[um(a)];for(const o of e)r[o]&&r[o].push(a)}return Object.fromEntries(t.map(e=>[e,cm(r[e])]))}(o.models||{},o.toolModels||{});lm.value=Object.fromEntries(Object.entries(n).map(([e,o])=>[e,o.length>0?o:[...sm[e]||[]]]))}catch(e){lm.value=pm()}}catch(n){am.value=sm,lm.value=pm()}finally{im.value=!1,hm=null}return am.value})())}function mm(e){const o=am.value?.[e];if(Array.isArray(o)&&o.length>0)return o;const n=lm.value?.[e];return Array.isArray(n)&&n.length>0?n:sm[e]||[]}function vm(e){return lm.value?.[e]||sm[e]||[]}function gm(){return{defaultModels:am,allModels:lm,loading:im,loadDefaultModels:fm,getDefaultModels:mm,getAllModelsByToolType:vm}}var bm={class:"model-redirect-editor"},ym={class:"redirect-input"},xm={class:"redirect-arrow"},Cm={class:"redirect-input"},wm={__name:"ModelRedirectEditor",props:{modelValue:{type:Array,default:()=>[]},availableModels:{type:Array,default:()=>[]},channelType:{type:String,default:"claude"}},emits:["update:modelValue"],setup(e,{emit:o}){const n=e,t=o,{getDefaultModels:r,loadDefaultModels:a}=gm();Je(async()=>{await a()});const l=to(()=>n.availableModels&&n.availableModels.length>0?n.availableModels:r(n.channelType).map(e=>({label:e,value:e})));function i(e){if(!e)return l.value;const o=e.toLowerCase();return l.value.filter(e=>(e.label||e.value||"").toLowerCase().includes(o))}function s(e,o,r){const a=[...n.modelValue];a[e]={...a[e],[o]:r},t("update:modelValue",a)}function d(){t("update:modelValue",[...n.modelValue,{from:"",to:""}])}return(o,r)=>(Ye(),Ro("div",bm,[(Ye(!0),Ro(co,null,He(e.modelValue,(e,o)=>(Ye(),Ro("div",{key:o,class:"redirect-row"},[Mo("div",ym,[Ne(yo(Wl),{value:e.from,options:i(e.from),placeholder:"源模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>s(o,"from",e)},null,8,["value","options","onUpdate:value"])]),Mo("div",xm,[Ne(yo(Q),{size:"16",color:"#999"},{default:io(()=>[Ne(yo(pn))]),_:1})]),Mo("div",Cm,[Ne(yo(Wl),{value:e.to,options:i(e.to),placeholder:"目标模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>s(o,"to",e)},null,8,["value","options","onUpdate:value"])]),Ne(yo(me),{quaternary:"",circle:"",size:"small",onClick:e=>function(e){const o=n.modelValue.filter((o,n)=>n!==e);t("update:modelValue",o)}(o)},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(sn))]),_:1})]),_:1},8,["onClick"])]))),128)),Ne(yo(me),{dashed:"",size:"small",onClick:d,class:"add-btn"},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Zo))]),_:1})]),default:io(()=>[r[0]||(r[0]=$e(" 添加重定向规则 ",-1))]),_:1})]))}},Sm=ge(wm,[["__scopeId","data-v-8ebdcad0"]]);function km(e,o=""){const n=Io(!1),t=Io([]),r=Io(""),a=Io(null);return{loading:n,candidates:t,warning:r,quota:a,sync:async function(){n.value=!0,r.value="";try{const n=await async function(e,o=""){return(await Eo.post(`${Bh(e)}/auth/sync-local`,o?{channelId:o}:{})).data}(yo(e),yo(o));return t.value=n.candidates||[],r.value=(n.warnings||[]).join(" "),n}catch(a){throw r.value=a?.response?.data?.error||a.message||"同步本地 OAuth 失败",a}finally{n.value=!1}},refreshQuota:async function(n=!0){const t=yo(o);if(!t)return null;const l=await async function(e,o,n=!1){const t=n?"?refresh=true":"";return(await Eo.get(`${Bh(e)}/${encodeURIComponent(o)}/auth/quota${t}`)).data}(yo(e),t,n);return a.value=l.quota||null,l.warning&&(r.value=l.warning),l}}}var Pm={class:"channel-auth-section"},Tm={class:"oauth-content"},Im={key:2,class:"oauth-meta"},Am={key:3,class:"oauth-quota"},zm={__name:"ChannelAuthSection",props:{platform:String,channelId:String,formData:Object,authMeta:Object},emits:["update-auth"],setup(e,{emit:o}){const n=e,t=o;function r(e){const o=e.authRef||e;return`${o.credentialId||o.providerId}:${o.accountId||o.identityKey||o.accountEmail||"account"}`}const a=to(()=>r({authRef:n.formData.authRef})),{loading:l,candidates:i,warning:s,quota:d,sync:c,refreshQuota:u}=km(lo(n,"platform"),lo(n,"channelId")),p=to(()=>Array.isArray(d.value?.windows)&&d.value.windows.length?d.value.windows:[d.value?.primary,d.value?.secondary]);function h(e){const o=i.value.find(o=>r(o)===e);o&&t("update-auth",o)}return(o,n)=>(Ye(),Ro("div",Pm,[Mo("div",Tm,[Ne(yo(me),{size:"small",type:"primary",loading:yo(l),onClick:yo(c)},{default:io(()=>[...n[0]||(n[0]=[$e("同步本地 OAuth",-1)])]),_:1},8,["loading","onClick"]),yo(s)?(Ye(),qe(yo(Cl),{key:0,type:"warning","show-icon":!1},{default:io(()=>[$e(eo(yo(s)),1)]),_:1})):Oe("",!0),yo(i).length?(Ye(),qe(yo(us),{key:1,value:a.value,"onUpdate:value":h},{default:io(()=>[Ne(yo(Ud),{vertical:""},{default:io(()=>[(Ye(!0),Ro(co,null,He(yo(i),o=>(Ye(),qe(yo(ds),{key:o.id,value:r(o)},{default:io(()=>[$e(eo(o.providerId||e.platform)+" / "+eo(o.accountEmail||o.accountId||o.authRef?.identityKey||"本地账户"),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])):Oe("",!0),e.authMeta?.channel?(Ye(),Ro("div",Im,eo(e.authMeta.channel.authRef?.providerId||e.platform)+" · "+eo(e.authMeta.channel.authRef?.accountEmail||e.authMeta.channel.authRef?.accountId||"已同步"),1)):Oe("",!0),yo(d)?(Ye(),Ro("div",Am,[(Ye(!0),Ro(co,null,He(p.value,e=>(Ye(),Ro("span",{key:e?.id||e?.label||"missing-window"},eo(e?.label||"—")+": "+eo(e?`${e.remainingPercent}%`:"—"),1))),128)),Ne(yo(me),{text:"",size:"tiny",onClick:yo(u)},{default:io(()=>[...n[1]||(n[1]=[$e("刷新额度",-1)])]),_:1},8,["onClick"])])):Oe("",!0)])]))}},Rm=ge(zm,[["__scopeId","data-v-8fcf77d4"]]),Mm=[{id:"official",name:"Claude 官方",category:"official",websiteUrl:"https://www.anthropic.com",baseUrl:"https://api.anthropic.com",env:{}},{id:"claude_oauth",name:"Claude OAuth",category:"oauth",description:"使用本地 Claude 登录凭据",websiteUrl:"",baseUrl:"",authMode:"oauth",oauthProviderId:"claude",env:{}},{id:"openai",name:"OpenAI",category:"third_party",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",gatewaySourceType:"openai_compatible",targetApi:"responses",env:{}},{id:"deepseek",name:"DeepSeek",category:"cn_official",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/anthropic",env:{ANTHROPIC_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_HAIKU_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_SONNET_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_OPUS_MODEL:"DeepSeek-V3.2-Exp"}},{id:"zhipu",name:"智谱 GLM",category:"cn_official",websiteUrl:"https://open.bigmodel.cn",baseUrl:"https://open.bigmodel.cn/api/anthropic",env:{ANTHROPIC_MODEL:"glm-4.6",ANTHROPIC_DEFAULT_HAIKU_MODEL:"glm-4.5-air",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-4.6",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-4.6"}},{id:"kimi",name:"Kimi K2",category:"cn_official",websiteUrl:"https://platform.moonshot.cn",baseUrl:"https://api.moonshot.cn/anthropic",env:{ANTHROPIC_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_HAIKU_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_SONNET_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_OPUS_MODEL:"kimi-k2-thinking"}},{id:"minimax",name:"MiniMax",category:"cn_official",websiteUrl:"https://platform.minimaxi.com",baseUrl:"https://api.minimaxi.com/anthropic",env:{ANTHROPIC_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_HAIKU_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_SONNET_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_OPUS_MODEL:"MiniMax-M2"}},{id:"qwen",name:"通义千问",category:"cn_official",websiteUrl:"https://bailian.console.aliyun.com",baseUrl:"https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy",env:{ANTHROPIC_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_HAIKU_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_SONNET_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_OPUS_MODEL:"qwen3-max"}},{id:"doubao",name:"豆包 Seed",category:"cn_official",websiteUrl:"https://www.volcengine.com/product/doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/coding",env:{ANTHROPIC_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_HAIKU_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_SONNET_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_OPUS_MODEL:"doubao-seed-code-preview-latest"}},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",env:{}}],Fm={official:"官方",cn_official:"国内官方",aggregator:"聚合服务",third_party:"第三方",oauth:"OAuth",custom:"自定义"};function Om(e){return Mm.find(o=>o.id===e)}var $m=[{id:"openai",name:"OpenAI",category:"official",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",providerKey:"openai-official"},{id:"codex_oauth",name:"Codex OAuth",category:"oauth",description:"使用本地 Codex 登录凭据",websiteUrl:"",baseUrl:"",providerKey:"codex-oauth",authMode:"oauth",oauthProviderId:"codex"},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",providerKey:""}],Bm={official:"官方",oauth:"OAuth",custom:"自定义"};function Em(e){return $m.find(o=>o.id===e)}var _m=[{id:"google",name:"Google AI",category:"official",websiteUrl:"https://ai.google.dev",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiFormat:"gemini_api"},{id:"gemini_oauth",name:"Gemini OAuth",category:"oauth",description:"使用本地 Gemini 登录凭据",websiteUrl:"",baseUrl:"",model:"gemini-2.5-pro",authMode:"oauth",oauthProviderId:"gemini"},{id:"vertex_ai_v1",name:"Vertex AI v1",category:"official",websiteUrl:"https://cloud.google.com/vertex-ai/generative-ai/docs",baseUrl:"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google",apiFormat:"vertex_ai_v1"},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",apiFormat:"gemini_api"}],Dm={official:"官方",oauth:"OAuth",custom:"自定义"};function Lm(e){return _m.find(o=>o.id===e)}var Hm=[{id:"opencode_oauth",name:"OpenCode OAuth",category:"oauth",description:"使用本地 OpenCode / Codex OAuth 登录凭据",websiteUrl:"",baseUrl:"",wireApi:"openai",authMode:"oauth",oauthProviderId:"openai-codex",models:[]},{id:"openrouter",name:"OpenRouter",category:"apikey",description:"统一接口访问 200+ 模型",websiteUrl:"https://openrouter.ai",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",models:["anthropic/claude-3.5-sonnet","openai/gpt-4o","meta-llama/llama-3.1-405b"]},{id:"openai_api",name:"OpenAI API",category:"apikey",description:"OpenAI 官方 API(需要 API Key)",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",wireApi:"openai",models:["gpt-4o","gpt-4o-mini","o1","o1-mini","gpt-4-turbo"]},{id:"anthropic_api",name:"Anthropic API",category:"apikey",description:"Anthropic 官方 API(需要 API Key)",websiteUrl:"https://console.anthropic.com",baseUrl:"https://api.anthropic.com/v1",wireApi:"anthropic",models:["claude-3-5-sonnet","claude-3-opus","claude-3-haiku"]},{id:"deepseek",name:"DeepSeek",category:"apikey",description:"DeepSeek AI 模型",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/v1",wireApi:"openai",models:["deepseek-chat","deepseek-coder"]},{id:"groq",name:"Groq",category:"apikey",description:"超快推理速度",websiteUrl:"https://console.groq.com",baseUrl:"https://api.groq.com/openai/v1",wireApi:"openai",models:["llama-3.1-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768"]},{id:"together",name:"Together AI",category:"apikey",description:"开源模型托管",websiteUrl:"https://www.together.ai",baseUrl:"https://api.together.xyz/v1",wireApi:"openai",models:["meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","mistralai/Mixtral-8x7B-Instruct-v0.1"]},{id:"entry_claude",name:"Claude Code 入口",category:"entry",description:"渠道按 Claude Code 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"claude",providerApi:"anthropic-messages",models:[]},{id:"entry_codex",name:"Codex 入口",category:"entry",description:"渠道按 Codex 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"codex",models:[]},{id:"entry_gemini",name:"Gemini 入口",category:"entry",description:"渠道按 Gemini 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"gemini",providerApi:"google-generative-ai",models:[]},{id:"entry_responses",name:"Responses 入口",category:"entry",description:"渠道按 OpenAI Responses 请求入口管理(非 Codex)",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"openai_compatible",models:[]},{id:"custom",name:"自定义",category:"custom",description:"自定义 OpenAI 兼容的 API 端点",websiteUrl:"",baseUrl:"",wireApi:"openai",models:[]}],jm={oauth:"OAuth",apikey:"API Key",entry:"转换入口",custom:"自定义"};function Um(e){return Hm.find(o=>o.id===e)}var Wm=[{id:"openrouter",name:"OpenRouter",category:"apikey",description:"统一接口访问 200+ 模型",websiteUrl:"https://openrouter.ai",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",models:["anthropic/claude-3.5-sonnet","openai/gpt-4o","meta-llama/llama-3.1-405b"]},{id:"openai_api",name:"OpenAI API",category:"apikey",description:"OpenAI 官方 API(需要 API Key)",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",wireApi:"openai",models:["gpt-4o","gpt-4o-mini","o1","o1-mini","gpt-4-turbo"]},{id:"anthropic_api",name:"Anthropic API",category:"apikey",description:"Anthropic 官方 API(需要 API Key)",websiteUrl:"https://console.anthropic.com",baseUrl:"https://api.anthropic.com/v1",wireApi:"anthropic",models:["claude-3-5-sonnet","claude-3-opus","claude-3-haiku"]},{id:"deepseek",name:"DeepSeek",category:"apikey",description:"DeepSeek AI 模型",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/v1",wireApi:"openai",models:["deepseek-chat","deepseek-coder"]},{id:"groq",name:"Groq",category:"apikey",description:"超快推理速度",websiteUrl:"https://console.groq.com",baseUrl:"https://api.groq.com/openai/v1",wireApi:"openai",models:["llama-3.1-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768"]},{id:"together",name:"Together AI",category:"apikey",description:"开源模型托管",websiteUrl:"https://www.together.ai",baseUrl:"https://api.together.xyz/v1",wireApi:"openai",models:["meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","mistralai/Mixtral-8x7B-Instruct-v0.1"]},{id:"entry_claude",name:"Claude Code 入口",category:"entry",description:"渠道按 Claude Code 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"claude",providerApi:"anthropic-messages",models:[]},{id:"entry_codex",name:"Codex 入口",category:"entry",description:"渠道按 Codex 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"codex",models:[]},{id:"entry_gemini",name:"Gemini 入口",category:"entry",description:"渠道按 Gemini 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"google-generative-ai",gatewaySourceType:"gemini",models:[]},{id:"entry_responses",name:"Responses 入口",category:"entry",description:"渠道按 OpenAI Responses 请求入口管理(非 Codex)",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"openai_compatible",models:[]},{id:"custom",name:"自定义",category:"custom",description:"自定义 OpenAI 兼容的 API 端点",websiteUrl:"",baseUrl:"",wireApi:"openai",models:[]},{id:"omp_oauth",name:"OMP OAuth",category:"oauth",description:"使用本地 OMP broker OAuth 登录凭据",websiteUrl:"",baseUrl:"",providerKey:"omp-oauth",authMode:"oauth",oauthProviderId:""},{id:"omp_oauth_gateway",name:"OMP OAuth Auth Gateway",category:"oauth",description:"通过健康的 pi-native Auth Gateway 转发 OMP broker OAuth 登录态",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"openai-completions",gatewaySourceType:"openai_compatible",transport:"pi-native",authMode:"oauth",oauthProviderId:"",models:[]}],Nm={apikey:"API Key",entry:"转换入口",oauth:"OAuth",custom:"自定义"};function Km(e){return Wm.find(o=>o.id===e)}function Vm(e,o=new Set){if(null==e)return"";if("string"==typeof e)return e.trim();if("number"==typeof e||"boolean"==typeof e)return String(e);if(e instanceof Error)return String(e.message||"").trim();if("object"!=typeof e)return"";if(o.has(e))return"";o.add(e);for(const n of["message","error","detail","reason"]){const t=Vm(e[n],o);if(t)return t}if("unsupported"===e.status)return"当前 CLI 暂不支持该操作";if("invalid"===e.status)return"渠道参数无效";if("failed"===e.status)return"渠道操作失败";if(e.code)return String(e.code);try{const o=JSON.stringify(e);return o&&"{}"!==o?o:""}catch{return""}}function qm(e,o="操作失败"){const n=[e?.response?.data?.error,e?.response?.data?.message,e?.data?.error,e?.data?.message,e?.message,e];for(const t of n){const e=Vm(t);if(e&&"[object Object]"!==e)return e}return o}var{getAllModelsByToolType:Gm,loadDefaultModels:Jm}=gm(),Ym=/^https?:\/\//i,Zm=/^[a-z0-9_-]+$/i,Xm=new Set(["anyrouter","newcli"]),Qm=["model","allowedModels","speedTestModel","presetId","modelConfig","models","modelMetadataMode","modelBindings","modelRedirects","targetApi","apiFormat","proxyUrl"];function ev(e){const o=e?.extra;if(!o||"object"!=typeof o||Array.isArray(o))return e;const n={...e};return Qm.forEach(e=>{void 0!==n[e]&&null!==n[e]||void 0===o[e]||(n[e]=o[e])}),n}function ov(e){const o=Array.isArray(e)?e:e?.channels||[];return Array.isArray(o)?o.map(ev):[]}function nv(e){return ov(e)}function tv(e){const o=Number(e);return!Number.isFinite(o)||o<=0?null:Math.round(o)}function rv(e){const o=Number(e);return!Number.isFinite(o)||o<1?1:Math.min(100,Math.round(o))}function av(e,o,{required:n}={}){if(!o)return n?`${e}不能为空`:"";if(!Ym.test(o))return`${e}必须以 http:// 或 https:// 开头`;try{new URL(o)}catch(t){return`${e}不是合法的链接`}return""}function lv(e){const o=String(e||"").trim();return o?Zm.test(o)?"openai"===o.toLowerCase()?"Provider Key 不能使用保留值 openai,请改成 openai-official 之类的自定义标识":"":"只能包含字母、数字、下划线和中划线,例如 openai-official":"Provider Key 不能为空"}function iv(e,o){try{return JSON.stringify(e??o,null,2)}catch{return JSON.stringify(o,null,2)}}function sv(e,o,n){const t=String(e||"").trim();if(!t)return n;try{return JSON.parse(t)}catch(r){throw new Error(`${o}不是合法 JSON:${r.message}`)}}function dv(e){const o=sv(e,"模型定义",[]);if(!Array.isArray(o))throw new Error("模型定义必须是 JSON 数组");return o}function cv(e){try{const o=dv(e),n=new Set;for(const e of o){if(!e||"object"!=typeof e||Array.isArray(e))return"每个模型定义必须是对象";const o=String(e.id||"").trim();if(!o)return"每个模型定义都必须包含 id";const t=o.toLowerCase();if(n.has(t))return`模型 ID 重复:${o}`;n.add(t)}}catch(o){return o.message}return""}function uv(e){const o=sv(e,"Provider 高级配置",{});if(!o||"object"!=typeof o||Array.isArray(o))throw new Error("Provider 高级配置必须是 JSON 对象");return o}function pv(e){const o=!0!==e._showChannelBalance||wv(e),n=["api_key","oauth","none"].includes(e.authMode)?e.authMode:"api_key",t="oauth"===n?Object.fromEntries(["credentialId","providerId","accountId","identityKey","accountEmail"].map(o=>[o,String(e.authRef?.[o]||"").trim()])):void 0;return{apiKey:"oauth"===n||"none"===n?"":e.apiKey||"",authMode:n,...t?{authRef:t,authSource:"synced-local",authStatus:e.authStatus||"available"}:{},oauthProviderId:"oauth"===n&&(e.oauthProviderId||e.providerKey)||"",balanceToken:o&&e.balanceToken||"",balanceUserId:o&&e.balanceUserId||null}}function hv(e){const o=pv(e);return"oauth"!==o.authMode?o:yv(e)?{...o,apiKey:String(e.apiKey||"").trim(),transport:"pi-native"}:{...o,transport:""}}function fv(e){return{authMode:e.authMode,...e.authRef?{authRef:e.authRef,authSource:e.authSource,authStatus:e.authStatus}:{},...e.oauthProviderId?{oauthProviderId:e.oauthProviderId}:{},...Object.prototype.hasOwnProperty.call(e,"transport")?{transport:e.transport}:{}}}function mv(e={}){return"oauth"===e.authMode}function vv(e={}){return"oauth"===e.authMode&&"pi-native"!==e.transport}function gv(e){return!mv(e)}function bv(){return{key:"authMode",label:"本地登录",type:"channel-auth",showWhen:mv}}function yv(e={}){return mv(e)&&!0===e.oauthGatewayMode}function xv(e={}){return!mv(e)||yv(e)}function Cv(e={}){return!mv(e)}function wv(e={}){return!0===e._showChannelBalance&&Xm.has(function(e={}){const o=[e.presetId,e.providerKey,e.name,e.websiteUrl,e.baseUrl].map(e=>String(e||"").trim().toLowerCase()).join(" ");return o.includes("anyrouter")?"anyrouter":o.includes("code.newcli.com")||o.includes("newcli")||o.includes("new-cli")?"newcli":null}(e))}function Sv(e="余额凭据"){return{key:"balanceToken",label:e,type:"password",showWhen:e=>gv(e)&&wv(e),placeholder:"选填:余额接口需要的会话 Token / Cookie(NewCLI 可填完整 Cookie)"}}function kv(){return{key:"balanceUserId",label:"余额用户 ID",type:"number",min:1,clearable:!0,showWhen:e=>gv(e)&&wv(e),placeholder:"选填:New API / AnyRouter 需要 New-Api-User 时填写"}}function Pv(e={}){const o=Array.isArray(e.allowedModels)?e.allowedModels.map(e=>String(e||"").trim()).filter(Boolean):[];return 0===o.length?"(默认/测速模型)":o.length<=3?o.join(", "):`${o.slice(0,3).join(", ")} +${o.length-3}`}function Tv(e){const o=String(e||"").trim().toLowerCase();return"claude"===o?"Claude Code":"gemini"===o?"Gemini":"Codex"}function Iv(e,o){return"oauth"===o?.authMode?{...e,authMode:"oauth",baseUrl:"",apiKey:"",websiteUrl:"",oauthProviderId:o.oauthProviderId||e.providerKey||""}:{...e,authMode:"api_key",authRef:void 0,authSource:void 0,authStatus:void 0,oauthProviderId:""}}function Av(e=[]){return e.map(e=>({label:e,value:e}))}function zv(...e){const o=new Set,n=[];for(const t of e)for(const e of t||[]){const t=String(e?.value||"").trim();if(!t)continue;const r=t.toLowerCase();o.has(r)||(o.add(r),n.push({label:e?.label||t,value:t}))}return n}function Rv(e){return Av(Gm(e))}function Mv(e,o={}){if("omp"===e)return Rv("omp");if("opencode"===e){const e=["claude","codex","gemini"].includes(o.gatewaySourceType)?o.gatewaySourceType:"";return zv(Rv("opencode"),e?Rv(e):[])}return Rv(e)}var Fv={schedule:[{key:"maxConcurrency",label:"最大并发",type:"number",placeholder:"留空表示不限",clearable:!0,validate:e=>{if(null==e||""===e)return"";const o=Number(e);return!Number.isFinite(o)||o<=0?"并发需为大于 0 的数字":o>100?"并发最多 100":""}},{key:"weight",label:"调度权重",type:"number",placeholder:"默认 1",min:1,max:100,validate:e=>{const o=Number(e);return!Number.isFinite(o)||o<1?"调度权重至少为 1":""}},{key:"enabled",label:"渠道状态",type:"switch",checkedText:"启用",uncheckedText:"停用"}]},Ov={dsh:()=>({type:"dsh",displayName:"DSH",schedulerSource:"dsh",storageKeys:{localCollapse:"dshChannelCollapse",collapseConfigKey:"dsh",orderConfigKey:"dsh"},emptyDescription:"暂无 DSH 渠道",showEmptyAction:!0,emptyActionText:"添加 DSH 渠道",addTitle:"添加 DSH 渠道",editTitle:"编辑 DSH 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!0,formSections:[{title:"基本信息",fields:[{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",label:"Provider Key",type:"text",required:!0,disabledOnEdit:!0,placeholder:"英文标识,如 deepseek-official",validate:lv},{key:"providerApi",label:"上游 API",type:"select",options:[{label:"OpenAI Chat Completions",value:"openai-completions"},{label:"OpenAI Responses",value:"openai-responses"},{label:"Anthropic Messages",value:"anthropic-messages"}]},{key:"baseUrl",label:"Base URL",type:"text",required:!0,placeholder:"https://api.example.com/v1",validate:e=>av("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,placeholder:"sk-..."},{key:"apiKeyEnv",label:"Key 环境变量",type:"text",placeholder:"CTX_DSH_PROVIDER_API_KEY"},{key:"model",label:"默认模型",type:"select",required:!0,placeholder:"输入或选择默认模型"},{key:"models",label:"可用模型",type:"model-multi-select",required:!0,placeholder:"输入模型名称后回车,可多选"},{key:"speedTestModel",label:"测速模型",type:"select",placeholder:"留空则使用默认模型",options:Rv("dsh"),clearable:!0}]},{title:"模型重定向",description:"将代理收到的模型名重定向到该渠道的实际模型。",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Fv.schedule}],getInitialForm:()=>({name:"DSH 渠道",providerKey:"",providerApi:"openai-completions",baseUrl:"",apiKey:"",apiKeyEnv:"",model:"",models:[],speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({name:e.name||"",providerKey:e.providerKey||"",providerApi:e.providerApi||"openai-completions",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",apiKeyEnv:e.apiKeyEnv||"",model:e.model||e.models?.[0]?.id||"",models:Array.isArray(e.models)?e.models.map(e=>"string"==typeof e?e:e?.id).filter(Boolean):[],speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await Jm();const t=Rv("dsh");if(!e)return void(o.availableModels=t);const r=await async function(e,{forceRefresh:o=!1}={}){return(await Eo.get(`/dsh/channels/${encodeURIComponent(e)}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n});o.availableModels=zv(Av(Array.isArray(r?.models)?r.models.map(e=>"string"==typeof e?e:e?.id).filter(Boolean):[]),t),(r?.fallbackUsed||r?.disabledByConfig)&&(o.modelsFetchError=r.error||"无法自动获取模型列表",o.modelsFetchErrorHint=r.errorHint||"已使用本地默认模型列表,也可以手动填写模型名称")},testFn:Wh,api:{fetch:async()=>ov(await async function(){return Eh("dsh")}()),syncCurrent:Uh,create:e=>async function(e){return _h("dsh",e)}({name:e.name,providerKey:e.providerKey,providerApi:e.providerApi,baseUrl:e.baseUrl,apiKey:e.apiKey,apiKeyEnv:e.apiKeyEnv||void 0,model:e.model,models:e.models,speedTestModel:e.speedTestModel||null,modelRedirects:e.modelRedirects||[],maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled}),update:(e,o)=>Hh(e.id,{name:o.name,providerApi:o.providerApi,baseUrl:o.baseUrl,apiKey:o.apiKey,apiKeyEnv:o.apiKeyEnv||void 0,model:o.model,models:o.models,speedTestModel:o.speedTestModel||null,modelRedirects:o.modelRedirects||[],maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled}),toggle:(e,o)=>Hh(e.id,{enabled:o}),remove:jh,applyToSettings:e=>async function(e){return(await Eo.post(`/dsh/channels/${encodeURIComponent(e)}/apply`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),e.proxy&&n.push({text:"代理中",type:"info"}),n},buildInfoRows:(e,o)=>[{label:"Provider",value:e.providerKey||"(未设置)",mono:!0},{label:"API",value:e.providerApi||"openai-completions",mono:!0},{label:"Model",value:e.model||"(未设置)",mono:!0},{label:"URL",value:e.baseUrl,mono:!0},{label:"Key",value:o.maskApiKey(e.apiKey),mono:!0}]}),claude:()=>({type:"claude",displayName:"Claude",schedulerSource:"claude",storageKeys:{localCollapse:"claudeChannelCollapse",collapseConfigKey:"claude",orderConfigKey:"claude"},emptyDescription:"暂无渠道",showEmptyAction:!1,emptyActionText:"",modalWidth:520,formLabelWidth:95,showApplyButton:!0,presets:Mm,presetCategories:Fm,getPresetById:Om,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[bv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"输入渠道名称"},{key:"baseUrl",showWhen:gv,label:"接口地址",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>av("接口地址",e,{required:!0})},{key:"apiKey",showWhen:gv,label:"接口密钥",type:"password",required:!0,placeholder:"sk-..."},Sv(),kv(),{key:"websiteUrl",showWhen:gv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>av("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:gv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则自动检测)",description:"指定用于速度测试的模型,留空则使用自动检测",options:Rv("claude"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,showWhen:e=>"official"===e.presetId||"openai_compatible"===e.gatewaySourceType,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"OpenAI 网关",description:"OpenAI 格式渠道需要通过 Claude 代理使用;优先选择 Responses API,不兼容时再切到 Chat Completions",showWhen:e=>"openai_compatible"===e.gatewaySourceType,fields:[{key:"targetApi",label:"上游接口",type:"radio-group",options:[{label:"Responses API",value:"responses"},{label:"Chat Completions",value:"chat.completions"}]}]},{title:"模型配置",description:"代理关闭时:模型映射(写入 settings.json);代理开启时:模型重定向(如 opus → sonnet 节省 token)",collapsible:!0,showWhen:e=>!mv(e)&&e.presetId&&"official"!==e.presetId,fields:[{key:"modelConfig.model",label:"主模型",type:"autocomplete",placeholder:"如 glm-4.6"},{key:"modelConfig.haikuModel",label:"Haiku 模型",type:"autocomplete",placeholder:"如 glm-4.5-air"},{key:"modelConfig.sonnetModel",label:"Sonnet 模型",type:"autocomplete",placeholder:"如 glm-4.6"},{key:"modelConfig.opusModel",label:"Opus 模型",type:"autocomplete",placeholder:"如 glm-4.6"}]},{title:"调度配置",fields:Fv.schedule},{title:"网络代理",description:"部分渠道可能需要代理才能访问",collapsible:!0,fields:[{key:"proxyUrl",label:"代理地址",type:"text",placeholder:"http://127.0.0.1:7890(选填)"}]}],getInitialForm:()=>({presetId:"official",name:"Claude 官方",baseUrl:"https://api.anthropic.com",apiKey:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://www.anthropic.com",speedTestModel:"",modelConfig:{model:"",haikuModel:"",sonnetModel:"",opusModel:""},modelRedirects:[],proxyUrl:"",gatewaySourceType:"claude",targetApi:"responses",maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null}),mapChannelToForm:e=>({presetId:e.presetId||"official",name:e.name||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",speedTestModel:e.speedTestModel||"",modelConfig:{model:e.modelConfig?.model||"",haikuModel:e.modelConfig?.haikuModel||"",sonnetModel:e.modelConfig?.sonnetModel||"",opusModel:e.modelConfig?.opusModel||""},modelRedirects:e.modelRedirects||[],proxyUrl:e.proxyUrl||"",gatewaySourceType:e.gatewaySourceType||"claude",targetApi:e.targetApi||"responses",maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null}),onPresetChange:(e,o)=>{const n=Om(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.baseUrl=n.baseUrl,t.websiteUrl=n.websiteUrl||"",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"claude",t.targetApi=n.targetApi||t.targetApi||"responses",n.env&&(t.modelConfig={model:n.env.ANTHROPIC_MODEL||"",haikuModel:n.env.ANTHROPIC_DEFAULT_HAIKU_MODEL||"",sonnetModel:n.env.ANTHROPIC_DEFAULT_SONNET_MODEL||"",opusModel:n.env.ANTHROPIC_DEFAULT_OPUS_MODEL||""}),Iv(t,n)},fetchModelsForChannel:async(e,o)=>{await Jm();const n=Rv((t=o.gatewaySourceType,"openai_compatible"===String(t||"").trim().toLowerCase()?"codex":"claude"));var t;if(o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=n,void(o.modelsFetching=!1);try{const t=await async function(e,o="claude"){const n=o?{params:{type:o}}:void 0;return(await Eo.get(`/channels/${e}/models`,n)).data}(e,o.gatewaySourceType||null);t.models&&t.models.length>0?(o.availableModels=zv(Av(t.models),n),t.fallbackUsed&&(o.modelsFetchError=qm(t?.error,"无法自动获取模型列表(API 端点受保护)"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!t.fallbackUsed&&t.supported||(o.availableModels=n,o.modelsFetchError=qm(t?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表")}catch(r){o.availableModels=n;const e=r.response?.data;e?(o.modelsFetchError=qm(e?.error||r,"获取模型列表失败"),o.modelsFetchErrorHint=e.errorHint||"已使用默认模型列表"):(o.modelsFetchError=qm(r,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表")}finally{o.modelsFetching=!1}},testFn:Qh,api:{fetch:async()=>ov(await async function(){return(await Eo.get("/channels")).data}()),syncCurrent:Nh,create:async e=>{const o=pv(e);return await async function(e,o,n,t,r={}){const a={name:e,baseUrl:o,apiKey:n,websiteUrl:t,...r};return(await Eo.post("/channels",a)).data}(e.name,e.baseUrl,o.apiKey,e.websiteUrl||void 0,{maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled,presetId:e.presetId,modelConfig:e.modelConfig,modelRedirects:e.modelRedirects||[],proxyUrl:e.proxyUrl||"",speedTestModel:e.speedTestModel||null,gatewaySourceType:e.gatewaySourceType||"claude",targetApi:e.targetApi||"responses",...fv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=pv(o);return await Kh(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled,presetId:o.presetId,modelConfig:o.modelConfig,modelRedirects:o.modelRedirects||[],proxyUrl:o.proxyUrl||"",speedTestModel:o.speedTestModel||null,gatewaySourceType:o.gatewaySourceType||"claude",targetApi:o.targetApi||"responses",...fv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:(e,o)=>Kh(e.id,{enabled:o}),remove:Vh,applyToSettings:async e=>async function(e){return(await Eo.post(`/channels/${e}/apply-to-settings`)).data}(e.id),resetHealth:async e=>async function(e){return(await Eo.post(`/channels/${e}/reset-health`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"URL",value:e.baseUrl},{label:"Key",value:o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),codex:()=>({type:"codex",displayName:"Codex",schedulerSource:"codex",storageKeys:{localCollapse:"codexChannelCollapse",collapseConfigKey:"codex",orderConfigKey:"codex"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Codex 渠道",modalWidth:600,formLabelWidth:90,showApplyButton:!0,presets:$m,presetCategories:Bm,getPresetById:Em,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[bv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",showWhen:gv,label:"Provider Key",type:"text",required:!0,placeholder:"英文标识,如 openai-official",disabledOnEdit:!0,validate:lv},{key:"baseUrl",showWhen:gv,label:"Base URL",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>av("Base URL",e,{required:!0})},{key:"apiKey",showWhen:gv,label:"API Key",type:"password",required:!0,placeholder:"sk-..."},Sv(),kv(),{key:"websiteUrl",showWhen:gv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>av("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:gv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用默认)",description:"指定用于速度测试的模型,留空则使用默认模型",options:Rv("codex"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Fv.schedule}],getInitialForm:()=>({presetId:"openai",name:"OpenAI",providerKey:"openai-official",baseUrl:"https://api.openai.com/v1",apiKey:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://platform.openai.com",gatewaySourceType:"codex",speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",gatewaySourceType:e.gatewaySourceType||"codex",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Em(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.websiteUrl=n.websiteUrl||"",t.providerKey=n.providerKey||"",t.baseUrl=n.baseUrl,t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"codex",Iv(t,n)},fetchModelsForChannel:async(e,o)=>{if(await Jm(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=Rv("codex"),void(o.modelsFetching=!1);try{const n=await async function(e){return(await Eo.get(`/codex/channels/${e}/models`)).data}(e);n.models&&n.models.length>0?(o.availableModels=zv(Av(n.models),Rv("codex")),n.fallbackUsed&&(o.modelsFetchError=qm(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=Rv("codex"),o.modelsFetchError=qm(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=Rv("codex"),o.modelsFetchError=qm(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:of,api:{fetch:async()=>ov(await async function(){return(await Eo.get("/codex/channels")).data}()),syncCurrent:qh,create:async e=>{const o=pv(e);return await async function(e,o,n,t,r,a={}){return(await Eo.post("/codex/channels",{name:e,providerKey:o,baseUrl:n,apiKey:t,websiteUrl:r,...a})).data}(e.name,e.providerKey,e.baseUrl,o.apiKey,e.websiteUrl||"",{maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled,modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,gatewaySourceType:e.gatewaySourceType||"codex",...fv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=pv(o);return await Gh(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,gatewaySourceType:o.gatewaySourceType||"codex",...fv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>Gh(e.id,{enabled:o}),remove:Jh,applyToSettings:async e=>async function(e){return(await Eo.post(`/codex/channels/${e}/apply-to-settings`)).data}(e.id),resetHealth:async e=>async function(e){return(await Eo.post(`/codex/channels/${e}/reset-health`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"Provider",value:e.providerKey,mono:!0},{label:"Auth",value:"oauth"===e.authMode?"OAuth":"API Key",mono:!0},{label:"URL",value:vv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:vv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),gemini:()=>({type:"gemini",displayName:"Gemini",schedulerSource:"gemini",storageKeys:{localCollapse:"geminiChannelCollapse",collapseConfigKey:"gemini",orderConfigKey:"gemini"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Gemini 渠道",modalWidth:520,formLabelWidth:90,showApplyButton:!1,presets:_m,presetCategories:Dm,getPresetById:Lm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[bv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"model",label:"Model",type:"text",required:!0,placeholder:"例如 gemini-2.5-pro"},{key:"baseUrl",showWhen:gv,label:"Base URL",type:"text",required:!0,placeholder:"https://generativelanguage.googleapis.com/v1beta",validate:e=>av("Base URL",e,{required:!0})},{key:"apiKey",showWhen:gv,label:"API Key",type:"password",required:!0,placeholder:"AIza..."},Sv(),kv(),{key:"websiteUrl",showWhen:gv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>av("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:gv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用 model 字段)",description:"指定用于速度测试的模型,留空则使用上方配置的 Model",options:Rv("gemini"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Fv.schedule}],getInitialForm:()=>({presetId:"google",name:"Google AI",model:"gemini-2.5-pro",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiKey:"",apiFormat:"gemini_api",balanceToken:"",balanceUserId:null,websiteUrl:"https://ai.google.dev",gatewaySourceType:"gemini",speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",model:e.model||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",apiFormat:e.apiFormat||"gemini_api",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",gatewaySourceType:e.gatewaySourceType||"gemini",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Lm(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,n.model&&(t.model=n.model),t.websiteUrl=n.websiteUrl||"",t.baseUrl=n.baseUrl,t.apiFormat=n.apiFormat||"gemini_api",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"gemini",Iv(t,n)},fetchModelsForChannel:async(e,o)=>{if(await Jm(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=Rv("gemini"),void(o.modelsFetching=!1);try{const n=await async function(e){return(await Eo.get(`/gemini/channels/${e}/models`)).data}(e);n.models&&n.models.length>0?(o.availableModels=zv(Av(n.models),Rv("gemini")),n.fallbackUsed&&(o.modelsFetchError=qm(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=Rv("gemini"),o.modelsFetchError=qm(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=Rv("gemini"),o.modelsFetchError=qm(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:tf,api:{fetch:async()=>ov(await async function(){return(await Eo.get("/gemini/channels")).data}()),syncCurrent:Yh,create:async e=>{const o=pv(e);return await async function(e,o,n,t,r,a={}){return(await Eo.post("/gemini/channels",{name:e,baseUrl:o,apiKey:n,model:t,websiteUrl:r,...a})).data}(e.name,e.baseUrl,o.apiKey,e.model,e.websiteUrl||"",{maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled,modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,apiFormat:e.apiFormat||"gemini_api",gatewaySourceType:e.gatewaySourceType||"gemini",...fv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=pv(o);return await Zh(e.id,{name:o.name,model:o.model,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,apiFormat:o.apiFormat||"gemini_api",gatewaySourceType:o.gatewaySourceType||"gemini",...fv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>Zh(e.id,{enabled:o}),remove:Xh,resetHealth:async e=>async function(e){return(await Eo.post(`/gemini/channels/${e}/reset-health`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>{return[{label:"Model",value:e.model,mono:!0},{label:"API",value:(n=e.apiFormat,"vertex_ai_v1"===String(n||"").trim().toLowerCase()?"Vertex AI v1":"Gemini API")},{label:"URL",value:vv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:vv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}];var n}}),opencode:()=>({type:"opencode",displayName:"OpenCode",schedulerSource:"opencode",storageKeys:{localCollapse:"opencodeChannelCollapse",collapseConfigKey:"opencode",orderConfigKey:"opencode"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 OpenCode 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Hm,presetCategories:jm,getPresetById:Um,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[bv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"baseUrl",label:"Base URL",type:"text",required:!0,showWhen:gv,placeholder:"https://api.example.com/v1",validate:e=>av("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,showWhen:gv,placeholder:"sk-..."},Sv(),kv(),{key:"websiteUrl",label:"官网链接",type:"text",showWhen:gv,placeholder:"https://(选填)",validate:e=>av("官网链接",e,{required:!1})},{key:"model",label:"默认模型",type:"select",placeholder:"选择或输入默认模型(留空则由调度器决定)",options:[],clearable:!0},{key:"speedTestModel",label:"测速模型",type:"select",showWhen:gv,placeholder:"选择用于测速的模型(留空则使用默认模型)",description:"指定用于速度测试的模型,留空则自动检测",options:[],clearable:!0},{key:"allowedModels",label:"可用模型",type:"model-multi-select",placeholder:"选择注册到 OpenCode 的模型(留空则使用检测到的所有模型)",description:"选择哪些模型注册到 opencode.json 的 provider 配置中"}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Fv.schedule}],getInitialForm:()=>({presetId:"openrouter",name:"OpenRouter",providerKey:"openrouter",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",apiKey:"",authMode:"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},authSource:void 0,authStatus:void 0,oauthProviderId:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://openrouter.ai",model:"",gatewaySourceType:"codex",speedTestModel:"",modelRedirects:[],allowedModels:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||"",baseUrl:e.baseUrl||"",wireApi:e.wireApi||"openai",apiKey:e.apiKey||"",authMode:e.authMode||"api_key",authRef:e.authRef?{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...e.authRef}:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},authSource:e.authSource,authStatus:e.authStatus,oauthProviderId:e.oauthProviderId||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",model:e.model||"",gatewaySourceType:e.gatewaySourceType||"codex",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],allowedModels:e.allowedModels||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Um(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.websiteUrl=n.websiteUrl||"",t.baseUrl=n.baseUrl,t.wireApi=n.wireApi||"openai",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"codex",Iv(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await Jm(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null;const t=o.presetId||"";if(["entry_claude","entry_codex","entry_gemini"].includes(t)){const e=o.gatewaySourceType||"codex";return o.availableModels=Rv("claude"===e?"claude":"gemini"===e?"gemini":"codex"),void(o.modelsFetching=!1)}if(!e){const e=Mv("opencode",o);if(!o.baseUrl)return o.availableModels=e,o.modelsFetchMeta={offline:!0,source:"Models.dev"},void(o.modelsFetching=!1);try{const n=await async function({baseUrl:e,apiKey:o,gatewaySourceType:n}){return(await Eo.post("/opencode/channels/probe-models",{baseUrl:e,apiKey:o,gatewaySourceType:n})).data}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"codex"});o.availableModels=zv(Av(n.models||[]),e),n.error&&(o.modelsFetchError=qm(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||(e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(a){o.availableModels=e,o.modelsFetchError=qm(a,"获取模型列表失败"),o.modelsFetchErrorHint=e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}return}const r=Mv("opencode",o);try{const t=await async function(e,{forceRefresh:o=!1}={}){return(await Eo.get(`/opencode/channels/${e}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n}),a=Av(t.models||[]);o.availableModels=zv(a,r),(t.fallbackUsed||0===a.length&&r.length>0)&&(o.modelsFetchError=qm(t?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=t.errorHint||"已使用 Models.dev 离线模型列表")}catch(a){o.availableModels=r,o.modelsFetchError=qm(a,"获取模型列表失败"),o.modelsFetchErrorHint=r.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}},testFn:df,api:{fetch:async()=>ov(await async function(){return(await Eo.get("/opencode/channels")).data}()),syncCurrent:af,create:async e=>{const o=pv(e);return await async function(e,o,n,t={}){return(await Eo.post("/opencode/channels",{name:e,baseUrl:o,apiKey:n,wireApi:t.wireApi||"openai",gatewaySourceType:t.gatewaySourceType||"codex",enabled:!1!==t.enabled,weight:t.weight||1,maxConcurrency:t.maxConcurrency||null,model:t.model||null,modelRedirects:t.modelRedirects||[],speedTestModel:t.speedTestModel||null,presetId:t.presetId||null,providerKey:t.providerKey||"",websiteUrl:t.websiteUrl||"",allowedModels:t.allowedModels||[],authMode:t.authMode||"api_key",authRef:t.authRef,authSource:t.authSource,authStatus:t.authStatus,oauthProviderId:t.oauthProviderId||"",balanceToken:t.balanceToken||"",balanceUserId:t.balanceUserId||null})).data}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerKey:e.providerKey||"",maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled,model:e.model||null,gatewaySourceType:e.gatewaySourceType||"codex",modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,websiteUrl:e.websiteUrl||"",allowedModels:e.allowedModels||[],...fv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=pv(o);return await lf(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,wireApi:o.wireApi||"openai",websiteUrl:o.websiteUrl,model:o.model||null,gatewaySourceType:o.gatewaySourceType||"codex",maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,allowedModels:o.allowedModels||[],...fv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>lf(e.id,{enabled:o}),remove:sf,resetHealth:async e=>async function(e){return(await Eo.post(`/opencode/channels/${e}/reset-health`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"入口协议",value:Tv(e.gatewaySourceType),mono:!0},{label:"Wire API",value:e.wireApi||"openai",mono:!0},{label:"Provider Key",value:e.providerKey||"(未设置)",mono:!0},{label:"Auth",value:e.authMode||"api_key",mono:!0},{label:"Model",value:e.model||"(默认)",mono:!0},{label:"URL",value:vv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:vv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),omp:()=>({type:"omp",displayName:"OMP",schedulerSource:"omp",storageKeys:{localCollapse:"ompChannelCollapse",collapseConfigKey:"omp",orderConfigKey:"omp"},emptyDescription:"暂无 OMP 渠道",showEmptyAction:!0,emptyActionText:"添加 OMP 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Wm,presetCategories:Nm,getPresetById:Km,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[{...bv(),showWhen:e=>mv(e)&&!yv(e)},{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",showWhen:xv,label:"Provider Key",type:"text",required:!0,placeholder:"openai-official",validate:lv},{key:"baseUrl",showWhen:xv,label:e=>mv(e)?"Auth Gateway URL":"Base URL",type:"text",required:!0,skipOnOAuth:!1,placeholder:"https://api.example.com/v1",validate:(e,o)=>av(mv(o)?"Auth Gateway URL":"Base URL",e,{required:!0})},{key:"apiKey",showWhen:xv,label:e=>mv(e)?"Gateway Token":"API Key",type:"password",required:!0,skipOnOAuth:!1,placeholder:"sk-...",validate:(e,o)=>function(e,o){if(null==o||""===o)return`${e}不能为空`}(mv(o)?"Gateway Token":"API Key",e)},{key:"routingGroup",showWhen:xv,label:"路由组",type:"text",placeholder:"相同路由组的兼容渠道可动态切换",description:"留空时按渠道 ID 隔离"},Sv(),kv(),{key:"websiteUrl",showWhen:Cv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>av("官网链接",e,{required:!1})},{key:"model",label:"默认模型",type:"select",placeholder:"选择或输入默认模型(留空则由 OMP 决定)",options:[],clearable:!0},{key:"speedTestModel",showWhen:Cv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用默认模型)",options:[],clearable:!0},{key:"allowedModels",label:"可用模型",type:"model-multi-select",placeholder:"选择注册到 OMP models.yml 的模型",description:"仅选中的模型会暴露给 OMP;留空时仅使用默认模型/测速模型,不回退到 provider 全量目录"}]},{title:"模型 Metadata",description:"自动获取后可直接修改;保存时以当前内容覆盖自动结果",collapsible:!0,fields:[{key:"modelDefinitionsJson",label:"模型定义",type:"model-definitions",fullWidth:!0,placeholder:'[\n { "id": "gpt-5.5", "reasoning": true, "contextWindow": 1050000 }\n]',validate:cv}]},{title:"模型重定向",description:"仅在 coding-tool-x 托管 OMP models.yml provider 启用时用于模型选择提示",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Fv.schedule}],getInitialForm:()=>({presetId:"openrouter",name:"OpenRouter",providerKey:"openrouter",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",providerApi:"openai-completions",apiKey:"",authMode:"api_key",oauthGatewayMode:!1,authSource:void 0,authStatus:void 0,oauthProviderId:"",transport:"",routingGroup:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://openrouter.ai",model:"",gatewaySourceType:"openai_compatible",speedTestModel:"",modelRedirects:[],allowedModels:[],modelMetadataMode:"hybrid",modelDefinitionsJson:"[]",providerConfigJson:"{}",modelMetadataFetching:!1,modelMetadataStatus:"",maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null,modelsFetchMeta:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||e.provider||e.name||"",baseUrl:e.baseUrl||"",wireApi:e.wireApi||"openai",providerApi:e.providerApi||e.api||"openai-completions",apiKey:e.apiKey||"",authMode:e.authMode||"api_key",authRef:e.authRef?{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...e.authRef}:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},oauthGatewayMode:"oauth"===e.authMode&&("pi-native"===e.transport||"pi-native"===e.providerConfig?.transport),authSource:e.authSource,authStatus:e.authStatus,oauthProviderId:e.oauthProviderId||"",transport:e.transport||e.extra?.transport||e.providerConfig?.transport||"",routingGroup:e.routingGroup||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",model:e.model||"",gatewaySourceType:e.gatewaySourceType||"openai_compatible",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],allowedModels:e.allowedModels||[],modelMetadataMode:"hybrid",modelDefinitionsJson:iv(e.models||[],[]),providerConfigJson:iv(e.providerConfig||{},{}),modelMetadataFetching:!1,modelMetadataStatus:"",maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null,modelsFetchMeta:null}),onPresetChange:(e,o)=>{const n=Km(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.providerKey=n.providerKey||(n.id||n.name||"provider").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,""),t.baseUrl=n.baseUrl,t.wireApi=n.wireApi||"openai",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"openai_compatible",t.transport=n.transport||"",t.websiteUrl=n.websiteUrl||"",t.oauthGatewayMode="omp_oauth_gateway"===n.id,"oauth"===n.authMode?{...t,authMode:"oauth",apiKey:"",authRef:void 0,authSource:void 0,authStatus:void 0,oauthProviderId:n.oauthProviderId||""}:Iv(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await Jm(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null;const t=Mv("omp",o);if(e)try{const r=await async function(e,{forceRefresh:o=!1}={}){return(await Eo.get(`/omp/channels/${e}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n}),a=Av(r.models||[]);o.availableModels=zv(a,t),o.modelsFetchMeta={cached:!!r.cached,stale:!!r.stale,retryAfter:r.retryAfter||null,fetchedAt:r.fetchedAt||null,offline:0===a.length,source:a.length>0?"channel":"Models.dev"},(r.error||0===a.length&&t.length>0)&&(o.modelsFetchError=qm(r?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=r.errorHint||"已使用 Models.dev 离线模型列表")}catch(r){o.availableModels=t,o.modelsFetchError=qm(r,"获取模型列表失败"),o.modelsFetchErrorHint=t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}else{if(!o.baseUrl)return o.availableModels=t,o.modelsFetchMeta={offline:!0,source:"Models.dev"},void(o.modelsFetching=!1);try{const e=await async function(e,{forceRefresh:o=!1}={}){return(await Eo.post("/omp/channels/probe-models",{...e,forceRefresh:o})).data}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"openai_compatible",authMode:o.authMode||"api_key",oauthProviderId:o.oauthProviderId||"",transport:o.transport||(mv(o)?"pi-native":""),model:o.model||null,speedTestModel:o.speedTestModel||null,allowedModels:Array.isArray(o.allowedModels)?o.allowedModels:[],modelRedirects:Array.isArray(o.modelRedirects)?o.modelRedirects:[]},{forceRefresh:n}),r=Av(e.models||[]);o.availableModels=zv(r,t),o.modelsFetchMeta={cached:!!e.cached,stale:!!e.stale,retryAfter:e.retryAfter||null,fetchedAt:e.fetchedAt||null,offline:0===r.length,source:r.length>0?"channel":"Models.dev"},e.error&&(o.modelsFetchError=qm(e?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=e.errorHint||(t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(r){o.availableModels=t,o.modelsFetchError=qm(r,"获取模型列表失败"),o.modelsFetchErrorHint=t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}}},fetchModelMetadataForChannel:async e=>{const o=String(e.providerKey||"").trim(),n=Array.isArray(e.allowedModels)?e.allowedModels:[],t=await async function(e,o={},{forceRefresh:n=!1}={}){return(await Eo.post("/omp/channels/catalog-metadata",{providerKey:e,forceRefresh:n,...o})).data}(o,{model:e.model||null,speedTestModel:e.speedTestModel||null,allowedModels:n,models:dv(e.modelDefinitionsJson),availableModels:n.length>0?[]:Array.isArray(e.availableModels)?e.availableModels.map(e=>e&&"object"==typeof e?e.value||e.id||e.name:e):[]}),r=dv(e.modelDefinitionsJson),a=new Map((t.models||[]).map(e=>[String(e.id||"").toLowerCase(),e]));for(const s of r){const e=String(s.id||"").toLowerCase(),o=a.get(e)||{};a.set(e,{...o,...s})}e.modelDefinitionsJson=iv([...a.values()].filter(e=>e.id),[]),e.modelMetadataMode="hybrid";const l=Array.isArray(t.warnings)?t.warnings.length:0,i="models.dev"===t.source?.name?"Models.dev":t.source?.name||"Models.dev";e.modelMetadataStatus=`已读取 ${t.models?.length||0} 个模型(${i} 离线快照)${l?`,${l} 条兼容提示`:""}`},api:{fetch:async()=>{const e=await async function(){return(await Eo.get("/omp/channels")).data}();return{channels:nv(e),authProviderMeta:Array.isArray(e)?null:e.authProviderMeta||null}},syncCurrent:uf,create:async e=>{const o=hv(e),n=uv(e.providerConfigJson);return await async function(e,o,n,t={}){const r=t.gatewaySourceType||"openai_compatible";let a=t.providerApi;return a||(a="claude"===r?"anthropic-messages":"gemini"===r?"google-generative-ai":"codex"===r?"responses":t.wireApi||"openai-completions"),(await Eo.post("/omp/channels",{name:e,baseUrl:o,apiKey:n,wireApi:t.wireApi||"openai",providerApi:a,providerKey:t.providerKey||"",authMode:t.authMode||"api_key",authRef:t.authRef,authSource:t.authSource,authStatus:t.authStatus,oauthProviderId:t.oauthProviderId||"",transport:t.transport||"",routingGroup:t.routingGroup||"",gatewaySourceType:r,enabled:!1!==t.enabled,model:t.model||null,allowedModels:t.allowedModels||[],speedTestModel:t.speedTestModel||null,presetId:t.presetId||null,websiteUrl:t.websiteUrl||"",balanceToken:t.balanceToken||"",balanceUserId:t.balanceUserId||null,models:Array.isArray(t.models)?t.models:[],modelMetadataMode:t.modelMetadataMode||"auto",modelBindings:Array.isArray(t.modelBindings)?t.modelBindings:[],providerConfig:t.providerConfig||{}})).data}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerApi:e.providerApi||"openai-completions",providerKey:e.providerKey,...fv(o),routingGroup:e.routingGroup||"",maxConcurrency:tv(e.maxConcurrency),weight:rv(e.weight),enabled:e.enabled,model:e.model||null,gatewaySourceType:e.gatewaySourceType||"openai_compatible",modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,websiteUrl:e.websiteUrl||"",allowedModels:e.allowedModels||[],balanceToken:o.balanceToken,balanceUserId:o.balanceUserId,models:dv(e.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(o,"transport")?{...n,transport:o.transport}:n})},update:async(e,o)=>{const n=hv(o),t=uv(o.providerConfigJson);return await pf(e.id,{name:o.name,providerKey:o.providerKey,baseUrl:o.baseUrl,apiKey:n.apiKey,wireApi:o.wireApi||"openai",providerApi:o.providerApi||"openai-completions",...fv(n),routingGroup:o.routingGroup||"",websiteUrl:o.websiteUrl,model:o.model||null,gatewaySourceType:o.gatewaySourceType||"openai_compatible",maxConcurrency:tv(o.maxConcurrency),weight:rv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,allowedModels:o.allowedModels||[],balanceToken:n.balanceToken,balanceUserId:n.balanceUserId,models:dv(o.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(n,"transport")?{...t,transport:n.transport}:t})},toggle:async(e,o)=>pf(e.id,{enabled:o}),remove:hf,resetHealth:async e=>async function(e){return(await Eo.post(`/omp/channels/${e}/reset-health`)).data}(e.id)},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>{const n=e.ompAuthProvider,t=[{label:"Provider",value:e.providerKey||e.provider||"(未设置)",mono:!0},{label:"API",value:e.providerApi||e.api||"openai-completions",mono:!0},{label:"Auth",value:e.authMode||"api_key",mono:!0},{label:"Routing Group",value:e.routingGroup||"(独立)",mono:!0},{label:"Model",value:e.model||"(默认)",mono:!0},{label:"Allowed",value:Pv(e),mono:!0}];return n&&t.push({label:"Login",value:n.loggedIn?`${n.name||n.id} (${n.accountCount||0})`:`${n.name||n.id} (未登录)`}),t.push({label:"URL",value:vv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:vv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}),t}})},$v=[1500,3e3,5e3,8e3];function Bv(e){try{const o=localStorage.getItem(e);if(o)return JSON.parse(o)}catch(o){}return{}}function Ev(e,o){try{localStorage.setItem(e,JSON.stringify(o))}catch(n){}}function _v(e,o){return qm(e,o||"操作失败")}function Dv(){return"undefined"==typeof document||"hidden"!==document.visibilityState}function Lv(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Hv(e){const o=Oh();let n=null,t=null,r=null,a=null,l=null,i=null,s=null,d=null,c=0;const u=no({channels:[],channelMeta:null,balances:{},loading:!1,balanceLoading:!1,balanceError:null,syncing:!1,toggling:{},collapsed:Bv(e.storageKeys.localCollapse),showDialog:!1,editingChannel:null,showChannelBalance:!1,formData:e.getInitialForm()}),p=no({});function h(e,{fallback:o=null,allowInsert:n=!1}={}){const t=function(e){return Lv(e?.channel)&&e.channel.id?e.channel:Lv(e)&&e.id?e:null}(e)||o;if(!t?.id)return!1;const r=u.channels.findIndex(e=>e.id===t.id);if(-1===r){if(!n)return!1;u.channels=[...u.channels,t]}else u.channels[r]={...u.channels[r],...t};return A(),f(),k(),!0}function f(){const n=o.getSchedulerState(e.schedulerSource);n?.channels?.length&&u.channels.length&&(u.channels.forEach(e=>{const o=n.channels.find(o=>o.id===e.id);o?.health&&(e.health=o.health)}),k())}const m=Xe(()=>o.getSchedulerState(e.schedulerSource)?.channels,f);function v(){const n=function(){if("function"!=typeof o.getChannels)return[];const n=o.getChannels(e.type);return Array.isArray(n?.value)?n.value:[]}();n.length&&!u.channels.length&&(u.channels=[...n],A(),f(),k())}function g(){s&&(clearTimeout(s),s=null)}function b(e){if(g(),!function(e){return Boolean(e?.refreshing||e?.authProvider?.refreshing)}(e))return void(c=0);if(c>=$v.length)return;const o=$v[c];c+=1,s=setTimeout(()=>{s=null,y({silent:!0,skipBalance:!0}).catch(()=>{})},o)}async function y(o={}){return d||(d=async function({silent:o=!1,skipBalance:n=!1}={}){o||(c=0);v(),u.loading=!o&&0===u.channels.length;try{const o=function(e){if(Array.isArray(e))return{channels:e,meta:null};if(!Lv(e))return{channels:[],meta:null};const o=Lv(e.authProviderMeta)?e.authProviderMeta:null,n=Lv(e.meta)?{...e.meta}:{};return o&&(n.authProvider=o),{channels:Array.isArray(e.channels)?e.channels:[],meta:Object.keys(n).length>0?n:null}}(await e.api.fetch());u.channels=[...o.channels],u.channelMeta=o.meta,await A(),f(),k(),b(u.channelMeta),n||w()}catch(t){0===u.channels.length&&eh.error(_v(t,`${e.displayName} 渠道加载失败`))}finally{u.loading=!1}}(o).finally(()=>{d=null}),d)}async function x(){return l||(u.balanceLoading=!0,u.balanceError=null,l=(async()=>{try{if(!0!==(await I())?.channelBalance?.showRemaining)return u.showChannelBalance=!1,u.formData._showChannelBalance=!1,u.balances={},null;u.showChannelBalance=!0,u.formData._showChannelBalance=!0;const o=await async function(e){return(await Eo.get("/channel-balances",{params:{source:e}})).data}(e.type);return u.balances=o?.enabled&&o.balances?o.balances:{},o?.refreshing&&(r&&clearTimeout(r),r=setTimeout(()=>{r=null,Dv()&&x().catch(()=>{})},1200)),o}catch(o){return u.balanceError=_v(o,`${e.displayName} 余额加载失败`),null}finally{u.balanceLoading=!1,l=null}})(),l)}function C(){t&&(clearTimeout(t),t=null),null!==a&&"undefined"!=typeof window&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(a),a=null,r&&(clearTimeout(r),r=null)}function w(){if(C(),!Dv())return;const e=()=>{t&&clearTimeout(t),a=null,t=null,x()};t=setTimeout(()=>{"undefined"==typeof window||"function"!=typeof window.requestIdleCallback?e():a=window.requestIdleCallback(e,{timeout:1500})},5e3)}function S(){n&&(clearTimeout(n),n=null)}function k(){S();const e=u.channels.filter(e=>"frozen"===e.health?.status&&Number(e.health?.freezeRemaining)>0).sort((e,o)=>Number(e.health?.freezeRemaining||0)-Number(o.health?.freezeRemaining||0))[0];if(!e)return;const o=Math.max(1e3,1e3*Number(e.health.freezeRemaining||0));n=setTimeout(()=>{n=null,y()},o+250)}let P=null,T=0;async function I(){return P&&Date.now()-T<6e4?P:i||(i=(async()=>{try{const e=await jo();if(e.success&&e.config)return P=e.config,T=Date.now(),P}catch(e){}finally{i=null}return null})(),i)}async function A(){try{if(u.channels.length>0){const e=[...u.channels].sort((e,o)=>{const n=e.updatedAt||e.createdAt||0;return(o.updatedAt||o.createdAt||0)-n}),o=e.filter(e=>!1!==e.enabled),n=e.filter(e=>!1===e.enabled);n.forEach(e=>{u.collapsed[e.id]=!0}),u.channels=[...o,...n]}}catch(e){}}async function z(){try{await qo("channelCollapse",e.storageKeys.collapseConfigKey,u.collapsed)}catch(o){}}function R(){u.showDialog=!1,u.editingChannel=null,u.formData=e.getInitialForm()}function M(){Object.keys(p).forEach(e=>{delete p[e]})}function F(){let o=!0;const n=e=>{const o=e.key.replace(/\./g,"_");delete p[e.key],delete p[o]};return e.formSections.forEach(e=>{const t=(e=>!e.showWhen||e.showWhen(u.formData))(e);e.fields.forEach(e=>{if(!t||!(e=>!e.showWhen||e.showWhen(u.formData))(e)||"oauth"===u.formData.authMode&&["baseUrl","apiKey","providerApi","gatewaySourceType"].includes(e.key)&&!1!==e.skipOnOAuth)return void n(e);if(e.disabledOnEdit&&u.editingChannel)return void n(e);const r=((e,o)=>{if(!o||"string"!=typeof o||!o.includes("."))return e[o];const n=o.split(".");let t=e;for(const r of n)t=t?.[r];return t})(u.formData,e.key);let a="";e.required&&(a=e.customRequiredMessage?null==r||""===r?e.customRequiredMessage:"":null==r||""===r?`${(e=>"function"==typeof e.label?e.label(u.formData):e.label)(e)}不能为空`:""),a||"function"!=typeof e.validate||(a=e.validate(r,u.formData)||""),a?(p[e.key]={status:"error",message:a},o=!1):n(e)})}),o}function O(o={}){const n=Number(o.added||0),t=Number(o.updated||0),r=Number(o.skipped||0);if(n>0||t>0){const o=[];return n>0&&o.push(`新增 ${n} 个`),t>0&&o.push(`更新 ${t} 个`),`${e.displayName} 同步完成:${o.join(",")}`}return r>0?`${e.displayName} 已在列表中,未重复导入`:`${e.displayName} 无需同步`}async function $(){P=null,T=0,i=null,await x(),u.formData._showChannelBalance=u.showChannelBalance}function B(){Dv()&&w()}return"undefined"!=typeof window&&window.addEventListener("channel-balance-visibility-change",$),"undefined"!=typeof document&&document.addEventListener("visibilitychange",B),v(),y().catch(()=>{}),async function(){try{const o=await I();if(o){const n=o.channelCollapse?.[e.storageKeys.collapseConfigKey]||{};u.collapsed=n,Ev(e.storageKeys.localCollapse,n)}}catch(o){}}().catch(()=>{}),_e(()=>{S(),C(),g(),m(),"undefined"!=typeof window&&window.removeEventListener("channel-balance-visibility-change",$),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",B)}),{state:u,validation:p,actions:{loadChannels:y,loadChannelBalances:x,openAddDialog:function(){u.editingChannel=null,u.formData={authMode:"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},...e.getInitialForm()||{}},u.formData._showChannelBalance=u.showChannelBalance,M(),u.showDialog=!0},closeDialog:R,toggleCollapse:function(o){u.collapsed[o]=!u.collapsed[o],Ev(e.storageKeys.localCollapse,u.collapsed),z()},handleEdit:function(o){u.editingChannel=o,u.formData={authMode:o.authMode||"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...o.authRef||{}},...e.mapChannelToForm(o)||{}},u.formData._showChannelBalance=u.showChannelBalance,M(),u.showDialog=!0},handleSave:async function(){if(!F()){const e=Object.values(p).map(e=>e?.message).filter(Boolean);return void eh.error(e.length>0?`请检查表单:${e.join(";")}`:"请检查表单填写是否完整")}try{const o=Boolean(u.editingChannel),n=h(o?await e.api.update(u.editingChannel,u.formData):await e.api.create(u.formData),{allowInsert:!o});eh.success(`${e.displayName} 渠道已${o?"更新":"添加"}`),R(),n||await y()}catch(o){eh.error(_v(o))}},handleDelete:function(o){oh.warning({title:`删除 ${e.displayName} 渠道`,content:"确定要删除这个渠道吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{await e.api.remove(o),u.channels=u.channels.filter(e=>e.id!==o),delete u.collapsed[o],Ev(e.storageKeys.localCollapse,u.collapsed),eh.success(`${e.displayName} 渠道已删除`)}catch(n){eh.error(_v(n))}}})},handleToggleEnabled:async function(o,n){if(o&&!u.toggling[o.id]){u.toggling[o.id]=!0;try{const t="boolean"==typeof n?n:!1===o.enabled,r=await e.api.toggle(o,t);eh.success(`${e.displayName} 渠道已${t?"启用":"禁用"}`),t?(delete u.collapsed[o.id],Ev(e.storageKeys.localCollapse,u.collapsed),z()):(u.collapsed[o.id]=!0,Ev(e.storageKeys.localCollapse,u.collapsed),z()),h(r,{fallback:{...o,enabled:t}})||await y(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(t){eh.error(_v(t))}finally{u.toggling[o.id]=!1}}},handleSyncCurrentChannels:async function(){if("function"!=typeof e.api.syncCurrent)return eh.warning(`${e.displayName} 暂不支持同步`),null;if(u.syncing)return null;u.syncing=!0;try{const o=await e.api.syncCurrent();await y(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}));const n=Array.isArray(o?.warnings)?o.warnings.filter(Boolean):[];n.length>0&&eh.warning(n.join(";"));const t=Number(o?.added||0),r=Number(o?.updated||0);return t>0||r>0?eh.success(O(o)):eh.info(O(o)),o}catch(o){return eh.error(_v(o,`${e.displayName} 同步失败`)),null}finally{u.syncing=!1}},handleApplyToSettings:function(o){"function"==typeof e.api.applyToSettings&&oh.warning({title:"写入配置",content:"写入配置后会关闭动态切换并默认使用该渠道,是否继续?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{const n=await e.api.applyToSettings(o);eh.success("已将渠道写入配置文件"),h(n)||!1===n?.success||await y(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(n){eh.error(_v(n))}}})},handleResetHealth:async function(o){if("function"==typeof e.api.resetHealth)try{const n=await e.api.resetHealth(o);n?.health?(o.health=n.health,f(),k()):await y(),eh.success("渠道健康状态已重置")}catch(n){eh.error(_v(n))}},handleRefreshBalance:async function(o){if(o?.id)try{const n=await async function(e,o){return(await Eo.post(`/channel-balances/${e}/${o}/refresh`)).data}(e.type,o.id);n?.enabled&&n.balance&&(u.balances[o.id]=n.balance,u.balanceError=null)}catch(n){u.balanceError=_v(n,`${o.name||e.displayName} 余额刷新失败`)}}}}}var jv=Object.freeze({endpoint:Object.freeze([{key:"baseUrl",label:"Base URL",type:"text",required:!0},{key:"websiteUrl",label:"官网链接",type:"text",required:!1}]),auth:Object.freeze([{key:"authMode",label:"认证方式",type:"select",options:["api_key","none"]},{key:"apiKey",label:"API Key",type:"password",required:!1}]),schedule:Object.freeze([{key:"maxConcurrency",label:"最大并发",type:"number",required:!1},{key:"weight",label:"调度权重",type:"number",min:1,max:100},{key:"enabled",label:"渠道状态",type:"switch",default:!0}])});function Uv(){return{name:"",baseUrl:"",websiteUrl:"",apiKey:"",authMode:"api_key",maxConcurrency:null,weight:1,enabled:!0}}var Wv={key:0,class:"loading-container"},Nv={key:1},Kv={key:0,class:"empty-state"},Vv={key:1,class:"channels-list"},qv={class:"section-title"},Gv={key:0,class:"section-desc"},Jv={key:0,class:"model-catalog-control"},Yv={key:3,class:"auth-provider-status"},Zv={key:9,class:"model-definitions-editor"},Xv={class:"model-definitions-toolbar"},Qv={class:"model-catalog-status",role:"status","aria-live":"polite"},eg={class:"dialog-footer"},og={__name:"BaseChannelPanel",props:{type:{type:String,required:!0}},emits:["open-website"],setup(e,{expose:o,emit:n}){const t=e,r=n,a=Vo().get(t.type)||{key:t.type,label:t.type,capabilities:{channels:!0}},l=(Ov[t.type]||(()=>function(e={},o={}){const n=String(e.key||"").trim().toLowerCase(),t=String(e.label||e.title||n).trim();return{type:n,displayName:t,schedulerSource:n,storageKeys:{localCollapse:`${n}ChannelCollapse`,collapseConfigKey:n,orderConfigKey:n},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加渠道",addTitle:`添加 ${t} 渠道`,editTitle:`编辑 ${t} 渠道`,modalWidth:520,formLabelWidth:95,showApplyButton:!1,formSections:[{title:"基本信息",fields:jv.endpoint},{title:"认证",fields:jv.auth},{title:"调度配置",fields:jv.schedule}],api:o,getInitialForm:Uv,mapChannelToForm:e=>({name:"",baseUrl:"",websiteUrl:"",apiKey:"",authMode:"api_key",maxConcurrency:null,weight:1,enabled:!0,...e||{}}),normalizeForm:e=>({...e}),getFormTitle:e=>e?`编辑 ${t} 渠道`:`添加 ${t} 渠道`,getChannelTitle:e=>e?.name||t,getHeaderTags:(e,o={})=>"frozen"===e.health?.status?[{text:"function"==typeof o.formatFreeze?o.formatFreeze(e.health.freezeRemaining):"已冻结",type:"error"}]:"checking"===e.health?.status?[{text:"检测中",type:"warning"}]:[],buildInfoRows:(e,o={})=>[{label:"URL",value:e.baseUrl,mono:!0},{label:"Key",value:e.apiKey?"function"==typeof o.maskApiKey?o.maskApiKey(e.apiKey):"已设置":"none"===e.authMode?"无需认证":"未设置",mono:!0,action:e.health?.status&&"healthy"!==e.health.status&&"function"==typeof o.handleResetHealth?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}],fetch:o.fetch,create:o.create,update:o.update,remove:o.remove}}(a,{fetch:()=>Eh(t.type),create:e=>_h(t.type,e),update:(e,o)=>Dh(t.type,e.id,o),remove:e=>Lh(t.type,e),toggle:(e,o)=>Dh(t.type,e.id,{...e,enabled:o})})))(),{state:i,validation:s,actions:d}=Hv(l),{getChannelInflight:c}=function(e="claude"){const o=Oh();return{getChannelInflight:function(n){const t=(o.getSchedulerState(e)||{channels:[]}).channels?.find(e=>e.id===n);return t?t.inflight:0}}}(l.schedulerSource);function u(e){return"function"==typeof e.label?e.label(i.formData):e.label}function p(e){return Array.isArray(e)?e.map(p):e&&"object"==typeof e?Object.keys(e).sort().reduce((o,n)=>(o[n]=p(e[n]),o),{}):null==e?"":String(e)}function h(){const e=i.formData||{},o=String(e.apiKey||"");return JSON.stringify(p({channelId:i.editingChannel?.id||null,presetId:e.presetId||"",providerKey:e.providerKey||"",providerApi:e.providerApi||"",wireApi:e.wireApi||"",targetApi:e.targetApi||"",gatewaySourceType:e.gatewaySourceType||"",authMode:e.authMode||"",oauthProviderId:e.oauthProviderId||"",baseUrl:e.baseUrl||"",apiKeyMarker:o?`${o.length}:${o.slice(-4)}`:""}))}function f({clearOptions:e=!1}={}){i.formData.modelsFetching=!1,i.formData._modelsLoadedOnce=!1,i.formData._modelsFetchSignature=null,i.formData.modelsFetchError=null,i.formData.modelsFetchErrorHint=null,i.formData.modelsFetchMeta=null,e&&(i.formData.availableModels=[])}async function m(){if(!l.fetchModelsForChannel||i.formData.modelsFetching)return;const e=h();(i.formData.availableModels||[]).length>0&&i.formData._modelsLoadedOnce&&i.formData._modelsFetchSignature===e||await S({signature:e})}const v=to(()=>i.formData.modelsFetching?"正在加载模型":i.formData.modelsFetchError?"重试加载模型":(i.formData.availableModels||[]).length>0?"刷新可选模型":"加载可选模型"),g=to(()=>{if(i.formData.modelsFetching)return"正在读取模型列表,仍可继续填写表单。";if(i.formData.modelsFetchError){const e=i.formData.modelsFetchErrorHint,o=i.formData.modelsFetchMeta?.stale&&i.formData.modelsFetchMeta?.retryAfter?`当前使用缓存目录,${new Date(i.formData.modelsFetchMeta.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`:"";return`${e?`模型列表未能更新:${i.formData.modelsFetchError}。${e}`:`模型列表未能更新:${i.formData.modelsFetchError}。可重试或手动填写模型名称。`}${o?` ${o}`:""}`}const e=i.formData.modelsFetchMeta;if(e?.stale&&e?.retryAfter)return`正在使用缓存的模型目录;${new Date(e.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`;if(e?.stale)return"正在使用已过期的模型目录;可点击“刷新可选模型”更新。";if(e?.cached)return"已从本地缓存加载可选模型。";const o=(i.formData.availableModels||[]).length;return o>0?`已加载 ${o} 个可选模型。`:"可手动填写模型名称,或加载该渠道的可选模型。"});function b(e){return e.fields?.some(e=>(!e.showWhen||e.showWhen(i.formData))&&function(e){return!!["model-redirect","model-multi-select","autocomplete"].includes(e.type)||"select"===e.type&&["model","speedTestModel"].includes(e.key)}(e))&&Boolean(l.fetchModelsForChannel)}async function y(){if(!l.fetchModelsForChannel||i.formData.modelsFetching)return;const e=h();await S({forceRefresh:i.formData._modelsLoadedOnce&&i.formData._modelsFetchSignature===e,signature:e})}async function x(){if("function"==typeof l.fetchModelMetadataForChannel&&!i.formData.modelMetadataFetching){i.formData.modelMetadataFetching=!0,i.formData.modelMetadataStatus="正在读取 OMP metadata…";try{await l.fetchModelMetadataForChannel(i.formData)}catch(e){i.formData.modelMetadataStatus=e?.response?.data?.error||e?.message||"读取 OMP metadata 失败"}finally{i.formData.modelMetadataFetching=!1}}}const C=to(()=>{if(!l.presets)return[];const e={};return l.presets.forEach(o=>{const n=o.category||"custom";e[n]||(e[n]={type:"group",label:l.presetCategories?.[n]||n,key:n,children:[]}),e[n].children.push({label:o.name,value:o.id})}),Object.values(e)});function w(e){if(l.onPresetChange){const o=l.onPresetChange(e,i.formData);Object.assign(i.formData,o)}else i.formData.presetId=e;f({clearOptions:!0})}async function S({forceRefresh:e=!1,signature:o=h()}={}){if(l.fetchModelsForChannel){i.formData.modelsFetching=!0,i.formData.modelsFetchError=null,i.formData.modelsFetchErrorHint=null,i.formData.modelsFetchMeta=null;try{await l.fetchModelsForChannel(i.editingChannel?.id||null,i.formData,{forceRefresh:e})}catch(n){h()===o&&(i.formData.modelsFetchError=qm(n,"获取模型列表失败"),i.formData.modelsFetchErrorHint="可重试,或先手动填写模型名称")}finally{h()===o&&(i.formData.modelsFetching=!1)}if(h()!==o)return void f({clearOptions:!0});i.formData._modelsLoadedOnce=!0,i.formData._modelsFetchSignature=o}}function k(e,o){if(!o.includes("."))return e[o];const n=o.split(".");let t=e;for(const r of n)t=t?.[r];return t}function P(e,o,n){if(!o.includes("."))return void(e[o]=n);const t=o.split(".");let r=e;for(let a=0;a<t.length-1;a++)r[t[a]]||(r[t[a]]={}),r=r[t[a]];r[t[t.length-1]]=n}function T(e){const o=i.formData.availableModels||[];if(!e||!o.length)return o;const n=e.toLowerCase();return o.filter(e=>(e.label||e.value||"").toLowerCase().includes(n))}function I(e,o){const n=[],t=new Set,r=e=>{for(const o of e||[]){const e=String(o?.value||"").trim();if(!e)continue;const r=e.toLowerCase();t.has(r)||(t.add(r),n.push({label:o?.label||e,value:e}))}};r(i.formData.availableModels||[]),r(o||[]);const a=n;if(!e||!a.length)return a;const l=e.toLowerCase();return a.filter(e=>(e.label||e.value||"").toLowerCase().includes(l))}function A(e){const o=e.replace(/\./g,"_");return s[o]?.status||s[e]?.status}function z(e){const o=e.replace(/\./g,"_");return s[o]?.message||s[e]?.message}function R(e){if("function"!=typeof e.getStatus)return{tags:[],message:""};const o=e.getStatus(i.formData)||{};return{tags:Array.isArray(o.tags)?o.tags:[],message:o.message||"",warning:!0===o.warning}}const M={getChannelInflight:c,getChannelBalance:e=>i.balances[e.id]||null,formatFreeze:e=>`冻结 ${e||0}s`,maskApiKey:e=>void 0===e?"已隐藏":e?e.length<=12?"******":`${e.slice(0,8)}******${e.slice(-4)}`:"(未设置)",handleResetHealth:e=>d.handleResetHealth(e),handleRefreshBalance:e=>d.handleRefreshBalance(e),handleOpenWebsite:e=>r("open-website",e)};function F(e){const o=c(e.id),n=e.maxConcurrency?`${o}/${e.maxConcurrency}`:o>0?o:"不限";return{weight:e.weight||1,concurrencyText:n,concurrencyActive:o>0}}function O(e){switch(e.type){case"password":case"text":case"textarea":default:return Ol;case"number":return kp;case"switch":return Wp;case"radio-group":return us}}function $(e){const o={placeholder:e.placeholder};return"password"===e.type&&(o.type="password",o["show-password-on"]="click"),"textarea"===e.type&&(o.type="textarea",o.autosize=e.autosize||{minRows:5,maxRows:16}),"number"===e.type&&(o.min=e.min??1,o.max=e.max??100,o.step=e.step??1,o.clearable=e.clearable,o.style="width: 100%;"),e.disabledOnEdit&&i.editingChannel&&(o.disabled=!0),o}return o({openAddDialog:d.openAddDialog,syncCurrentChannels:d.handleSyncCurrentChannels,refresh:d.loadChannels}),(o,n)=>(Ye(),Ro("div",null,[yo(i).loading?(Ye(),Ro("div",Wv,[Ne(yo(Dp),{size:"small"})])):(Ye(),Ro("div",Nv,[0===yo(i).channels.length?(Ye(),Ro("div",Kv,[Ne(yo(Ya),{description:yo(l).emptyDescription},Ge({_:2},[yo(l).showEmptyAction?{name:"extra",fn:io(()=>[Ne(yo(me),{type:"primary",size:"small",onClick:yo(d).openAddDialog},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Zo))]),_:1})]),default:io(()=>[$e(" "+eo(yo(l).emptyActionText),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1032,["description"])])):(Ye(),Ro("div",Vv,[(Ye(!0),Ro(co,null,He(yo(i).channels,e=>(Ye(),qe(rm,{key:e.id,channel:e,collapsed:yo(i).collapsed[e.id],"header-tags":yo(l).getHeaderTags(e,M),balance:M.getChannelBalance(e),"info-rows":yo(l).buildInfoRows(e,M),meta:F(e),"show-apply-button":yo(l).showApplyButton,"channel-type":yo(l).type,"test-fn":yo(l).testFn,toggling:!!yo(i).toggling[e.id],onToggleCollapse:o=>yo(d).toggleCollapse(e.id),onApply:o=>yo(d).handleApplyToSettings(e),onEdit:o=>yo(d).handleEdit(e),onDelete:o=>yo(d).handleDelete(e.id),onToggleEnabled:o=>yo(d).handleToggleEnabled(e,o),onRefreshBalance:o=>yo(d).handleRefreshBalance(e),onOpenWebsite:n[0]||(n[0]=e=>r("open-website",e))},null,8,["channel","collapsed","header-tags","balance","info-rows","meta","show-apply-button","channel-type","test-fn","toggling","onToggleCollapse","onApply","onEdit","onDelete","onToggleEnabled","onRefreshBalance"]))),128))]))])),Ne(yo(Pt),{show:yo(i).showDialog,"onUpdate:show":n[7]||(n[7]=e=>yo(i).showDialog=e),preset:"card",title:yo(i).editingChannel?yo(l).editTitle:yo(l).addTitle,class:"channel-dialog",style:uo({width:yo(l).modalWidth+"px",maxHeight:"80vh"}),"content-style":{maxHeight:"calc(80vh - 100px)",overflowY:"auto"}},{footer:io(()=>[Mo("div",eg,[Ne(yo(me),{onClick:yo(d).closeDialog},{default:io(()=>[...n[9]||(n[9]=[$e("取消",-1)])]),_:1},8,["onClick"]),Ne(yo(me),{type:"primary",onClick:yo(d).handleSave},{default:io(()=>[$e(eo(yo(i).editingChannel?"保存修改":"添加渠道"),1)]),_:1},8,["onClick"])])]),default:io(()=>[Ne(yo(Fu),{"label-placement":"left","label-width":yo(l).formLabelWidth,class:"channel-form"},{default:io(()=>[(Ye(!0),Ro(co,null,He(yo(l).formSections,o=>(Ye(),Ro(co,{key:o.title},[!o.showWhen||o.showWhen(yo(i).formData)?(Ye(),Ro("div",{key:0,class:ho(["form-section",{collapsible:o.collapsible}])},[Mo("div",qv,[$e(eo(o.title)+" ",1),o.description?(Ye(),Ro("span",Gv,eo(o.description),1)):Oe("",!0)]),b(o)?(Ye(),Ro("div",Jv,[Ne(yo(me),{text:"",type:"primary",size:"tiny",loading:yo(i).formData.modelsFetching,onClick:y},{default:io(()=>[$e(eo(v.value),1)]),_:1},8,["loading"]),Mo("span",{class:ho(["model-catalog-status",{"is-error":yo(i).formData.modelsFetchError,"is-loading":yo(i).formData.modelsFetching}]),role:"status","aria-live":"polite"},eo(g.value),3)])):Oe("",!0),(Ye(!0),Ro(co,null,He(o.fields,o=>zo((Ye(),qe(yo(cp),{label:u(o),"label-style":o.fullWidth?{display:"none"}:void 0,required:o.required,"validation-status":A(o.key),feedback:z(o.key)},{default:io(()=>["channel-auth"===o.type?(Ye(),qe(Rm,{key:0,platform:e.type,"channel-id":yo(i).editingChannel?.id||"","form-data":yo(i).formData,"auth-meta":yo(i).authMeta,onUpdateAuth:n[1]||(n[1]=e=>{yo(i).formData.authMode="oauth",yo(i).formData.authRef=e.authRef,yo(i).formData.authSource=e.authSource,yo(i).formData.authStatus=e.authStatus,yo(i).formData.oauthProviderId=e.oauthProviderId||e.authRef?.providerId||""})},null,8,["platform","channel-id","form-data","auth-meta"])):"preset"===o.type?(Ye(),qe(yo(Di),{key:1,value:yo(i).formData.presetId,options:C.value,placeholder:o.placeholder,"onUpdate:value":w},null,8,["value","options","placeholder"])):"model-redirect"===o.type?(Ye(),qe(Sm,{key:2,modelValue:yo(i).formData.modelRedirects,"onUpdate:modelValue":n[2]||(n[2]=e=>yo(i).formData.modelRedirects=e),"available-models":yo(i).formData.availableModels,"channel-type":yo(l).type,onFocusin:m},null,8,["modelValue","available-models","channel-type"])):"auth-provider-status"===o.type?(Ye(),Ro("div",Yv,[R(o).tags.length>0?(Ye(),qe(yo(Ud),{key:0,size:"small",class:"auth-provider-tags"},{default:io(()=>[(Ye(!0),Ro(co,null,He(R(o).tags,e=>(Ye(),qe(yo(sl),{key:e.text,size:"small",type:e.type||"default",bordered:!1},{default:io(()=>[$e(eo(e.text),1)]),_:2},1032,["type"]))),128))]),_:2},1024)):Oe("",!0),R(o).message?(Ye(),Ro("div",{key:1,class:ho(["auth-provider-message",{warning:R(o).warning}])},eo(R(o).message),3)):Oe("",!0)])):"model-multi-select"===o.type?(Ye(),qe(yo(Di),{key:4,value:yo(i).formData.allowedModels,"onUpdate:value":n[3]||(n[3]=e=>yo(i).formData.allowedModels=e),options:yo(i).formData.availableModels||[],placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,multiple:"",filterable:"",clearable:"",tag:"",onFocus:m},null,8,["value","options","placeholder","loading"])):"select"===o.type&&"speedTestModel"===o.key?(Ye(),qe(yo(Wl),{key:5,value:yo(i).formData.speedTestModel,options:I(yo(i).formData.speedTestModel,o.options),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:m,"onUpdate:value":n[4]||(n[4]=e=>yo(i).formData.speedTestModel=e)},null,8,["value","options","placeholder","loading"])):"select"===o.type&&"model"===o.key?(Ye(),qe(yo(Wl),{key:6,value:yo(i).formData.model,options:I(yo(i).formData.model,o.options),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:m,"onUpdate:value":n[5]||(n[5]=e=>yo(i).formData.model=e)},null,8,["value","options","placeholder","loading"])):"autocomplete"===o.type?(Ye(),qe(yo(Wl),{key:7,value:k(yo(i).formData,o.key),options:T(k(yo(i).formData,o.key)),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,onFocus:m,"onUpdate:value":e=>P(yo(i).formData,o.key,e)},null,8,["value","options","placeholder","loading","onUpdate:value"])):"radio-group"===o.type?(Ye(),qe(yo(us),{key:8,value:k(yo(i).formData,o.key),"onUpdate:value":e=>P(yo(i).formData,o.key,e)},{default:io(()=>[Ne(yo(Ud),null,{default:io(()=>[(Ye(!0),Ro(co,null,He(o.options,e=>(Ye(),qe(yo(ds),{key:e.value,value:e.value},{default:io(()=>[$e(eo(e.label),1)]),_:2},1032,["value"]))),128))]),_:2},1024)]),_:2},1032,["value","onUpdate:value"])):"model-definitions"===o.type?(Ye(),Ro("div",Zv,[Mo("div",Xv,[Ne(yo(me),{size:"tiny",secondary:"",loading:yo(i).formData.modelMetadataFetching,onClick:x},{default:io(()=>[...n[8]||(n[8]=[$e(" 自动获取 Metadata ",-1)])]),_:1},8,["loading"]),Mo("span",Qv,eo(yo(i).formData.modelMetadataStatus||"Metadata 读取 Models.dev 离线快照;模型列表按钮才探测渠道,普通保存不会启动网络或 OMP 命令。"),1)]),Ne(yo(Ol),{value:yo(i).formData.modelDefinitionsJson,type:"textarea",autosize:{minRows:8,maxRows:20},placeholder:o.placeholder,"onUpdate:value":n[6]||(n[6]=e=>yo(i).formData.modelDefinitionsJson=e)},null,8,["value","placeholder"])])):(Ye(),qe(Ze(O(o)),Be({key:10,value:k(yo(i).formData,o.key)},{ref_for:!0},$(o),{"onUpdate:value":e=>P(yo(i).formData,o.key,e)}),null,16,["value","onUpdate:value"]))]),_:2},1032,["label","label-style","required","validation-status","feedback"])),[[so,!o.showWhen||o.showWhen(yo(i).formData)]])),256))],2)):Oe("",!0)],64))),128))]),_:1},8,["label-width"])]),_:1},8,["show","title","style"])]))}},ng=ge(og,[["__scopeId","data-v-68aaf124"]]),tg={__name:"ClaudeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=Io(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(ng,{ref_key:"baseRef",ref:r,type:"claude",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},rg={__name:"CodexChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=Io(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(ng,{ref_key:"baseRef",ref:r,type:"codex",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},ag={__name:"GeminiChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=Io(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(ng,{ref_key:"baseRef",ref:r,type:"gemini",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},lg={__name:"OpenCodeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=Io(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(ng,{ref_key:"baseRef",ref:r,type:"opencode",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},ig={__name:"OmpChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=Io(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(ng,{ref_key:"baseRef",ref:r,type:"omp",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},sg={class:"proxy-logs"},dg={class:"logs-header"},cg={class:"header-left"},ug={class:"today-stats"},pg={class:"logs-table"},hg={key:0,class:"empty-state"},fg={class:"action-message"},mg={class:"action-time"},vg={class:"action-message"},gg={class:"action-time"},bg=["title"],yg={key:0},xg={style:{"font-family":"monospace","font-size":"12px"}},Cg={key:0,style:{"margin-top":"4px"}},wg={style:{"font-family":"monospace","font-size":"12px"}},Sg={key:1,style:{"margin-top":"6px",color:"#d97706","font-size":"12px"}},kg={key:1},Pg={class:"logs-footer"},Tg={class:"count"},Ig=ge({__name:"ProxyLogs",props:{source:{type:String,default:"claude"}},setup(e){const o=e,{logsBySource:n,wsConnected:t,clearLogsState:r,logLimit:a}=Bf(),l=to(()=>{const e=String(o.source||"").trim().toLowerCase();return(n.value[e]||[]).slice(0,a.value)});Io(l.value.length);const i=Io(null),s=Io({requests:0,tokens:0});let d=null,c=null;function u(e,o){return e.usageMissing?"--":e.tokens?.[o]||0}async function p(){try{const e=(await mf(o.source))?.summary||{},n="object"==typeof e.tokens?e.tokens.total:e.tokens;s.value={requests:e.requests||0,tokens:n||0}}catch(e){}}async function h(){try{await async function(){return(await Eo.post("/proxy/logs/clear")).data}(),r(),eh.success("日志已清空")}catch(e){eh.error("清空失败: "+e.message)}}return Xe(l,e=>{const o=e[0]?.id||null;o&&o!==c?(c=o,(!i.value||i.value.scrollTop<20)&&De(()=>{i.value&&(i.value.scrollTop=0)})):c=o}),Xe(()=>o.source,()=>{p(),c=l.value[0]?.id||null}),Je(()=>{p(),d=setInterval(()=>{p()},3e4)}),_e(()=>{d&&(clearInterval(d),d=null)}),(o,n)=>(Ye(),Ro("div",sg,[Mo("div",dg,[Mo("div",cg,[n[0]||(n[0]=Mo("h3",{class:"title"},"实时日志",-1)),Mo("div",ug,[Ne(yo(sl),{size:"tiny",bordered:!1,type:"info"},{default:io(()=>[$e(" 今日请求: "+eo(s.value.requests),1)]),_:1}),Ne(yo(sl),{size:"tiny",bordered:!1,type:"success"},{default:io(()=>{return[$e(" 今日Token: "+eo((e=s.value.tokens,e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toString())),1)];var e}),_:1})])]),Ne(yo(me),{text:"",size:"small",onClick:h},{default:io(()=>[Ne(yo(Q),{size:"16"},{default:io(()=>[Ne(yo(bn))]),_:1}),n[1]||(n[1]=$e(" 清空 ",-1))]),_:1})]),Mo("div",pg,[Mo("div",{class:ho(["table-header",`table-header-${e.source}`])},[Mo("div",{class:ho(["col col-channel",`col-channel-${e.source}`])},"渠道",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"请求",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"回复",2),"claude"===e.source?(Ye(),Ro(co,{key:0},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"写入",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"命中",2)],64)):"codex"===e.source?(Ye(),Ro(co,{key:1},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"推理",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"gemini"===e.source?(Ye(),Ro(co,{key:2},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"opencode"===e.source||"omp"===e.source?(Ye(),Ro(co,{key:3},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"推理",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):Oe("",!0),Mo("div",{class:ho(["col col-time",`col-time-${e.source}`])},"时间",2)],2),Mo("div",{class:"table-body",ref_key:"tableBody",ref:i},[0===l.value.length?(Ye(),Ro("div",hg," 暂无日志 ")):Oe("",!0),(Ye(!0),Ro(co,null,He(l.value,o=>(Ye(),Ro("div",{key:o.id,class:ho(["action"===o.type?"action-row":"error"===o.status?"error-row":"table-row",{"new-log":o.isNew}])},["action"===o.type?(Ye(),Ro(co,{key:0},[Ne(yo(Q),{size:"16",style:{color:"#18a058","margin-right":"8px"}},{default:io(()=>[Ne(yo(Cn))]),_:1}),Mo("span",fg,eo(o.message),1),Mo("span",mg,eo(o.time),1)],64)):"error"===o.status?(Ye(),Ro(co,{key:1},[Ne(yo(Q),{size:"16",style:{color:"#d03050","margin-right":"8px"}},{default:io(()=>[Ne(yo(hn))]),_:1}),Mo("span",vg,eo(o.channel)+": "+eo(o.error||o.message||"请求失败"),1),Mo("span",gg,eo(o.time),1)],64)):(Ye(),qe(yo(ps),{key:2,placement:"top",style:{maxWidth:"300px"}},{trigger:io(()=>[Mo("div",{class:ho(["table-row-content",`table-row-content-${e.source}`])},[Mo("div",{class:ho(["col col-channel",`col-channel-${e.source}`]),title:o.channel},[Ne(yo(sl),{size:"small",type:"success"},{default:io(()=>[$e(eo(o.channel),1)]),_:2},1024)],10,bg),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"input")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"output")),3),"claude"===e.source?(Ye(),Ro(co,{key:0},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cacheCreation")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cacheRead")),3)],64)):"codex"===e.source?(Ye(),Ro(co,{key:1},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"reasoning")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):"gemini"===e.source?(Ye(),Ro(co,{key:2},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):"opencode"===e.source||"omp"===e.source?(Ye(),Ro(co,{key:3},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"reasoning")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):Oe("",!0),Mo("div",{class:ho(["col col-time",`col-time-${e.source}`])},eo(o.time),3)],2)]),default:io(()=>[o.model?(Ye(),Ro("div",yg,[n[3]||(n[3]=Mo("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型信息",-1)),Mo("div",xg,eo(o.model),1),o.originalModel&&o.originalModel!==o.model?(Ye(),Ro("div",Cg,[n[2]||(n[2]=Mo("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型重定向",-1)),Mo("div",wg,eo(o.originalModel)+" → "+eo(o.model),1)])):Oe("",!0),o.usageMissing?(Ye(),Ro("div",Sg," 上游响应未返回 usage,当前仅确认实际模型,无法计算 token。 ")):Oe("",!0)])):(Ye(),Ro("div",kg,"暂无模型信息"))]),_:2},1024))],2))),128))],512)]),Mo("div",Pg,[Mo("span",{class:ho(["status",{connected:yo(t)}])},[Ne(yo(Q),{size:"14"},{default:io(()=>[(Ye(),qe(Ze(yo(t)?yo(Cn):yo(hn))))]),_:1}),$e(" "+eo(yo(t)?"已连接":"未连接"),1)],2),Mo("span",Tg,"共 "+eo(l.value.length)+" 条",1)])]))}},[["__scopeId","data-v-b403c421"]]),Ag=new Map;function zg(e={}){return{...e.platform?{platform:e.platform}:{},...e.cwd?{cwd:e.cwd}:{},...e.scope?{scope:e.scope}:{}}}async function Rg(e="claude",o={}){const n=function(e,o={}){return Ch("skills",e,o.scope||"user",o.cwd||"")}(e,o);if(Ag.has(n))return Ag.get(n);const t=wh(n,t=>Eo.get("/skills",{params:{platform:e,scope:o.scope||"user",...zg(o)},signal:t}).then(e=>e.data).catch(e=>{throw Ag.delete(n),e}),"skills",`skills:${e}`);return Ag.set(n,t),t}async function Mg(e="claude",o={}){return function(e=""){for(const o of Ag.keys())e&&!o.includes(`:${e}:`)||Ag.delete(o)}(e),(await Eo.post("/skills/refresh",{platform:e,scope:o.scope||"user",...o.cwd?{cwd:o.cwd}:{}})).data}async function Fg(e,o={}){return(await Eo.get(`/skills/refresh/${encodeURIComponent(e)}`,{params:zg(o)})).data}async function Og(e,o,n="claude",t={}){return(await Eo.put("/skills/toggle",{controlKey:e,enabled:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function $g(e,o,n="claude",t={}){return(await Eo.put("/skills/trust",{controlKey:e,trust:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function Bg(){return(await Eo.get("/skills/omp-settings")).data}async function Eg(e){return(await Eo.put("/skills/omp-settings",e)).data}async function _g(e,o="claude",n=null,t=null,r={}){const a={platform:o,...zg(r)};t&&(a.fullDirectory=t),n&&(n.id&&(a.repoId=n.id),n.provider&&(a.provider=n.provider),n.host&&(a.host=n.host),n.owner&&(a.owner=n.owner),n.name&&(a.name=n.name),n.branch&&(a.branch=n.branch),n.directory&&(a.directory=n.directory),n.projectPath&&(a.projectPath=n.projectPath),n.localPath&&(a.localPath=n.localPath),n.repoUrl&&(a.repoUrl=n.repoUrl));return wh(Ch(`skill-detail:${e}:${t||""}`,o,r.scope||"",`${r.cwd||""}:${n?.localPath||n?.projectPath||""}`),o=>Eo.get(`/skills/detail/${e}`,{params:a,signal:o}).then(e=>e.data),"skill-detail",`skill-detail:${o}`)}async function Dg(e,o="claude"){return(await Eo.post("/skills/create",{...e,platform:o})).data}async function Lg(e="claude"){return(await Eo.get("/skills/repos",{params:{platform:e}})).data}async function Hg(e,o="claude"){return(await Eo.post("/skills/repos",{...e,platform:o})).data}async function jg(e,o="claude"){return(await Eo.delete("/skills/repos",{params:{platform:o,id:e.id||"",owner:e.owner||"",name:e.name||"",directory:e.directory||""}})).data}async function Ug(e,o,n="claude"){return(await Eo.put("/skills/repos/toggle",{id:e.id||"",owner:e.owner||"",name:e.name||"",enabled:o,directory:e.directory||"",platform:n})).data}async function Wg(e,o={},n="claude"){return(await Eo.put("/skills/repos/auth",{id:e.id||"",owner:e.owner||"",name:e.name||"",directory:e.directory||"",token:o.token||"",clearToken:!!o.clearToken,platform:n})).data}async function Ng(e,o="claude"){return(await Eo.post("/skills/create-with-files",{...e,platform:o})).data}var Kg={class:"right-panel"},Vg={class:"toolbar-section"},qg={class:"toolbar-left"},Gg={class:"toolbar-right"},Jg={class:"panel-header"},Yg={class:"header-title"},Zg={class:"header-actions"},Xg={class:"channels-scroll-area"},Qg={key:1,class:"channels-section channels-unsupported"},eb=ge({__name:"RightPanel",props:{showChannels:{type:Boolean,default:!0},showLogs:{type:Boolean,default:!0},proxyRunning:{type:Boolean,default:!1},proxyLoading:{type:Boolean,default:!1}},emits:["proxy-toggle","show-recent"],setup(e,{emit:o}){const n=Po(),t=e,r=o,a=to(()=>Ko(n)),{getPlatform:l}=Dt(),i=to(()=>l(a.value)),s=Io(null),d=Io(!1),c=Io(0),u={claude:tg,codex:rg,gemini:ag,opencode:lg,omp:ig},p=to(()=>u[a.value]||ng),h=to(()=>u[a.value]?{}:{type:a.value});function f(e){return!0===i.value?.capabilities?.[e]||!0===i.value?.resourceTypes?.[e]}function m(e){return f(e)||!0===i.value?.resourceTypes?.[e]}to(()=>["skills","commands","agents","plugins"].some(m));const v=to(()=>m("skills")),g=to(()=>m("commands")),b=to(()=>m("plugins")),y=to(()=>m("agents")),x=to(()=>i.value?.proxyLabels?.toggle||"动态切换");async function C(){if(v.value)try{const e=await Rg(a.value);e.success&&e.skills&&(c.value=e.skills.filter(e=>e.enabled).length)}catch(e){}else c.value=0}const w=to(()=>`${i.value?.label||i.value?.title||a.value} 渠道管理`);function S(e){window.open(e,"_blank")}function k(){s.value?.openAddDialog?.()}async function P(){const e=s.value;if(e?.syncCurrentChannels&&!d.value){d.value=!0;try{await e.syncCurrentChannels()}finally{d.value=!1}}}function T(e){const o=String(e?.detail?.channel||"").trim().toLowerCase();o&&o!==a.value||s.value?.refresh?.()}function I(e){r("proxy-toggle",e)}function A(){r("show-recent")}function z(e){e?.currentTarget?.blur?.()}function R(e){window.dispatchEvent(new CustomEvent("open-skills-drawer",{detail:{platform:a.value}})),z(e)}function M(e){window.dispatchEvent(new CustomEvent("open-commands-drawer",{detail:{platform:a.value}})),z(e)}function F(e){window.dispatchEvent(new CustomEvent("open-agents-drawer",{detail:{platform:a.value}})),z(e)}function O(e){window.dispatchEvent(new CustomEvent("open-plugins-drawer",{detail:{platform:a.value}})),z(e)}return Je(()=>{C(),"undefined"!=typeof window&&window.addEventListener("channel-management-refresh",T)}),Xe(()=>a.value,()=>{C()}),Xe(()=>t.proxyRunning,()=>{}),_e(()=>{"undefined"!=typeof window&&window.removeEventListener("channel-management-refresh",T)}),(o,n)=>(Ye(),Ro("div",Kg,[Mo("div",Vg,[Mo("div",qg,[Ne(yo(Kp),{depth:"3",class:"toolbar-label"},{default:io(()=>[$e(eo(x.value),1)]),_:1}),f("proxy")?(Ye(),qe(yo(Wp),{key:0,value:e.proxyRunning,loading:e.proxyLoading,disabled:e.proxyLoading,size:"small","onUpdate:value":I},null,8,["value","loading","disabled"])):(Ye(),qe(yo(Kp),{key:1,depth:"3",class:"toolbar-label"},{default:io(()=>[...n[0]||(n[0]=[$e("当前平台暂无代理控制",-1)])]),_:1})),v.value&&c.value>0?(Ye(),qe(yo(sl),{key:2,type:"success",size:"small",bordered:!1},{default:io(()=>[$e(eo(c.value)+" 技能 ",1)]),_:1})):Oe("",!0)]),Mo("div",Gg,[v.value?(Ye(),qe(yo(ps),{key:0,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:R},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(nn))]),_:1})]),_:1})]),default:io(()=>[n[1]||(n[1]=$e(" Skills 技能 ",-1))]),_:1})):Oe("",!0),b.value?(Ye(),qe(yo(ps),{key:1,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:O},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(fn))]),_:1})]),_:1})]),default:io(()=>[n[2]||(n[2]=$e(" Plugins 插件 ",-1))]),_:1})):Oe("",!0),g.value||y.value?(Ye(),Ro(co,{key:2},[g.value?(Ye(),qe(yo(ps),{key:0,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:M},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(tn))]),_:1})]),_:1})]),default:io(()=>[n[3]||(n[3]=$e(" Commands 命令 ",-1))]),_:1})):Oe("",!0),y.value?(Ye(),qe(yo(ps),{key:1,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:F},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(un))]),_:1})]),_:1})]),default:io(()=>[n[4]||(n[4]=$e(" Agents 代理 ",-1))]),_:1})):Oe("",!0)],64)):Oe("",!0),f("sessions")?(Ye(),qe(yo(ps),{key:3,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:A},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(Qo))]),_:1})]),_:1})]),default:io(()=>[n[5]||(n[5]=$e(" 最新对话 ",-1))]),_:1})):Oe("",!0)])]),e.showChannels&&f("channels")?(Ye(),Ro("div",{key:0,class:ho(["channels-section",{"full-height":!e.showLogs||!f("nativeLogs")}])},[Mo("div",Jg,[Mo("div",Yg,[Mo("h3",null,eo(w.value),1),Ne(yo(Kp),{depth:"3",class:"header-hint"},{default:io(()=>[...n[6]||(n[6]=[$e("启用渠道优先显示",-1)])]),_:1})]),Mo("div",Zg,[Ne(yo(me),{secondary:"",size:"small",loading:d.value,disabled:d.value,onClick:P},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(mn))]),_:1})]),default:io(()=>[n[7]||(n[7]=$e(" 同步 ",-1))]),_:1},8,["loading","disabled"]),Ne(yo(me),{type:"primary",size:"small",onClick:k},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Zo))]),_:1})]),default:io(()=>[n[8]||(n[8]=$e(" 添加 ",-1))]),_:1})])]),Mo("div",Xg,[(Ye(),qe(Ze(p.value),Be({ref_key:"currentPanelRef",ref:s},h.value,{onOpenWebsite:S}),null,16))])],2)):e.showChannels?(Ye(),Ro("div",Qg,[Ne(yo(Cl),{type:"info","show-icon":!1},{default:io(()=>[$e(eo(w.value)+" 未声明渠道管理能力。 ",1)]),_:1})])):Oe("",!0),e.showLogs&&f("nativeLogs")?(Ye(),Ro("div",{key:2,class:ho(["logs-section",{"full-height":!e.showChannels}])},[Ne(Ig,{source:a.value},null,8,["source"])],2)):Oe("",!0)]))}},[["__scopeId","data-v-e779d4e0"]]),ob={class:"layout"},nb={class:"panel-security-auth"},tb={class:"header"},rb={class:"logo-wrapper"},ab=["alt"],lb={class:"nav-tabs"},ib=["onClick"],sb={class:"nav-label"},db={class:"header-actions"},cb={class:"env-warning-count"},ub={class:"favorites-button-wrapper"},pb={key:0,class:"favorites-badge"},hb={class:"more-menu-trigger","aria-label":"更多工具"},fb={class:"main-container"},mb={key:0,class:"global-loading-overlay"},vb={class:"left-content"},gb="coding-tool-x",bb={__name:"Layout",setup(e){const o=vo(()=>Ht(()=>import("./RecentSessionsDrawer-B_17aJBG.js").then(e=>e.n),__vite__mapDeps([9,1,2,6,10,11,12,13,5,3,7,14,15,16,17,18]))),n=vo(()=>Ht(()=>import("./FavoritesDrawer-DaziQmBp.js"),__vite__mapDeps([61,1,2,6,21,8,11,10,12,13,5,3,7,14,15,16,23,17,62]))),t=vo(()=>Ht(()=>import("./ChatHistoryDrawer-BTmQ1aQr.js"),__vite__mapDeps([40,1,2,6,10,11,14,34,36,13,5,3,7,41]))),r=vo(()=>Ht(()=>import("./SettingsDrawer-fYb0DU7X.js"),__vite__mapDeps([63,1,2,5,3,4,6,7,8,21,11,45,10,12,64]))),a=vo(()=>Ht(()=>import("./McpDrawer-I8rl8lGH.js"),__vite__mapDeps([65,1,2,5,3,6,21,8,11,27,28,10,12,29,30,14,66]))),l=vo(()=>Ht(()=>import("./PromptsDrawer-CoZ-ZtsY.js"),__vite__mapDeps([67,1,2,5,3,6,10,11,12,35,34,36,37,68]))),i=vo(()=>Ht(()=>import("./SpeedTestDrawer-Bbn38SfV.js"),__vite__mapDeps([69,1,2,6,10,11,12,70]))),s=vo(()=>Ht(()=>import("./GatewayConvertDrawer-OMgWUUSc.js"),__vite__mapDeps([71,1,2,3,6,10,11,12,72]))),d=vo(()=>Ht(()=>import("./SkillsDrawer-Ms4lPCow.js"),__vite__mapDeps([73,1,2,10,11,12,32,4,5,3,6,7,8,21,26,14,33,34,35,36,37,29,38,39,74]))),c=vo(()=>Ht(()=>import("./CommandsDrawer-CaZWDI_G.js"),__vite__mapDeps([75,1,2,5,3,4,6,7,21,8,11,26,14,10,12,35,34,36,37,76]))),u=vo(()=>Ht(()=>import("./AgentsDrawer-Cj5CJ4d9.js"),__vite__mapDeps([77,1,2,5,3,4,6,7,21,8,11,26,14,10,12,35,34,36,37,78]))),p=vo(()=>Ht(()=>import("./PluginsDrawer-_zZENaQn.js"),__vite__mapDeps([79,1,2,10,11,12,56,5,3,4,6,7,8,21,26,14,34,38,57,80]))),h=vo(()=>Ht(()=>import("./WorkspaceDrawer-L7HJRc6u.js"),__vite__mapDeps([81,1,2,44,6,8,21,11,45,14,46,5,3,47,10,12,82]))),f=vo(()=>Ht(()=>import("./ConfigTemplatesDrawer-B17RqFi4.js"),__vite__mapDeps([83,1,2,50,6,8,21,11,28,45,34,36,35,37,46,5,3,51,10,12,84]))),m=vo(()=>Ht(()=>import("./ConfigExportDrawer-C3vSZEsS.js"),__vite__mapDeps([85,1,2,5,3,6,33,8,21,11,45,10,12,86]))),{isDark:v,toggleTheme:g}=$f(),{getProxyState:b,startProxy:y,stopProxy:x}=Bf(),{totalFavorites:C}=Df(),{dashboardData:w,isLoading:S,loadDashboard:k}=Lf(),P=fo(),T=Po(),I=[{label:"配置模板",key:"config-templates"},{label:"配置导入/导出",key:"config-export"},{label:"渠道速度测试",key:"speed-test"},{type:"divider",key:"divider-1"},{label:"使用帮助",key:"help"},{label:"GitHub 仓库",key:"github"}],A=to(()=>T.name),z=to(()=>Ko(T)||null),{enabledPlatforms:R}=Dt(),M=to(()=>R.value.find(e=>e.key===z.value)||null),F=to(()=>!0===M.value?.capabilities?.nativeLogs),O=to(()=>No(R.value)),$=to(()=>T.path),B=Io(!0),E=Io(!0),_=to(()=>z.value&&(B.value||E.value&&F.value)),D=Io(!1),L=Io(!1),H=Io(!1),j=Io(!1),U=Io(!1),W=Io(!1),N=Io(!1),K=Io(!1),V=Io(!1),q=Io(!1),G=Io(!1),J=Io(!1),Y=Io(""),Z=Io(""),X=Io(!1),ee=Io(""),oe=Io(!1),ne=Io(""),te=Io(!1),re=Io(""),ae=Io(""),le=Io(!1),ie=Io(null),se=Io(null),de=Io(null),ce=no(new Set);function ue(e){return ce.has(e)}Xe([de,ie,se,le],([e,o,,n])=>{e&&o&&n&&e.open()},{flush:"post"});const pe=Io([]),he=Io(!1),fe=Io(!1),ve=Io(!1),ge=Io(""),be=Io(""),ye=Io(!1),xe=to(()=>fe.value&&!ve.value);function Ce(){ge.value="",be.value="",ye.value=!1}async function we(){if(ge.value){ye.value=!0,be.value="";try{const e=await async function(e){return(await Eo.post("/security/verify",{password:e})).data}(ge.value);e.success?(ve.value=!0,Ce()):be.value=e.error||"密码错误"}catch(e){be.value=e.response?.data?.error||"密码错误"}finally{ye.value=!1}}else be.value="请输入密码"}async function Se(){try{const e=await Zp();e.success&&(pe.value=e.conflicts||[],0===pe.value.length&&(he.value=!1))}catch(e){}}function ke(){he.value=!1}function Pe(){he.value=!1,localStorage.setItem("envConflictNeverRemind","true")}const Te=Io(!1),Ie=to(()=>Boolean(b(z.value)?.value?.running)),Ae=to(()=>Boolean(b(z.value)?.value?.loading));function ze(e,o){!function(e){ce.add(e)}(e),o.value=!0}function Re(){ze("recent",D)}function Me(){ze("favorites",L)}function Fe(){ze("settings",H)}function Be(){ze("mcp",j)}function Ee(){ze("prompts",U)}function De(){ze("workspace",V)}function je(e){"config-templates"!==e?"config-export"!==e?"speed-test"!==e?"help"!==e?"github"===e&&window.open("https://github.com/ZeaoZhang/coding-tool","_blank"):K.value=!0:ze("speed-test",W):ze("config-export",G):ze("config-templates",q)}async function Ue(e){const o=z.value;if(!o)return;const n=function(e=z.value){return b(e)}(o);n.value.loading=!0;try{let n;n=e?await y(o):await x(o,{refreshChannelsDrawer:!0}),!1!==n.success?(eh.success("omp"===o?e?"OMP 动态切换已启用":"OMP 已切换为单渠道直连模式":e?"代理已启动":"代理已停止"),e&&(E.value=!0),async function(){try{await qo("panelVisibility","showChannels",B.value),await qo("panelVisibility","showLogs",E.value)}catch(e){}}()):eh.error(n.error||"操作失败")}catch(t){eh.error(t.response?.data?.error||t.message||"操作失败")}finally{n.value.loading=!1}}function We(e){const{showChannels:o,showLogs:n}=e.detail;B.value=o,E.value=n}function Ke(e){Y.value=e?.detail?.platform||"",Z.value=e?.detail?.cwd||e?.detail?.projectPath||"",ze("skills",J)}function Ve(e){ee.value=e?.detail?.platform||"",ze("commands",X)}function Ge(e){ne.value=e?.detail?.platform||"",ze("agents",oe)}function Qe(e){re.value=e?.detail?.platform||"",ae.value=e?.detail?.cwd||e?.detail?.projectPath||"",ze("plugins",te)}function oo(){"opencode"===z.value&&ze("gateway",N)}function ro({session:e,channel:o}){ie.value=e,se.value=o,le.value=!0}return Je(()=>{!async function(){Te.value=!0;try{const e=await bh();fe.value=Boolean(e?.success&&e.hasPassword),ve.value=!fe.value,fe.value||Ce()}catch(e){fe.value=!1,ve.value=!0,Ce()}finally{Te.value=!1}}(),async function(){try{const e=await k();e&&e.uiConfig&&(B.value=!1!==e.uiConfig.panelVisibility?.showChannels,E.value=!1!==e.uiConfig.panelVisibility?.showLogs)}catch(e){}}(),window.addEventListener("panel-visibility-change",We),window.addEventListener("open-skills-drawer",Ke),window.addEventListener("open-commands-drawer",Ve),window.addEventListener("open-agents-drawer",Ge),window.addEventListener("open-plugins-drawer",Qe),window.addEventListener("open-gateway-convert-drawer",oo),async function(){try{const e=await Zp();e.success&&e.conflicts?.length>0&&(pe.value=e.conflicts,"true"!==localStorage.getItem("envConflictNeverRemind")&&(he.value=!0))}catch(e){}}()}),_e(()=>{window.removeEventListener("panel-visibility-change",We),window.removeEventListener("open-skills-drawer",Ke),window.removeEventListener("open-commands-drawer",Ve),window.removeEventListener("open-agents-drawer",Ge),window.removeEventListener("open-plugins-drawer",Qe),window.removeEventListener("open-gateway-convert-drawer",oo)}),Xe(()=>z.value,e=>{"opencode"!==e&&N.value&&(N.value=!1)}),(e,b)=>{const y=Le("router-link"),x=Le("router-view");return Ye(),Ro("div",ob,[Ne(gh,{visible:he.value,"onUpdate:visible":b[0]||(b[0]=e=>he.value=e),conflicts:pe.value,onDeleted:Se,onClose:b[1]||(b[1]=e=>he.value=!1),onIgnore:ke,onNeverRemind:Pe},null,8,["visible","conflicts"]),Ne(yo(Pt),{show:xe.value,preset:"card",title:"验证访问密码","mask-closable":!1,"close-on-esc":!1,closable:!1,style:{width:"460px","max-width":"92vw"}},{default:io(()=>[Mo("div",nb,[Ne(yo(Kp),{depth:"3",style:{"font-size":"13px"}},{default:io(()=>[...b[22]||(b[22]=[$e(" 请输入访问密码后进入面板 ",-1)])]),_:1}),Ne(yo(Ol),{value:ge.value,"onUpdate:value":b[2]||(b[2]=e=>ge.value=e),type:"password",placeholder:"访问密码","show-password-on":"click",autofocus:"",onKeydown:So(we,["enter"])},null,8,["value"]),be.value?(Ye(),qe(yo(Kp),{key:0,depth:"3",class:"panel-security-error"},{default:io(()=>[$e(eo(be.value),1)]),_:1})):Oe("",!0),Ne(yo(Kp),{depth:"3",class:"panel-security-hint"},{default:io(()=>[b[24]||(b[24]=$e(" 忘记密码可在终端执行 ",-1)),Ne(yo(Kp),{code:""},{default:io(()=>[...b[23]||(b[23]=[$e("ctx security reset",-1)])]),_:1}),b[25]||(b[25]=$e(" 关闭密码 ",-1))]),_:1}),Ne(yo(Ud),{justify:"end",style:{"margin-top":"16px"}},{default:io(()=>[Ne(yo(me),{type:"primary",loading:ye.value,onClick:we},{default:io(()=>[...b[26]||(b[26]=[$e(" 验证 ",-1)])]),_:1},8,["loading"])]),_:1})])]),_:1},8,["show"]),Mo("header",tb,[Ne(y,{class:"logo-section",to:{name:"home"},"aria-label":"返回首页"},{default:io(()=>[Mo("div",rb,[Mo("img",{src:"/logo.png",alt:`${gb} logo`,class:"logo-image"},null,8,ab)]),Mo("div",{class:"title-group"},[Mo("h1",{class:"title-main"},eo(gb)),b[27]||(b[27]=Mo("span",{class:"title-sub"},"AI 编程工作台",-1))])]),_:1}),Mo("div",lb,[Mo("div",{class:ho(["nav-tab",{active:"home"===A.value}]),onClick:b[3]||(b[3]=e=>yo(P).push({name:"home"}))},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[Ne(yo(on))]),_:1}),b[28]||(b[28]=Mo("span",{class:"nav-label"},"Home",-1))],2),(Ye(!0),Ro(co,null,He(O.value,e=>(Ye(),Ro("div",{key:e.key,class:ho(["nav-tab",{active:z.value===e.key}]),onClick:o=>yo(P).push({name:"cli-projects",params:{platform:e.key}})},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[(Ye(),qe(Ze(e.icon)))]),_:2},1024),Mo("span",sb,eo(e.label),1)],10,ib))),128)),Mo("div",{class:ho(["nav-tab",{active:"analytics"===A.value}]),onClick:b[4]||(b[4]=e=>yo(P).push({name:"analytics"}))},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[Ne(yo(an))]),_:1}),b[29]||(b[29]=Mo("span",{class:"nav-label"},"Analytics",-1))],2)]),Mo("div",db,[pe.value.length>0?(Ye(),qe(yo(ps),{key:0,trigger:"hover"},{trigger:io(()=>[Mo("div",{class:"env-warning-btn",onClick:b[5]||(b[5]=e=>he.value=!0)},[Ne(yo(Q),{size:18,class:"env-warning-icon"},{default:io(()=>[Ne(yo(xn))]),_:1}),Mo("span",cb,eo(pe.value.length),1)])]),default:io(()=>[$e(" 检测到 "+eo(pe.value.length)+" 个环境变量冲突,点击查看 ",1)]),_:1})):Oe("",!0),Ne(Yp,{icon:yo(v)?yo(yn):yo(Go),tooltip:yo(v)?"切换到亮色主题":"切换到暗色主题",onClick:yo(g)},null,8,["icon","tooltip","onClick"]),b[30]||(b[30]=Mo("div",{class:"header-divider"},null,-1)),Mo("div",ub,[Ne(Yp,{icon:yo(Yo),tooltip:`我的收藏 (${yo(C)})`,onClick:Me},null,8,["icon","tooltip"]),yo(C)>0?(Ye(),Ro("div",pb,eo(yo(C)),1)):Oe("",!0)]),Ne(Yp,{icon:yo(gn),tooltip:"工作区管理",onClick:De},null,8,["icon"]),Ne(Yp,{icon:yo(en),tooltip:"Prompts 管理",onClick:Ee},null,8,["icon"]),Ne(Yp,{icon:yo(dn),tooltip:"MCP 服务器管理",onClick:Be},null,8,["icon"]),Ne(Yp,{icon:yo(cn),tooltip:"设置",onClick:Fe},null,8,["icon"]),Ne(yo(As),{trigger:"click",placement:"bottom-end",options:I,onSelect:je},{default:io(()=>[Mo("div",hb,[Ne(Yp,{icon:yo(Xo),tooltip:"更多工具"},null,8,["icon"])])]),_:1})])]),Mo("div",fb,[Te.value?(Ye(),Ro("div",mb,[Ne(yo(Dp),{size:"large"},{description:io(()=>[...b[31]||(b[31]=[$e(" 加载配置中... ",-1)])]),_:1})])):Oe("",!0),Mo("div",vb,[Ne(x,null,{default:io(({Component:e})=>[(Ye(),qe(Ze(e),{key:$.value}))]),_:1})]),_.value?(Ye(),qe(eb,{key:1,"show-channels":B.value,"show-logs":E.value,"proxy-running":Ie.value,"proxy-loading":Ae.value,onProxyToggle:Ue,onShowRecent:Re},null,8,["show-channels","show-logs","proxy-running","proxy-loading"])):Oe("",!0)]),ue("recent")?(Ye(),qe(yo(o),{key:0,visible:D.value,"onUpdate:visible":b[6]||(b[6]=e=>D.value=e),channel:z.value},null,8,["visible","channel"])):Oe("",!0),ue("favorites")?(Ye(),qe(yo(n),{key:1,visible:L.value,"onUpdate:visible":b[7]||(b[7]=e=>L.value=e),onViewHistory:ro},null,8,["visible"])):Oe("",!0),ie.value?(Ye(),qe(yo(t),{key:2,ref_key:"chatHistoryRef",ref:de,show:le.value,"onUpdate:show":b[8]||(b[8]=e=>le.value=e),"project-name":ie.value.projectName,"session-id":ie.value.sessionId,"session-alias":ie.value.alias,channel:se.value},null,8,["show","project-name","session-id","session-alias","channel"])):Oe("",!0),ue("settings")?(Ye(),qe(yo(r),{key:3,visible:H.value,"onUpdate:visible":b[9]||(b[9]=e=>H.value=e)},null,8,["visible"])):Oe("",!0),ue("mcp")?(Ye(),qe(yo(a),{key:4,visible:j.value,"onUpdate:visible":b[10]||(b[10]=e=>j.value=e)},null,8,["visible"])):Oe("",!0),ue("prompts")?(Ye(),qe(yo(l),{key:5,visible:U.value,"onUpdate:visible":b[11]||(b[11]=e=>U.value=e)},null,8,["visible"])):Oe("",!0),ue("speed-test")?(Ye(),qe(yo(i),{key:6,visible:W.value,"onUpdate:visible":b[12]||(b[12]=e=>W.value=e)},null,8,["visible"])):Oe("",!0),"opencode"===z.value&&ue("gateway")?(Ye(),qe(yo(s),{key:7,visible:N.value,"onUpdate:visible":b[13]||(b[13]=e=>N.value=e)},null,8,["visible"])):Oe("",!0),ue("workspace")?(Ye(),qe(yo(h),{key:8,visible:V.value,"onUpdate:visible":b[14]||(b[14]=e=>V.value=e)},null,8,["visible"])):Oe("",!0),ue("config-templates")?(Ye(),qe(yo(f),{key:9,visible:q.value,"onUpdate:visible":b[15]||(b[15]=e=>q.value=e)},null,8,["visible"])):Oe("",!0),ue("config-export")?(Ye(),qe(yo(m),{key:10,visible:G.value,"onUpdate:visible":b[16]||(b[16]=e=>G.value=e)},null,8,["visible"])):Oe("",!0),ue("skills")?(Ye(),qe(yo(d),{key:11,visible:J.value,"onUpdate:visible":b[17]||(b[17]=e=>J.value=e),platform:Y.value,"project-path":Z.value},null,8,["visible","platform","project-path"])):Oe("",!0),ue("commands")?(Ye(),qe(yo(c),{key:12,visible:X.value,"onUpdate:visible":b[18]||(b[18]=e=>X.value=e),platform:ee.value},null,8,["visible","platform"])):Oe("",!0),ue("agents")?(Ye(),qe(yo(u),{key:13,visible:oe.value,"onUpdate:visible":b[19]||(b[19]=e=>oe.value=e),platform:ne.value},null,8,["visible","platform"])):Oe("",!0),ue("plugins")?(Ye(),qe(yo(p),{key:14,visible:te.value,"onUpdate:visible":b[20]||(b[20]=e=>te.value=e),platform:re.value,"project-path":ae.value},null,8,["visible","platform","project-path"])):Oe("",!0),Ne(yo(Pt),{show:K.value,"onUpdate:show":b[21]||(b[21]=e=>K.value=e),preset:"card",title:`${gb} 使用帮助`,style:{width:"800px","max-width":"90vw"}},{default:io(()=>[Mo("div",{class:"help-content"},[Mo("div",{class:"help-section"},[b[32]||(b[32]=Mo("h4",null,"[START] 快速开始",-1)),Mo("p",null,eo(gb)+" 是面向 Claude Code、Codex、Gemini 和 OpenCode 的统一 AI 编程工作台,提供会话管理、动态渠道切换、全局搜索与实时监控能力。"),b[33]||(b[33]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[STAR] 最简单的启动方式:",-1)),b[34]||(b[34]=Mo("div",{style:{background:"var(--bg-primary)",padding:"12px","border-radius":"6px",margin:"8px 0","border-left":"3px solid #18a058"}},[Mo("p",{style:{margin:"0","font-family":"'Courier New', monospace","font-size":"13px","font-weight":"600",color:"var(--primary-color)"}},"ctx start"),Mo("p",{style:{margin:"4px 0 0 0","font-size":"12px",color:"var(--text-secondary)"}},[$e("• 后台启动所有服务"),Mo("br"),$e("• 可以关闭终端窗口"),Mo("br"),$e("• 代理服务保持运行")])],-1)),b[35]||(b[35]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[LOG] 日常工作流:",-1)),b[36]||(b[36]=Mo("div",{style:{"font-size":"12px","line-height":"1.8",color:"var(--text-secondary)"}},[Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx start"),$e(" 启动服务"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx status"),$e(" 查看状态"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx logs"),$e(" 查看日志"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx stop"),$e(" 停止服务 ")],-1))]),b[45]||(b[45]=Mo("div",{class:"help-section"},[Mo("h4",null,"[AI] 支持的 AI 工具"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"Claude Code"),$e(":Anthropic 官方命令行工具,支持 Claude 系列模型")]),Mo("li",null,[Mo("strong",null,"Codex"),$e(":支持 OpenAI GPT 系列和 Claude 模型(通过 OpenAI 兼容格式)")]),Mo("li",null,[Mo("strong",null,"Gemini"),$e(":支持 Google Gemini 系列模型")])])],-1)),b[46]||(b[46]=Mo("div",{class:"help-section"},[Mo("h4",null,"[LOG] 命令行用法"),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[START] 服务管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx start"),Mo("span",null,"后台启动所有服务(推荐)")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx stop"),Mo("span",null,"停止所有服务")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx restart"),Mo("span",null,"重启所有服务")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx status"),Mo("span",null,"查看服务状态")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[PROXY] 代理管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx claude start"),Mo("span",null,"启动 Claude 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx codex start"),Mo("span",null,"启动 Codex 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx gemini start"),Mo("span",null,"启动 Gemini 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx claude stop"),Mo("span",null,"停止指定代理(支持 stop/restart/status)")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[LOG] 日志管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs"),Mo("span",null,"查看所有日志")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs claude"),Mo("span",null,"查看 Claude 日志(支持 ui/codex/gemini)")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs --follow"),Mo("span",null,"实时跟踪日志")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs --clear"),Mo("span",null,"清空日志")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[STATS] 其他命令"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx stats"),Mo("span",null,"查看统计信息")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx doctor"),Mo("span",null,"系统诊断")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx -h"),Mo("span",null,"完整帮助")])])],-1)),b[47]||(b[47]=Mo("div",{class:"help-section"},[Mo("h4",null,"[TARGET] Web UI 功能"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"多类型支持"),$e(":统一管理 Claude Code、Codex、Gemini 三种工具的项目和会话")]),Mo("li",null,[Mo("strong",null,"项目管理"),$e(":查看所有项目,支持拖拽排序、搜索过滤、删除项目")]),Mo("li",null,[Mo("strong",null,"会话管理"),$e(":查看项目会话列表,支持搜索、Fork、删除、重命名")]),Mo("li",null,[Mo("strong",null,"快速启动"),$e(":点击会话可直接复制对应 AI 工具启动命令")]),Mo("li",null,[Mo("strong",null,"动态切换"),$e(":每种工具独立的渠道管理,可在右侧面板快速切换 API 渠道")]),Mo("li",null,[Mo("strong",null,"实时日志"),$e(":查看各类型代理的实时请求日志、token 消耗和成本统计")]),Mo("li",null,[Mo("strong",null,"全局搜索"),$e(":使用 "),Mo("kbd",null,"Cmd/Ctrl"),$e(" + "),Mo("kbd",null,"K"),$e(" 在所有项目中搜索对话内容")])])],-1)),b[48]||(b[48]=Mo("div",{class:"help-section"},[Mo("h4",null,"[BOLT] 代理服务与渠道管理"),Mo("p",null,"每种 AI 工具都有独立的代理服务和渠道配置:"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"Claude 代理"),$e(":端口 20088,支持 Anthropic API 格式")]),Mo("li",null,[Mo("strong",null,"Codex 代理"),$e(":端口 20089,支持 OpenAI API 格式(兼容 Claude)")]),Mo("li",null,[Mo("strong",null,"Gemini 代理"),$e(":端口 20090,支持 Gemini API 格式")])]),Mo("p",null,"在 Dashboard 或各工具详情页,可以添加多个渠道并快速切换,无需修改配置文件或重启工具。")],-1)),Mo("div",{class:"help-section"},[b[37]||(b[37]=Mo("h4",null,"[STAR] 后台启动与开机自启",-1)),b[38]||(b[38]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"后台启动服务",-1)),b[39]||(b[39]=Mo("p",{style:{"font-size":"12px","line-height":"1.8"}},[$e("使用 "),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),$e(" 命令后台启动所有服务,可以安全关闭终端窗口而不影响代理服务的运行。")],-1)),b[40]||(b[40]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"配置开机自启(可选)",-1)),b[41]||(b[41]=Mo("p",{style:{"font-size":"12px",color:"var(--text-secondary)",margin:"0 0 8px 0"}},"第一次启用开机自启只需三个步骤:",-1)),b[42]||(b[42]=Mo("div",{style:{background:"var(--bg-primary)",padding:"12px","border-radius":"6px",margin:"8px 0","border-left":"3px solid #18a058","font-family":"'Courier New', monospace","font-size":"11px","line-height":"1.8",color:"var(--text-secondary)"}},[$e(" # 第 1 步:启用 PM2 开机自启"),Mo("br"),Mo("span",{style:{color:"var(--primary-color)"}},"pm2 startup"),Mo("br"),Mo("br"),$e(" # 第 2 步:保存配置"),Mo("br"),Mo("span",{style:{color:"var(--primary-color)"}},"pm2 save"),Mo("br"),Mo("br"),$e(" # 第 3 步:重启电脑,服务自动启动 [v] ")],-1)),b[43]||(b[43]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"相关命令",-1)),b[44]||(b[44]=Mo("div",{style:{"font-size":"12px",color:"var(--text-secondary)","line-height":"1.8"}},[Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),$e(" 后台启动"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx status"),$e(" 查看状态"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx logs"),$e(" 查看日志"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 list"),$e(" 查看所有后台进程"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 unstartup"),$e(" 禁用开机自启 ")],-1)),Mo("p",{style:{color:"#18a058","font-size":"12px","margin-top":"8px"}},"[TIP] 提示:配置开机自启后,重启电脑时 "+eo(gb)+" 会自动启动,无需手动运行命令。")]),b[49]||(b[49]=Mo("div",{class:"help-section"},[Mo("h4",null,"[LINK] 相关链接"),Mo("div",{class:"link-list"},[Mo("a",{href:"https://github.com/ZeaoZhang/coding-tool",target:"_blank"},"GitHub 仓库"),Mo("a",{href:"https://github.com/ZeaoZhang/coding-tool/issues",target:"_blank"},"问题反馈")])],-1))])]),_:1},8,["show","title"])])}}},yb=ge(bb,[["__scopeId","data-v-1b46cda2"]]),xb={__name:"App",setup(e){const{isDark:o,loadTheme:n}=$f(),t=to(()=>o.value?Gp:null),r=to(()=>o.value?{common:{primaryColor:"#18a058",primaryColorHover:"#1db165",primaryColorPressed:"#0c7a43",fontFamily:'"SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',fontFamilyMono:'"SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", monospace',borderRadius:"16px",borderRadiusSmall:"12px",bodyColor:"#0a1116",cardColor:"#121b22",modalColor:"#121b22",popoverColor:"#121b22",tableColor:"#121b22",inputColor:"#16222a",codeColor:"#0d171d",tabColor:"#121b22",actionColor:"#16222a",tableHeaderColor:"#16222a",hoverColor:"rgba(255, 255, 255, 0.08)",pressedColor:"rgba(255, 255, 255, 0.12)",borderColor:"#263740",dividerColor:"#263740"},Drawer:{color:"#121b22",headerColor:"#121b22",footerColor:"#121b22"},Modal:{color:"#121b22",boxShadow:"0 24px 64px rgba(0, 0, 0, 0.42)"},Card:{color:"#121b22",borderColor:"#263740"},Popover:{color:"#121b22",textColor:"#edf5f4",boxShadow:"0 20px 48px rgba(0, 0, 0, 0.34)"},Tooltip:{color:"#121b22",textColor:"#edf5f4",boxShadow:"0 20px 48px rgba(0, 0, 0, 0.34)"},Dialog:{color:"#121b22"},Button:{borderRadiusMedium:"12px"},Input:{borderRadius:"12px"}}:{common:{primaryColor:"#18a058",primaryColorHover:"#1db165",primaryColorPressed:"#0c7a43",fontFamily:'"SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',fontFamilyMono:'"SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", monospace',borderRadius:"16px",borderRadiusSmall:"12px",bodyColor:"#f4f7f8",cardColor:"#ffffff",modalColor:"#ffffff",popoverColor:"#ffffff",tableColor:"#ffffff",inputColor:"#f7faf8",codeColor:"#edf3f1",tabColor:"#ffffff",actionColor:"#f7faf8",tableHeaderColor:"#edf3f1",hoverColor:"rgba(24, 160, 88, 0.08)",pressedColor:"rgba(24, 160, 88, 0.12)",borderColor:"#d8e1de",dividerColor:"#d8e1de"},Modal:{color:"#ffffff",boxShadow:"0 24px 64px rgba(15, 23, 29, 0.16)"},Card:{color:"#ffffff",borderColor:"#d8e1de"},Popover:{color:"#ffffff",textColor:"#122025",boxShadow:"0 18px 42px rgba(15, 23, 29, 0.12)"},Tooltip:{color:"rgba(18, 32, 37, 0.94)",textColor:"#f7faf8",boxShadow:"0 18px 42px rgba(15, 23, 29, 0.18)"},Drawer:{color:"#ffffff",headerColor:"#ffffff",footerColor:"#ffffff"},Button:{borderRadiusMedium:"12px"},Input:{borderRadius:"12px"}});return Je(()=>{n()}),(e,o)=>(Ye(),qe(yo(Oi),{theme:t.value,"theme-overrides":r.value},{default:io(()=>[Ne(yo(Ks),null,{default:io(()=>[Ne(yo(cd),null,{default:io(()=>[Ne(yb)]),_:1})]),_:1})]),_:1},8,["theme","theme-overrides"]))}};!async function(){const e=ao(xb),o=oo();e.use(o);const n=Vo(o),{loadUIConfig:t}=Ho();await Promise.all([n.load(),t()]),e.use(Ut),e.mount("#app"),Ef()}();export{ps as $,bh as A,Wt as At,cp as B,ef as C,dr as Ct,ff as D,ar as Dt,cf as E,lr as Et,Wp as F,zc as G,Cu as H,Dp as I,$d as J,Ud as K,Op as L,oh as M,eh as N,Ch as O,er as Ot,Kp as P,As as Q,kp as R,vf as S,cr as St,rf as T,ir as Tt,hu as U,Fu as V,tu as W,Bs as X,Ls as Y,Ms as Z,Df as _,qa as _t,_g as a,Ai as at,gf as b,vr as bt,Rg as c,yi as ct,$g as d,Ol as dt,us as et,Og as f,Cl as ft,Lf as g,Ya as gt,Wg as h,ol as ht,Bg as i,Bi as it,yh as j,Dt as jt,wh as k,Nt as kt,Mg as l,ei as lt,Eg as m,sl as mt,Dg as n,ji as nt,Fg as o,Pi as ot,Ug as p,yl as pt,Ld as q,Ng as r,Di as rt,Lg as s,Ci as st,Hg as t,ds as tt,jg as u,_l as ut,Bf as v,Cr as vt,nf as w,sr as wt,bf as x,hr as xt,$f as y,br as yt,bp as z};